Repository navigation
fix(packaging): compose eval stack proxies auth in-network and bootstraps a first admin - #4768
Conversation
…raps a first admin den-web's /api/auth/* proxy (SSO ACS, SCIM, /setup account creation) reads DEN_API_BASE server-side; pointing it at the host-only localhost:<API_PORT> answered 502 upstream_unreachable from inside the web container. Keep the in-network http://den:8788 with a comment saying why, and drop DEN_AUTH_FALLBACK_BASE, which den-web has not read since 2026-07-08. Pass DEN_SINGLE_ORG_OWNER_EMAILS and DEN_INITIAL_ADMIN_BOOTSTRAP_CODE through to the den service as OPENWORK_OWNER_EMAILS / OPENWORK_SETUP_CODE (empty keeps the public-signup default) and document the Compose path of the first-administrator flow next to the Helm one.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Warden review summary — ClearNative findings: 0. Blocking policy matches before consolidation: 0. Full finding text remains in Warden's native checks and review threads. This comment retains only native IDs, severity, skill attribution, and safe locations. Analysis run Reported trigger coverage (not proof of complete repository or context coverage): diff-security-review (40141 ms), confidentiality-review (45549 ms). Blockers
Advisories
Needs recheck
Observed review-thread metrics
Thread states are read-only collection snapshots. These metrics are neither lifetime totals nor exact resolution times, and this summary is not clearance authority. |
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (a01761540ecc6b4179585e19bc617b657f7e7aa7). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
|
Passed · 6/6 tests · 7/7 assertions · 5 images Commit |
… not the in-network DEN_API_BASE (#4793) Follow-up to #4768. den-web's legacy /api/den/* 307 (older desktop builds) resolved its Location from DEN_API_BASE first. In the documented Compose and Helm shapes DEN_API_BASE is the container-internal upstream the /api/auth/* proxy needs (http://den:8788), so browsers were redirected to a host they cannot reach. Prefer DEN_API_PUBLIC_URL, the browser-reachable origin that runtime-config already hands to new clients, then fall back to DEN_API_BASE, then api.<web host>, in both the route handler and its build-time mirror. The runtime side now also rejects non-http(s) schemes like the mirror did, so a scheme-less value no longer produces a "null" origin. The /api/auth/* proxy, readiness and the SSO probe keep reading DEN_API_BASE. Proof: extended den-web unit tests (route, origin, build-time parity) and a new PR-lane spec, evals/specs/den-web-public-api-redirect.test.ts, that boots the documented docker-compose.eval.yml as an isolated project with a locally built den-web image (OPENWORK_EVAL_DEN_WEB_IMAGE) and asserts from the host that the redirect lands on Den API health, the auth proxy still answers through the in-network upstream, runtime-config agrees with the redirect, and the same image without DEN_API_PUBLIC_URL keeps the DEN_API_BASE fallback.
Problem
Two gaps in the documented pull-only evaluation stack (
packaging/docker/docker-compose.eval.yml,packages/docs/self-host/evaluate-with-docker-compose.mdx):F2 — auth proxy upstream. den-web's
/api/auth/*route is a server-side proxy that readsDEN_API_BASE(ee/apps/den-web/app/api/_lib/upstream-proxy.ts). WithDEN_API_BASE=http://localhost:<OPENWORK_API_PORT>— the shape the stack shipped with until #4729 — the web container cannot reach the upstream and answers502 upstream_unreachable. That breaks every web-origin auth URL Den advertises: the SAML ACS URL (/api/auth/sso/saml2/sp/acs/...), the SCIM base URL (/api/auth/scim/v2), and the/setuppage's account creation (POST /api/auth/sign-up/email). #4729 already moved the pin tohttp://den:8788; this PR documents why in the file so the next edit does not regress it, and dropsDEN_AUTH_FALLBACK_BASE, which den-web has not read since 2026-07-08 (no.tsreference inee/apps/den-web; removed from the den-web README too).F5 — first administrator on Compose.
first-administrator.mdxwas Helm-only and the compose file did not passDEN_SINGLE_ORG_OWNER_EMAILS/DEN_INITIAL_ADMIN_BOOTSTRAP_CODEthrough, soOPENWORK_ALLOW_SIGNUP=falseleft no way to create the first account.Change
docker-compose.eval.yml(image:lines byte-identical — ci(release): pin the compose evaluation stack automatically after each release (gated remainder of #4732; scripts in #4905) #4732's automation owns them): comment onDEN_API_BASE; removeDEN_AUTH_FALLBACK_BASE; newOPENWORK_OWNER_EMAILS→DEN_SINGLE_ORG_OWNER_EMAILSandOPENWORK_SETUP_CODE→DEN_INITIAL_ADMIN_BOOTSTRAP_CODEon thedenservice only (den-migratereads DB vars only). Empty defaults keep today's behaviour (getInitialAdminBootstrapAvailability→not_configured).evaluate-with-docker-compose.mdx: two table rows + "Create a private first administrator" section.first-administrator.mdx: names the Den API env var; new "Docker Compose evaluation stack" subsection.ee/apps/den-web/README.md: drop deadDEN_AUTH_FALLBACK_BASE.curl … | shasum --checkfetches a compose file that actually has the new knobs.Proof
Config/docs change; runtime proof is the stack boots below (published
0.18.46images,OPENWORK_WEB_PORT=13005 OPENWORK_API_PORT=18788), not a testkit spec.F2 negative — current compose + override
DEN_API_BASE=http://localhost:18788(the pre-#4729 shape), from the host:F2 positive — this branch's compose:
F5 — booted with
OPENWORK_ALLOW_SIGNUP=false [email protected] OPENWORK_SETUP_CODE=<random>; the sequence/setupdrives (ee/apps/den-web/app/(den)/setup/page.tsx), verify on the API origin and sign-up through the web-origin proxy:Docs (the
validate-docsCI lane, run locally inpackages/docs):npx -y [email protected] validate→build validation passed;npx -y [email protected] broken-links→no broken links found.Download pin:
curl …/79636623bfbed3e2e5daff48b8550cb2ba220d77/packaging/docker/docker-compose.eval.yml | shasum -a 256 --check→docker-compose.eval.yml: OK.Warden (
pnpm warden:check, HEADa01761540, origin/dev634df629abefore and after): diff-security-review + confidentiality-review both completed, No findings, exit 0.Not fixed here (den-web code, needs an image release)
/api/den/*is a 307 redirect (app/api/_lib/den-api-redirect.ts→denApiOriginForWebOrigin) and it prefersDEN_API_BASEoverDEN_API_PUBLIC_URL. With the in-networkDEN_API_BASEthe browser is sent tolocation: http://den:8788/…, which is unreachable from the host; Helm has the same shape (DEN_API_BASE=http://<release>-den-api:8788). The pre-#4729 config redirected correctly but 502'd the proxy — the two envs cannot satisfy both today. Fix belongs in den-web (den-api-origin.ts+next-config-den-api-redirects.cjs: preferDEN_API_PUBLIC_URL, thenDEN_API_BASE, thenapi.<host>); the route only serves older desktop builds, runtime-config already hands new clientsdenApiUrl=http://localhost:18788.