Fix WebUI stuck-connecting on token-only auth; ansible cleanup - #71
Merged
Conversation
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PsdNZLfmAFrMX2VUtkLtmm
Administrators configure source/destination volumes on agent hosts out of scope of drsync - the role has no business asserting anything about paths it doesn't own. Removes the three "Check the source/destination mount path exists" / "Assert both mount paths exist" tasks, the drsync_agent_source_mount/drsync_agent_dest_mount variables (defaults and group_vars), and the systemd unit's RequiresMountsFor= that depended on them. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PsdNZLfmAFrMX2VUtkLtmm
…o login is configured /api/v1/whoami's login_configured only reflected whether auth.yaml was present, saying nothing about a bearer token still being required. A coordinator with -api-token-file set (its own default path can be populated left over from an earlier deployment even when nobody intended token auth) but no auth.yaml reported login_configured=false - correct in isolation, but the WebUI (session-cookie login only, no bearer-token entry) read that as "nothing to authenticate," started polling, got 401'd on every request, and reloaded on each 401 - looping the console on "connecting..." forever with no explanation. Adds a token_required field to the whoami response (token set, no authenticator) and has the WebUI check it before ever starting the poll loop, showing a static explanation screen instead (there being no bearer-token UI to fall back to - it points at the CLI/DRSYNC_TOKEN instead). The same check also short-circuits onUnauthorized so a stray 401 later doesn't fall into the reload path. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PsdNZLfmAFrMX2VUtkLtmm
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.
Summary
Three independent small fixes:
-api-token-fileset (its own default path can be populated left over from an earlier deployment) but noauth.yaml, the WebUI got stuck permanently on "connecting..." -/api/v1/whoami'slogin_configuredonly checkedauth.yaml, so the console treated "token required, no login UI" the same as "no auth at all," started polling, got 401'd on every request, and reload-looped forever. Adds atoken_requiredfield towhoamiand has the WebUI show a clear static explanation instead of looping.stdout_callback = yamlis deprecated in current Ansible; replaced withresult_format = yaml.drsync_agent_source_mount/drsync_agent_dest_mountvariables, and the systemd unit'sRequiresMountsFor=that depended on them - administrators configure agent-host volumes out of scope of drsync.Test plan
go test -count=1 ./...- all green, including a newTestWhoAmIReportsTokenRequired(verified it fails against the pre-fix handler)make webui-test- all 62 tests green, including a new regression test for the stuck-connecting scenario (verified: without the fix, the same scenario hangs the test runner via an unbounded reload loop in jsdom - confirms the bug is a genuine infinite loop, not just a cosmetic stall)Test plan for a human
-api-token-filepointing at a populated token file and no/etc/drsync/auth.yaml; open the WebUI - should show a clear "token required, use the CLI" message instead of hanging on "connecting..."ansible-playbook site.yml --syntax-check(needs theansible.posixcollection installed) against the updated role🤖 Generated with Claude Code
https://claude.ai/code/session_01PsdNZLfmAFrMX2VUtkLtmm