Skip to content

fix(postgres): ignore commented listen_addresses in custom conf - #11067

Open
devrim-1283 wants to merge 1 commit into
coollabsio:nextfrom
devrim-1283:fix/postgres-custom-conf-listen-addresses
Open

fix(postgres): ignore commented listen_addresses in custom conf#11067
devrim-1283 wants to merge 1 commit into
coollabsio:nextfrom
devrim-1283:fix/postgres-custom-conf-listen-addresses

Conversation

@devrim-1283

Copy link
Copy Markdown
Contributor

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

  • Fixes

Category

  • Bug fix
  • Improvement
  • New feature
  • Adding new one click service
  • Fixing or updating existing one click service

Preview

No UI change.

AI Assistance

  • AI was NOT used to create this PR
  • AI was used (please describe below)

If AI was used:

  • Tools used: Claude Code
  • How extensively: used to locate the substring check and to draft the fix and the unit test. I read the diff, confirmed the PostgreSQL default for this setting, and verified the tests myself.

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

  • I have read and understood the contributor guidelines. If I have failed to follow any guideline, I understand that this PR may be closed without review.
  • I have searched existing issues and pull requests (including closed ones) to ensure this isn't a duplicate.
  • I have tested all the changes thoroughly with a local development instance of Coolify and I am confident that they will work as expected when a maintainer tests them.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant