-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker compose environment variables encoded as KEY='value' are not longer accepted since 2.6 #91
Comments
In the report, the compose configuration template got messed up. GOTIFY_DATABASE_CONNECTION='host=ip_of_postgres_server port=port_of_postgres_server user=username dbname=dbname password=password sslmode=sslmode' |
I think the issue is docker-compose env is just a string not a key value pair so you don't need the single quote. Looks like our stale fork diverged from upstream and silently stripped off single quotes in env values when upstream did not, removing the single quote seem to fix it on my reproduction. I looked at the official documentation and did not see places where we suggested this syntax, however if this is common usage among users maybe we can manually strip off every environment variable starting with "GOTIFY_" before loading config? |
I had the string in single quotes due to the password having characters needing escaping. Removing the quotes and escaping the characters myself does allow for 2.6.1 to start correctly. I don't mind doing this, but I believe YAML does allow for wrapping a string in quotes to avoid having to escape characters. Single quotes fully escape the entire string. Double quotes still allows for interpretation of some unescaped characters, though none that should be used in a password. I did a test and the failed behavior happens for both single and double quotes. If the fix is to strip quotes, it should not be limited to single. Otherwise, I'd be happy with a documentation fix that says "properly escape your characters with a \ blockhead" 😄 |
I think Because The schema says list or dict, so maybe if you write it like this it might be more ergonomic
|
Converting environment to a dictionary and escaping it as suggested works. Seems this is not an actual bug, but a case of user error. I'd be happy to close this if you agree? Seems the previous operational state was just covering an incorrectly formatted compose yaml. |
I think the documentation could be better with the current compose template . We can close this or transfer this to the documentation repo. Thanks for the issue, I had some issues configuring it too ( I chose to just to mount a config file into the container for my own deployment so I don't have to deal with this complex escaping thing) |
Transferring it to the documentation repo seems like it would be the correct move, at least resulting in better documentation. Thanks for the ideas on getting to a fix. |
Signed-off-by: eternal-flame-AD <[email protected]>
Signed-off-by: eternal-flame-AD <[email protected]>
* clarify docker-compose environment format (#91) --------- Signed-off-by: eternal-flame-AD <[email protected]>
Gotify 2.6.1 is ignoring the postfix host settings. The same connection settings work fine in 2.5. After upgrading to 2.6.1, gotify only attempts to connect to [::1]:5432
I cannot test this on Gotify 2.6.0 due to bool value crashing.
Rolling back to 2.5 works. The configuration is never changed.
Digging through changes, I can't really find much except
2d6601747b546c81d364a87bcfaf070bdd4f9f74
I don't know if this directly correlates.
Can the issue be reproduced with the latest available release? (y/n) yes
Which one is the environment gotify server is running in?
Docker startup command or config file here (please mask sensitive information)
compose configuration snippit
gotify:
container_name: gotify
image: gotify/server:latest
#image: gotify/server:2.5 # working image
restart: unless-stopped
environment:
- TZ=America/Los_Angeles
- GOTIFY_SERVER_PORT=<port_number>
- GOTIFY_SERVER_SSL_ENABLED=false
- GOTIFY_SERVER_SSL_REDIRECTTOHTTPS=false
- GOTIFY_DATABASE_DIALECT=postgres
- GOTIFY_DATABASE_CONNECTION='host=<ip_of_postgres_server> port=<port_of_postgres_server> user= dbname= password= sslmode='
- GOTIFY_PASSSTRENGTH=11
- GOTIFY_REGISTRATION=false
- GOTIFY_SERVER_KEEPALIVEPERIODSECONDS=75
- GOTIFY_SERVER_STREAM_PINGPERIODSECONDS=30
volumes:
-
Do you have an reverse proxy installed in front of gotify server? (Please select None if the problem can be reproduced without the presense of a reverse proxy)
On which client do you experience problems? (Select as many as you can see)
What did you do?
Upgraded
What did you expect to see?
Gotify server running
What did you see instead? (Include screenshots, android logcat/request dumps if possible)
Starting Gotify version 2.6.1@2024-11-16-08:49:43
panic: dial tcp [::1]:5432: connect: connection refused
goroutine 1 [running]:
main.main()
/src/gotify/app.go:47 +0x39c
Starting Gotify version 2.6.1@2024-11-16-08:49:43
panic: dial tcp [::1]:5432: connect: connection refused
goroutine 1 [running]:
main.main()
/src/gotify/app.go:47 +0x39c
Starting Gotify version 2.6.1@2024-11-16-08:49:43
panic: dial tcp [::1]:5432: connect: connection refused
goroutine 1 [running]:
main.main()
/src/gotify/app.go:47 +0x39c
Starting Gotify version 2.6.1@2024-11-16-08:49:43
panic: dial tcp [::1]:5432: connect: connection refused
goroutine 1 [running]:
main.main()
/src/gotify/app.go:47 +0x39c
The text was updated successfully, but these errors were encountered: