Self hosted FLOSS fitness/workout, nutrition and weight tracker
Read the PS_DATABASE_URI variable, if set
Roland Geidera9d4b29a8951
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 004e883a4..ce7cdd5a7 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -1,5 +1,17 @@# Changelog for the next release+## Upgrade steps++* Set the `PS_DATABASE_URI` with the wger db password in the usual format+ `postgres://<user>:<password>@<host>:<port>/<dbname>`. Note that if you didn't+ change the default db config, you just need to update the docker compose files,+ and you're good to go.++* The Postgres container in the docker-compose setup now reads its credentials+ (`POSTGRES_USER`, `POSTGRES_PASSWORD`, `POSTGRES_DB`) from `prod.env` instead+ of having them hardcoded in `services/postgres.yaml`. As above, you only need+ to change this if you are using some non-standard password.+## PowersyncAdds powersync support. This allows clients (i.e. the mobile app) to finallydiff --git a/settings/main.py b/settings/main.pyindex 79b42f652..143b097af 100644--- a/settings/main.py+++ b/settings/main.py@@ -61,7 +61,9 @@ if os.environ.get('DJANGO_ADMINS'):]MANAGERS = ADMINS-if os.environ.get('DJANGO_DB_ENGINE'):+if os.environ.get('PS_DATABASE_URI'):+ DATABASES = {'default': env.db_url('PS_DATABASE_URI')}+elif os.environ.get('DJANGO_DB_ENGINE'):DATABASES = {'default': {'ENGINE': env.str('DJANGO_DB_ENGINE'),