From 0c7a9524a7fb393a89bb75f615df902039403d01 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Sun, 17 Dec 2023 17:07:24 -0700 Subject: [PATCH] add more startup commentary --- README.md | 8 +++++++- data/webpush.db.empty | Bin 0 -> 20480 bytes 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 data/webpush.db.empty 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 0000000000000000000000000000000000000000..ede51c97c62e939c302b182f212c60d331a84f75 GIT binary patch literal 20480 zcmeI&&1>U06aes~`!TdIvwNC>xr|{cv}D-GvMkFmg>_QLNn@vposXuMVoOfrG>y}I z)eh`o!u+rMZ>&?=(k@I-bLheoC{gs}r{^EeL13?CM~hGz#ItLEAt|}vbNPJkFG+ueq;B-_(-B<8qHWt)AUNa%-i; zxMmM0Wp7~kD79K{kvEcsN78th(CdVqPh4G;D^Z;wIpy`j)^`%vM&@Y>)Fl&4GB&K2^jYo)8x?4_T-dmL=zgpSq>a9q4>JRFX+>Fr8F=PG6 z8~2?8O-7y?%62b3sTO>uo#Ce4xG9tt)~Mc{6ij1AeX7T zBh@($hSg?l9v7Q4XGsQFbzJ|lubg(QGyA$2UR{l9qspMxSXa`nI|-BC^kk_Uw$n+M zV@Fd0?`(3e%~<*NY)F(-+chqaoSIcNE=|KJIaVpXu{?+9*>9^{z8~M3)sls7{o7i} zXtgfe@-hwA-D#g1UNSAzn?_G~V>;}3L|ZwFdZF#DF8ji(+|Z$GG|GnI#)Y