fix(postgres): ignore commented listen_addresses in custom conf - #11067
Open
devrim-1283 wants to merge 1 commit into
Open
fix(postgres): ignore commented listen_addresses in custom conf#11067devrim-1283 wants to merge 1 commit into
devrim-1283 wants to merge 1 commit into
Conversation
A commented out line matched the substring check, so Coolify skipped appending listen_addresses and PostgreSQL fell back to localhost. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DqVWdKoss9n1o4uobK14Mg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Coolify appends
listen_addresses = '*'to a custom Postgres configuration only when the setting is missing, but the check was a plain substring match. A commented out line counted as configured, so nothing was appended. Since the custom file is mounted as the complete config file, PostgreSQL then falls back to its built in default of localhost. The container still reports healthy, because the health check connects over the local socket, while the database is unreachable from every other container.The check now looks for an active, uncommented assignment at the start of a line. It is case insensitive and tolerates CRLF input and a missing space around the equals sign.
Issues
Category
Preview
No UI change.
AI Assistance
If AI was used:
Testing
Added tests/Unit/PostgresqlCustomConfTest.php covering a commented out line, an active line, both in one file, CRLF input, the name appearing inside another setting value, and empty or null input.
Manually: saved a Postgres configuration whose only mention of the setting was commented out, restarted the database, and confirmed the generated custom-postgres.conf now ends with the appended value and that the container is reachable from another container on the same network.
Contributor Agreement
Important