Skip to content

Commit 5c0cbbf

Browse files
committed
docs(settings,auth): a clear goes through an env pin; the lockout recovery is four steps
- service-settings README, Env override: every write but a clear (null) fails with HTTP 409; a clear removes the value stored beneath the override and changes nothing in force. - authentication.mdx, "If you are already locked out": PR #30382 merged first, so this PR rewrites the bullet (seat ruling: the later lander rewrites it) to the four steps that work: start with OS_AUTH_ALLOWED_IP_RANGES empty, sign in, PUT /api/settings/auth with allowed_ip_ranges null, remove the variable. The forward reference above it now says "steps". Claude-Session: https://claude.ai/code/session_01Utp6CZjAtpVuoYZBzB9n5i Co-authored-by: Claude <noreply@anthropic.com>
1 parent 173cc44 commit 5c0cbbf

2 files changed

Lines changed: 24 additions & 12 deletions

File tree

‎content/docs/permissions/authentication.mdx‎

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ These rules apply to `allowed_ip_ranges`.
662662
API save, `PUT /api/settings/auth`, which **Setup → Authentication** calls, so any
663663
HTTP client gets the same answer. The message names your address, says the list
664664
would refuse your own next sign-in, and asks you to add your address or its range,
665-
or to save from an address the list matches. It ends with the recovery step below.
665+
or to save from an address the list matches. It ends with the recovery steps below.
666666
It is written in your language (English, Chinese, Japanese or Spanish). The field
667667
error in `details.fields` also carries your address as `constraint.clientAddress`.
668668
If the server cannot establish your address at all, any non-empty list is refused,
@@ -673,15 +673,24 @@ These rules apply to `allowed_ip_ranges`.
673673
the gate goes back to the list the deployment itself declares (`allowedIpRanges` in
674674
its auth configuration, for example set by an `auth:configure` handler), or to no
675675
restriction when it declares none. A clear is never refused.
676-
- **If you are already locked out**, start the server with
677-
`OS_AUTH_ALLOWED_IP_RANGES` set to an empty value (`OS_AUTH_ALLOWED_IP_RANGES=`).
678-
Environment variables are read at startup, so a restart is needed. An empty value
679-
is not the same as an unset variable: any value that is set, the empty string
680-
included, is an env override in force. It wins over the stored list, and an empty
681-
list means no restriction. While the variable is set, the stored list is kept but
682-
not used, and the field is locked: a save to it is refused with
683-
`409 SETTINGS_LOCKED`. Remove the variable, and the stored list applies again at
684-
the next restart.
676+
- **If you are already locked out**, recover in four steps:
677+
1. Start the server with `OS_AUTH_ALLOWED_IP_RANGES` set to an empty value
678+
(`OS_AUTH_ALLOWED_IP_RANGES=`). Environment variables are read at startup, so a
679+
restart is needed. An empty value is not the same as an unset variable: any
680+
value that is set, the empty string included, is an env override in force. It
681+
wins over the stored list, and an empty list means no restriction.
682+
2. Sign in.
683+
3. Clear the stored list: send `PUT /api/settings/auth` with
684+
`{ "allowed_ip_ranges": null }`. While the variable is set the field is locked,
685+
so **Setup → Authentication** shows it read-only and any other save to it is
686+
refused with `409 SETTINGS_LOCKED`; a clear (`null`) is the one write the lock
687+
lets through. It clears the stored value and changes nothing in force: the
688+
answer still reads the empty value from the environment.
689+
4. Remove the variable and restart. With the stored list cleared, nothing brings
690+
it back: the gate applies the list the deployment declares, or no restriction.
691+
692+
Removing the variable without step 3 brings the stored list back at the next
693+
restart, and locks you out again.
685694

686695
---
687696

‎packages/services/service-settings/README.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@ a resolver that layers `OS_* env > Tenant > User > Default`.
3030
to underscores) takes precedence over any stored value. For example,
3131
`mail.smtp_host` resolves from `OS_MAIL_SMTP_HOST`, and
3232
`ai.log_prompts` resolves from `OS_AI_LOG_PROMPTS`.
33-
Such fields are returned with `source: 'env', locked: true` and writes
34-
(service or REST) fail with HTTP 409.
33+
Such fields are returned with `source: 'env', locked: true`. Every write
34+
(service or REST) but a clear (`null`) fails with HTTP 409. A clear removes
35+
the value stored beneath the override and changes nothing in force: the key
36+
still answers the env value, and falls back to its default once the variable
37+
is removed.
3538

3639
## Encryption
3740

0 commit comments

Comments
 (0)