20c603dd84
Adds the arrproxy front door to the arrstack app: the external, oauth-gated entry to sonarr/radarr/prowlarr with per-user API-key brokering, wired to match the arrproxy v0.1.0 code (ports, routes, identity headers, keys dir). Topology (apps/base/arrstack/arrproxy): - oauth2-proxy Deployment/Service is the single front (Authentik OIDC), path- routing via --upstreams to arrproxy-ui (/, static SPA) and arrproxy-api (/api token API + /<app> proxy). skip-auth-regex ^/[^/]+/api bypasses auth only for the *arr proxy API (/sonarr/api...), keeping /api/tokens + /api/me and the UI authenticated. - Identity+groups reach the api via --pass-user-headers (X-Forwarded-*); the api reads ARRPROXY_GROUPS_HEADER=X-Forwarded-Groups (set-xauthrequest is auth_request-response-only and never reaches an upstream). - oauth2-proxy trusts identity.unkin.net's internal-CA cert via a combine-certs initContainer (system roots + vault-ca-cert). - CNPG token store (arrproxy-db, 2 instances, cephrgw backups); a wave-1 Sync hook Job applies the schema (arrproxy-api does not self-migrate). - VaultStaticSecrets for the seeded ARRPROXY_PEPPER and the oauth-credentials; the real *arr keys reuse the existing <app>-apikey Secrets (projected one file per app into /etc/arrproxy/keys). - External Gateway (traefik-external, arrstack.unkin.net, vault-issuer TLS) + HTTPRoute to the oauth2-proxy entry. Also adds the arrstack.unkin.net apex A record (-> external DMZ VIP 198.18.199.0) to the bind-operator unkin.net zone.
47 lines
2.7 KiB
YAML
47 lines
2.7 KiB
YAML
---
|
|
# Non-secret oauth2-proxy configuration (client_id/secret/cookie_secret come from
|
|
# the oauth-credentials Secret). oauth2-proxy is the single auth front for the
|
|
# arrstack: it authenticates the UI and the token API against Authentik, and path-
|
|
# routes to the arrproxy-ui / arrproxy-api upstreams. /<app>/api is exempted from
|
|
# auth (SKIP_AUTH_REGEX) so *arr clients presenting a per-user token reach the api
|
|
# directly; the api then validates the token. Everything else requires the oauth
|
|
# session and receives identity via X-Forwarded-* / X-Auth-Request-* headers.
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: arrproxy-oauth2-env
|
|
namespace: arrstack
|
|
annotations:
|
|
argocd.argoproj.io/sync-wave: "2"
|
|
data:
|
|
OAUTH2_PROXY_HTTP_ADDRESS: "0.0.0.0:4180"
|
|
OAUTH2_PROXY_PROVIDER: "oidc"
|
|
# Authentik arrstack app discovery issuer (served by the internal unkin.net CA;
|
|
# trusted via PROVIDER_CA_FILES below). CONFIRM the slug matches the Authentik
|
|
# application (terraform-authentik PR #18).
|
|
OAUTH2_PROXY_OIDC_ISSUER_URL: "https://identity.unkin.net/application/o/arrstack/"
|
|
OAUTH2_PROXY_REDIRECT_URL: "https://arrstack.unkin.net/oauth2/callback"
|
|
# Longest-prefix wins: /api and /<app> go to arrproxy-api, everything else
|
|
# (the SPA + static assets) to arrproxy-ui.
|
|
OAUTH2_PROXY_UPSTREAMS: "http://arrproxy-ui.arrstack.svc.cluster.local:8080/,http://arrproxy-api.arrstack.svc.cluster.local:8080/api/,http://arrproxy-api.arrstack.svc.cluster.local:8080/sonarr/,http://arrproxy-api.arrstack.svc.cluster.local:8080/radarr/,http://arrproxy-api.arrstack.svc.cluster.local:8080/prowlarr/"
|
|
OAUTH2_PROXY_SCOPE: "openid email profile ak_groups"
|
|
# Populate session.Groups from the Authentik ak_groups claim; pass-user-headers
|
|
# then emits it as a single comma-joined X-Forwarded-Groups header.
|
|
OAUTH2_PROXY_OIDC_GROUPS_CLAIM: "ak_groups"
|
|
# Forward identity + groups to arrproxy-api as X-Forwarded-{User,Email,Groups}
|
|
# (the api reads these; ARRPROXY_GROUPS_HEADER=X-Forwarded-Groups). NOTE:
|
|
# set-xauthrequest is intentionally NOT set -- it only populates auth_request
|
|
# *response* headers, which never reach an --upstreams-proxied backend.
|
|
OAUTH2_PROXY_PASS_USER_HEADERS: "true"
|
|
# Bypass auth ONLY for the *arr proxy API (/<app>/api...): this matches
|
|
# /sonarr/api but NOT /api/tokens or /api/me (which stay authenticated).
|
|
OAUTH2_PROXY_SKIP_AUTH_REGEX: "^/[^/]+/api"
|
|
OAUTH2_PROXY_EMAIL_DOMAINS: "*"
|
|
OAUTH2_PROXY_COOKIE_SECURE: "true"
|
|
OAUTH2_PROXY_COOKIE_DOMAINS: "arrstack.unkin.net"
|
|
OAUTH2_PROXY_WHITELIST_DOMAINS: "arrstack.unkin.net"
|
|
OAUTH2_PROXY_REVERSE_PROXY: "true"
|
|
OAUTH2_PROXY_PROVIDER_CA_FILES: "/etc/ssl/combined/ca-certificates.crt"
|
|
OAUTH2_PROXY_CODE_CHALLENGE_METHOD: "S256"
|
|
OAUTH2_PROXY_SKIP_PROVIDER_BUTTON: "true"
|