diff --git a/README.md b/README.md index 6f4dd05..8275f98 100644 --- a/README.md +++ b/README.md @@ -23,12 +23,16 @@ bzip2 -d py-push-server-amd-$PUSH_SERVER_VERSION.tar.bz2 sudo docker load -i py-push-server-amd-$PUSH_SERVER_VERSION.tar +# start with an empty DB +cp data/webpush.db.empty py-push-server-db/webpush.db + +# here's how to run it -- but if you're on production then look below about ADMIN_PASSWORD sudo docker run -d -p 8900:3000 -v ~/py-push-server-db:/app/instance/data --name py-push-server-$PUSH_SERVER_VERSION py-push-server:amd-$PUSH_SERVER_VERSION ``` On a production server for security (eg /web-push/generate_vapid): set an environment variable `ADMIN_PASSWORD` for permissions; one way is to add this to the `docker run` command: `-e ADMIN_PASSWORD=` -Finally, generate a new VAPID by hitting the `regenerate_vapid` endpoint with a POST, eg. `curl -X POST localhost:8080/web-push/regenerate_vapid` +Finally, after it's started, generate a new VAPID by hitting the `regenerate_vapid` endpoint with a POST, eg. `curl -X POST localhost:8080/web-push/regenerate_vapid` @@ -278,3 +282,5 @@ Troubleshooting * If you get "unable to open database file", you can provide the app.py with SQLALCHEMY_DATABASE_URI with `sqlite:////...` with the full path to the data/webpush.db file. (Why does the relative path of `sqlite:///...` not work for a relative path?) + +* Another potential problem with "unable to open database file" is the permissions on the directory or file with the DB, as set on the local volume that matches the docker `/app/instance/data` directory. Note that the user id in the Dockerfile is set to 1000; the `id` command will tell you the uid for your user, which should match. diff --git a/data/webpush.db.empty b/data/webpush.db.empty new file mode 100644 index 0000000..ede51c9 Binary files /dev/null and b/data/webpush.db.empty differ