Archilyzer · Source

archilyzer

Archilyzer
git clone https://archilyzer.pages.dev/source/archilyzer.git
Log | Files | Refs | README | LICENSE

commit 27a3ef3bcaf701e5e04e55479312c9eb4a27d1fc
parent e4d72e2538e55b920880c8dd1feb0ce3b954c58b
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Fri, 16 Oct 2026 17:46:15 -0400

docs: RUNNING_IN_DOCKER.md — Docker as the first-class install: a quickstart to a transcribed channel, Run it as a service (both modes), report → video, local models, the Claude API, browser cookies, X posts, text to speech and the MCP from the container, the storage overlay (the media tier's links, not the retired dataDir), and a feature-by-install matrix; COMMANDS/ENVIRONMENT/CHANNEL/SETTINGS regenerated; AGENTS, FACTS, CHANGELOG

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Diffstat:
MAGENTS.md | 11++++++++---
MCHANNEL.md | 2+-
MCOMMANDS.md | 6++++++
MENVIRONMENT.md | 3+++
MRUNNING_IN_DOCKER.md | 308+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------
MSETTINGS.md | 2+-
Meditor/CHANGELOG.md | 3+++
Mplans/FACTS.md | 35+++++++++++++++++++++++++++++++++++
8 files changed, 334 insertions(+), 36 deletions(-)

diff --git a/AGENTS.md b/AGENTS.md @@ -203,10 +203,15 @@ is new and is a THIRD Dockerfile — `Dockerfile.build` (the opt-in docker build runner's per-site containers, host only) and `Dockerfile.test` (sharded e2e) are untouched and unrelated. -Three runtime targets share one build: `runtime` (CPU whisper.cpp, the default), +Four runtime targets share one build: `runtime` (CPU whisper.cpp, the default), `runtime-vulkan` (parakeet.cpp on Vulkan — AMD/Intel/NVIDIA, `/dev/dri` passed -through, `docker-compose.vulkan.yml`) and `runtime-cuda` (NVIDIA-only whisper, -`docker-compose.gpu.yml`). `ARCHILYZER_TRANSCRIBER` is baked per target and is +through, `docker-compose.vulkan.yml`), `runtime-cuda` (NVIDIA-only whisper, +`docker-compose.gpu.yml`) and `runtime-umtool` (umtool's own image, on trixie: +ImageMagick 7 + Pango, chromium, hyperframes — report → video in a container). +Docker is the first-class install: RUNNING_IN_DOCKER.md's feature matrix says +what each feature needs there. `archilyzer service install` runs either Docker +or the host apps as systemd user units (`common/bin/service.ts`); on this +machine the operator runs host-mode units, which the command adopts. `ARCHILYZER_TRANSCRIBER` is baked per target and is what makes `docker/entrypoint.sh` seed a parakeet worker and fetch a GGUF rather than a whisper worker and a `.bin`. diff --git a/CHANNEL.md b/CHANNEL.md @@ -42,7 +42,7 @@ Regenerate this file with `pnpm --filter yt-dlp-transcript-common exec tsx bin/f | `fullSweepIntervalMinutes` | config | Full-sweep cadence: a sync upgrades itself to a full sweep when `now - lastFullSweepAt >= fullSweepIntervalMinutes`. Absent = inherit `syncScheduler.fullSweepIntervalMinutes`; 0 = never sweep (every sync is a paged walk); positives clamp to [1, 44640]. | | `skipLiveDownloads` | config | Per-channel override for the global `skipLiveDownloads`. Absent = inherit; false = allow downloading currently-live / upcoming videos. | | `downloadFilter` | config | Per-channel title/description download filter, matched against the per-video metadata prefetch. A declined video is SETTLED by a terminal download-outcome keyed on the filter's signature, not by an archive line, so changing either pattern re-evaluates every settled video on the next run. An object with no real rule is dropped (the filter is inert). See [`downloadFilter`](#downloadfilter). | -| `cookiesFromBrowser` | config | Per-channel override of the global cookies-from-browser spec. Trimmed; blank = inherit. | +| `cookiesFromBrowser` | config | Per-channel override of the global cookies-from-browser spec (a browser spec, or `file:<path>` for a cookies.txt). Trimmed; blank = inherit. | | `cookieMode` | config | Per-channel override of the global cookie mode. Absent = inherit. | | `sleepBetweenDownloadsSeconds` | config | Per-channel override for the global pause between downloads. Absent = inherit; 0 = no sleep; floored and capped at 600. | | `audioCheck` | config | Audio-integrity checking for sources that intermittently serve corrupt audio mid-download: the managed downloader periodically validates the in-progress `.part` file and rolls back to the last known-good snapshot on corruption (transcribe handling), and a clip window gets the same final probe, fetched once more when malformed and never kept when malformed twice. ON BY DEFAULT for an Odysee video (`audioCheck: {"enabled": false}` turns it off); the channel's opt-in for any other platform. See [`audioCheck`](#audiocheck). | diff --git a/COMMANDS.md b/COMMANDS.md @@ -80,6 +80,12 @@ Run from the repo root (in the container: `docker compose exec editor pnpm archi | `archilyzer docs cli` | `[--check]` | write COMMANDS.md from this command table and `pnpm ops --help` | | `archilyzer settings example` | `[--check]` | write settings.json.example + SETTINGS.md from the schema | | `archilyzer tts setup` | `[--engine kokoro\|orpheus\|espeak-ng] [--from <dir>] [--python <py>] [--check]` | install a text-to-speech engine under settings.tts.home/&lt;engine&gt; (default ~/.local/share/archilyzer/tts/&lt;engine&gt;): a python venv with its pinned packages (uv venv --python 3.12 when uv is on PATH, else --python &lt;py&gt; -m venv) — kokoro-onnx for kokoro, onnxruntime and numpy for orpheus — and its model files, downloaded once (kokoro: the kokoro-onnx model-files-v1.0 release; orpheus: the Q8\_0 GGUF and the SNAC decoder from Hugging Face, 3.5 GB) one stream at a time with no retries, verified by size and sha256; --from &lt;dir&gt; takes already-downloaded model files from &lt;dir&gt; instead (hard links where it can, else copies; verified the same way); orpheus's llama-server is not installed here (settings.tts.orpheus.serverBin) but is checked; --check installs nothing, lists what is missing and exits 1 when anything is | +| `archilyzer service install` | `[--mode docker\|host] [--apps <a,b>] [--sites <id>:<port>,…] [--overlays <name,…>\|none] [--bind <host>] [--editor-port <n>] [--umtool-port <n>] [--editor-memory <N>G] [--umtool-memory <N>G] [--idle-boot] [--linger] [--no-start] [--force] [--dry-run]` | install the apps as systemd USER units and start them: docker mode (the default when `docker compose` answers) is ONE unit, archilyzer.service, running `docker compose up` in the foreground with a profile per --apps (editor, umtool, site, homepage, ollama; default editor) and the overlays given or found (anthropic when the key file exists, storage when docker-compose.storage.yml does); host mode is archilyzer-editor.service and archilyzer-umtool.service (node running `next start` from the app dir, -H --bind default 0.0.0.0, ports 3001/3050, MemoryHigh/Max sized from MemTotal) plus archilyzer-site-&lt;id&gt;.service per --sites (a built bundle on 127.0.0.1); each unit refuses to start while its build or image is missing. A unit already installed under the same name is ADOPTED when identical and shown as a diff and refused when not (--force replaces it; a running unit is not restarted); --no-start enables without starting; --linger runs loginctl enable-linger (start at boot with nobody logged in); --dry-run prints the units and commands and writes nothing. Linux and systemd only | +| `archilyzer service status` | | read-only: each installed archilyzer unit's state, enablement and pid; for an app its build id, its port and what / answers; the transcription lane's held state; in docker mode each container | +| `archilyzer service logs` | `[--apps <a,b>] [--lines <n>] [--follow]` | the units' journal (journalctl --user), the last 200 lines by default | +| `archilyzer service restart` | `[--apps <a,b>] [--dry-run]` | restart the installed units (all, or the named apps: editor, umtool, site-&lt;id&gt;, docker) — the editor's running jobs are stopped by its shutdown reaper | +| `archilyzer service uninstall` | `[--mode docker\|host] [--apps <a,b>] [--dry-run]` | stop, disable and remove the units (volumes, builds and the corpus are untouched) | +| `archilyzer service storage-overlay` | `[--corpus <dir>] [--out <file>] [--check] [--dry-run]` | write docker-compose.storage.yml: every storage location's root, and every channel media link or saved-video store link no location covers, bind-mounted into the editor and umtool at the SAME absolute path (the links are absolute); --corpus also mounts a host corpus at /data/transcripts in place of the volume; read off the corpus disk only (no media drive is touched) | | `archilyzer doctor` | `[--json]` | read-only report: node, the checkout, the corpus, settings, every tool, the port block; exit 1 on a failure | | `archilyzer release show` | `[editor\|export]` | latest release, its date, how many bullets wait under \[Unreleased\] | | `archilyzer release cut` | `<editor\|export\|all> <X.Y.Z\|next\|next-minor> [--commit] [--date YYYY-MM-DD]` | \[Unreleased\] -&gt; a dated heading; all = both, one version, two commits | diff --git a/ENVIRONMENT.md b/ENVIRONMENT.md @@ -186,6 +186,9 @@ The container's own set, read by `docker/*.sh`, the compose files and Caddy — | `ARCHILYZER_FORWARD_AUTH_UPSTREAM` | — | Forward-auth server (Authelia, tinyauth, …), `host:port`. | docker/Caddyfile | | `ARCHILYZER_FORWARD_AUTH_URI` | `/api/auth/caddy` | The forward-auth server's verify path. | docker/Caddyfile | | `ARCHILYZER_TAG` | `local` | The image tag the compose files build and run. | docker-compose*.yml | +| `ARCHILYZER_ANTHROPIC_ENV_FILE` | `~/.config/archilyzer/anthropic.env` | The host's Claude API key file (one line `ANTHROPIC_API_KEY=…`, mode 600), bind-mounted read-only into the editor and umtool by the anthropic overlay; `archilyzer service install` adds that overlay when the file exists (it never opens it). | docker-compose.anthropic.yml, common/bin/service.ts | +| `ARCHILYZER_FIREFOX_PROFILES` | `~/.mozilla/firefox` | The host's Firefox profiles directory, mounted read-only at `/data/browser/firefox` by the browser overlay, for `cookiesFromBrowser = firefox:/data/browser/firefox`. | docker-compose.browser.yml | +| `OLLAMA_TAG` | `0.40.5` | The `ollama/ollama` image tag the `ollama` profile runs. | docker-compose.yml | ## Tests only diff --git a/RUNNING_IN_DOCKER.md b/RUNNING_IN_DOCKER.md @@ -1,9 +1,12 @@ # Running an archive in Docker -One command stands up a working archive server: the editor, the tools it drives -(yt-dlp, ffmpeg, and a transcription engine — whisper.cpp, or parakeet.cpp in the -Vulkan image), and a reverse proxy that is the only thing on the box with an open -port. +Docker is the first-class way to run Archilyzer: every feature works in it (the +[feature matrix](#every-feature-by-install) says which need an overlay, and the +few that need a desktop). One command stands up a working archive server: the +editor, the tools it drives (yt-dlp, gallery-dl, ffmpeg, and a transcription +engine — whisper.cpp, or parakeet.cpp in the Vulkan image), and a reverse proxy +that is the only thing on the box with an open port. umtool, a local model +server and the published site are one profile each. > This document is about **running the apps** — publishing included: every publish > stage (index, build, deploy) runs inside the editor's container. Fanning per-site @@ -16,6 +19,8 @@ port. ## Quickstart +From a clone to a transcribed channel: + ```sh git clone <your-remote> archilyzer cd archilyzer @@ -23,10 +28,20 @@ cp .env.example .env docker compose up -d --build ``` -Then open **http://localhost:8081**. - -The first build takes a while — it compiles whisper.cpp and builds two Next.js -apps. Afterwards, `docker compose up -d` is seconds. +1. Open **http://localhost:8081**. With no channel yet, the dashboard's **First + steps** lists what this install has and what it lacks. +2. **Paste a URL** (Channels → Add): a channel or playlist. Platform, handling + and slug fill in. +3. On the channel's page, **Sync**: captions and audio land in the `corpus` + volume. +4. **Transcribe** the videos that have no captions — the seeded worker and the + model fetched on first boot do it. + +The first build takes a while — it compiles whisper.cpp and builds three Next.js +apps. Afterwards, `docker compose up -d` is seconds. To start it at boot, enable +Docker itself (`sudo systemctl enable --now docker`): every service is +`restart: unless-stopped`, so the stack comes back with the daemon. Or install it +as a unit — [Run it as a service](#run-it-as-a-service). On first boot the container also: @@ -50,16 +65,65 @@ Watch it happen with `docker compose logs -f editor`. | **editor** | http://localhost:8081 | the admin app: channels, downloads, transcription, builds | | site | http://localhost:8080 | the published archive (profile `site`) | | homepage | http://localhost:8082 | the project's own site (profile `homepage`) | -| umtool | http://localhost:8083 | the clip/report bench (profile `umtool`) | +| umtool | http://localhost:8083 | the clip/report bench and report → video renders (profile `umtool`, its own image) | +| ollama | — (internal) | local models for digests and local generation (profile `ollama`) | Only the editor and Caddy run by default. Somebody who wants an archive runs two containers, not five: ```sh docker compose --profile site up -d # + the archive server -docker compose --profile umtool up -d # + umtool +docker compose --profile umtool up -d --build # + umtool (builds its image once) +docker compose --profile ollama up -d # + a local model server +``` + +### Run it as a service + +`archilyzer service` installs the stack as systemd **user** units and starts it +(Linux; it needs Node 22 and pnpm on the host to run the command itself — a +checkout with `pnpm install`): + +```sh +pnpm archilyzer service install --dry-run # see the unit first +pnpm archilyzer service install --apps editor,umtool,ollama --linger +pnpm archilyzer service status +pnpm archilyzer service logs --follow +pnpm archilyzer service restart +pnpm archilyzer service uninstall # volumes untouched ``` +**Docker mode** (the default when `docker compose` answers) is ONE unit, +`archilyzer.service`, running `docker compose … up` in the foreground — so every +container's log is in the journal — and `docker compose … down` on stop. `--apps` +picks the profiles (`editor`, `umtool`, `site`, `homepage`, `ollama`); the +overlays come from `--overlays vulkan,browser,…` or are found: +`docker-compose.anthropic.yml` when the Claude API key file exists, +`docker-compose.storage.yml` when you have generated one. The unit never builds: +an image that was never built is refused at start with the `docker compose build` +line to run. Compose's own restart policy does the container restarts; the unit +adds start/stop, status and logs through systemd, and `--linger` +(`loginctl enable-linger`) starts it at boot with nobody logged in. A user unit, +not a system one: nothing needs root to install it, and it runs as the person +whose checkout and `.env` it reads. + +**Host mode** (`--mode host`; the default once host units exist) is one unit per +app: `archilyzer-editor.service` and `archilyzer-umtool.service` run +`node … next start` from the app's directory (node directly — pnpm swallows the +SIGTERM the editor's shutdown reaper needs), ports 3001 and 3050, bound to +`--bind` (default `0.0.0.0`, as `next start` itself; the editor has no login, so +pass `--bind 127.0.0.1` on a machine others can reach), `MemoryHigh`/`MemoryMax` +sized from the machine's RAM (`--editor-memory 8G`), `KillMode=mixed` with time +for the reaper, and a start that refuses with a sentence while `.next/BUILD_ID` +is missing. `--sites <id>:<port>` adds `archilyzer-site-<id>.service`, a built +private site's bundle served on 127.0.0.1. `--idle-boot` boots the editor +without arming its runners. + +Installing over units that already exist ADOPTS them: identical text is left +alone; a different one is printed as a diff and refused unless `--force`. A unit +replaced while it runs keeps running until `service restart`. `--dry-run` prints +every unit and every command and writes nothing. Every flag is in +[COMMANDS.md](COMMANDS.md). + --- ## The exposure model @@ -376,6 +440,135 @@ override alone with a warning — update it where you build it. A substitute tha does not run is reported as `yt-dlp: MISSING — … does not run: …` (the editor still starts), and by `archilyzer doctor`. +### Report → video (umtool) + +```sh +docker compose --profile umtool up -d --build +``` + +umtool runs its own image, the `runtime-umtool` target: everything a render +shells out to is in it — ImageMagick 7 with the Pango coder (cards, the +timeline, every text render), `rsvg-convert`, `qrencode` and `zbarimg`, +`chromium` for the review still, the pinned `hyperframes` CLI and its headless +shell for the chrome frames (`HYPERFRAMES_BIN`, so a render never runs +`npx --yes`), and Playwright's headless Chromium for post screenshots. It is +built on trixie because bookworm has no ImageMagick 7. The Archilyzer Media +preset's faces ship in the repo; an unbranded card falls back from Fira Sans +(not packaged by Debian) to DejaVu Sans. + +Projects live in the `reports` volume (`REPORTS_DIR=/data/reports`). Clip +windows are fetched through the editor (`ARCHILYZER_EDITOR_URL=http://editor:3001` +is set for you; `WORKER_TOKEN` in `.env` is what it authenticates with). A render +runs inside the umtool container; give the Docker VM the memory a render needs +(4 GB or more on Docker Desktop). + +### Local models + +```sh +docker compose --profile ollama up -d +docker compose exec ollama ollama pull qwen3:8b +``` + +The digest lanes and generation routed to **local** reach `OLLAMA_URL`, which +compose points at the `ollama` service (`http://ollama:11434`, internal — no port +is published). The Vulkan and GPU overlays give it the same device as the +editor (ollama's Vulkan backend is opt-in upstream — the overlay sets +`OLLAMA_VULKAN=1`; check `docker compose logs ollama` for the device it found). +To use an ollama already running on the host instead: + +```sh +# .env +OLLAMA_URL=http://host.docker.internal:11434 +``` + +(`host.docker.internal` resolves on Linux too — compose maps it for the editor +and umtool. The host's ollama must listen beyond loopback for a container to +reach it: `OLLAMA_HOST=0.0.0.0`.) + +### The Claude API + +Frame scan and generation routed to **api** read the same one-line key file a +host install does (`ANTHROPIC_API_KEY=…`, mode 600, default +`~/.config/archilyzer/anthropic.env`). The overlay mounts it read-only where the +app looks by default, so no setting changes: + +```sh +docker compose -f docker-compose.yml -f docker-compose.anthropic.yml up -d +``` + +A mount, not an environment variable: the key never shows in +`docker compose config`, `docker inspect` or `.env`. Without the overlay those +features say "no API key"; nothing else needs it. `ARCHILYZER_ANTHROPIC_ENV_FILE` +names another file. Generation routed to **code** is done by a Claude Code +session through the MCP (`/gen`), not by the container — register the MCP from +the container ([below](#the-mcp-server-from-the-container)). + +### Browser cookies + +yt-dlp's `--cookies-from-browser` (Settings → cookies, a channel's own value, +`cookieMode`) and gallery-dl's read a browser's cookie store, and a container has +no browser. Mount the host's Firefox profiles read-only: + +```sh +docker compose -f docker-compose.yml -f docker-compose.browser.yml up -d +``` + +and set **cookiesFromBrowser** to `firefox:/data/browser/firefox` (the newest +profile under it; `firefox:/data/browser/firefox/<xxxx.default-release>` pins +one). yt-dlp copies the database before reading it, so Firefox may stay open. + +| Browser | From a container | Works for | +|---|---|---| +| Firefox | the browser overlay | YouTube, Rumble (`cf_clearance`; the app pins the User-Agent it was issued to), Odysee, X through gallery-dl | +| Chrome / Chromium | **no** — their Linux cookies are encrypted with a key the desktop keyring holds | export a `cookies.txt` (Netscape format) instead | + +A `cookies.txt` works anywhere: copy it into the config volume and name it with +`file:`, which the app passes as `--cookies <path>`: + +```sh +docker compose cp cookies.txt editor:/data/config/cookies.txt +# Settings → cookiesFromBrowser: file:/data/config/cookies.txt +``` + +It goes stale as the site rotates its cookies; re-export when fetches start +asking for a login. `ARCHILYZER_FIREFOX_PROFILES` in `.env` names a profiles +directory that is not `~/.mozilla/firefox` (a snap's or a flatpak's). + +### X posts + +gallery-dl is in the image (pinned; `GALLERY_DL_BIN`), and so is the headless +Chromium the post capture and the Nitter fallback use. **Connect X account** and +**Connect forum session** open a browser window for you to log in, and a +container has no display: log in to X in the host's Firefox and use the browser +overlay above (the X fetchers read the same store), or connect on a host install. + +### Text to speech + +`espeak-ng` is in the image, so `pnpm ops tts` speaks with no model at all. +Kokoro (the default engine) installs into the container on demand: + +```sh +docker compose exec editor pnpm archilyzer tts setup --engine kokoro +``` + +It lands in the `models` volume (the image links +`~/.local/share/archilyzer/tts` there), so it survives `docker compose up`. +Orpheus needs a `llama-server` beside the editor, which the image does not carry +— run Orpheus on a host install. + +### The MCP server, from the container + +```sh +claude mcp add archilyzer -- docker compose -f /path/to/archilyzer/docker-compose.yml \ + exec -T editor pnpm --silent archilyzer mcp +``` + +`-T` (no TTY) and `--silent` keep stdout to the JSON-RPC protocol alone. Inside +the container `ARCHILYZER_EDITOR_URL` already names the editor, so `fetch_clip` +works once `WORKER_TOKEN` is set in `.env`. Point it at a published archive +with `exec -T -e TRANSCRIPT_SITE_URL=https://… editor …`, or at a local build +with `-e TRANSCRIPT_LOCAL_DIR=/data/builds/.export-builds/<site-id>/out`. + ### Driving the editor without a browser Every editor gesture is a server action, which is fine for a person and hostile @@ -596,8 +789,10 @@ reachable from a Linux container at all, so it would have to be a host install. ### Backup `corpus` is the volume that matters — real media, real transcripts, hundreds of -GB when it grows up. `config` holds `settings.json`. `models` and `builds` are -reproducible; losing them costs a download and a rebuild. +GB when it grows up. `config` holds `settings.json` and the generation ledger; +`reports` holds umtool's projects — real work, back it up too. `models`, +`builds` and `ollama` are reproducible; losing them costs a download and a +rebuild. ```sh docker run --rm -v archilyzer_corpus:/corpus -v "$PWD:/backup" \ @@ -606,10 +801,28 @@ docker run --rm -v archilyzer_corpus:/corpus -v "$PWD:/backup" \ ### A channel whose media is on another drive -The Storage panel can move a channel's `data/` to another root (see AGENTS.md). In a -container that root is a path **inside the container**, and `channels/<slug>/data` -becomes an absolute symlink to it — so the drive must be bind-mounted **at the same -absolute path the editor recorded**: +The Storage panel can move a channel's media to another drive (see AGENTS.md): +`channels/<slug>/media` becomes ONE absolute symlink to `<root>/<slug>/media`. In +a container that root is a path **inside the container**, so the drive must be +bind-mounted **at the same absolute path the corpus's links name**. Generate the +overlay from the configured storage locations and the links themselves: + +```sh +pnpm archilyzer service storage-overlay # writes docker-compose.storage.yml +pnpm archilyzer service storage-overlay --dry-run # prints it +docker compose -f docker-compose.yml -f docker-compose.storage.yml up -d +``` + +It lists every location's root, every channel `media` link (and a legacy `data` +link) whose target no location covers, and the saved-video store when it is a +link — read off the corpus disk with `readlink`, so an unmounted drive cannot +stall it. Each is mounted into the editor and umtool with `create_host_path: +false`: a drive that is not mounted on the host refuses `up` rather than +becoming an empty directory the corpus would read as no media. `--corpus <dir>` +also mounts a host corpus at `/data/transcripts` in place of the volume — the +path from a host install to Docker without copying it. `archilyzer service +install` adds the overlay by itself once the file exists; re-run the command +after adding a location or moving a channel. By hand it is one line per drive: ```yaml services: @@ -655,7 +868,7 @@ mount; fix the path. So the container's remedy is the manual one, and it is not a downgrade: **change the location's root to the path the media is actually at, and re-point.** Edit the location on `/storage`, or press Re-point after correcting the root; the job rewrites each -channel's `data/` symlink and its `config.dataDir` and moves no bytes. Equivalently, +channel's `media` link and its `config.mediaDir` and moves no bytes. Equivalently, fix the compose file so the bind mount lands where the editor recorded — the same `-v /host/path:/container/path` line above — and nothing needs re-pointing at all. `autoRepoint` has nothing to act on here and can stay off. @@ -675,6 +888,40 @@ docker compose down # stop; volumes survive docker compose down -v # stop AND DELETE the corpus ``` +## Every feature, by install + +**works** — nothing to add. *needs X* — one step, named. **no** — not +supported there, and why. The three Docker columns are the default image, the +Vulkan overlay and the CUDA overlay; umtool runs its own image in all three. + +| Feature | Host install | Docker CPU | Docker Vulkan | Docker CUDA | +|---|---|---|---|---| +| Channels: add, sync, download (yt-dlp + deno) | works | works | works | works | +| Imports: archive.org (torrents via aria2), Odysee, BitChute, the Wayback Machine | works | works | works | works | +| The Odysee audio check, audio audit, find-copy, mirrors | works | works | works | works | +| Cookies from a browser | works (any browser yt-dlp reads) | Firefox: *needs the browser overlay*; Chrome: *needs a cookies.txt* (`file:`) — [Browser cookies](#browser-cookies) | same | same | +| X posts: fetch and capture (gallery-dl) | *needs gallery-dl* | works (pinned in the image) | works | works | +| Bluesky capture, the Nitter and Playwright X fetchers, forum threads (headless Chromium) | *needs `playwright install chromium`* | works | works | works | +| Connect X account / Connect forum session (a browser window) | works | **no** — a container has no display; use the browser overlay's Firefox login | **no** | **no** | +| Transcription, whisper.cpp on the CPU | *needs whisper.cpp* | works | works (whisper-cli is in it too) | works | +| Transcription on a GPU | *needs a GPU build* | **no** — CPU image | works: parakeet.cpp on Vulkan (AMD, Intel, NVIDIA) | works: whisper.cpp on CUDA (NVIDIA) | +| Diarization (sherpa-onnx, Sortformer) | *needs the engine's python env* | **no** — not baked (an engine and models the operator chooses); run it on a host or a [unit executor](#running-as-a-unit-executor-for-another-machine) | **no** | **no** | +| Digests, attribution, generation routed to **local** | *needs ollama* | *needs `--profile ollama`* (or the host's ollama) | same, on the GPU (`OLLAMA_VULKAN=1`) | same, on the GPU | +| Frame scan, generation routed to **api** (Claude API) | *needs the key file* | *needs the anthropic overlay* | same | same | +| Generation routed to **code** (`/gen` in Claude Code) | works (MCP) | works ([MCP from the container](#the-mcp-server-from-the-container)) | works | works | +| Curated tags, reports prepare/export, articles, PDF/print exports | works | works | works | works | +| Report → video renders | *needs ImageMagick 7 + Pango, qrencode, rsvg-convert, chromium* | *needs `--profile umtool`* (its image has all of it) | same | same | +| Text to speech: espeak-ng | *needs espeak-ng* | works | works | works | +| Text to speech: Kokoro | *needs `tts setup`* | *needs `tts setup`* in the container (kept in the models volume) | same | same | +| Text to speech: Orpheus | *needs `tts setup --engine orpheus` + a llama-server* | **no** — no llama-server in the image | **no** | **no** | +| Publish: index, build, deploy (local, Cloudflare) | works | works (token in `.env`) | works | works | +| Publish: the docker runner's per-site fan-out | works | **no** — no engine in a container, by design | **no** | **no** | +| The homepage's `/source` mirror | works | *needs the source overlay*; no gitleaks/stagit (no secret scan, no history pages) | same | same | +| The seeder (WebTorrent behind WireGuard) | works (`archilyzer seed`) | *needs the seeder overlay* | same | same | +| Media on other drives | works (UUID re-point) | *needs the storage overlay*; re-point by path only | same | same | +| The MCP server | works | works (`exec -T`) | works | works | +| Run as a service | `service install --mode host` | `service install` (or Docker's own restart) | same, `--overlays vulkan` | same, `--overlays gpu` | + --- ## What is in the image, and what is not @@ -682,34 +929,33 @@ docker compose down -v # stop AND DELETE the corp **Baked in:** Node 22 (the pinned wrangler needs it) + the installed workspace, the built editor / umtool / homepage, `yt-dlp`, a JavaScript runtime for it (`deno` — without one yt-dlp warns and silently loses formats), `ffmpeg`/`ffprobe`, `whisper-cli` (statically linked), +`gallery-dl` (pinned), Playwright's headless Chromium, `espeak-ng`, `aria2`, `zip`/`tar`/`xz`/`gzip`, `rsync`, `git`, `curl`, `ps`; `python3` with yt-dlp's -optional modules (for a substituted yt-dlp), `pipx` and a pinned `git-filter-repo` -(the homepage's source mirror), and — in the workspace's `node_modules` — a -pinned `wrangler`, so a deploy fetches nothing. The Vulkan image adds -`parakeet-cli`, the Mesa Vulkan drivers and `vulkaninfo`. +optional modules (for a substituted yt-dlp) and `venv` (for a Kokoro install), +`pipx` and a pinned `git-filter-repo` (the homepage's source mirror), and — in +the workspace's `node_modules` — a pinned `wrangler`, so a deploy fetches +nothing. The Vulkan image adds `parakeet-cli`, the Mesa Vulkan drivers and +`vulkaninfo`. The umtool image (`runtime-umtool`) adds ImageMagick 7 with Pango, +`rsvg-convert`, `qrencode`, `zbarimg`, `chromium` and the pinned `hyperframes` +with its headless shell. Local models are the `ollama` service's own image. **Not baked, on purpose:** - **The corpus.** It is a separate git repo holding production data, and it lives in the `corpus` volume. -- **whisper models.** 142 MB to 3 GB, and the choice is yours. Fetched on boot. +- **Speech models.** 142 MB to 3 GB, and the choice is yours. Fetched on boot. - **The export site build.** It is a static render *of a corpus*, and there is no corpus at image-build time. The publish stages make it at run time. - **Credentials.** `CLOUDFLARE_API_TOKEN` and friends come from `.env` at run - time, never from the image. + time; the Claude API key file is mounted by its overlay. Never in the image. - **The repository.** No `.git`; `docker-compose.source.yml` mounts the host's for the `/source` mirror. The build's commit and branch are baked as `ARCHILYZER_COMMIT`/`ARCHILYZER_BRANCH` when the build passes them (`ARCHILYZER_COMMIT=$(git rev-parse HEAD) ARCHILYZER_BRANCH=$(git branch --show-current) docker compose build`) — the publish stamps record them. -- **ImageMagick with Pango, and `qrencode`.** Only `umtool/report-to-video/` - needs them, and rendering a report to video is a workstation task, not - something a server does. Run that part on a host checkout. -- **gallery-dl.** The X/Twitter post fetcher. Install it and point - `GALLERY_DL_BIN` at it if you want the social corpus. -- **ollama / claude.** The digest lanes reach a local ollama or the `claude` CLI. - Point `OLLAMA_URL` at a host ollama (`http://host.docker.internal:11434`) if you - want digests. +- **Diarization engines and Orpheus's llama-server.** Each is an engine plus + models the operator chooses, GPU-specific; the matrix above says where they + run. ### Two build runners, and the container has one diff --git a/SETTINGS.md b/SETTINGS.md @@ -156,7 +156,7 @@ Default: ## `cookiesFromBrowser` -Browser spec (e.g. "firefox", "chrome:Default") passed to `yt-dlp --cookies-from-browser`. WHEN it is passed is governed by `cookieMode` below. Empty string = no cookies configured. Per-channel override available (ChannelConfig.cookiesFromBrowser). +Browser spec (e.g. "firefox", "chrome:Default", "firefox:/data/browser/firefox" for a profile directory) passed to `yt-dlp --cookies-from-browser` — or `file:<path>`, a cookies.txt passed as `--cookies <path>` (for a container or a server with no browser). WHEN it is passed is governed by `cookieMode` below. Empty string = no cookies configured. Per-channel override available (ChannelConfig.cookiesFromBrowser). Default: `""` diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog ## [Unreleased] +- **Every feature runs in Docker, and the whole stack runs as a service.** `pnpm archilyzer service install` installs Archilyzer as systemd user units and starts it — in Docker (one `archilyzer.service` running `docker compose up`, the default when Docker is present) or on the host (`--mode host`: `archilyzer-editor.service`, `archilyzer-umtool.service`, and `--sites <id>:<port>` for a private site's server). `service status` shows each unit, its build, its port's answer and whether the transcription lane is held; `service logs`, `service restart` and `service uninstall` do what they say; `--dry-run` prints the units and writes nothing, and units you already have under those names are adopted when identical and shown as a diff when not (`--force` replaces them). In Docker, umtool now renders report videos (its own image carries ImageMagick 7, chromium and hyperframes), the image carries gallery-dl, headless Chromium and espeak-ng, `--profile ollama` runs local models, and overlays mount the Claude API key file, your Firefox cookies and every media drive (`archilyzer service storage-overlay` writes that one). RUNNING_IN_DOCKER.md has a feature-by-install table. +- **A cookies.txt works wherever a browser's cookies do.** Set cookies-from-browser (in Settings or on a channel) to `file:/path/to/cookies.txt` and yt-dlp and gallery-dl are handed `--cookies <path>` — for a container, or a machine whose browser store cannot be read. +- **A fresh install's dashboard says what to do first.** With no channel yet, **First steps** lists adding a channel, whether a transcription worker has its model, syncing and transcribing, and publishing — each with what this install already has. - **Odysee downloads always get the audio check, clip windows included.** A video from Odysee — which intermittently serves corrupt audio — is downloaded with the audio check on unless its channel turns it off (`audioCheck: {"enabled": false}`); before, a channel had to opt in. A clip window from such a source now gets the check's final probe too: a malformed window is deleted and fetched once more, and if it is malformed again the fetch fails and nothing is kept, so a clip is never cut from corrupt audio. The verdict is recorded in the window's provenance. - **An article can correct what the transcripts mishear in its quotes.** `archilyzer reports respell <article> --heard "cake cup,cakeup" --reads K-Cup` previews every change — the article's quotes and citations, its report's own words, and its video's burned-in quotes and flip cards — as before → after, and writes nothing; `--apply` writes it, each file backed up first. `--bracket` shows the correction as an altered quote, `[K-Cup]`. The article records the respelling, and every quote check applies it to the transcript before comparing, so a corrected quote still verifies exactly; the transcript itself is untouched. A video shows the new words once it is rebuilt. - **`pnpm ops audio-audit` checks the audio already on disk, file by file.** `pnpm ops audio-audit --json '{"platform":"odysee"}'` (or `{"slug":"<channel>"}`; `"scope":"all"` for transcribed videos too, `"max"` to cap the files) decodes each audio file a channel holds with error tolerance — one file at a time, at the lowest CPU and disk priority — and writes what it found beside the file in `audio-integrity.json`: clean, damaged (part of it will not decode) or undecodable, with how much decodes and where the gaps are. Audio downloaded before the audio check existed, or on a channel without it, was never checked. The same command again skips the files already checked. A drive that stops answering ends that channel's run with a sentence that says so instead of hanging. diff --git a/plans/FACTS.md b/plans/FACTS.md @@ -9914,3 +9914,38 @@ parsed to 0 cues, indexing the video textless) is CLOSED by `200a3105` (transcri - The editor's Configure form writes `audioCheck` only when its box is ticked: an Odysee channel with no `audioCheck` shows an unticked box though the check is on (owed: show the default). + +## The apps as services, and Docker parity (verified 2026-10-16, branch `r32/services`) + +- **`archilyzer service install|status|logs|restart|uninstall|storage-overlay`** (`common/bin/service.ts`; units + rendered by the pure `common/lib/service/units.ts`, tested byte for byte). systemd USER units in + `$XDG_CONFIG_HOME/systemd/user` (default `~/.config/systemd/user`); Linux only. +- **Unit names:** docker mode `archilyzer.service` (compose `up --no-build` in the foreground, `down` on stop, + `--profile` per app, `-f` per overlay); host mode `archilyzer-editor.service`, `archilyzer-umtool.service`, + `archilyzer-site-<id>.service` (`export/scripts/serve-out.mjs <exportBuildsDir>/<id>/out <port>`, HOST=127.0.0.1). +- **Host units are the operator's hand-written units of 2026-10-16, reproduced**: node directly, `next start -H 0.0.0.0 + -p 3001|3050` from the app dir, `UV_THREADPOOL_SIZE=16` (editor), PATH `~/.local/bin:~/.local/share/pnpm:/usr/local/bin: + /usr/bin:/bin` (node's dir first when elsewhere), ExecStartPre refusing without `.next/BUILD_ID`, StartLimit 5/300 s, + KillMode=mixed, TimeoutStopSec 90 (editor) / 60 (umtool), MemoryMax = ceil(MemTotal × ½) (editor) / ceil(× ⅜) + (umtool) GiB, MemoryHigh 1 GiB under — 8G/7G and 6G/5G on a 16 GB machine. Install over an identical unit = adopt + (no write, no daemon-reload); a different one → diff, refused without `--force`; a replaced running unit is NOT + restarted. +- **Mode default:** `--mode`, else host when any `archilyzer-*.service` is installed, else docker when it is, else + docker when `docker compose version` answers, else host. +- **Image:** `runtime-umtool` target (FROM runtime-base on trixie via `RUNTIME_IMAGE`, for ImageMagick 7's `magick`; + + Pango coder, rsvg-convert, qrencode, zbarimg, chromium, `hyperframes@<HYPERFRAMES_PKG_DEFAULT>` + `browser + ensure`; `HYPERFRAMES_BIN`, `CHROME`). runtime-base and runtime-cuda: gallery-dl pinned via pipx (`GALLERY_DL_BIN`), + espeak-ng, Playwright's headless shell at `PLAYWRIGHT_BROWSERS_PATH=/opt/ms-playwright` (`--with-deps`), + `REPORTS_DIR=/data/reports`, and three state links into volumes: `~/.local/share/archilyzer/tts` → + `/data/models/tts`, `/repo/.tts` → `/data/builds/tts`, `/repo/.generation` → `/data/config/generation` (the daily + caps' ledger survives a recreate). `buildImage.test.ts` holds the gallery-dl and hyperframes pins. +- **Compose:** volumes `reports`, `ollama`; `ollama` service (profile `ollama`, `ollama/ollama:${OLLAMA_TAG:-0.40.5}`, + internal); `OLLAMA_URL` defaults to `http://ollama:11434`; `ARCHILYZER_EDITOR_URL=http://editor:3001`; + `host.docker.internal:host-gateway` on editor and umtool. Overlays: `docker-compose.anthropic.yml` (the key file + bind-mounted read-only at `/root/.config/archilyzer/anthropic.env`, `create_host_path: false` — never env, so + `docker compose config` cannot print it), `docker-compose.browser.yml` (Firefox profiles at `/data/browser/firefox`), + `docker-compose.storage.yml` (GENERATED, gitignored; every location root + every uncovered absolute `media`/`data`/ + saved-videos link target, same path, editor + umtool). +- **Cookie spec `file:<path>`** (`cookiePolicy.ts` `cookieArgs`, `cookieFileOf`; gallery-dl's login args) → + `--cookies <path>`; any other spec stays `--cookies-from-browser <spec>`. `file:` with no path → no flag. +- **First run:** the dashboard's `FirstRunPanel` renders only while the actionable summary has zero channels.