Skip to content

Rename GRYT_AUTH_MODE to what it actually does (GRYT-281) - #49

Merged
sivert-io merged 1 commit into
mainfrom
claude/GRYT-281-rename-auth-mode
Aug 14, 2026
Merged

Rename GRYT_AUTH_MODE to what it actually does (GRYT-281)#49
sivert-io merged 1 commit into
mainfrom
claude/GRYT-281-rename-auth-mode

Conversation

@sivert-io

Copy link
Copy Markdown
Member

GRYT_AUTH_MODE read like it controlled whether members need an account. It never did. The entire implementation was:

if (authMode === "disabled")   reject every join
if (authMode !== "required")   reject, misconfigured
// otherwise carry on

Joining without an account is decided by GRYT_IDENTITY_TIERS alone, and the two never interacted. A server with GRYT_IDENTITY_TIERS=account,local and GRYT_AUTH_MODE=required admits guests exactly as intended, while the config file next to it claimed the opposite.

It's a maintenance switch wearing a security name. Now it's GRYT_SERVER_ENABLED, taking true/on/yes/1 and false/off/no/0.

The old name still works, silently

A rename that took somebody's server offline on upgrade — or quietly reopened one they'd deliberately closed — would be worse than the bug being fixed. So GRYT_AUTH_MODE and its required/disabled values are still read.

The new variable wins when both are set. That way they can be added and removed in either order without a window where the two disagree and the answer depends on which the code happened to read first.

Two decisions worth checking

An unrecognised value still refuses joins, as the old code did. Neither default is safe: reading requried as on ignores somebody who meant to close their server; reading it as off takes a server down over a typo. The error names whichever variable the operator actually set, so it points at the line they wrote rather than the one we prefer.

An empty value is treated as unset, not as a refusal. A commented-out line leaving GRYT_SERVER_ENABLED= behind shouldn't take a server down. Tested.

Kept the auth_disabled error code and its wording, even though "disabled authentication" is now doubly wrong. The client matches on the code, and changing the code and the copy in the same release would leave nothing recognisable in a bug report. Worth doing later, separately.

Verified

yarn test82 pass, 0 fail. 19 new, covering both variables, all accepted spellings, precedence when both are set, the empty-value case, and that a typo refuses rather than guessing.

Not in this PR

The docs still describe the old behaviour, and in one place give actively wrong advice — configuration.mdx:389 says "Use GRYT_AUTH_MODE=required if you need account-based access control", which does nothing of the sort. Four docs pages plus two .env.example files need updating; those are separate repos and separate PRs. The .env.example under ops/deploy/compose is already being fixed in gryt#80.

🤖 Generated with Claude Code

The setting read like it controlled whether members need an account, and
every comment and doc page said so. It never did. Joining without an
account is decided by GRYT_IDENTITY_TIERS alone, and the two do not
interact at all — a server with GRYT_IDENTITY_TIERS=account,local and
GRYT_AUTH_MODE=required admits guests exactly as intended, while the
config file sitting next to it claimed the opposite.

All it ever did was reject every join. That is a maintenance switch
wearing a security name.

It is GRYT_SERVER_ENABLED now, and it takes the words somebody would
guess: true/on/yes/1 and false/off/no/0.

The old name and the old values are still read, silently. A rename that
took somebody's server offline on upgrade, or quietly reopened one they
had closed, would be a worse bug than the one being fixed. Where both are
set the new one wins, so the two can be added and removed in either order
without a window where the answer depends on which is read first.

An unrecognised value still refuses joins rather than guessing, which is
what the old code did. Neither default is safe: reading a typo as on
ignores somebody who meant to close their server, and reading it as off
takes a server down over a spelling mistake. The error names whichever
variable the operator actually set.

Kept the `auth_disabled` error code and its wording. The client matches on
the code, and changing the code and the message in the same release would
leave nothing recognisable in a bug report.

19 tests, including that the old variable still works and that an empty
value is treated as unset rather than as a refusal — a commented-out line
leaving GRYT_SERVER_ENABLED= behind should not take a server down.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@sivert-io
sivert-io merged commit 725ecb3 into main Aug 14, 2026
1 check passed
@sivert-io
sivert-io deleted the claude/GRYT-281-rename-auth-mode branch August 14, 2026 16:13
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.

1 participant