Skip to content

fix(logout): drive portal-host prefix from required SMB_NAME env#11

Open
awais786 wants to merge 4 commits into
foss-mainfrom
fix/logout-smb-name
Open

fix(logout): drive portal-host prefix from required SMB_NAME env#11
awais786 wants to merge 4 commits into
foss-mainfrom
fix/logout-smb-name

Conversation

@awais786
Copy link
Copy Markdown

@awais786 awais786 commented May 1, 2026

Summary

  • Logout currently hardcodes "foss." as the portal-host prefix at frontend/src/app/main/data/auth.cljs:266. Silently broke when the deployment moved from foss.* to moneta.* in the askii.ai cutover.
  • Source the prefix from the required SMB_NAME env var (no default under SSO — nginx-entrypoint.sh exits non-zero at startup if AUTH_TYPE=SSO and SMB_NAME is unset).
  • Plumbed via the same Pattern B2 mechanism as MPASS_SIGNOUT_URL: placeholder in config.js, runtime substitution in nginx-entrypoint.sh, exposed via app.config/smb-name.

Why

Hardcoded prefixes silently break domain cutovers. Container env name (SMB_NAME) is uniform across every devstack app behind ForwardAuth — see sso-rules RULES.md §1 Logout.

Files changed

  • docker/images/files/config.js//var penpotSmbName = ""; placeholder
  • docker/images/files/nginx-entrypoint.shupdate_smb_name substitution + fail-fast under SSO
  • frontend/src/app/config.cljs(def smb-name ...)
  • frontend/src/app/main/data/auth.cljs — interpolate cf/smb-name into the regex

Test plan

  • Deploy with SMB_NAME=moneta + AUTH_TYPE=SSO; verify logout lands on moneta.<domain>
  • Omit SMB_NAME with AUTH_TYPE=SSO; verify the frontend container fails to start with a clear error message
  • Omit SMB_NAME without SSO; verify startup still succeeds (no SSO logout path exercised)

🤖 Generated with Claude Code

The logout redirect hardcoded "foss." as the portal-host prefix in
auth.cljs. That broke silently when the deployment moved from foss.*
to moneta.* in the askii.ai cutover.

Make the prefix env-driven via a required SMB_NAME var (no default
under SSO — nginx-entrypoint.sh exits non-zero at startup if
AUTH_TYPE=SSO and SMB_NAME is unset, instead of silently rendering
the wrong portal host at logout).

Same Pattern B2 plumbing as MPASS_SIGNOUT_URL:
- config.js: //var penpotSmbName = "" placeholder
- nginx-entrypoint.sh: update_smb_name substitutes from $SMB_NAME
- app.config: (def smb-name (obj/get global "penpotSmbName"))
- app.main.data.auth: read cf/smb-name and interpolate into the regex

Container env name (SMB_NAME) is uniform across every devstack app
behind ForwardAuth. See sso-rules RULES.md section 1 Logout.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@jawad-khan jawad-khan force-pushed the fix/logout-smb-name branch from 770377b to 220938b Compare May 2, 2026 08:52
jawad-khan and others added 3 commits May 2, 2026 14:08
Drops the cf/smb-name read on the SPA logout path. The previous approach
required threading SMB_NAME through devstack docker-compose env →
nginx-entrypoint.sh substitution into config.js → cljs cf alias; any
broken link silently routed logout to the wrong host or crashed.

Switching to a regex on js/location host removes the env dependency and
works for any `<prefix>-<app>.<domain>` shape:
- foss-design.local.moneta.dev → foss.local.moneta.dev
- moneta-design.askii.ai       → moneta.askii.ai

The cf/smb-name declaration and nginx-entrypoint.sh plumbing are now
dead; will be removed in a separate cleanup pass.
Cleanup follow-up to 99f36f6 — the regex-based portal-host derivation
no longer reads cf/smb-name, so the runtime config plumbing is dead:
- docker/images/files/config.js: remove placeholder declaration
- docker/images/files/nginx-entrypoint.sh: remove envsubst block
- frontend/src/app/config.cljs: remove smb-name def
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.

2 participants