Dezio/docs/PROGRESS.md
astar76 32cab8b397 S006a: keep /dezio prefix in the Tailscale mapping
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 23:09:41 -06:00

9.7 KiB

Progress

One entry per session, newest last, ≤ 15 lines: done, verified how, not done, later.

2026-12-01 — fm commands moved from Last.fm to ListenBrainz (no plan, owner request)

  • Done: backup tag lastfm-api-backup (pushed). src/commands/lastfm/api.rs now reads ListenBrainz and turns results into the old Last.fm shape, so views/extras barely changed. Top lists, recent, profile, now playing, Who Knows, chart, Pixel Jumble, lyrics all on ListenBrainz + Cover Art Archive; lyrics title search on Deezer. Help, dashboard, website and privacy text updated.
  • Fixed on the way: MusicBrainz/Wikimedia refused the bare Dezio user agent (403/503), so artist photos never loaded; they now get Dezio/<version> (Discord bot).
  • Verified: cargo build; cargo test (only failures are worktree-only missing assets/data and ROMs); cargo test listenbrainz_live -- --ignored against the public user rob.
  • Not done: not tested in Discord 🧑; not deployed. Everyone must link again (/fm mode:link), ListenBrainz names can differ from Last.fm ones.
  • Differences: periods are ListenBrainz's (last week/month/quarter/half-year, this year), not rolling; stats update about once a day; Who Knows and "plays of this track" only see each person's all-time top 1000.

2026-12-01 — covers and artist photos with fallbacks (owner request)

  • Done: covers.rs (cover chain, artist photos, missing album names via Deezer); listens keep the player's tag IDs (mbids), tags win over ListenBrainz's guess; play counts and Who Knows match by ID first. Every card, chart and Pixel Jumble uses it.
  • Verified: cargo test (same 8 worktree-only asset failures); cargo test covers_live -- --ignored and listenbrainz_live pass.
  • Not done: not deployed at commit time; not checked in Discord 🧑.

2026-12-01 — S001 uploads by speed

  • Done: media::budget_for / upload_budget(ctx) with UPLOAD_SECONDS=75 and UPLOAD_BYTES_PER_SEC=114_000 (reuse in S002, S008). Real limit 10 MiB. /download plans by budget, retries only reset/429/5xx, timeout becomes a website link. Convert and /media use the budget.
  • Verified: cargo check only. /download video still over budget after compress goes out as a link. Music card already drops to a still on a slow line; quote/games send small images, left as is. Not done: link for audio/gallery over budget; per-call HTTP timeout (twilight sets one timeout per client).

Later

  • Per-request shorter timeout for plain Discord API calls: not done in S001.

2026-12-01 — S002 outbound timeouts

  • Done: audit found most spawns and HTTP calls already limited. Fixed: ffmpeg::probe (no limit), ffmpeg::inspect (no kill), music stream and peaks (ffmpeg -rw_timeout 20 s idle, peaks read idle 30 s). Helper stays download::tools::run_lines.
  • Verified: cargo check only. Not done: bail_user! rewrite of the plain timeout strings; not tested.
  • S002 follow-up: timeout texts reworded in plain words (ffmpeg::run, ytdl::extract, VirusTotal wait). They are NOT bail_user!: those helpers return Result<_, String> (bail_user needs the command error type), and every caller already shows the string as a "❌ ..." reply. download/tools.rs already uses DlError::user cards. Turning the helpers into UserError would touch many callers; left for later.

2026-12-01 — S003 recovery and shaping

  • Done: gateway exits (systemd restarts) after 10 min of failed reconnects or when all shards stop; voice driver retries 8, watcher rejoins 3 times then leaves with a notice and clears the player. Shaping cap kept at 800 kbit (comment with numbers).
  • Verified: cargo check only. Not tested, not deployed, dezio-shape not reinstalled, no upload measured.

2026-12-01 — S004 /image removed, /caption added

  • Done: /image + D!fx and all effects/filters gone. /caption + D!caption (options source-attachment, source-link, text; no source = latest media in channel via convert::last_chat_media). Still → PNG (JPEG if too big); GIF/animated WebP → GIF; video → MP4 (no sound, 10 s, 12 fps, 480 px max). Help and website text updated.
  • Shared helpers for S005: images::pick_opt, convert::last_chat_media, images::frames_of, encode_gif, caption_image / caption_video pattern (band + stack), ffmpeg::Scratch + ffmpeg::run. /speechbubble is not added yet (S005).
  • Verified: cargo check only. Not tested, not checked in Discord 🧑.

2026-12-01 — S005 /speechbubble

  • Done: /speechbubble + D!speechbubble (alias bubble; options source-attachment, source-link, position, flip, solid; prefix words bottom flip solid). Pure bubble_mask + draw_bubble in images.rs. Still → PNG, GIF/WebP → GIF (transparent), video → transparent GIF, or MP4 with solid. Video frame loop shared as map_frames (caption uses it too).
  • Verified: cargo check only. Not tested, shape not compared with the reference GIFs, not checked in Discord 🧑 (S011). See docs/tests/S005-speechbubble.md doubts (GIF transparency, no anti-aliasing).

