chore(auth): drop redundant WEKNORA_AUTH_REGISTRATION_MODE env override

DISABLE_REGISTRATION=true (handler layer) and
WEKNORA_AUTH_REGISTRATION_MODE=invite_only (config layer) were two
env-level ways of saying the same thing: block /auth/register.
Keeping both invites confusion about which wins and risks operators
setting one while expecting the other.

Remove the WEKNORA_AUTH_REGISTRATION_MODE env override so the env
layer exposes a single knob (DISABLE_REGISTRATION). The
auth.registration_mode config field stays — operators who want the
richer behaviour (frontend hides the registration entry via
/auth/config in addition to the server-side 403) flip it in
config.yaml.

No behaviour change for deployments that did not set the env var.
Update docs/rbac.md to document the deliberate split.
This commit is contained in:
wizardchen
2026-05-18 21:07:44 +08:00
committed by lyingbug
parent 4344765cf9
commit 2ab54f1542
2 changed files with 14 additions and 5 deletions
+7 -1
View File
@@ -130,9 +130,15 @@ Environment overrides (always win over YAML):
| Env var | YAML key | Values |
|--------------------------------------|--------------------------------|------------------------------|
| `WEKNORA_TENANT_ENABLE_RBAC` | `tenant.enable_rbac` | `true` / `false` |
| `WEKNORA_AUTH_REGISTRATION_MODE` | `auth.registration_mode` | `self_serve` / `invite_only` |
| `WEKNORA_AUDIT_RETENTION_DAYS` | `audit.retention_days` | non-negative integer |
`auth.registration_mode` is intentionally not env-overridable to avoid
duplicating the long-standing `DISABLE_REGISTRATION` env knob. Set
`auth.registration_mode: invite_only` in `config.yaml` when you want the
frontend to hide the registration entry in addition to the server-side
block; use `DISABLE_REGISTRATION=true` for a quick env-level kill switch
that only enforces server-side.
The startup logger emits one line summarising both effective values
plus their override sources, so you can confirm at boot which mode
the deployment is in.