Move Astar Hub links to astar76.com
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
parent
97124682e1
commit
62e8190d8f
11 changed files with 24 additions and 24 deletions
|
|
@ -45,7 +45,7 @@ Never modify: `data/` contents on the server (`/root/Dezio/data`, live user data
|
|||
- Build and test on this PC: `source ~/.cargo/env; cargo build --release` and `cargo test` (about 227 unit tests). Tests that need the internet are `#[ignore]`d (`cargo test live_ -- --ignored`).
|
||||
- Without `DEZIO_LIVE=1` the binary only lists its commands and exits. **Never run it with the real token on this PC**: the live bot would answer twice.
|
||||
- Local website for testing: `cargo build && DISCORD_BOT_TOKEN=dev-placeholder target/debug/dezio --web-dev` → http://127.0.0.1:8099 (also the `dezio-web-dev` entry in `.claude/launch.json`).
|
||||
- Server: the Chromebook, `ssh [email protected]` (Arch Linux, x86_64). Bot in `/root/Dezio` (binary `dezio`, `assets/`, `web/`, `data/`, `.env`). `dezio-bot.service` runs `/root/Dezio/dezio --headless`, Restart=always; website on 127.0.0.1:8080, public at https://astar76sites.parore-gila.ts.net. Logs: `journalctl -u dezio-bot`.
|
||||
- Server: the Chromebook, `ssh [email protected]` (Arch Linux, x86_64). Bot in `/root/Dezio` (binary `dezio`, `assets/`, `web/`, `data/`, `.env`). `dezio-bot.service` runs `/root/Dezio/dezio --headless`, Restart=always; website on 127.0.0.1:8080, public at https://astar76.com. Logs: `journalctl -u dezio-bot`.
|
||||
- The server's line is slow: measured about 425 KB/s down and **114 KB/s (≈ 0.9 Mbit/s) up**, on `wlan0`. `dezio-shape.service` (deploy/shape-upload.sh, installed as `/usr/local/bin/dezio-shape`) caps internet-bound upload at 800 kbit with fq_codel so voice packets go first. Voice and every upload share that.
|
||||
- Discord HTTP client: one twilight `Client` with a 180 s timeout for every call (`src/main.rs`). `/download` retries uploads 3 times (`UPLOAD_RETRIES`), so a file that can't finish in 180 s costs 9+ minutes (seen 2026-11-12: a 9.2 MB video, 3 timeouts, handler took 792 s).
|
||||
- Discord's attachment limit for bots is 10 MiB unless the server is boosted (tier 2: 50 MiB, tier 3: 100 MiB). `media::upload_limit` reads the server's tier; `FALLBACK_UPLOAD_LIMIT` lives in `download/plan.rs`.
|
||||
|
|
@ -64,7 +64,7 @@ Never modify: `data/` contents on the server (`/root/Dezio/data`, live user data
|
|||
- Upload time, not file size, is what breaks: at ~100 KB/s a 10 MiB file needs ~105 s on an idle line and much longer with voice. Any upload path must think in seconds.
|
||||
- Retrying a whole upload that timed out just repeats the timeout. Retry only on errors that can succeed the second time.
|
||||
- yt-dlp, ffmpeg, gallery-dl and curl are child processes fed user links: never pass user text where it can become an option (`--`), keep the private-network check (`safe_redirects`, music's check) on every fetch.
|
||||
- Security testing runs against a **local copy only** (`--web-dev` on 127.0.0.1). Never send attack traffic to https://astar76sites.parore-gila.ts.net or Discord. Never connect to Tor or proxies.
|
||||
- Security testing runs against a **local copy only** (`--web-dev` on 127.0.0.1). Never send attack traffic to https://astar76.com or Discord. Never connect to Tor or proxies.
|
||||
- Discord changes can't be tested on this PC; things only the owner checks in Discord are marked 🧑.
|
||||
- `/help` pages and slash registration change when commands are added or removed: run the help-limits test.
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
> Files touched: src/web/{mod,activity}.rs, src/hosted.rs, src/commands/gameboy.rs, web/**/*.{html,js,css}, docs/topgg.md, deploy/landing/index.html (new)
|
||||
|
||||
## Goal
|
||||
Move all of Dezio's website (site, dashboard, API, OAuth, Game Boy Activity, hosted `/f/` files) from the root of https://archlinux.tail7c4f5e.ts.net to https://archlinux.tail7c4f5e.ts.net/dezio/ (D-013). The root `/` becomes a very simple static landing page with links to `/dezio/` and `/git/`; the owner will improve it later, so keep it minimal. `/git` (Forgejo) stays as is.
|
||||
Move all of Dezio's website (site, dashboard, API, OAuth, Game Boy Activity, hosted `/f/` files) from the root of https://astar76.com to https://astar76.com/dezio/ (D-013). The root `/` becomes a very simple static landing page with links to `/dezio/` and `/git/`; the owner will improve it later, so keep it minimal. `/git` (Forgejo) stays as is.
|
||||
|
||||
## Read
|
||||
- `src/web/mod.rs` lines 1–70 (config, `DASHBOARD_URL`) and 280–320 (router)
|
||||
|
|
@ -17,8 +17,8 @@ Move all of Dezio's website (site, dashboard, API, OAuth, Game Boy Activity, hos
|
|||
- [x] Base path: derive it from the path part of `DASHBOARD_URL` (e.g. `https://…ts.net/dezio` → `/dezio`; none → `/`). Check with `tailscale serve --help` / docs whether `--set-path /dezio` strips the prefix before proxying (it is believed to strip it). Make the router work both ways: nest all routes under the base path and also accept un-prefixed paths, OR rely on stripping — pick one, say which in DECISIONS (D-013 addition). Cookie `Path` must match the base path.
|
||||
- [x] Pages: every absolute link in `web/site`, `web/dashboard`, `web/activity` (`href="/…"`, `src="/…"`, `fetch("/api…")`, `/login`, `/assets`, `/images`, `/dashboard`, `/activity/api/…`) works under `/dezio/`. Prefer relative paths; where a page needs the base, inject it from the server once (no per-page copy-paste). OAuth `redirect_uri` stays `DASHBOARD_URL + "/callback"`. Redirects the server sends (login, logout, `slash_redirect`) carry the base path.
|
||||
- [x] Hosted links (`hosted::store`) and `/gameboy` links come from `DASHBOARD_URL`, so they follow; check nothing else hard-codes `/f/` or `/activity` at the root.
|
||||
- [x] Landing page: `deploy/landing/index.html`, one small static page (title, two links: Dezio → `/dezio/`, Source → `/git/`), plain inline CSS, no JS. Write the deploy commands into the plan's test file for S011, do not run them: copy to `/srv/landing/` on the server, `tailscale serve --bg --set-path / /srv/landing` (static files), `tailscale serve --bg --set-path /dezio http://127.0.0.1:8080`, set `DASHBOARD_URL=https://archlinux.tail7c4f5e.ts.net/dezio` in `/root/Dezio/.env` (back it up first). Keep Funnel on.
|
||||
- [x] Docs: `docs/topgg.md` website URL → `/dezio/`; the module comments in `src/web/mod.rs`, `src/web/activity.rs`, `src/commands/gameboy.rs` that name the portal setup. 🧑 list for the owner in the test file: Discord Developer Portal → OAuth2 Redirects add `https://archlinux.tail7c4f5e.ts.net/dezio/callback`; Activities → URL Mappings `/` → `archlinux.tail7c4f5e.ts.net/dezio/activity`; top.gg website field.
|
||||
- [x] Landing page: `deploy/landing/index.html`, one small static page (title, two links: Dezio → `/dezio/`, Source → `/git/`), plain inline CSS, no JS. Write the deploy commands into the plan's test file for S011, do not run them: copy to `/srv/landing/` on the server, `tailscale serve --bg --set-path / /srv/landing` (static files), `tailscale serve --bg --set-path /dezio http://127.0.0.1:8080`, set `DASHBOARD_URL=https://astar76.com/dezio` in `/root/Dezio/.env` (back it up first). Keep Funnel on.
|
||||
- [x] Docs: `docs/topgg.md` website URL → `/dezio/`; the module comments in `src/web/mod.rs`, `src/web/activity.rs`, `src/commands/gameboy.rs` that name the portal setup. 🧑 list for the owner in the test file: Discord Developer Portal → OAuth2 Redirects add `https://astar76.com/dezio/callback`; Activities → URL Mappings `/` → `astar76.com/dezio/activity`; top.gg website field.
|
||||
- [x] Unit test for the base-path parsing (pure function).
|
||||
- [x] Test file `docs/tests/S006a-dezio-path.md`: local checks with `DASHBOARD_URL=http://127.0.0.1:8099/dezio --web-dev` (every page, asset, API call, login redirect, `/f/` link, activity page under the prefix; root of the local server does not serve Dezio pages), the deploy commands above, and the 🧑 portal list.
|
||||
- [x] PROGRESS entry, INDEX line, commit `S006a: …`
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ Find and fix security faults in the website, dashboard API, OAuth sign-in and Ga
|
|||
- The test file lists every checklist item with a finding or "fine because …".
|
||||
|
||||
## Pitfalls
|
||||
- Never send traffic to https://archlinux.tail7c4f5e.ts.net or Discord. No Tor or proxies.
|
||||
- Never send traffic to https://astar76.com or Discord. No Tor or proxies.
|
||||
- Never run the bot with the real token; `--web-dev` uses `DISCORD_BOT_TOKEN=dev-placeholder`.
|
||||
- Don't break the existing web tests in `src/web/mod.rs`.
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ Deploy the finished bot to the Chromebook, check it starts cleanly, and have the
|
|||
## Steps
|
||||
- [x] Gate: no open HIGH check or HIGH known bug; otherwise stop and report to the orchestrator (open HIGH are only "not run" Discord/voice/browser checks; owner accepted: "Yes, deploy")
|
||||
- [x] Tell the orchestrator before deploying; `cargo build --release`; scp to `dezio.new`; on the server back up `dezio` as `dezio.bak-<date>`, move in, `rsync -a` changed `assets/` and `web/`, `systemctl restart dezio-bot`
|
||||
- [x] Check `systemctl status dezio-bot` and `journalctl -u dezio-bot -n 50`: logged in, commands registered, no errors; `curl -sI https://archlinux.tail7c4f5e.ts.net` (plain GET, not attack traffic) returns 200
|
||||
- [x] Check `systemctl status dezio-bot` and `journalctl -u dezio-bot -n 50`: logged in, commands registered, no errors; `curl -sI https://astar76.com` (plain GET, not attack traffic) returns 200
|
||||
- [ ] 🧑 Owner tries `/caption` and `/speechbubble` (every option, a GIF and a video) and `/download` of a ~9 MB video; record the answers in the test report
|
||||
- [ ] PROGRESS entry, INDEX line, commit `S011: …` and push to `origin`
|
||||
|
||||
|
|
@ -45,4 +45,4 @@ MED
|
|||
10. `/convert` result over 8.5 MB gives a link (S001-8); `/convert` and caption on a normal mp4 work (S008-13).
|
||||
11. Start `/caption` on a long video, then another at once: "You already have a media job running" (S008-14).
|
||||
12. fm commands with a linked account (S006); `/convert` timeout and `/play` lookup timeout messages (S002-10,11).
|
||||
13. Open `https://archlinux.tail7c4f5e.ts.net/dezio/` (S007-10; works only after the S006a tailscale/.env change, still pending).
|
||||
13. Open `https://astar76.com/dezio/` (S007-10; works only after the S006a tailscale/.env change, still pending).
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
<p align="center">
|
||||
<a href="https://discord.com/oauth2/authorize?client_id=1387839600017412106&scope=bot%20applications.commands&permissions=8"><b>➕ Add to your server</b></a> ·
|
||||
<a href="https://astar76sites.parore-gila.ts.net">Website</a> ·
|
||||
<a href="https://astar76.com">Website</a> ·
|
||||
<a href="https://discord.gg/UnSga5DmR7">Support server</a>
|
||||
</p>
|
||||
|
||||
|
|
|
|||
|
|
@ -14,5 +14,5 @@
|
|||
- D-010 — 2026-12-01 — The fm commands read ListenBrainz (free, no key) instead of the Last.fm API, which needs Pro for everything but scrobbling from 2026-12-01. Same commands and cards; links are stored separately in `data/listenbrainz.json` (`data/lastfm.json` is kept, untouched); song links still go to the Last.fm website (free, and the Listen button reads them). Lyrics song search uses Deezer (popularity-ranked, no key). The Last.fm version is the git tag `lastfm-api-backup`. — Owner request. — all fm commands.
|
||||
- D-011 — 2026-12-01 — Covers come from a chain (`src/commands/lastfm/covers.rs`): the release ID in the player's own tags (Cover Art Archive) → ListenBrainz's match → the release group → Deezer → iTunes; Deezer/iTunes results count only when artist and title match. Artist photos: Deezer → MusicBrainz/Wikimedia. Play counts match by MusicBrainz ID before names. — MusicBrainz art alone left many covers blank; owner asked for the most reliable sources with fallbacks. — fm commands.
|
||||
- D-012 — 2026-12-01 — All fm logic must get its data from ListenBrainz and MusicBrainz (plus the D-011 cover/photo fallbacks); leftover Last.fm API logic and Last.fm-only fields are replaced or removed. Song links to the Last.fm website stay. — Owner request after the Last.fm API change. — S006, S010.
|
||||
- D-013 — 2026-12-01 — All of Dezio's website (site, dashboard, API, OAuth, Game Boy Activity, hosted `/f/` files) moves to https://archlinux.tail7c4f5e.ts.net/dezio/. The root `/` serves a minimal static landing page (links to `/dezio/` and `/git/`), which the owner will improve in a later session; old root links to Dezio are not redirected. `/git` stays Forgejo. — Owner request. — S006a, S007, S011.
|
||||
- D-013 — 2026-12-01 — All of Dezio's website (site, dashboard, API, OAuth, Game Boy Activity, hosted `/f/` files) moves to https://astar76.com/dezio/. The root `/` serves a minimal static landing page (links to `/dezio/` and `/git/`), which the owner will improve in a later session; old root links to Dezio are not redirected. `/git` stays Forgejo. — Owner request. — S006a, S007, S011.
|
||||
- D-013 addition — 2026-12-01 — Base path = path part of `DASHBOARD_URL` (`/dezio`, none → root). The router serves every route both under the base and un-prefixed, so it works whether `tailscale serve --set-path` strips the prefix or not. HTML pages carry `__BASE__` (server replaces it); dashboard JS reads `<html data-base>`; site pages use relative paths; the Activity derives its base from `location.pathname` (so it also works at `/` inside Discord). Cookie `Path` = base. — Avoids guessing tailscale's behaviour. — S006a, S011.
|
||||
|
|
|
|||
|
|
@ -19,13 +19,13 @@ Run: `DASHBOARD_URL=http://127.0.0.1:8099/dezio DISCORD_BOT_TOKEN=dev-placeholde
|
|||
- Landing: `scp deploy/landing/index.html [email protected]:/srv/landing/index.html` (mkdir `/srv/landing` first).
|
||||
- `tailscale serve --bg --set-path / /srv/landing`
|
||||
- `tailscale serve --bg --set-path /dezio http://127.0.0.1:8080` (keep Funnel on; keep the `/git` mapping).
|
||||
- In `/root/Dezio/.env`: `DASHBOARD_URL=https://archlinux.tail7c4f5e.ts.net/dezio`, then restart `dezio-bot`.
|
||||
- Check `https://archlinux.tail7c4f5e.ts.net/`, `/dezio/`, `/git/`. The router accepts the prefix stripped or not.
|
||||
- In `/root/Dezio/.env`: `DASHBOARD_URL=https://astar76.com/dezio`, then restart `dezio-bot`.
|
||||
- Check `https://astar76.com/`, `/dezio/`, `/git/`. The router accepts the prefix stripped or not.
|
||||
|
||||
## Owner checklist 🧑
|
||||
- Developer Portal → OAuth2 → Redirects: add `https://archlinux.tail7c4f5e.ts.net/dezio/callback`.
|
||||
- Activities → URL Mappings: `/` → `archlinux.tail7c4f5e.ts.net/dezio/activity`.
|
||||
- top.gg website field: `https://archlinux.tail7c4f5e.ts.net/dezio/`.
|
||||
- Developer Portal → OAuth2 → Redirects: add `https://astar76.com/dezio/callback`.
|
||||
- Activities → URL Mappings: `/` → `astar76.com/dezio/activity`.
|
||||
- top.gg website field: `https://astar76.com/dezio/`.
|
||||
|
||||
## Doubts
|
||||
- Whether tailscale strips `/dezio` (both handled, not verified).
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ copy (`DASHBOARD_URL=http://127.0.0.1:8099/dezio`); a Result of `pass` means it
|
|||
| 5 | HIGH | PATCH `/dezio/api/user` with cookie `dezio_session=devtoken` and: no `x-csrf-token`; `Origin: http://evil.test`; no Origin; `Content-Type: text/plain` | 403, 403, 403, 415 | integration (curl) | pass |
|
||||
| 6 | HIGH | `curl --path-as-is` `/dezio/assets/../../.env`, `/dezio/f/../../.env` | 404 | integration | pass |
|
||||
| 7 | MED | 21 POSTs to `/dezio/activity/api/token` with `{"code":"x"}` in one minute (use a stub: do NOT let these reach Discord, e.g. run without network) | 21st → 429 "Too many sign-ins" | integration | pass (no network: 20 x 401, 21st and 22nd 429) |
|
||||
| 8 | MED | `DEZIO_ACTIVITY_DEV=1`, POST `/dezio/activity/api/dev-session` plain; with `X-Forwarded-For: 1.2.3.4`; with `Host: archlinux.tail7c4f5e.ts.net` | session; 404; 404 | integration | pass |
|
||||
| 8 | MED | `DEZIO_ACTIVITY_DEV=1`, POST `/dezio/activity/api/dev-session` plain; with `X-Forwarded-For: 1.2.3.4`; with `Host: astar76.com` | session; 404; 404 | integration | pass |
|
||||
| 9 | MED | GET `/dezio` and `/dezio?a=//evil.test` | 308 to `/dezio/` and `/dezio/?a=//evil.test` (relative, same host) | integration | pass |
|
||||
| 10 | MED | Open the site at `https://…/dezio` on the live server after deploy | lands on `/dezio/`, CSS and images load | by hand 🧑 | not run: live site, owner |
|
||||
| 11 | MED | Dashboard with `?error=busy` | shows "Too many sign-ins right now…" | screen | pass (text present in app.js; page not looked at) |
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ Copy each block into the matching field on the bot's Top.gg edit page.
|
|||
|---|---|
|
||||
| Invite URL | https://discord.com/oauth2/authorize?client_id=1387839600017412106&scope=bot%20applications.commands&permissions=8 |
|
||||
| Support server | https://discord.gg/UnSga5DmR7 |
|
||||
| Website | https://archlinux.tail7c4f5e.ts.net/dezio/ |
|
||||
| GitHub / source | https://archlinux.tail7c4f5e.ts.net/git/astar76/Dezio |
|
||||
| Website | https://astar76.com/dezio/ |
|
||||
| GitHub / source | https://astar76.com/git/astar76/Dezio |
|
||||
| Prefix | `D!` (every command is also a slash command) |
|
||||
| Library | Rust (twilight + songbird) |
|
||||
|
||||
|
|
@ -55,9 +55,9 @@ Chess, Connect 4, tic-tac-toe, Wordle, hangman, minesweeper, 2048, Akinator, Coo
|
|||
AI chat with a personality you can change per server, anime GIF actions, confessions, a phone-call system between servers, quotes you can style, emoji tools, weather, translation, wikipedia / web / image search, a calculator and a **Game Boy you can play inside Discord** (Activity).
|
||||
|
||||
## Links
|
||||
- **Website & dashboard:** https://archlinux.tail7c4f5e.ts.net/dezio/
|
||||
- **Website & dashboard:** https://astar76.com/dezio/
|
||||
- **Support server:** https://discord.gg/UnSga5DmR7
|
||||
- **Source code:** https://archlinux.tail7c4f5e.ts.net/git/astar76/Dezio
|
||||
- **Source code:** https://astar76.com/git/astar76/Dezio
|
||||
- Privacy policy and terms are on the website.
|
||||
|
||||
Written in **Rust** for speed. Add it, type `/help`, and you're done.
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
//! GET /activity/api/art/<id> the game's cover (public): an image next to the ROM wins, else SteamGridDB
|
||||
//! (STEAMGRIDDB_API_KEY), cached in data/gameboy/art
|
||||
//!
|
||||
//! Developer Portal setup (once): Activities → Settings → enable; Activities → URL Mappings → `/` → `<DASHBOARD_URL host + path>/activity` (e.g. archlinux.tail7c4f5e.ts.net/dezio/activity)
|
||||
//! Developer Portal setup (once): Activities → Settings → enable; Activities → URL Mappings → `/` → `<DASHBOARD_URL host + path>/activity` (e.g. astar76.com/dezio/activity)
|
||||
//! (no https://); OAuth2 → Redirects needs at least one entry (the dashboard's /callback is there already).
|
||||
//! DEZIO_ACTIVITY_DEV=1 adds POST /activity/api/dev-session, a test sign-in for requests from 127.0.0.1.
|
||||
//! Everything else under /api needs the session from /api/token (`Authorization: Bearer …`).
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
//! The web dashboard: Dezio's website plus per-user and per-server settings, served by the bot itself.
|
||||
//!
|
||||
//! Everything below lives under the path of DASHBOARD_URL (https://archlinux.tail7c4f5e.ts.net/dezio → /dezio; D-013).
|
||||
//! Everything below lives under the path of DASHBOARD_URL (https://astar76.com/dezio → /dezio; D-013).
|
||||
//! Un-prefixed paths work too. HTML pages get that path in place of `__BASE__`.
|
||||
//! / the website (web/site/: index, terms, privacy, assets/, images/)
|
||||
//! /dashboard the settings app (web/dashboard/), which talks to /api/…
|
||||
|
|
@ -431,8 +431,8 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn base_path_from_dashboard_url() {
|
||||
assert_eq!(base_path("https://archlinux.tail7c4f5e.ts.net/dezio"), "/dezio");
|
||||
assert_eq!(base_path("https://archlinux.tail7c4f5e.ts.net/dezio/"), "/dezio");
|
||||
assert_eq!(base_path("https://astar76.com/dezio"), "/dezio");
|
||||
assert_eq!(base_path("https://astar76.com/dezio/"), "/dezio");
|
||||
assert_eq!(base_path("http://127.0.0.1:8099/a/b"), "/a/b");
|
||||
assert_eq!(base_path("http://192.168.1.71:8080"), "");
|
||||
assert_eq!(base_path("http://192.168.1.71:8080/"), "");
|
||||
|
|
|
|||
Loading…
Reference in a new issue