2026-12-01 — S006 fm on ListenBrainz

  • Done: audit of every fm feature; code was already fully on ListenBrainz/MusicBrainz, no Last.fm API leftovers in src. Only fix: docs/topgg.md wording. Test list in docs/tests/S006-fm.md.
  • Dropped from cards: listeners, global plays, bio, tags (none were shown). Profile realname/country are skipped when empty.
  • Verified: grep and cargo check only. Not tested in Discord 🧑. No new unit test (no new logic; api.rs already has sample-JSON tests).

2026-12-01 — S006a website under /dezio/

  • Done: Cfg.base from DASHBOARD_URL path (base_path, unit test); routes nested under base and also un-prefixed; cookie Path, redirects, login link carry base; pages use __BASE__/relative paths; deploy/landing/index.html (minimal). topgg + module comments updated.
  • Not done: nothing deployed. Static copy of web/dashboard/index.html now has __BASE__ placeholders (only the bot serves it).
  • Verified: cargo check, cargo test base_path. No browser check. Server commands + 🧑 portal list in docs/tests/S006a-dezio-path.md.

2026-12-01 — S007 website security

  • Done: review + local curl probes (findings table in docs/tests/S007-website-security.md). Fixed: sign-in rate limit (20/min) on /callback and Activity token; /f/ files sandboxed by CSP; /dezio → /dezio/ and /dezio/ serves the site; ServeDir folder redirects off; Activity dev sessions refuse forwarded or non-local requests; --web-dev honours DASHBOARD_URL's path.
  • Verified: cargo test web:: (10/11; ROM test needs assets/roms), curl probes. Not checked in a browser (sandboxed video), not deployed.
  • Later (LOW): role menus can offer a cosmetic role above the editor's own rank; /api/places and web-session have no rate limit.

2026-12-01 — S008 media inputs and dependencies

  • Done: one public-address check (media::is_public_ip, adds Tailscale 100.64/10, IPv4-in-IPv6, NAT64); PublicDns resolver on state.web (private DNS answers dropped, covers redirects/rebinding); ffmpeg/ffprobe protocol whitelists on local and stream inputs; playlists refused in /convert and video caption; gallery-dl --; decode limits (pix::limits, GIF/WebP frame memory cap); one convert/caption/speechbubble job per user; url 2.5.9.
  • Verified: cargo check only. Not tested. Audit summary and test list in docs/tests/S008-media-commands-deps.md.
  • Advisories left open: libcrux-* (davey, DAVE voice; 4 high), crypto-bigint, curve25519-dalek, ringbuf (songbird): need upstream major bumps. rustls 0.22/webpki 0.102 only in Cargo.lock, not built.
  • Later: ffmpeg/yt-dlp/gallery-dl redirects and rebinding can't be checked from inside; an egress firewall for the bot's user on the server would close it.

2026-12-01 — S009 test: it runs, network

  • Done: release build ok; cargo test 249 pass, 8 worktree-only asset failures; binary lists commands. Added 2 child-process tests (timeout kill, cancel). Results filled in S001-S003 test files; docs/TEST-REPORT.md started.
  • Not done: Discord, voice, network-cut and timed-upload checks (not run, need live bot/server). Nothing deployed.

2026-12-01 — S010 test: images, fm, security, app

  • Done: 6 new tests (S008 checks 2-8) pass; web-dev probes pass offline (S007 7 incl.); contact sheet of caption/speechbubble ok; Results filled in S004-S008 test files.
  • Not done: Discord checks, video path via bot, browser check of /f/ sandbox, one_job unit test, old-data restart.
  • No bug found, no source fix. Nothing deployed.

2026-12-01 — S011 deploy

  • Done: gate ok (owner: "Yes, deploy"); release build; binary + web/ on the Chromebook (backups dezio.bak-2026-12-01, web.bak-2026-12-01; no rsync there, used tar). Service active, 208 commands, 71 slash synced, 9 guilds; site / and /dezio/ 200.
  • Not done: step 4 (owner list in the S011 plan), INDEX tick, S006a tailscale/.env DASHBOARD_URL change, TEST-REPORT answers.

S006a server path change applied (2026-12-01)

  • Backups on server: /root/tailscale-serve.bak-2026-12-01.json, /root/Dezio/.env.bak-2026-12-01.
  • Landing page in /srv/landing; / serves it, /dezio proxies 127.0.0.1:8080, /git kept, Funnel on (use tailscale funnel --bg --set-path, plain serve turns Funnel off).
  • .env DASHBOARD_URL now ends in /dezio; dezio-bot restarted, active, no errors. GET /, /dezio/, /dezio/dashboard, /dezio/terms, /git/ all 200.
  • Owner still must do the Developer Portal steps (redirect URL, activity mapping, top.gg field).
  • Fix (2026-12-01): Tailscale strips the /dezio prefix, so /dezio (no slash) served the page and relative CSS/images broke. Mapping is now tailscale funnel --bg --set-path /dezio http://127.0.0.1:8080/dezio; /dezio gives 308 to /dezio/. Backup: /root/tailscale-serve.bak-2026-12-01b.json. Use funnel, not serve (serve turns Funnel off).