Repository navigation
v0.15.0: a web dashboard -- the live queue, and drag to reorder - #568
Merged
Merged
Conversation
Co-Authored-By: Claude & Lothrop (cycle.five@proton.me)
…lookups, one renderer Co-Authored-By: Claude & Lothrop (cycle.five@proton.me)
Co-Authored-By: Claude & Lothrop (cycle.five@proton.me)
…ext; move a track by id Co-Authored-By: Claude & Lothrop (cycle.five@proton.me)
…overflowing Co-Authored-By: Claude & Lothrop (cycle.five@proton.me)
Co-Authored-By: Claude & Lothrop (cycle.five@proton.me)
Co-Authored-By: Claude & Lothrop (cycle.five@proton.me)
Co-Authored-By: Claude & Lothrop (cycle.five@proton.me)
Each poll runs in its own task; a failed read keeps the last view and the poller keeps ticking, instead of dying and leaving the map a dead sender. Co-Authored-By: Claude & Lothrop (cycle.five@proton.me)
…rtableJS 1.15.7 (sha256 bf4241bc73fef7f11c59a283a69fe8051cdd31c6d8ff5a2b9ba219e7831fcf76) Adds the GET routes (picker, queue page with inlined JSON, static assets), the CSP and security headers, the Backend trait the routes are generic over, and a FakeBackend for tests. SortableJS is 1.15.7, the latest 1.15.x on jsdelivr (the plan named 1.15.6). Co-Authored-By: Claude & Lothrop (cycle.five@proton.me)
The timeout layer wrapped only the page routes, so /auth/callback and /auth/exchange -- which call Discord through a client with no timeout of its own -- could hold a request open indefinitely. Build the layer once and apply it to the nested auth router too. Tighten the security-header test to cover /auth and the fallback 404 with exact values, and assert the CSP has no 'unsafe-' source. Co-Authored-By: Claude & Lothrop (cycle.five@proton.me)
Co-Authored-By: Claude & Lothrop (cycle.five@proton.me)
Co-Authored-By: Claude & Lothrop (cycle.five@proton.me)
The event route moves inside the timed router (tower-http never times the body, so the stream stays open), the recheck's presence read gets PRESENCE_TIMEOUT, and the recheck interval delays missed ticks. New tests: live updates reach an open stream, a closed stream stops reading, a hung presence recheck does not stall it, unknown membership is 503. Co-Authored-By: Claude & Lothrop (cycle.five@proton.me)
Co-Authored-By: Claude & Lothrop (cycle.five@proton.me)
Co-Authored-By: Claude & Lothrop (cycle.five@proton.me)
…k links Replaces the app.js source scan with a CSP that makes a supporting browser throw on any string assigned to an HTML sink. track_view drops non-http(s) urls so an href can never carry a javascript: scheme. Co-Authored-By: Claude & Lothrop (cycle.five@proton.me)
… a read move_by_id awaited update_queue_messages, which edits every stored queue message one by one under Discord's per-channel rate limit. A busy guild or a few quick drags pushed the move's answer past the 15s request timeout, so the page reported a failure for a move that happened, and the dropped future stopped the refresh halfway. It now takes Arc<Http> and spawns the refresh after the locks are dropped. queue_state checked playback_owner once, before the call was read: a game that claimed and enqueued during the read could have its first title published. The owner is now checked again after the read. Co-Authored-By: Claude & Lothrop (cycle.five@proton.me)
…o-store Hub::publish sent the route's view from outside the poller, so a poll read that began before the move could land after it and put the old order back for a tick. Hub::refresh now wakes the guild's poller (a Notify per guild, whose stored permit makes a read in flight be followed by another), so every read and send happens in that task, in order. The move answers with its own fresh read. The fake backend's move now changes the view it serves, so a route that reads the view before the move fails its test; a refused move is shown to publish nothing and to answer with a fresh read. The picker, the queue page and move answers carry Cache-Control: no-store; assets keep no-cache. Co-Authored-By: Claude & Lothrop (cycle.five@proton.me)
onEnd cleared `pending` before the move's POST, so an answer without a view (game_in_progress, not_allowed, a network error, 401/503) redrew the pre-drag state, and the hub, which sends only on change, never sent the discarded view again: /gp starting mid-drag left the old queue on screen, with handles, for the whole game. The answer now prefers its own view, then the pending one, then the one on screen, taking can_control from the pending state; an answer that lands during a new drag is stored, not drawn. A failed logout shows a note instead of an unhandled rejection. Co-Authored-By: Claude & Lothrop (cycle.five@proton.me)
catacombs' MemoryStorage keeps each signed-in user's profile and Discord refresh token in process memory, in plaintext, until restart. Co-Authored-By: Claude & Lothrop (cycle.five@proton.me)
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.
What
This is the web dashboard's first arc. Guild members sign in with Discord and watch their server's queue update live. Members in the bot's voice channel can drag to reorder the upcoming tracks. Reordering is the only control in this arc.
docs/superpowers/specs/2026-09-30-web-dashboard-queue-design.mddocs/superpowers/plans/2026-09-30-web-dashboard-queue.mdanddocs/superpowers/plans/2026-09-30-catacombs-website-flow.mddocs/web-dashboard.mdIt is dormant until configured. The
webfeature is on by default, but with noWEB_*env the bot logsweb dashboard off; missing or unusable: …and runs as before. Production can take this image with no visible change.Design
crack-webcrate (axum 0.8) runs inside the bot process. It sharesData, the serenity cache andHttp. Dashboard startup failures are logged and never propagated.music::remote:queue_state,bot_channel,active_guilds,move_by_id, plusmove_track_by_idinmusic::queue;clippy.tomlbans (Songbird::get,TrackHandle::data) keep holding;/gpgame refuses them;statecheck and a cookie session, and is pinned as a git tag like crack-osint and crack-bf.Http::get_member, memoised for 5 minutes (a 404 is remembered, other errors are not). The HTTP fallback exists because the bot never requests member chunks, so a large guild's cached member list is partial.watchhub reads the queue once a second, only while someone is watching, and publishes only on change. A move wakes the poller at once. Instrumenting every mutation site instead is the "remember to notify" bug class Playback ownership: a per-guild lease for queue mutation #434 removed. Each poll runs in its own task, so a panicking read can't freeze a guild. Views are always sent whole, so a missed event is corrected by the next one.SameSite=Lax, JSON, and an exactOriginmatch.default-src 'none'plus Trusted Types. This replaces the plan's source-scan test, which the owner's standing rule against source scans rules out.<escaped and drawn withtextContentonly.no-store./authand the event stream, sits inside a 15 s request timeout. tower-http 0.6'sTimeoutLayerbounds only the time to the first response, so the stream is not cut; a test shows it outliving the timeout. The stream's 5 s presence rechecks have their own timeout.Testing
cargo test --workspace: 625 passed, 0 failed.remoteandmusic::queue: 25.update_queue_messagesafter a move, and thePlayingarm ofstate_of_call/bot_channel: both need a live voice connection. Exercised on TuneTitan;app.jsbehaviour: no browser in CI. It was exercised on TuneTitan, and a throwaway Node harness was run during the fix wave;/authtimeout wiring, which needs a stalled Discord;MissedTickBehavior::Delay, and the under-lockreceiver_countrecheck in the hub./queueembed could briefly show an older order.On TuneTitan (2026-09-30, branch image at
ab4741e4)homelab verifypasses: 23/23 migrations applied, and the dashboard is on (a signed-out/redirects to login).A walk through an SSH tunnel, with the owner in voice:
dashboard move), and a second tab followed live./skips reached both tabs./queueplus a drag, and leaving and rejoining voice, behaved correctly./gphidden view. It is covered by unit tests.Rollout after merge
v0.15.0. cargo-dist owns the release.dash.cracktun.esCaddy block, a tunnel ingress rule and CNAME, the production app's redirecthttps://dash.cracktun.es/auth/callback, and its client secret in Vaultwarden.docs/web-dashboard.md"What it holds".Follow-ups, deliberately not in this arc
prompt=none, to skip Discord's consent screen on every login;Originchecks on its own POSTs.🤖 Generated with Claude Code
https://claude.ai/code/session_019Qh7eJv3Ct5Uispr77BF5J