Skip to content

fix(chart): inject N8N_EDITOR_BASE_URL into containers#153

Merged
krider2010 merged 1 commit into
mainfrom
krider2010/review-hosting-issue-148
Jun 4, 2026
Merged

fix(chart): inject N8N_EDITOR_BASE_URL into containers#153
krider2010 merged 1 commit into
mainfrom
krider2010/review-hosting-issue-148

Conversation

@krider2010

Copy link
Copy Markdown
Collaborator

Summary

  • Fixes [Bug]: N8N_EDITOR_BASE_URL set in ConfigMap but never injected into any container (empty at runtime) #148. The chart was writing N8N_EDITOR_BASE_URL into 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.
  • Wires the key into the main / worker / webhook-processor containers via configMapKeyRef, matching how WEBHOOK_URL is already done, and gates it on the same condition configmap.yaml uses so we never reference a missing key.

Test plan

  • helm lint charts/n8n
  • helm template for three scenarios: ingress with hosts, webhook.url=https://… without ingress, and neither (env present, present, absent respectively)
  • Installed on OrbStack with the reporter's values (webhook.url=https://n8n.example.com, ingress off, queue mode + webhook processor). Confirmed kubectl exec ... printenv N8N_EDITOR_BASE_URL returns the configured URL on main, worker, and webhook-processor pods.

Note for reviewers

Users on the documented config.extraEnv workaround will end up with the env name defined twice in the container spec. The *ConfigMapEnv helpers render before config.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.

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>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Loading

Re-trigger cubic

@krider2010 krider2010 merged commit 5f74f4a into main Jun 4, 2026
11 checks passed
@krider2010 krider2010 deleted the krider2010/review-hosting-issue-148 branch June 4, 2026 17:34
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.

[Bug]: N8N_EDITOR_BASE_URL set in ConfigMap but never injected into any container (empty at runtime)

1 participant