sipcapture/homer7-docker

I cannot set sslmode in docker environment

geo-matheou opened this issue · 11 comments

Hello,

I would like to ask if it is possible to set the ssl mode of the database from the docker files.

Thank you in advance,
George

Hello @geo-matheou you mean the postgres container? this is not modified in any way, so you can refer to the original documentation and apply any of its settings including the server.key/crt mountpoints. If you need any confirmation on your attempts or find any issues while applying them, feel free to post it here.

Hello @lmangani,
Thank you for your prompt reply.

I am trying to connect homer to an external postgres which has ssl enabled by default.

show us the failing errors and the settings, and we might be able to comment and help out. No guesswork :)

In the homer-web app container I updated DB_HOST, DB_USER and DB_PASS to store my external db settings. I did the same for the HEPLIFYSERVER_DBADDR, HEPLIFYSERVER_DBUSER and HEPLIFYSERVER_DBPASS of the helplify server.

Here are the logs from homer web app:
homer-webapp | {"level":"error","msg":"pq: SSL connection is required. Please specify SSL options and retry.","time":"2021-04-26T09:05:09Z"}
homer-webapp | {"level":"error","msg":"Couldn't establish connection. Please be sure you can have correct passwordpq: SSL connection is required. Please specify SSL options and retry.","time":"2021-04-26T09:05:09Z"}
homer-webapp | {"level":"error","msg":"Try run: sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';"","time":"2021-04-26T09:05:09Z"}
homer-webapp | panic: pq: SSL connection is required. Please specify SSL options and retry.

Did you enable ssl mode in webapp_config.js for the database block? Try this and see if the pgsql connection string changes:

"sslmode": true

I didn't because the file does not exist in https://github.com/sipcapture/homer7-docker/tree/master/heplify-server/hom7-prom-all. I suppose I have to login to the web app container and do this. Right?

It would be nice to change the sslmode value from the docker-compose file like we do for DB_HOST, DB_USER and DB_PASS.

the container is not designed to provide those functions, rather as a quick way to get started. Feel free to send in a PR with those changes, they are quite trivial. I would not suggest performing those in the container manually as you would loose them every time.

closing this one as its not related to the docker recipes rather the homer-app (webapp) container entrypoint.
Feel free to reopen at https://github.com/sipcapture/homer-app where this actually belongs. Thanks!

Thank you @lmangani!

Thank you @adubovikov!