Skip to content

Fix WebUI stuck-connecting on token-only auth; ansible cleanup - #71

Merged
srhoods merged 3 commits into
masterfrom
fix/webui-token-only-auth-and-ansible-cleanup
Aug 12, 2026
Merged

Fix WebUI stuck-connecting on token-only auth; ansible cleanup#71
srhoods merged 3 commits into
masterfrom
fix/webui-token-only-auth-and-ansible-cleanup

Conversation

@srhoods

@srhoods srhoods commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Summary

Three independent small fixes:

  1. WebUI fix: when a coordinator has -api-token-file set (its own default path can be populated left over from an earlier deployment) but no auth.yaml, the WebUI got stuck permanently on "connecting..." - /api/v1/whoami's login_configured only checked auth.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 a token_required field to whoami and has the WebUI show a clear static explanation instead of looping.
  2. ansible.cfg: stdout_callback = yaml is deprecated in current Ansible; replaced with result_format = yaml.
  3. ansible drsync_agent role: removed the "Check the source/destination mount path exists" and "Assert both mount paths exist" pre-flight tasks, the drsync_agent_source_mount/drsync_agent_dest_mount variables, and the systemd unit's RequiresMountsFor= that depended on them - administrators configure agent-host volumes out of scope of drsync.

Test plan

  • go test -count=1 ./... - all green, including a new TestWhoAmIReportsTokenRequired (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)
  • gofmt / go vet / agent build clean
  • YAML syntax-checked on the touched Ansible files

Test plan for a human

  • Deploy a coordinator with -api-token-file pointing 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..."
  • Run ansible-playbook site.yml --syntax-check (needs the ansible.posix collection installed) against the updated role

🤖 Generated with Claude Code

https://claude.ai/code/session_01PsdNZLfmAFrMX2VUtkLtmm

srhoods and others added 3 commits August 12, 2026 22:24
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
@srhoods
srhoods merged commit 697f7c4 into master Aug 12, 2026
23 checks passed
@srhoods
srhoods deleted the fix/webui-token-only-auth-and-ansible-cleanup branch August 12, 2026 21:39
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