fix(chart): inject N8N_EDITOR_BASE_URL into containers#153
Merged
Conversation
The chart computed N8N_EDITOR_BASE_URL into the n8n ConfigMap whenever ingress hosts existed or webhook.url was set, but no template wired the key into any container env. With no bulk envFrom: configMapRef:, the value silently never reached the running n8n process — leaving editor links, OAuth callbacks, and notification URLs empty even when configured. Mirror the existing WEBHOOK_URL pattern: add a configMapKeyRef block for N8N_EDITOR_BASE_URL to the main, worker, and webhook-processor ConfigMap env helpers, gated on the same condition configmap.yaml uses to emit the key, so the env is never sourced from a missing ConfigMap entry. Fixes #148 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
No issues found across 1 file
Architecture diagram
sequenceDiagram
participant User as User/values.yaml
participant Chart as Chart Helm
participant ConfigMap as ConfigMap Resource
participant Pod as n8n Pod (main/worker/webhook)
Note over User,Pod: NEW: N8N_EDITOR_BASE_URL Injection Flow
User->>Chart: Provide configuration (ingress.enabled with hosts OR webhook.url)
Chart->>ConfigMap: Render ConfigMap with N8N_EDITOR_BASE_URL key
alt Condition: ingress with hosts OR webhook.url starting with "http"
Note over ConfigMap: Key N8N_EDITOR_BASE_URL present
Chart->>Pod: Inject env var via configMapKeyRef in container spec
Note over Pod: NEW: N8N_EDITOR_BASE_URL available at runtime
else Condition not met
Note over ConfigMap: Key N8N_EDITOR_BASE_URL absent
Chart->>Pod: No env var injected
Note over Pod: Editor links/OAuth callbacks may be missing
end
Note over Pod: ConfigMap-sourced value takes precedence over extraEnv if both defined
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.
Summary
N8N_EDITOR_BASE_URLinto the ConfigMap, but no template referenced it as a container env var, so the value never reached the running n8n process even though the ConfigMap looked right. Editor links, OAuth callbacks, etc. came back empty.configMapKeyRef, matching howWEBHOOK_URLis already done, and gates it on the same conditionconfigmap.yamluses so we never reference a missing key.Test plan
helm lint charts/n8nhelm templatefor three scenarios: ingress with hosts,webhook.url=https://…without ingress, and neither (env present, present, absent respectively)webhook.url=https://n8n.example.com, ingress off, queue mode + webhook processor). Confirmedkubectl exec ... printenv N8N_EDITOR_BASE_URLreturns the configured URL on main, worker, and webhook-processor pods.Note for reviewers
Users on the documented
config.extraEnvworkaround will end up with the env name defined twice in the container spec. The*ConfigMapEnvhelpers render beforeconfig.extraEnv, so in a Kubernetes env list the ConfigMap-sourced value wins. In practice the workaround value is the same URL the chart now derives, so behavior should be identical — but worth a release note.