Rename GRYT_AUTH_MODE to what it actually does (GRYT-281) - #49
Merged
Conversation
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>
This was referenced Aug 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GRYT_AUTH_MODEread like it controlled whether members need an account. It never did. The entire implementation was:Joining without an account is decided by
GRYT_IDENTITY_TIERSalone, and the two never interacted. A server withGRYT_IDENTITY_TIERS=account,localandGRYT_AUTH_MODE=requiredadmits 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, takingtrue/on/yes/1andfalse/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_MODEand itsrequired/disabledvalues 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
requriedas 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_disablederror 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 test— 82 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:389says "UseGRYT_AUTH_MODE=requiredif you need account-based access control", which does nothing of the sort. Four docs pages plus two.env.examplefiles need updating; those are separate repos and separate PRs. The.env.exampleunderops/deploy/composeis already being fixed in gryt#80.🤖 Generated with Claude Code