xirixiz / dsmr-reader-docker

DSMR Reader in Docker.
https://hub.docker.com/r/xirixiz/dsmr-reader-docker
112 stars 33 forks source link

I would like to see a bit more elaborate explanation of user/passwords of this setup #320

Closed gctwnl closed 1 year ago

gctwnl commented 1 year ago

Request

I tried setting up postgres & dsmr and did set postgres and dsmr data via env files in my docker-compose.yaml. But this failed with python crsashing. I then used this as postgres.env:

TZ=Europe/Amsterdam
PG_TZ=Europe/Amsterdam
POSTGRES_USER=dsmrreader
POSTGRES_PASSWORD=dsmrreader
POSTGRES_DB=dsmrreader

and this as dsmr.env:

DJANGO_TIME_ZONE=Europe/Amsterdam
DB_HOST=dsmrdb
DSMR_USER=dsmrreader
DSMR_PASSWORD=dsmrreader
DSMR_EMAIL=root@localhost
VIRTUAL_HOST=localhost

just to see if it would work, and it did, so I know that the basic setup using docker works. I just don't know what to do to get decent identities/secrets (not-standard) used by the docker setup.

Additional information

No response

xirixiz commented 1 year ago

Hi, you can find this in the readme.

This definition on the PG database (backend) is set with these settings:

POSTGRES_USER=dsmrreader
POSTGRES_PASSWORD=dsmrreader
POSTGRES_DB=dsmrreader

If you modify one of the above settings then this needs to be matched on the DSMR container as well (authentication from application to the database, backend communication):

DJANGO_DATABASE_NAME=dsmrreader
DJANGO_DATABASE_USER=dsmrreader
DJANGO_DATABASE_PASSWORD=dsmrreader

More info: https://github.com/xirixiz/dsmr-reader-docker#db-related-defaults-are-shown-as-value

These settings are used for the UI/frontend of DSMR Reader and have no relationship with the databse. You can set them to whatever you like:

DSMR_USER=dsmrreader
DSMR_PASSWORD=dsmrreader
DSMR_EMAIL=root@localhost

I hope this clarifies things for you. If not just update the ticket, else please close it :)

gctwnl commented 1 year ago

I see, if I only had set POSTGRES_USER and POSTGRES_PASSWORD and DSMR_USER and DSMR_PASSWORD, the thing that went wrong was that I needed to set DJANGO_DATABASE_USER and DJANGO_DATABASE_PASSWORD to the same values as POSTGRES_USER and POSTGRES_PASSWORD?

gctwnl commented 1 year ago

What is the best process to change this from dsmrreader everywhere to more safe values? Because I do not want to lose my current database.

xirixiz commented 1 year ago

Sorry, I have been quiet busy. I wlll respond asap!