fix(chart): use DB_POSTGRESDB_SSL_ENABLED to enable Postgres TLS - #175
Open
b3go wants to merge 1 commit into
Open
fix(chart): use DB_POSTGRESDB_SSL_ENABLED to enable Postgres TLS#175b3go wants to merge 1 commit into
b3go wants to merge 1 commit into
Conversation
n8n reads DB_POSTGRESDB_SSL_ENABLED, not DB_POSTGRESDB_SSL, so database.ssl.enabled had no effect on its own and the connection quietly stayed plaintext. This likely went unnoticed because n8n also switches SSL on whenever DB_POSTGRESDB_SSL_CA or _CERT is set, and the chart emits those correctly.
Contributor
There was a problem hiding this comment.
No issues found across 2 files
Architecture diagram
sequenceDiagram
participant Helm as Helm Values
participant CM as ConfigMap
participant Env as Container Environment
participant n8n as n8n Process
participant Postgres as PostgreSQL
Note over Helm,Postgres: Postgres TLS configuration flow
Helm->>CM: database.ssl.enabled=true
alt NEW: DB_POSTGRESDB_SSL_ENABLED key emitted
CM->>CM: Set DB_POSTGRESDB_SSL_ENABLED="true"
else OLD: DB_POSTGRESDB_SSL emitted (not read by n8n)
Note over CM: Bug: wrong key name caused silent plaintext
end
opt ssl.ca or ssl.cert also set
Helm->>CM: database.ssl.ca / database.ssl.cert
CM->>CM: Set DB_POSTGRESDB_SSL_CA / DB_POSTGRESDB_SSL_CERT
end
CM->>Env: Inject environment variables
Env->>n8n: DB_POSTGRESDB_SSL_ENABLED=true
n8n->>n8n: Read DB_POSTGRESDB_SSL_ENABLED
alt TLS enabled
n8n->>Postgres: Connect with TLS
Postgres-->>n8n: Encrypted connection
else TLS disabled
n8n->>Postgres: Connect without TLS
Postgres-->>n8n: Plaintext connection
end
opt ssl.ca present
n8n->>Postgres: Use CA certificate for validation
end
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.
Pull Request
Description
n8n reads DB_POSTGRESDB_SSL_ENABLED, not DB_POSTGRESDB_SSL, so database.ssl.enabled had no effect on its own and the connection quietly stayed plaintext.
This likely went unnoticed because n8n also switches SSL on whenever DB_POSTGRESDB_SSL_CA or _CERT is set, and the chart emits those correctly.
Type of Change
Changes Made
Testing Performed
Rendered with database.ssl.enabled=true and no client certs. Before no SSL variable n8n reads was emitted. With the change: DB_POSTGRESDB_SSL_ENABLED=true is present in the ConfigMap and injected into main, worker and webhook-processor.
Chart Validation
helm lint charts/n8npasses- [ ]
./scripts/validate-examples.shpasses -> this doesn't existBreaking Changes
database.ssl.enabledkeeps its name and meaning, andDB_POSTGRESDB_SSLis not read by n8n, so no working configuration depends on it. Deployments already getting TLS viassl.ca/ssl.certare unaffected but those that were silently running plaintext will now genuinely negotiate TLS on upgrade.Checklist
Summary by cubic
Fixes Postgres TLS enablement in the
n8nchart by emittingDB_POSTGRESDB_SSL_ENABLEDwhendatabase.ssl.enabled=true. Instances that were silently using plaintext will now negotiate TLS as expected.DB_POSTGRESDB_SSLtoDB_POSTGRESDB_SSL_ENABLEDinconfigmap.yamland_configmap-env.tpl.DB_POSTGRESDB_SSL_ENABLED=trueis injected into main, worker, and webhook-processor;helm lintpasses.Written for commit 5e74d79. Summary will update on new commits.