Skip to content

feat(docker): expose DASHBOARD_ALLOW_EMBED as a build argument - #10701

Merged
diegosouzapw merged 2 commits into
release/v3.8.50from
feat/dockerfile-dashboard-embed-arg
Aug 19, 2026
Merged

diegosouzapw merged 2 commits into
release/v3.8.50from
feat/dockerfile-dashboard-embed-arg

Conversation

@diegosouzapw

Copy link
Copy Markdown
Owner

Why

DASHBOARD_ALLOW_EMBED=vscode (#10273) is read while the bundle is built — Next.js compiles
headers() into the route manifest — so an operator running the official image had no way to
get an embed-enabled dashboard except by editing the Dockerfile.

Worse, the obvious attempt fails silently: Docker drops a --build-arg that has no matching
ARG, printing at most a warning, so docker build --build-arg DASHBOARD_ALLOW_EMBED=vscode
produced the default unframable image and no error. That is the same trap the Dockerfile already
documents for OMNIROUTE_USE_TURBOPACK (L129-134: "a bare ENV shadows any same-named ARG … the
escape hatch only ever worked via -e at runtime").

Surfaced while auditing the VS Code / OmniCopilot docs (#10697), which had to document Docker as
"❌ build your own".

Change

  • Dockerfile — ARG DASHBOARD_ALLOW_EMBED="" + ENV DASHBOARD_ALLOW_EMBED=$DASHBOARD_ALLOW_EMBED
    in the builder stage, next to OMNIROUTE_BASE_PATH, before the build step
  • Docs: the guide's Docker row becomes ✅ with the actual command; ENVIRONMENT.md and
    .env.example gain the Docker note

Default posture unchanged. The arg is empty by default, so every existing build keeps
frame-ancestors 'none' + X-Frame-Options: DENY. The runtime stages deliberately do not
carry the variable — the headers are already baked, and a runtime value would advertise an
effect it cannot have.

Tests

tests/unit/dockerfile-dashboard-embed-arg-10273.test.ts — 3 assertions: declared as ARG (not a
bare ENV) and promoted from the ARG value, set before the build step, empty default, and absent
from every runtime stage.

Verified by mutation, not just by passing: replacing the ARG with a bare
ENV DASHBOARD_ALLOW_EMBED=vscode fails 2 of the 3 tests; restoring it returns 3/3.

✔ #10273 the builder stage exposes DASHBOARD_ALLOW_EMBED as a build arg
✔ #10273 the default is empty, so images stay unframable unless asked
✔ #10273 no runtime stage carries DASHBOARD_ALLOW_EMBED

npm run check:docs-all and npm run typecheck:core are clean.

Note on the diff size

docs/guides/VSCODE-COPILOT.md shows more churn than the one-row change: lint-staged runs
prettier on *.md, which normalized emphasis markers (*x* → _x_) and table padding across
the file. Content-wise only the Docker row changed.

Not verified here

A real docker build — no Docker daemon in this sandbox. The end-to-end proof is an image built
with the arg serving frame-ancestors 'self' vscode-webview: on /dashboard; the unit test
guards the mechanism that makes the arg reachable at all.

Refs #10273

The dashboard's frame-ancestors policy is compiled into the route manifest at
build time, so the only way to get an embed-enabled image was to edit the
Dockerfile: Docker silently drops a --build-arg with no matching ARG, so
`docker build --build-arg DASHBOARD_ALLOW_EMBED=vscode` produced the default
image and no error.

Declared as ARG+ENV in the builder stage, mirroring OMNIROUTE_BASE_PATH, and
empty by default — the unframable default posture is unchanged. The runtime
stages deliberately do not carry it: the headers are already baked, so a
runtime value would advertise an effect it cannot have.

Guarded by tests/unit/dockerfile-dashboard-embed-arg-10273.test.ts, verified by
mutation (a bare ENV in place of the ARG fails 2 of the 3 assertions). Docs
updated across the guide, ENVIRONMENT.md and .env.example.

The guide also carries prettier normalization (emphasis markers, table
padding) applied by lint-staged on commit.

Refs #10273
@jonlwheat2-gif

jonlwheat2-gif commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Review: verified, correct as-is — no changes needed

Applied the PR head (feat/dockerfile-dashboard-embed-arg) to the current release/v3.8.50 tip and re-ran the full validation, including the mutation the PR describes. Everything holds; nothing to change.

Placement, verified against the PR head's Dockerfile:

  • FROM base AS builder — line 60; the new ARG DASHBOARD_ALLOW_EMBED="" / ENV DASHBOARD_ALLOW_EMBED=$DASHBOARD_ALLOW_EMBED land at lines 152–153, immediately after the OMNIROUTE_BASE_PATH pair (140–141) and before npm run build (line 175) — so the value reaches next.config.mjs → scripts/build/dashboardEmbed.mjs inside the same builder stage.
  • The ARG→ENV promotion mirrors the proven OMNIROUTE_BASE_PATH pattern (Docker's ENV substitutes). With the ARG defaulting to "", an ambient DASHBOARD_ALLOW_EMBED in the build environment cannot leak in — Docker prefers the ARG default.
  • No runtime leak: runner stages (FROM base AS runner-base, line 167+) are separate stages and COPY --from=builder carries files, not ENV — the "no runtime stage carries it" assertion matches the file.

Validation run (Windows, Node 24):

  • 3/3 unit tests pass (tests/unit/dockerfile-dashboard-embed-arg-10273.test.ts)
  • Mutation verified: replacing the ARG with a bare ENV DASHBOARD_ALLOW_EMBED=vscode → 1 pass / 2 fail, exactly as claimed; restored
  • npm run check:docs-all clean (no fabricated env/API/file references); ESLint clean; typecheck:core no errors in touched files
  • Changelog fragment changelog.d/features/10701-dockerfile-dashboard-embed-arg.md matches convention

Not verifiable here: an actual docker build --build-arg DASHBOARD_ALLOW_EMBED=vscode + framed-dashboard check was not run (no image was built); the unit guard pins the mechanism that makes the arg reachable at all.

Mirrored on jonlwheat2-gif/OmniRoute:fix/10701-docker-embed-arg → 648d08efb (same content, folded into one commit). PR is open and mergeable. Refs #10273.

@jonlwheat2-gif

Copy link
Copy Markdown
Contributor

⚠️ base-red inherited: #9985 — none of the failing checks are caused by this PR

All 7 failing checks trace to files outside this PR's changes (Dockerfile, docs, .env.example, tests/unit/dockerfile-dashboard-embed-arg-10273.test.ts). release/v3.8.50 is tracked red in #9985 (open, base-red).

Failing check What failed Related to this PR?
Fast Quality Gates 4 gates: error-helper (open-sse/handlers/imageGeneration/providers/geminiWeb.ts raw err.message), mutation-test-coverage (4 tests missing from stryker.conf.json tap.testFiles: sse-auth-exclusive-leases, aihorde-optional-api-key, responses-passthrough-openai-compatible), dead-code (knip 419 > baseline 415), open-sse-typecheck (1 new error under open-sse/) ❌ No
Unit Tests fast-path 1–4/4 tests/unit/chat-messages-validation-6402.test.ts — "Antigravity cloudcode envelope routes… gemini-3-pro-image(-preview)" ❌ No
Vitest (fast-path) tests/unit/autoCombo/provider-family-combos.test.ts — auto/glm virtual combo (flagged flaky in Trunk) ❌ No
No new ESLint warnings repo-wide npm run lint:json -- --max-warnings 0 — base red ❌ No

Per repo policy (AGENTS.md → Base-green check): inherited failures are not this branch's defect, are not fixed inside a feature branch, and are tracked via the base-red issue. This PR's own changes passed their targeted validation: 3/3 Dockerfile guard tests, mutation check (bare ENV → 2/3 fail), check:docs-all, ESLint on the new test, and typecheck on touched files.

@diegosouzapw
diegosouzapw merged commit dd70abe into release/v3.8.50 Aug 19, 2026
11 checks passed
@diegosouzapw
diegosouzapw deleted the feat/dockerfile-dashboard-embed-arg branch August 19, 2026 15:10
giauphan pushed a commit to giauphan/OmniRoute that referenced this pull request Aug 20, 2026
…souzapw#10701)

* feat(docker): expose DASHBOARD_ALLOW_EMBED as a build argument

The dashboard's frame-ancestors policy is compiled into the route manifest at
build time, so the only way to get an embed-enabled image was to edit the
Dockerfile: Docker silently drops a --build-arg with no matching ARG, so
`docker build --build-arg DASHBOARD_ALLOW_EMBED=vscode` produced the default
image and no error.

Declared as ARG+ENV in the builder stage, mirroring OMNIROUTE_BASE_PATH, and
empty by default — the unframable default posture is unchanged. The runtime
stages deliberately do not carry it: the headers are already baked, so a
runtime value would advertise an effect it cannot have.

Guarded by tests/unit/dockerfile-dashboard-embed-arg-10273.test.ts, verified by
mutation (a bare ENV in place of the ARG fails 2 of the 3 assertions). Docs
updated across the guide, ENVIRONMENT.md and .env.example.

The guide also carries prettier normalization (emphasis markers, table
padding) applied by lint-staged on commit.

Refs diegosouzapw#10273

* chore(changelog): correct the fragment to the real PR number (diegosouzapw#10701)

---------

Co-authored-by: Xiangzhe <bakryun0718@proton.me>
@diegosouzapw

Copy link
Copy Markdown
Owner Author

Rebased onto the post-#10698 base would make the Merge integrity red go away, but the 7 unit
reds it shows are inherited from the release tip, not this PR — the full unit run on a docs +
Dockerfile change exercises the same pre-existing failures catalogued in #9985 (GLM import,
Antigravity aliases, model-sync, zh-TW glossary, …). None of them touches the Dockerfile, the
docs, or the new test.

This PR's own surface is green in isolation:

  • tests/unit/dockerfile-dashboard-embed-arg-10273.test.ts — 3/3 (verified by mutation: a bare
    ENV in place of the ARG fails 2 of the 3)
  • check:docs-all, typecheck:core — clean

Held for review rather than auto-merged, since it's the first production-code change in this
batch. The base-red drain is #10704 (in) + the remaining cluster tracked in #9985.

muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…souzapw#10701)

* feat(docker): expose DASHBOARD_ALLOW_EMBED as a build argument

The dashboard's frame-ancestors policy is compiled into the route manifest at
build time, so the only way to get an embed-enabled image was to edit the
Dockerfile: Docker silently drops a --build-arg with no matching ARG, so
`docker build --build-arg DASHBOARD_ALLOW_EMBED=vscode` produced the default
image and no error.

Declared as ARG+ENV in the builder stage, mirroring OMNIROUTE_BASE_PATH, and
empty by default — the unframable default posture is unchanged. The runtime
stages deliberately do not carry it: the headers are already baked, so a
runtime value would advertise an effect it cannot have.

Guarded by tests/unit/dockerfile-dashboard-embed-arg-10273.test.ts, verified by
mutation (a bare ENV in place of the ARG fails 2 of the 3 assertions). Docs
updated across the guide, ENVIRONMENT.md and .env.example.

The guide also carries prettier normalization (emphasis markers, table
padding) applied by lint-staged on commit.

Refs diegosouzapw#10273

* chore(changelog): correct the fragment to the real PR number (diegosouzapw#10701)

---------

Co-authored-by: Xiangzhe <bakryun0718@proton.me>
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.

3 participants