feat(rgxr): opt-in sign-in mode and web frontend deployment #7

Merged
yuuhikaze merged 2 commits from rgxr/optin-auth into master 2026-10-25 04:55:37 -05:00
Owner

Implements the cluster side of yuuhikaze/rgxr#80 (app PR: k8s-services/rgxr#82): the rgxr site becomes public-by-default — every visitor is the shared anonymous user — and signing in is initiated from the app (a CRT boot splash on entry; no forced Authelia redirect, no auth in the top bar).

Ingress change (review focus)

auth.mode picks what unauthenticated requests get; the authelia@file middleware itself stays on every route in both modes (it is what injects Remote-*):

  • forced (default, prod): one_factor for the whole domain — every route redirects to the SSO portal. Unchanged.
  • optin (values-test.yaml): one_factor only for /auth, bypass for the rest of the domain. Unauthenticated visitors are served as anonymous; the app splash's [ SIGN IN ] option hits /auth/signin?rd=/, whose route triggers the SSO dance and returns to the app once authenticated. Signed-in sessions keep injecting Remote-* on normal requests.

Action needed from the cluster admin: the opt-in mode only takes effect together with matching access_control rules for the rgxr host in modules/features/authelia.nix — otherwise the whole domain keeps redirecting:

{ domain = "rgxr-test.yhkze.net"; path = "/auth"; policy = "one_factor"; }
{ domain = "rgxr-test.yhkze.net"; policy = "bypass"; }

(path rule first; the middleware reference is unchanged.)

Also in this chart

  • rgxr-web Deployment + Service, gated behind web.enabled (test only — prod keeps API-only), so the web routes and the AUTH_* env have somewhere to land. Kargo promotion for ghcr.io/yuuhikaze/rgxr-web is a follow-up in gitops/apps.
  • API container gets RGXR_ANONYMOUS_FALLBACK=true in optin mode (header-less requests resolve to anonymous instead of 401).
  • Web container gets AUTH_SIGNIN_PATH (+ AUTH_SIGNOUT_PATH once auth.signoutPath is set — left empty pending confirmation of the Authelia portal logout URL).

helm lint and helm template verified for both modes; the default render is byte-identical to today (only the /api route).

Implements the cluster side of yuuhikaze/rgxr#80 (app PR: k8s-services/rgxr#82): the rgxr site becomes public-by-default — every visitor is the shared `anonymous` user — and signing in is initiated from the app (a CRT boot splash on entry; no forced Authelia redirect, no auth in the top bar). ## Ingress change (review focus) `auth.mode` picks what unauthenticated requests get; the `authelia@file` middleware itself stays on **every** route in both modes (it is what injects `Remote-*`): - `forced` (default, prod): `one_factor` for the whole domain — every route redirects to the SSO portal. Unchanged. - `optin` (values-test.yaml): `one_factor` only for `/auth`, `bypass` for the rest of the domain. Unauthenticated visitors are served as `anonymous`; the app splash's `[ SIGN IN ]` option hits `/auth/signin?rd=/`, whose route triggers the SSO dance and returns to the app once authenticated. Signed-in sessions keep injecting `Remote-*` on normal requests. **Action needed from the cluster admin:** the opt-in mode only takes effect together with matching `access_control` rules for the rgxr host in `modules/features/authelia.nix` — otherwise the whole domain keeps redirecting: ``` { domain = "rgxr-test.yhkze.net"; path = "/auth"; policy = "one_factor"; } { domain = "rgxr-test.yhkze.net"; policy = "bypass"; } ``` (path rule first; the middleware reference is unchanged.) ## Also in this chart - `rgxr-web` Deployment + Service, gated behind `web.enabled` (test only — prod keeps API-only), so the web routes and the `AUTH_*` env have somewhere to land. Kargo promotion for `ghcr.io/yuuhikaze/rgxr-web` is a follow-up in gitops/apps. - API container gets `RGXR_ANONYMOUS_FALLBACK=true` in optin mode (header-less requests resolve to `anonymous` instead of 401). - Web container gets `AUTH_SIGNIN_PATH` (+ `AUTH_SIGNOUT_PATH` once `auth.signoutPath` is set — left empty pending confirmation of the Authelia portal logout URL). `helm lint` and `helm template` verified for both modes; the default render is byte-identical to today (only the `/api` route).
Issue yuuhikaze/rgxr#80. auth.mode picks what unauthenticated requests
get (the Authelia access_control rules on the host enforce it):

  forced — one_factor for the whole domain: every route redirects to
           the SSO portal (unchanged default).
  optin  — one_factor only for auth.path (/auth), bypass elsewhere:
           anonymous visitors are served as the shared `anonymous`
           user and sign in from the app's top bar. The forward-auth
           middleware stays on every route so signed-in sessions still
           inject Remote-* on normal requests. Only values-test.yaml
           opts in; prod stays forced.

The /auth route plus the web catch-all need the frontend in the
cluster, so the chart now ships an (opt-in) rgxr-web Deployment +
Service; the api gains RGXR_ANONYMOUS_FALLBACK and the web container
AUTH_SIGNIN_PATH / AUTH_SIGNOUT_PATH in optin mode.

NOTE for review: auth.mode: optin only takes effect together with
access_control rules in modules/features/authelia.nix for the rgxr
host (see ingress.yaml) — otherwise the domain keeps redirecting.

Co-Authored-By: GLM (OpenCode) <dev@yhkze.net>
Co-Authored-By: GLM (OpenCode) <dev@yhkze.net>
yuuhikaze merged commit 0f40438756 into master 2026-10-25 04:55:37 -05:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gitops/charts!7
No description provided.