Compare commits

..
37 Commits
Author SHA1 Message Date
ginnoir 87800f8553 fix(streaming): rename PLEX_URL to PLEX_BASEURL for jellyplex-watched v9 2026-11-30 13:03:29 -06:00
ginnoir 385e103dde fix(media): mount unified /storage1 in sonarr, radarr, bazarr for hardlinks 2026-11-21 19:05:32 -06:00
ginnoirandClaude Opus 5.5 d4ed52b29a feat(recyclarr): add TRaSH [Anime] Remux-1080p profile for Sonarr
Anime series (338) can't use WEB-1080p: it only allows WEB, so anime
BD encodes would be rejected. All Sonarr anime series + anime import
lists now use [Anime] Remux-1080p; standard series use WEB-1080p,
movies use HD Bluray + WEB. Ultra-HD items were left alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 18:22:12 -06:00
ginnoirandClaude Opus 5.5 fe0ff4a9d8 chore(authentik): drop stale forward-auth blueprint and its mount
The ./blueprints bind resolved to Portainer's internal /data/compose/17
path, so authentik saw an empty dir and never applied it. Good thing:
the June snapshot pinned the embedded outpost to 11 providers (it has
22 now) and would recreate 5 retired forward-auth providers, including
one in front of Gitea. Providers are managed via the Authentik API; the
DB is the source of truth. File remains in git history (109cc0d).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 17:45:22 -06:00
ginnoirandClaude Opus 5.5 38f49fdc6b fix(recyclarr): unique instance names + correct WEB-1080p trash_id
recyclarr v8 silently exits on duplicate instance names across services
(both were `main`), and the Sonarr WEB-1080p profile trash_id was
garbled (33 chars). Rename to sonarr-main/radarr-main and use
72dae194fc92bf828f32cde7744e51a1 from the TRaSH guide JSON.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 17:42:11 -06:00
ginnoirandClaude Opus 5.5 09ce938f6e fix(media): mount recyclarr config from /config/recyclarr
./recyclarr resolved to /data/compose/10/... (the Portainer-internal
path), so recyclarr has run against an empty /config since 2026-06-17
and never synced TRaSH profiles. The config is now copied to
/config/recyclarr on the host.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 17:35:54 -06:00
ginnoirandClaude Opus 5.5 4aea57a7d7 fix(media): mount mam-bonus script from /config, not ./
A relative bind resolves to /data/compose/10/... (the path inside the
Portainer container), so Docker bound an empty host dir and the job had
no script. Use the absolute /config/mam-bonus/buy-upload.sh like the
backup stack does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 17:25:35 -06:00
ginnoirandClaude Opus 5.5 ca257000c8 feat(media): add mam-bonus daily upload-credit buyer
Spends MAM bonus points once a day (04:17) on upload credit via
json/bonusBuy.php (spendtype=upload, "Max Affordable ") so seedbonus
never caps out. Dedicated MAM session; rotated mam_id is persisted in a
curl cookie jar under /config/mam-bonus. Skips when below the 50 GiB
minimum; failures alert ntfy topic `mam`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 17:20:02 -06:00
ginnoirandClaude Opus 5.5 4140fd49c8 feat(cameras): turn off Frigate recording, snapshots and detection
Live view only now. Existing recordings/clips (~276 GB) and their DB rows
were deleted on the host.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 13:38:43 -05:00
ginnoirandClaude Opus 5.5 62751a3b89 fix(famapp,resume): pull MinIO from registry.ginnoir.com mirror
minio/minio disappeared from Docker Hub (pull access denied since
2026-10-22), so Portainer's pull-on-redeploy failed every poll and both
stacks were frozen. Re-pushed the last cached RELEASE.2025-09-07 image to
registry.ginnoir.com/mirror/minio and pointed both stacks at it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 03:36:18 -05:00
ginnoirandClaude Opus 5.5 5c8b108f2b fix(dev,resume): drop value-less env entries that blanked stack.env
A bare `- VAR` in `environment:` passes through Portainer's (empty) shell
env and overrides the env_file value with nothing. BookStack's APP_KEY and
DB_PASS, mariadb's MYSQL_* passwords, TZ, and minio_resume's OIDC client
id/secret were all arriving empty; BookStack only worked via its persisted
/config/www/.env. env_file already supplies every one of these, and the
stack.env values were verified to match the live ones before removal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 03:17:36 -05:00
ginnoirandClaude Opus 5.5 39b26e68d1 chore(dev): remove Plane
Deploy Caddyfile to valhalla / deploy (push) Successful in 1m24s
Plane had been broken since the June env_file cutover (bare DATABASE_URL /
SECRET_KEY entries overrode stack.env with empty values, so the migrator
never connected) and TB-018 already dropped it. It held one empty project.

Removes the 8 Plane services and their env from the dev stack, the
plane.ginnoir.com Caddy block, the Authentik forward-auth provider/app,
the nightly pg_dump and minio snapshot path, and stale doc references.
A final pg_dump + minio tarball is kept at ~/plane-final-20261026 on valhalla.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 03:02:49 -05:00
ginnoirandClaude Opus 5.5 f0ce040ed2 feat(media): add courarr for seasonal AniList anime lists
Deploy Caddyfile to valhalla / deploy (push) Successful in 21s
The Trakt "latest-anime" import list in Sonarr has silently added nothing
since its OAuth token lapsed on 2024-12-02. Courarr builds seasonal lists
straight from AniList (no key, no OAuth), maps them to TVDB via
Fribb/anime-lists, and serves them as Sonarr Custom List feeds at
http://courarr:6161/feed/<slug> over the media network.

courarr.ginnoir.com is internal-only behind Authentik forward auth
(provider homelab-courarr, pk 49); /api and /feed skip SSO.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 02:41:28 -05:00
ginnoirandClaude Opus 5.5 57c9a22464 docs: correct Caddy deploy runner names and timing in CLAUDE.md
Either act_runner (gitea_runner = valhalla-dev-runner, gitea_runner_ci =
valhalla-ci-runner-2) can pick up deploy-caddy.yml; checking only one
container's logs looked like a missed trigger. Runners now have
force_pull: false (host config) so a deploy takes ~25s instead of ~2min.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 02:37:50 -05:00
ginnoirandClaude Opus 5.5 9a45d53048 feat(streaming): add Jellyfin-backed jellyseerr at jellyseerr.ginnoir.com
Deploy Caddyfile to valhalla / deploy (push) Successful in 2m0s
Second Seerr instance pointed at Jellyfin, running alongside the
Plex-backed seerr until the Plex cutover.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 02:22:39 -05:00
ginnoirandClaude Opus 5.5 a50849b766 fix(media): on-complete hook reads author/title from end of MAM save path
autobrr's {{ .Category }} renders as "Audiobook/Non-Fiction", so the save
path is <Category>/<SubCategory>/<Author>/<Title>; indexing from the front
would have filed books under the subcategory as author.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 20:56:51 -05:00
ginnoirandClaude Opus 5.5 247276af25 feat(media): qBittorrent on-complete hook files MAM grabs into book libraries
AutoRun now runs on-complete.py: it keeps the cross-seed webhook and, for
category mam (autobrr MyAnonamouse filter), hardlinks audiobooks into the
ABS library and copies ebooks into the CWA ingest folder (CWA edits and then
deletes ingest files, so a hardlink would corrupt the seed). Host copy lives
at /config/qbittorrent/scripts/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 20:52:18 -05:00
ginnoirandClaude Opus 5.5 c76d24ac5b fix(streaming): pin jellyfin to 12.3ubu2604-ls56, exclude from watchtower
Watchtower's mid-day recreate caused ~9 min of Caddy 502s while
Jellyfin started silently on virtiofs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 14:42:30 -05:00
ginnoirandClaude Opus 5.5 c53052daee fix(media): pin qbittorrent to 5.2.4 (downgrade from 5.3.0)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 17:00:00 -05:00
ginnoirandClaude Opus 5.5 1f77238e35 fix(backup): install crontab root-owned so busybox crond runs it
busybox crond silently ignores a crontab not owned by root; the bind-mounted
/config/backup/crontab is ginnoir-owned, so no dump or freshness check had run
since the Oct 18 remount. Mount it at /crontab.src and install it 0600 root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 13:41:31 -05:00
ginnoirandClaude Opus 5.5 a09f7f6d52 docs(media): note storyteller CUDA pin is the v3 beta and where the v2 DB backup is
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 19:48:19 -05:00
ginnoirandClaude Opus 5.5 17743dfdcf feat(media): run Storyteller whisper on the P100 (CUDA 12.9 image)
Switch storyteller to the amd64-cuda-12.9.0 image with the P100 via CDI.
Tested on a 2-min clip: 3.9 s on GPU vs 25 s on the CPU build. The whisper
build lacks sm_60 kernels, so persist the PTX JIT cache under /data.
CUDA images are SHA-tagged only, so pin the tag and exclude from Watchtower.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 19:39:31 -05:00
ginnoirandClaude Opus 5.5 f51cc9c7e8 docs(media): widen autobrr freeleech limits
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 19:32:29 -05:00
ginnoirandClaude Opus 5.5 a7c34a7be4 docs(media): Sonarr/Radarr on-import hook into cross-seed
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 17:15:36 -05:00
ginnoirandClaude Opus 5.5 032185e258 docs(media): autobrr TL live, race filter, qbit racing prefs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 17:05:30 -05:00
ginnoirandClaude Opus 5.5 a92c417f03 feat(media): autobrr wired to qbit + cross-seed; ops API key; docs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 16:36:11 -05:00
ginnoirandClaude Opus 5.5 6e9f75220a feat(media): autobrr with Authentik OIDC
Deploy Caddyfile to valhalla / deploy (push) Successful in 42s
- autobrr service in the media stack (media + edge nets, /config/autobrr),
  native OIDC via Authentik provider homelab-autobrr (pk 48, ginnoir-only
  binding); built-in login disabled.
- Caddy: autobrr.ginnoir.com, internal_only, no forward_auth.
- Bookmarks regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 16:28:29 -05:00
ginnoirandClaude Opus 5.5 460ea266e5 docs(media): cross-seed live in inject mode — verification + share-limit notes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 16:22:01 -05:00
ginnoirandClaude Opus 5.5 cf0343c2f4 docs(media): cross-seed dry-run status + v6 save/linkDirs gotcha
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 16:03:52 -05:00
ginnoirandClaude Opus 5.5 a510504c7f fix(media): cross-seed qbit login creds in stack.env (qbit auth is on)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 15:59:22 -05:00
ginnoirandClaude Opus 5.5 ac367cc707 feat(media): cross-seed (dry-run) + move qbittorrent off the 6881 port
- qbittorrent: torrent port 6881 -> 43817 (6881-6889 is banned on many
  private trackers), plus a same-path /storage1 mount so cross-seed
  hardlinks resolve identically in both containers.
- cross-seed v6 daemon on the media net; config.js is host-managed at
  /config/cross-seed and reads API keys from stack.env. Starts in
  action "save" (dry run) against TorrentLeech.
- Plan: docs/superpowers/plans/2026-10-18-cross-seed-autobrr.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 15:58:23 -05:00
ginnoirandClaude Opus 5.5 6d8d34d996 fix(authentik): allow ABS /audiobookshelf-prefixed OIDC callbacks
Current Audiobookshelf serves under /audiobookshelf, so it sends
/audiobookshelf/auth/openid/callback, which Authentik rejected. Add the
prefixed callback + mobile-redirect URIs, and have setup-books-auth.py
sync redirect URIs on existing providers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 14:25:13 -05:00
ginnoirandClaude Opus 5.5 e1fd7acce9 fix(authentik): chaptarr verified-email mapping + ginnoir-only binding
Authentik's default email scope hardcodes email_verified=false, which
Chaptarr's OIDC rejects. Chaptarr gets its own verified email mapping,
and the app is bound to the ginnoir user so the email allowlist can't
be matched by another account.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 13:52:36 -05:00
ginnoirandClaude Opus 5.5 f92cad4d66 feat(media): chaptarr native OIDC instead of forward_auth
Deploy Caddyfile to valhalla / deploy (push) Successful in 1m23s
Chaptarr has built-in OIDC (/signin-oidc), so per the auth standard it
gets Pattern A: new homelab-chaptarr OAuth2 provider, old forward_auth
proxy provider removed, Caddy block reduced to internal_only + proxy.
setup-books-auth.py now handles both OIDC apps generically.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 13:46:49 -05:00
ginnoirandClaude Opus 5.5 e0240d8e10 fix(backup): make backup_scheduler actually run; add freshness alerting
busybox crond reads <dir>/<user>, but the crontab was mounted at
/etc/crontab, so no cron job had ever run: SQL dumps were last taken
2026-06-17 and the ntfy failure alerts never fired. Kopia's own server
schedule kept file snapshots going until its cache broke on 2026-08-28,
and nothing noticed for seven weeks.

- mount crontab at /etc/crontabs/root and run crond -c /etc/crontabs
- add hourly backup-check-freshness.sh: every Kopia source and the
  newest SQL dump must be <26h old and dumps must not be empty stubs;
  pushes UP/DOWN to the Uptime Kuma push monitor "Backups fresh" (#73),
  which also alerts via ntfy if no push arrives for 2h
- scheduler joins edge to reach uptime_kuma; jq added; KOPIA password
  and KUMA_PUSH_URL exported to /etc/backup.env for cron's bare env
- drop backup-run-snapshots.sh from cron (would duplicate the kopia
  server's 03:00 policy snapshots); keep it for manual runs
- bookstack dump used an unset MYSQL_PASSWORD (empty 20-byte gzip);
  dump_mariadb now takes the password env var name
- add immich-postgres and nextcloud-postgres dumps

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 03:13:35 -05:00
ginnoirandClaude Opus 5.5 72688f48ac feat(authentik): books-stack providers + ABS OIDC client
Deploy Caddyfile to valhalla / deploy (push) Failing after 1m37s
Adds idempotent scripts/run-books-auth.sh (ak shell) that creates
forward_single proxy providers for chaptarr/books/storyteller on the
embedded outpost and the homelab-audiobooks OIDC provider. Records the
ABS client credentials in media stack.env and marks host prep done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 02:44:32 -05:00
ginnoirandClaude Opus 5.5 ca00f8899d feat(media): add books stack (chaptarr, CWA, audiobookshelf, storyteller)
Chaptarr grabs ebooks into the CWA ingest folder and audiobooks into the
ABS library; Storyteller reads both read-only for read-along alignment.
All four are internal_only; chaptarr/CWA/storyteller use forward_auth,
ABS uses native OIDC. Adds STORYTELLER_SECRET_KEY to stack.env and a
BOOKS.md runbook (host prep, Authentik, post-deploy checklist).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 02:44:32 -05:00
37 changed files with 1111 additions and 692 deletions

No files matched your search

+1 -1
View File
@@ -31,7 +31,7 @@ The first `Bash` of a session is gated by a GateGuard hook — state the user re
| `notify` | `ntfy`, `freshrss`, `vigilant` | | `notify` | `ntfy`, `freshrss`, `vigilant` |
| `monitoring` | `uptime_kuma`, `homarr` | | `monitoring` | `uptime_kuma`, `homarr` |
| `remote` | `hbbr`, `hbbs` | | `remote` | `hbbr`, `hbbs` |
| `dev` | `gitea`, `code_server`, `bookstack`, `mariadb_bookstack`, `dbx`, `registry`, `postgres_gitea`, `postgres_plane`, `redis_plane`, `plane_minio`, `plane_api`, `plane_web`, `plane_worker`, `plane_beat`, `plane_create_bucket` | | `dev` | `gitea`, `code_server`, `bookstack`, `mariadb_bookstack`, `dbx`, `registry`, `postgres_gitea` |
| management plane (raw compose at `~/valhalla-lab/portainer-compose.yml`, project name `valhalla-lab`) | `portainer`, `vault`, `github_runner`, `watchtower` | | management plane (raw compose at `~/valhalla-lab/portainer-compose.yml`, project name `valhalla-lab`) | `portainer`, `vault`, `github_runner`, `watchtower` |
## Common ops by container name ## Common ops by container name
+1 -1
View File
@@ -31,7 +31,7 @@ The first `Bash` of a session is gated by a GateGuard hook — state the user re
| `notify` | `ntfy`, `freshrss`, `vigilant` | | `notify` | `ntfy`, `freshrss`, `vigilant` |
| `monitoring` | `uptime_kuma`, `homarr` | | `monitoring` | `uptime_kuma`, `homarr` |
| `remote` | `hbbr`, `hbbs` | | `remote` | `hbbr`, `hbbs` |
| `dev` | `gitea`, `code_server`, `bookstack`, `mariadb_bookstack`, `dbx`, `registry`, `postgres_gitea`, `postgres_plane`, `redis_plane`, `plane_minio`, `plane_api`, `plane_web`, `plane_worker`, `plane_beat`, `plane_create_bucket` | | `dev` | `gitea`, `code_server`, `bookstack`, `mariadb_bookstack`, `dbx`, `registry`, `postgres_gitea` |
| management plane (raw compose at `~/valhalla-lab/portainer-compose.yml`, project name `valhalla-lab`) | `portainer`, `vault`, `github_runner`, `watchtower` | | management plane (raw compose at `~/valhalla-lab/portainer-compose.yml`, project name `valhalla-lab`) | `portainer`, `vault`, `github_runner`, `watchtower` |
## Common ops by container name ## Common ops by container name
-7
View File
@@ -127,13 +127,6 @@ CODE_SERVER_PASSWORD=c0de_s3rver_pass
BOOKSTACK_DB_PASSWORD=bookstack_d3v_pass BOOKSTACK_DB_PASSWORD=bookstack_d3v_pass
BOOKSTACK_DB_ROOT_PASSWORD=bookstack_r00t_pass BOOKSTACK_DB_ROOT_PASSWORD=bookstack_r00t_pass
# Plane project management
# Rotate with: openssl rand -hex 32
PLANE_SECRET_KEY=60gp0byfz2dvffa45cxl20p1scy9xbpf6d8c5y0geejgkyp1b52
PLANE_DB_PASSWORD=plane_d3v_p4ss_8x3m
PLANE_MINIO_USER=planeadmin
PLANE_MINIO_PASSWORD=plane_minio_p4ss
# Vault unseal keys + root token (generated 2026-06-04 during init) # Vault unseal keys + root token (generated 2026-06-04 during init)
# Need any 3 of 5 keys to unseal after a restart. # Need any 3 of 5 keys to unseal after a restart.
# Re-unseal with: apply-compose.ps1 -VaultUnseal (or manually via SSH) # Re-unseal with: apply-compose.ps1 -VaultUnseal (or manually via SSH)
+3 -3
View File
@@ -16,7 +16,7 @@ Deployment configuration for a **live, single-host Docker homelab** running on a
. .
├── stacks/ # one directory per Portainer-managed application stack ├── stacks/ # one directory per Portainer-managed application stack
│ ├── proxy/ # caddy │ ├── proxy/ # caddy
│ ├── media/ # *arr stack, deluge, qbittorrent, stash, ... │ ├── media/ # *arr stack, qbittorrent, cross-seed, autobrr, stash, ...
│ ├── foundry/ # foundry, foundry2 (5etools is Caddy static files) │ ├── foundry/ # foundry, foundry2 (5etools is Caddy static files)
│ ├── owncloud/ # owncloud + its mariadb + redis │ ├── owncloud/ # owncloud + its mariadb + redis
│ ├── resume/ # reactive-resume + its postgres + minio + chrome │ ├── resume/ # reactive-resume + its postgres + minio + chrome
@@ -25,7 +25,7 @@ Deployment configuration for a **live, single-host Docker homelab** running on a
│ ├── notify/ # ntfy, freshrss, vigilant │ ├── notify/ # ntfy, freshrss, vigilant
│ ├── monitoring/ # uptime-kuma, homarr │ ├── monitoring/ # uptime-kuma, homarr
│ ├── remote/ # rustdesk hbbr + hbbs │ ├── remote/ # rustdesk hbbr + hbbs
│ ├── dev/ # code-server, bookstack, dbx, plane │ ├── dev/ # code-server, bookstack, dbx
│ └── cameras/ # neolink (Reolink E1 Baichuan→RTSP), frigate, frigate-notify │ └── cameras/ # neolink (Reolink E1 Baichuan→RTSP), frigate, frigate-notify
├── portainer-compose.yml # management plane (raw compose, not a Portainer stack) ├── portainer-compose.yml # management plane (raw compose, not a Portainer stack)
├── vault.hcl # vault config (deployed alongside portainer-compose.yml) ├── vault.hcl # vault config (deployed alongside portainer-compose.yml)
@@ -197,7 +197,7 @@ These run on valhalla but are managed outside of Portainer/Docker.
- `Caddyfile` proxies `matrix.ginnoir.com → localhost:8008`, but there is **no Matrix/Synapse service in compose** — it's external/legacy. Likewise `dev.ginnoir.com → 192.168.1.74:3000` points at a different LAN host. - `Caddyfile` proxies `matrix.ginnoir.com → localhost:8008`, but there is **no Matrix/Synapse service in compose** — it's external/legacy. Likewise `dev.ginnoir.com → 192.168.1.74:3000` points at a different LAN host.
- `watchtower` auto-updates `:latest` images, so a running image can drift ahead of what the last `apply` pulled. **Infra images** (Postgres, MariaDB, Redis, MinIO, CouchDB, Caddy, Vault) are **version-pinned** in compose with `com.centurylabs.watchtower.enable=false`; bump tags manually every few months. - `watchtower` auto-updates `:latest` images, so a running image can drift ahead of what the last `apply` pulled. **Infra images** (Postgres, MariaDB, Redis, MinIO, CouchDB, Caddy, Vault) are **version-pinned** in compose with `com.centurylabs.watchtower.enable=false`; bump tags manually every few months.
- Line endings: `.gitattributes` forces **LF** so files stay Unix-clean. Pushing CRLF (especially `stack.env`) to the Linux host appends stray `\r` to values and breaks things. - Line endings: `.gitattributes` forces **LF** so files stay Unix-clean. Pushing CRLF (especially `stack.env`) to the Linux host appends stray `\r` to values and breaks things.
- **Caddyfile reloads** are handled by `.gitea/workflows/deploy-caddy.yml` (Gitea Actions, `valhalla-management-runner`). If Gitea Actions doesn't trigger, fall back to `apply-compose.ps1 -Caddy`. The GitHub workflow (`.github/workflows/deploy.yml`) is disabled. - **Caddyfile reloads** are handled by `.gitea/workflows/deploy-caddy.yml` (Gitea Actions). Either runner container can take the job: `gitea_runner` (registered in Gitea as `valhalla-dev-runner`; the `GITEA_RUNNER_NAME` env is only read at first registration) or `gitea_runner_ci` (`valhalla-ci-runner-2`), so check both containers' logs, or better, the run list in Gitea. A deploy takes ~25s from the **push** (Gitea activity feed), not from the commit time. If Gitea Actions doesn't trigger, fall back to `apply-compose.ps1 -Caddy`. The GitHub workflow (`.github/workflows/deploy.yml`) is disabled.
- **famapp images** are built by Gitea Actions on `v*` tags and pushed to `registry.ginnoir.com/ginnoir/famapp`. Portainer pulls from the self-hosted registry (registered in Portainer as "Valhalla Registry"). - **famapp images** are built by Gitea Actions on `v*` tags and pushed to `registry.ginnoir.com/ginnoir/famapp`. Portainer pulls from the self-hosted registry (registered in Portainer as "Valhalla Registry").
- **Portainer app stacks must have empty UI environment variables.** All stack config comes from `stack.env` via `env_file`. Run `scripts/check-portainer-stack-env.ps1` to verify before pushing. - **Portainer app stacks must have empty UI environment variables.** All stack config comes from `stack.env` via `env_file`. Run `scripts/check-portainer-stack-env.ps1` to verify before pushing.
+74 -29
View File
@@ -139,6 +139,10 @@ jellyfin.ginnoir.com {
reverse_proxy jellyfin:8096 reverse_proxy jellyfin:8096
} }
jellyseerr.ginnoir.com {
reverse_proxy jellyseerr:5055
}
wizarr.ginnoir.com { wizarr.ginnoir.com {
reverse_proxy wizarr:5690 reverse_proxy wizarr:5690
} }
@@ -161,6 +165,24 @@ sonarr.ginnoir.com {
} }
} }
courarr.ginnoir.com {
route {
import internal_gate
import authentik_outpost
# API (X-Api-Key) and feeds (read by Sonarr) skip SSO; Courarr gates /api itself.
handle /api/* {
reverse_proxy courarr:6161
}
handle /feed/* {
reverse_proxy courarr:6161
}
handle {
import authentik_forward_auth
reverse_proxy courarr:6161
}
}
}
radarr.ginnoir.com { radarr.ginnoir.com {
route { route {
import internal_gate import internal_gate
@@ -275,6 +297,58 @@ stash.ginnoir.com {
} }
} }
# BOOKS — CWA / storyteller behind forward_auth; chaptarr + ABS use native OIDC
# (forward_auth would break the ABS mobile app). All internal_only — remote access
# is via the tailnet (100.64.0.0/10 is already allowed by internal_only).
chaptarr.ginnoir.com {
import internal_only
reverse_proxy chaptarr:8789
}
# autobrr — native OIDC (Authentik homelab-autobrr), so no forward_auth.
autobrr.ginnoir.com {
import internal_only
reverse_proxy autobrr:7474
}
books.ginnoir.com {
import internal_only
route {
import authentik_outpost
# OPDS + Kobo sync clients authenticate with CWA's own credentials.
handle /opds* {
reverse_proxy calibre-web-automated:8083
}
handle /kobo/* {
reverse_proxy calibre-web-automated:8083
}
handle {
import authentik_forward_auth
reverse_proxy calibre-web-automated:8083
}
}
}
audiobooks.ginnoir.com {
import internal_only
reverse_proxy audiobookshelf:80
}
storyteller.ginnoir.com {
import internal_only
route {
import authentik_outpost
# Storyteller Reader app talks to the API with its own tokens.
handle /api/* {
reverse_proxy storyteller:8001
}
handle {
import authentik_forward_auth
reverse_proxy storyteller:8001
}
}
}
# ============================================================= # =============================================================
# GAMES / ROMS — internal only # GAMES / ROMS — internal only
# External access for a trusted friend is via the `share` stack's Tailscale # External access for a trusted friend is via the `share` stack's Tailscale
@@ -584,35 +658,6 @@ docs.ginnoir.com {
reverse_proxy bookstack:80 reverse_proxy bookstack:80
} }
plane.ginnoir.com {
route {
import authentik_outpost
@plane_api {
path /api/*
header X-API-Key *
}
handle @plane_api {
reverse_proxy plane_api:8000
}
handle /api/* {
import authentik_forward_auth
reverse_proxy plane_api:8000
}
handle /auth/* {
import authentik_forward_auth
reverse_proxy plane_api:8000
}
handle /god-mode/* {
import authentik_forward_auth
reverse_proxy plane_admin:3000
}
handle {
import authentik_forward_auth
reverse_proxy plane_web:3000
}
}
}
# ============================================================= # =============================================================
# FILES / DOCUMENTS — internal only # FILES / DOCUMENTS — internal only
# files.ginnoir.com is the primary domain; nextcloud.ginnoir.com is an alias. # files.ginnoir.com is the primary domain; nextcloud.ginnoir.com is an alias.
+7 -1
View File
@@ -31,12 +31,14 @@
<DT><H3>STREAMING — public (replaces Plex's own remote access) (public)</H3> <DT><H3>STREAMING — public (replaces Plex's own remote access) (public)</H3>
<DL><p> <DL><p>
<DT><A HREF="https://jellyfin.ginnoir.com">jellyfin</A> <DT><A HREF="https://jellyfin.ginnoir.com">jellyfin</A>
<DT><A HREF="https://jellyseerr.ginnoir.com">jellyseerr</A>
<DT><A HREF="https://wizarr.ginnoir.com">wizarr</A> <DT><A HREF="https://wizarr.ginnoir.com">wizarr</A>
</DL><p> </DL><p>
<DT><H3>MEDIA MANAGEMENT (public)</H3> <DT><H3>MEDIA MANAGEMENT (public)</H3>
<DL><p> <DL><p>
<DT><A HREF="https://sonarr.ginnoir.com">sonarr</A> <DT><A HREF="https://sonarr.ginnoir.com">sonarr</A>
<DT><A HREF="https://courarr.ginnoir.com">courarr</A>
<DT><A HREF="https://radarr.ginnoir.com">radarr</A> <DT><A HREF="https://radarr.ginnoir.com">radarr</A>
<DT><A HREF="https://bazarr.ginnoir.com">bazarr</A> <DT><A HREF="https://bazarr.ginnoir.com">bazarr</A>
<DT><A HREF="https://prowlarr.ginnoir.com">prowlarr</A> <DT><A HREF="https://prowlarr.ginnoir.com">prowlarr</A>
@@ -50,6 +52,11 @@
<DT><A HREF="https://nzbget.ginnoir.com">nzbget</A> <DT><A HREF="https://nzbget.ginnoir.com">nzbget</A>
<DT><A HREF="https://whisparr.ginnoir.com">whisparr</A> <DT><A HREF="https://whisparr.ginnoir.com">whisparr</A>
<DT><A HREF="https://stash.ginnoir.com">stash</A> <DT><A HREF="https://stash.ginnoir.com">stash</A>
<DT><A HREF="https://chaptarr.ginnoir.com">chaptarr [internal]</A>
<DT><A HREF="https://autobrr.ginnoir.com">autobrr [internal]</A>
<DT><A HREF="https://books.ginnoir.com">books [internal]</A>
<DT><A HREF="https://audiobooks.ginnoir.com">audiobooks [internal]</A>
<DT><A HREF="https://storyteller.ginnoir.com">storyteller [internal]</A>
<DT><A HREF="https://roms.ginnoir.com">roms</A> <DT><A HREF="https://roms.ginnoir.com">roms</A>
<DT><A HREF="https://romhacks.ginnoir.com">romhacks</A> <DT><A HREF="https://romhacks.ginnoir.com">romhacks</A>
<DT><A HREF="https://jd.ginnoir.com">jd [internal]</A> <DT><A HREF="https://jd.ginnoir.com">jd [internal]</A>
@@ -105,7 +112,6 @@
<DT><A HREF="https://dbx.ginnoir.com">dbx</A> <DT><A HREF="https://dbx.ginnoir.com">dbx</A>
<DT><A HREF="https://vault.ginnoir.com">vault</A> <DT><A HREF="https://vault.ginnoir.com">vault</A>
<DT><A HREF="https://docs.ginnoir.com">docs [internal]</A> <DT><A HREF="https://docs.ginnoir.com">docs [internal]</A>
<DT><A HREF="https://plane.ginnoir.com">plane</A>
<DT><A HREF="https://nextcloud.ginnoir.com">nextcloud [internal]</A> <DT><A HREF="https://nextcloud.ginnoir.com">nextcloud [internal]</A>
<DT><A HREF="https://office.ginnoir.com">office [internal]</A> <DT><A HREF="https://office.ginnoir.com">office [internal]</A>
</DL><p> </DL><p>
+8 -1
View File
@@ -46,9 +46,15 @@
<DT><A HREF="http://valhalla:5055">seerr</A> <DT><A HREF="http://valhalla:5055">seerr</A>
<DT><A HREF="http://valhalla:8181">tautulli</A> <DT><A HREF="http://valhalla:8181">tautulli</A>
<DT><A HREF="http://valhalla:3232">qbittorrent :3232</A> <DT><A HREF="http://valhalla:3232">qbittorrent :3232</A>
<DT><A HREF="http://valhalla:6881">qbittorrent :6881 (TCP/UDP)</A> <DT><A HREF="http://valhalla:43817">qbittorrent :43817 (TCP/UDP)</A>
<DT><A HREF="http://valhalla:7474">autobrr</A>
<DT><A HREF="http://valhalla:6969">whisparr</A> <DT><A HREF="http://valhalla:6969">whisparr</A>
<DT><A HREF="http://valhalla:6971">stash :6971</A> <DT><A HREF="http://valhalla:6971">stash :6971</A>
<DT><A HREF="http://valhalla:8789">chaptarr</A>
<DT><A HREF="http://valhalla:8083">calibre-web-automated</A>
<DT><A HREF="http://valhalla:13378">audiobookshelf :13378</A>
<DT><A HREF="http://valhalla:8001">storyteller</A>
<DT><A HREF="http://valhalla:6161">courarr</A>
</DL><p> </DL><p>
<DT><H3>Monitoring</H3> <DT><H3>Monitoring</H3>
@@ -113,6 +119,7 @@
<DT><A HREF="http://valhalla:8096">jellyfin</A> <DT><A HREF="http://valhalla:8096">jellyfin</A>
<DT><A HREF="http://valhalla:3009">jellystat :3009</A> <DT><A HREF="http://valhalla:3009">jellystat :3009</A>
<DT><A HREF="http://valhalla:5690">wizarr</A> <DT><A HREF="http://valhalla:5690">wizarr</A>
<DT><A HREF="http://valhalla:5056">jellyseerr :5056</A>
</DL><p> </DL><p>
</DL><p> </DL><p>
@@ -0,0 +1,237 @@
# cross-seed + autobrr in the media stack — plan
**Goal:** build tracker standing (seed volume, ratio, buffer) on TorrentLeech now — and on every
private tracker joined later — without spending disk or ratio, so the BTN/PTP-tier recruitment
requirements come for free.
- **cross-seed** matches files already on disk against tracker uploads and injects them into
qBittorrent via hardlinks → instant seeding, zero new downloads, zero new disk.
- **autobrr** watches tracker IRC announce channels and grabs freeleech uploads in the first minutes
(when peers are hungry) → ratio buffer without risking ratio.
## What's there today (checked 2026-10-18)
| Thing | State | Consequence |
|---|---|---|
| qBittorrent | 3 torrents total; library is ~all usenet (dognzb / nzb.life / altHUB) | cross-seed's value is **data-mode** (library → trackers), not torrent-mode |
| qBittorrent port | `6881`, UPnP off | 6881–6889 is **banned on many private trackers**; must move + forward on OPNsense |
| qBittorrent share limits | global ratio 1 / 14400 min (10 d) | fine for TL's H&R rule, but would stop cross-seeds that cost nothing to keep seeding |
| Mounts | qbit `/storage1/complete:/downloads`; library at `/storage1/{TV,Movies,Anime}` (`/storage1/Media/*` are symlinks to these) | hardlinks work on the virtiofs `/storage1` (verified), but **not across two bind mounts** (`EXDEV`) — link source and target must be under ONE container mount |
| Prowlarr | TL = indexer **id 8** (only private torrent indexer); nyaa/sukebei disabled | cross-seed gets TL's Torznab via Prowlarr; new trackers get added there first |
| Free space | `/storage1` 15 T free (85 %), no redundancy | autobrr must be size- and count-capped |
## Design
```
IRC announce (TL #tlannounces, later others)
│
autobrr ──(freeleech filter)──► qBittorrent [cat: autobrr]
│ │ on-complete hook
└──(announce webhook)──┐ ▼
▼ cross-seed daemon :2468
/storage1/{TV,Movies,Anime} ──(dataDirs scan)──► │ ──Torznab──► prowlarr:9696/<id>/api
└─ hardlink into /storage1/cross-seed-links
+ inject into qBittorrent [cat: cross-seed]
```
- Both qbit and cross-seed mount **`/storage1:/storage1`** (same path inside and out). qbit keeps its
existing `/downloads` mount too, so Sonarr/Radarr's download-client paths don't change.
- Link dir: **`/storage1/cross-seed-links`** — a sibling of `complete/`, so nzbget/Sonarr never see it.
- New autobrr grabs save to `/storage1/complete/autobrr` (absolute path, under the `/storage1` mount)
so cross-seed can hardlink from them too. The 3 legacy `/downloads/...` torrents are left out
(linking from them would cross mounts) — not worth migrating.
- cross-seed has no web UI → `media` net only, no Caddy. autobrr has a UI → `edge` + Caddy +
Authentik **Pattern A** (autobrr has native OIDC).
- Secrets go in `stacks/media/stack.env` (repo convention). cross-seed's `config.js` is plain JS, so
it reads them via `process.env.*` — no secrets in the host-managed config file.
## Phase 0 — prerequisites (ginnoir, manual)
1. Torrent port chosen: **43817** (6881–6889 / 51413 are banned on many trackers).
2. OPNsense → Firewall → NAT → Port Forward: TCP+UDP `43817` → `192.168.1.69:43817` (GUI, never
hand-edit `config.xml`).
3. TL IRC: register a nick on TL's IRC network and note the announce channel + the IRC/announce key
from your TL profile (autobrr's TL preset lists exactly which fields it needs).
4. Decide: autobrr disk budget (suggest max **1 TB** live in the `autobrr` category) and whether your
upload bandwidth is good enough to race (≥ 100 Mbit up is comfortable; below that, keep filters tight).
## Phase 1 — qBittorrent prep (`stacks/media/docker-compose.yml`)
- `qbittorrent`: `TORRENTING_PORT=43817`, ports `43817:43817` tcp+udp (drop 6881), add volume
`/storage1:/storage1`.
- After redeploy, in qBittorrent (WebUI or API):
- category `cross-seed` → save path `/storage1/cross-seed-links`, share limits **unlimited**.
- category `autobrr` → save path `/storage1/complete/autobrr`, share limit e.g. ratio 3 **or**
21 d, then *remove torrent (keep files only if cross-seeded)* — pick the stricter of TL's H&R rules.
- global limit: leave ratio 1 / 10 d for `tv`/`movies` (Sonarr grabs). Confirm what the
current limit *action* is (pause vs remove) before changing anything.
- Options → Downloads → "Run external program on torrent finished":
`curl -s -XPOST http://cross-seed:2468/api/webhook?apikey=<CROSS_SEED_API_KEY> --data-urlencode "infoHash=%I" --data-urlencode "includeSingleEpisodes=true"`
- Verify: TL profile shows **Connectable: yes** on the new port.
## Phase 2 — cross-seed
Compose:
```yaml
cross-seed:
image: ghcr.io/cross-seed/cross-seed:6 # pin the major; verify current major on deploy
container_name: cross-seed
restart: unless-stopped
networks: [media]
user: 1000:1000 # match PUID/PGID so links keep ownership
env_file:
- stack.env
command: daemon
volumes:
- /config/cross-seed:/config
- /storage1:/storage1
```
`/config/cross-seed/config.js` (host-managed; bootstrap with `docker run … gen-config`):
- `torznab`: `[\`http://prowlarr:9696/8/api?apikey=${process.env.PROWLARR_API_KEY}\`]` — one entry
per **private torrent** indexer in Prowlarr; never public ones.
- `torrentClients`: `[\`qbittorrent:http://${user}:${pass}@qbittorrent:3232\`]` from env.
- `dataDirs`: `/storage1/TV`, `/storage1/Movies`, `/storage1/Anime` (real paths, not the
`/storage1/Media` symlinks); `linkDirs`: `["/storage1/cross-seed-links"]`; `linkType: "hardlink"`.
- `useClientTorrents: true`, `matchMode: "partial"`, `maxDataDepth: 3`, `includeSingleEpisodes: false`
(searching every episode floods TL; the qbit hook passes `includeSingleEpisodes=true` per call).
- **v6 gotcha:** `action: "save"` is rejected when `linkDirs` is set, so the dry run runs with
`linkDirs: []` and `seasonFromEpisodes: null`; restore both when flipping to `inject`.
- `action: "save"` **first** (dry run → `.torrent` files in `/config/output`), flip to `"inject"`
once matches look right; `linkCategory: "cross-seed"`, `duplicateCategories: false`.
- Rate limits — be gentle with TL's API: `delay: 30`, `searchCadence: "1 day"`, `searchLimit: 400`,
`excludeOlder: "2 weeks"` (relative to an item's *first* search), `excludeRecentSearch: "3 days"`.
- `notificationWebhookUrl` → ntfy topic.
- `apiKey: process.env.CROSS_SEED_API_KEY`.
`stack.env` additions: `CROSS_SEED_API_KEY`, `PROWLARR_API_KEY`, `SONARR_API_KEY`, `RADARR_API_KEY`
(Sonarr/Radarr give ID lookups so renamed library files still match). qbit WebUI auth is disabled
(`WebUI\AuthenticationEnabled=false`), so `torrentClients` has no credentials.
At 400 searches/day the first pass over the library takes weeks — that's intended.
## Phase 3 — autobrr
Compose:
```yaml
autobrr:
image: ghcr.io/autobrr/autobrr:latest
container_name: autobrr
restart: unless-stopped
networks: [media, edge]
user: 1000:1000
env_file:
- stack.env
volumes:
- /config/autobrr:/config
ports:
- "7474:7474"
```
- **Authentik (Pattern A):** provider `homelab-autobrr` + application `autobrr` with the standard
IDs from CLAUDE.md (explicit `grant_types` + `signing_key`). Confirm autobrr's current OIDC env
var names and callback path from its docs at deploy time (expected
`https://autobrr.ginnoir.com/api/auth/oidc/callback`); add `AUTOBRR__OIDC_*` to `stack.env`.
- **Caddyfile:** `autobrr.ginnoir.com { import internal_gate … reverse_proxy autobrr:7474 }`
(no forward_auth — native OIDC), then `./scripts/gen-bookmarks.ps1`.
- In autobrr UI:
- IRC network: TL preset (nick + IRC key from Phase 0).
- Download client: qBittorrent `http://qbittorrent:3232`, category `autobrr`, rules: max active
downloads 3, ignore slow torrents.
- Filter **TL-freeleech**: freeleech only, size 1–40 GB, resolutions 1080p/2160p, max 10
downloads/day; exclude what Sonarr/Radarr already handle if you want pure buffer.
- Second action on every filter: **Webhook** → `http://cross-seed:2468/api/announce` (cross-seed's
announce endpoint) so new releases on *other* trackers race against data we already have.
- Notifications → ntfy.
## Phase 4 — monitoring
- Uptime Kuma: HTTP monitor `http://autobrr:7474/api/healthz/liveness`; HTTP monitor
`http://cross-seed:2468/api/ping`.
- Weekly reaper for dead links: torrents removed from qbit leave hardlinks behind in
`/storage1/cross-seed-links`. Add a host timer (or qbit_manage later) that deletes files there with
link count 1 and no owning torrent. **Deferred** until the first month shows how much accumulates.
## Phase 5 — rollout order & verification
1. Phase 0 manual steps → confirm Connectable on TL.
2. Push Phase 1 compose change → wait for Portainer redeploy → set categories/hook.
3. Push cross-seed in `action: save` → check `/config/output` and logs after ~1 h for sane matches
(correct release names, sizes, no partial-junk).
4. Flip to `inject` → spot-check 3 injected torrents: 100 % complete on recheck, seeding, files in
`cross-seed-links` share an inode with the library file (`stat -c %i`).
5. Push autobrr + Caddy + Authentik → log in via SSO → enable the TL filter → watch the first grab
land in category `autobrr` and its webhook reach cross-seed.
6. After a week: TL seed size / bonus points up, no H&R warnings, free space drop ≤ autobrr budget.
## When a new tracker is joined
1. Add it in Prowlarr (it syncs to Sonarr/Radarr).
2. Append its Torznab URL to cross-seed's `torznab` list → restart cross-seed → it backfills.
3. Add its IRC preset + a freeleech filter in autobrr.
4. Set a per-tracker share limit in qBittorrent matching its H&R rule.
## Docs / memory
- CLAUDE.md layout line for `media/`: mention cross-seed + autobrr.
- New memory + Obsidian note: cross-seed hardlink layout (`/storage1:/storage1` both sides, `EXDEV`
across bind mounts), port-change reason, TL Prowlarr id 8.
## Out of scope (noted)
- Sonarr/Radarr import as **copies** today (download and library are separate bind mounts). A
TRaSH-style single `/storage1` mount across *arrs + clients would make imports hardlinks too; worth
its own plan.
## Status (2026-10-18)
- **Phase 1 done:** qbit on port 43817 (forwarded, externally reachable; UPnP off), `/storage1` mount,
`cross-seed` category, completion hook. qbit WebUI auth is **on** (the conf's
`AuthenticationEnabled=false` is misleading); cross-seed uses Sonarr's qbit login via
`QBIT_USER`/`QBIT_PASS`.
- **Phase 2 live in inject mode.** Dry run: 6 matches in the first 29 of 3320 searchees, all 100 %
of video bytes (AT S7 partial: 25/75 files = only nfo/srt extras missing, auto-resumed). Injected
6/6 + 1 live; 95 files all link-count 2 with library inodes; `df` unchanged. Links land in
`/storage1/cross-seed-links/<Tracker>/<release>`, ATM off, save path set per torrent.
- **Share limits:** qbit WebAPI 2.15 ignores share limits on `editCategory` → set
`ratio/seeding/inactive = -1` directly in `categories.json` (qbit stopped; backup
`categories.json.bak-2026-10-18`). Injected torrents carry `-2` (inherit), which should resolve to
the category's `-1` on qBittorrent 5.x; the first 7 were also set to `-1` per torrent
(`setShareLimits` needs `shareLimitAction` or it 400s). **Check in ~10 days** that new
cross-seeds aren't stopped at ratio 1 / 10 d (global action = Stop).
- **Phase 3 deployed (2026-10-18):** autobrr v1.88.0, Authentik provider `homelab-autobrr` (pk 48,
app slug `autobrr`, ginnoir-only user binding), built-in login disabled (OIDC only; onboarding is
skipped when OIDC is on). Caddy `autobrr.ginnoir.com` internal_only. Scripted-ops API key =
`AUTOBRR_API_KEY` (inserted straight into the `api_key` table; header `X-API-Token`). API routes:
`/api/downloaders` (not download_clients); filter POSTs need every array field as `[]` or SQLite
NOT NULL fails.
- Download client 1 = qbit (same login), rules: 3 active max, ignore slow when maxed.
- qbit category `autobrr` → `/storage1/complete/autobrr`, ratio 2 **or** 14 d →
**RemoveWithContent** (cross-seeded copies survive via their own hardlinks).
- Filter 1 **TL freeleech** (prio 10): freeleech, 1–20 GB, 1080p/2160p, 5/day → qbit + cross-seed
announce webhook. Filter 2 **cross-seed announce (all)** (prio 0) → webhook only. Both created
**disabled with no indexer**; they need TL attached.
- Uptime Kuma monitor 82 (`/api/healthz/liveness`). No cross-seed monitor yet: the MCP
`createMonitor` can't set `docker_container`.
- **TL attached + live (2026-10-18 17:03).** autobrr IRC wedged after API network restarts
(no IDENTIFY/JOIN); a plain `docker restart autobrr` fixed it. Don't loop reconnects (TL bans join/quit).
- **Race filter added (symmetric gigabit):** Filter 3 **TL race (non-FL)** (prio 5): `TV :: Episodes HD`,
1080p WEB/WEB-DL, groups FLUX/NTb/EDITH/ETHEL/BLOOM/SuccessfulCrab/APEX, 1–5 GB, 3/day → qbit
`autobrr` + cross-seed webhook. (Indexers only attach via PUT with every array field present.)
qbit tuned for racing + large cross-seed counts: unlimited upload slots and active
torrents/uploads, 5 active downloads with slow ones not counted, 1000 connections (200 per torrent).
- **Usenet imports → cross-seed (2026-10-18):** Sonarr + Radarr each have a Custom Script connection
"cross-seed" (id 4, On Import + On Upgrade) running host-managed `/config/{sonarr,radarr}/scripts/cross-seed-import.sh`
(`/config/scripts/...` in the container). It maps `/tv`, `/anime`, `/movies` → `/storage1/{TV,Anime,Movies}` and
POSTs `path=` to cross-seed's `/api/webhook` with `includeSingleEpisodes=true`. Multi-file Sonarr imports
also post the season folder (packs). Key comes from `CROSS_SEED_API_KEY` (shared stack.env). Tested:
204, and cross-seed resolves IDs and searches immediately.
- **Freeleech widened (2026-10-18):** filter 1 is now 1–30 GB, any resolution, 12/day. autobrr client rule
is 8 active downloads (ignore slow when maxed); qbit max_active_downloads 10 (slow not counted). Worst
case ~5 TB live in `autobrr` (12 × 30 GB × 14 d); in practice far less, since ratio 2 removes early. The
client is updated with `PUT /api/downloaders` (not `/downloaders/{id}`) and must resend the password.
- **Review ~2026-10-25:** ratio on `autobrr`-category torrents grabbed by the race filter. If it's
above 1.0, widen (more per day, movies, bigger sizes). Below ~0.7, disable the filter.
@@ -1,6 +1,6 @@
# TB-018 — Is Plane worth it? # TB-018 — Is Plane worth it?
**Status:** dropped **Status:** dropped — stack removed from repo + host 2026-10-26 (final dump in ~/plane-final-20261026 on valhalla)
**Your call:** _(unset — talk first)_ **Your call:** _(unset — talk first)_
--- ---
+9
View File
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
# Creates the books-stack Authentik providers/apps (idempotent). Run on valhalla.
# Copies the OIDC client ids/secrets out on success.
set -euo pipefail
here="$(cd "$(dirname "$0")" && pwd)"
docker cp "$here/setup-books-auth.py" authentik_server:/tmp/setup-books-auth.py
docker exec authentik_server ak shell -c "exec(open('/tmp/setup-books-auth.py').read())" 2>&1 | grep -E '^(PROXY|OIDC)|Error|Traceback'
docker cp authentik_server:/tmp/books-oidc.env "${1:-./books-oidc.env}"
docker exec authentik_server rm -f /tmp/books-oidc.env /tmp/setup-books-auth.py
+131
View File
@@ -0,0 +1,131 @@
# Authentik objects for the books stack (see stacks/media/BOOKS.md).
# Idempotent. Run via scripts/run-books-auth.sh (ak shell inside authentik_server).
# - forward_single proxy providers for books (CWA) / storyteller, cloned from
# homelab-sonarr and attached to the embedded outpost (Pattern B)
# - native OIDC providers for chaptarr + audiobookshelf (Pattern A)
# Writes the OIDC client ids/secrets to /tmp/books-oidc.env in the container.
from authentik.core.models import Application
from authentik.crypto.models import CertificateKeyPair
from authentik.flows.models import Flow
from authentik.outposts.models import Outpost
from authentik.providers.oauth2.models import OAuth2Provider
from authentik.providers.proxy.models import ProxyMode, ProxyProvider
AUTH_FLOW = Flow.objects.get(pk="b88daebc-c54d-4e85-ae27-8b47384d5d74")
INVALIDATION_FLOW = Flow.objects.get(pk="3259f9c5-7eab-40bf-81cb-2b0ede6eb7b3")
SIGNING_KEY = CertificateKeyPair.objects.get(pk="dc7cbd9e-c6d2-4168-b402-e7570bcb59d1")
SCOPES = [
"718abef2-504c-452c-9ff0-329eda8031c7", # openid
"19491dd8-d239-41a4-aa48-030c1471779d", # email
"ca45a8da-db62-41ba-b1c4-e669bf3c9a82", # profile
]
template = ProxyProvider.objects.get(name="homelab-sonarr")
outpost = Outpost.objects.get(managed="goauthentik.io/outposts/embedded")
FORWARD = [
# (slug, app name, host)
("books", "Calibre-Web Automated", "books.ginnoir.com"),
("storyteller", "Storyteller", "storyteller.ginnoir.com"),
]
for slug, app_name, host in FORWARD:
p, created = ProxyProvider.objects.get_or_create(
name=f"homelab-{slug}",
defaults=dict(
mode=ProxyMode.FORWARD_SINGLE,
external_host=f"https://{host}",
authorization_flow=AUTH_FLOW,
invalidation_flow=INVALIDATION_FLOW,
intercept_header_auth=template.intercept_header_auth,
access_token_validity=template.access_token_validity,
),
)
if created:
p.property_mappings.set(template.property_mappings.all())
outpost.providers.add(p)
app, _ = Application.objects.update_or_create(
slug=slug,
defaults=dict(name=app_name, provider=p, meta_launch_url=f"https://{host}"),
)
print(f"PROXY {slug}: provider pk={p.pk} created={created} app={app.slug}")
# chaptarr started on forward_auth; it has native OIDC, so drop the proxy provider.
old = ProxyProvider.objects.filter(name="homelab-chaptarr").first()
if old:
outpost.providers.remove(old)
old.delete()
print("PROXY chaptarr: removed old forward_auth provider")
outpost.save() # nudge the embedded outpost to pick up provider changes
def redirect(url):
return {"url": url, "matching_mode": "strict", "redirect_uri_type": "authorization"}
OIDC = [
# (slug, app name, host, env prefix, redirect URIs)
("chaptarr", "Chaptarr", "chaptarr.ginnoir.com", "CHAPTARR_OIDC", [
redirect("https://chaptarr.ginnoir.com/signin-oidc"),
]),
("audiobooks", "Audiobookshelf", "audiobooks.ginnoir.com", "ABS_OIDC", [
# ABS 2.2x+ serves under /audiobookshelf; keep the unprefixed pair too.
redirect("https://audiobooks.ginnoir.com/audiobookshelf/auth/openid/callback"),
redirect("https://audiobooks.ginnoir.com/audiobookshelf/auth/openid/mobile-redirect"),
redirect("https://audiobooks.ginnoir.com/auth/openid/callback"),
redirect("https://audiobooks.ginnoir.com/auth/openid/mobile-redirect"),
redirect("audiobookshelf://oauth"),
]),
]
lines = []
for slug, app_name, host, prefix, uris in OIDC:
p, created = OAuth2Provider.objects.get_or_create(
name=f"homelab-{slug}",
defaults=dict(
client_type="confidential",
authorization_flow=AUTH_FLOW,
invalidation_flow=INVALIDATION_FLOW,
sub_mode="hashed_user_id",
signing_key=SIGNING_KEY,
grant_types=["authorization_code", "refresh_token"],
_redirect_uris=uris,
),
)
if created:
p.property_mappings.set(SCOPES)
if p._redirect_uris != uris:
p._redirect_uris = uris
p.save()
print(f"OIDC {slug}: redirect URIs updated")
Application.objects.update_or_create(
slug=slug,
defaults=dict(name=app_name, provider=p, meta_launch_url=f"https://{host}"),
)
print(f"OIDC {slug}: provider pk={p.pk} created={created}")
lines += [f"{prefix}_CLIENT_ID={p.client_id}", f"{prefix}_CLIENT_SECRET={p.client_secret}"]
# chaptarr insists on email_verified=true, but authentik's default email
# mapping hardcodes False. Give chaptarr its own email mapping, and bind the
# app to ginnoir only so nobody can match the allowlist by editing their email.
from authentik.core.models import User
from authentik.policies.models import PolicyBinding
from authentik.providers.oauth2.models import ScopeMapping
verified, _ = ScopeMapping.objects.update_or_create(
name="homelab: OpenID 'email' (verified)",
defaults=dict(
scope_name="email",
description="Email address (marked verified)",
expression='return {"email": request.user.email, "email_verified": True}',
),
)
ch = OAuth2Provider.objects.get(name="homelab-chaptarr")
ch.property_mappings.set([SCOPES[0], SCOPES[2], verified.pk])
ch_app = Application.objects.get(slug="chaptarr")
PolicyBinding.objects.get_or_create(target=ch_app, user=User.objects.get(username="ginnoir"), defaults=dict(order=0))
print(f"OIDC chaptarr: verified-email mapping + ginnoir-only binding")
with open("/tmp/books-oidc.env", "w") as f:
f.write("\n".join(lines) + "\n")
@@ -1,353 +0,0 @@
# yaml-language-server: $schema=https://goauthentik.io/blueprints/schema.json
# TB-006 batch 1 — forward-auth proxy providers for admin *.ginnoir.com sites.
version: 1
metadata:
name: Homelab forward auth — admin batch 1
labels:
blueprints.goauthentik.io/instantiate: "true"
entries:
- model: authentik_providers_proxy.proxyprovider
state: present
identifiers:
name: homelab-portainer
attrs:
name: homelab-portainer
mode: forward_single
external_host: https://portainer.ginnoir.com
access_token_validity: hours=24
token_validity: hours=24
refresh_token_validity: days=30
intercept_header_auth: true
internal_host_ssl_validation: true
authorization_flow: !Find [authentik_flows.flow, [slug, default-provider-authorization-implicit-consent]]
invalidation_flow: !Find [authentik_flows.flow, [slug, default-provider-invalidation-flow]]
- model: authentik_core.application
state: present
identifiers:
slug: portainer
attrs:
name: Portainer
slug: portainer
meta_launch_url: https://portainer.ginnoir.com
policy_engine_mode: any
provider: !Find [authentik_providers_proxy.proxyprovider, [name, homelab-portainer]]
- model: authentik_providers_proxy.proxyprovider
state: present
identifiers:
name: homelab-code
attrs:
name: homelab-code
mode: forward_single
external_host: https://code.ginnoir.com
access_token_validity: hours=24
token_validity: hours=24
refresh_token_validity: days=30
intercept_header_auth: true
internal_host_ssl_validation: true
authorization_flow: !Find [authentik_flows.flow, [slug, default-provider-authorization-implicit-consent]]
invalidation_flow: !Find [authentik_flows.flow, [slug, default-provider-invalidation-flow]]
- model: authentik_core.application
state: present
identifiers:
slug: code
attrs:
name: code-server
slug: code
meta_launch_url: https://code.ginnoir.com
policy_engine_mode: any
provider: !Find [authentik_providers_proxy.proxyprovider, [name, homelab-code]]
- model: authentik_providers_proxy.proxyprovider
state: present
identifiers:
name: homelab-registry-ui
attrs:
name: homelab-registry-ui
mode: forward_single
external_host: https://registry-ui.ginnoir.com
access_token_validity: hours=24
token_validity: hours=24
refresh_token_validity: days=30
intercept_header_auth: true
internal_host_ssl_validation: true
authorization_flow: !Find [authentik_flows.flow, [slug, default-provider-authorization-implicit-consent]]
invalidation_flow: !Find [authentik_flows.flow, [slug, default-provider-invalidation-flow]]
- model: authentik_core.application
state: present
identifiers:
slug: registry-ui
attrs:
name: Registry UI
slug: registry-ui
meta_launch_url: https://registry-ui.ginnoir.com
policy_engine_mode: any
provider: !Find [authentik_providers_proxy.proxyprovider, [name, homelab-registry-ui]]
- model: authentik_providers_proxy.proxyprovider
state: present
identifiers:
name: homelab-vault
attrs:
name: homelab-vault
mode: forward_single
external_host: https://vault.ginnoir.com
access_token_validity: hours=24
token_validity: hours=24
refresh_token_validity: days=30
intercept_header_auth: true
internal_host_ssl_validation: true
authorization_flow: !Find [authentik_flows.flow, [slug, default-provider-authorization-implicit-consent]]
invalidation_flow: !Find [authentik_flows.flow, [slug, default-provider-invalidation-flow]]
- model: authentik_core.application
state: present
identifiers:
slug: vault
attrs:
name: Vault
slug: vault
meta_launch_url: https://vault.ginnoir.com
policy_engine_mode: any
provider: !Find [authentik_providers_proxy.proxyprovider, [name, homelab-vault]]
- model: authentik_providers_proxy.proxyprovider
state: present
identifiers:
name: homelab-minio
attrs:
name: homelab-minio
mode: forward_single
external_host: https://minio.ginnoir.com
access_token_validity: hours=24
token_validity: hours=24
refresh_token_validity: days=30
intercept_header_auth: true
internal_host_ssl_validation: true
authorization_flow: !Find [authentik_flows.flow, [slug, default-provider-authorization-implicit-consent]]
invalidation_flow: !Find [authentik_flows.flow, [slug, default-provider-invalidation-flow]]
- model: authentik_core.application
state: present
identifiers:
slug: minio
attrs:
name: MinIO Console
slug: minio
meta_launch_url: https://minio.ginnoir.com
policy_engine_mode: any
provider: !Find [authentik_providers_proxy.proxyprovider, [name, homelab-minio]]
- model: authentik_providers_proxy.proxyprovider
state: present
identifiers:
name: homelab-homarr
attrs:
name: homelab-homarr
mode: forward_single
external_host: https://homarr.ginnoir.com
access_token_validity: hours=24
token_validity: hours=24
refresh_token_validity: days=30
intercept_header_auth: true
internal_host_ssl_validation: true
authorization_flow: !Find [authentik_flows.flow, [slug, default-provider-authorization-implicit-consent]]
invalidation_flow: !Find [authentik_flows.flow, [slug, default-provider-invalidation-flow]]
- model: authentik_core.application
state: present
identifiers:
slug: homarr
attrs:
name: Homarr
slug: homarr
meta_launch_url: https://homarr.ginnoir.com
policy_engine_mode: any
provider: !Find [authentik_providers_proxy.proxyprovider, [name, homelab-homarr]]
- model: authentik_providers_proxy.proxyprovider
state: present
identifiers:
name: homelab-uptime
attrs:
name: homelab-uptime
mode: forward_single
external_host: https://uptime.ginnoir.com
access_token_validity: hours=24
token_validity: hours=24
refresh_token_validity: days=30
intercept_header_auth: true
internal_host_ssl_validation: true
authorization_flow: !Find [authentik_flows.flow, [slug, default-provider-authorization-implicit-consent]]
invalidation_flow: !Find [authentik_flows.flow, [slug, default-provider-invalidation-flow]]
- model: authentik_core.application
state: present
identifiers:
slug: uptime
attrs:
name: Uptime Kuma
slug: uptime
meta_launch_url: https://uptime.ginnoir.com
policy_engine_mode: any
provider: !Find [authentik_providers_proxy.proxyprovider, [name, homelab-uptime]]
- model: authentik_providers_proxy.proxyprovider
state: present
identifiers:
name: homelab-backup
attrs:
name: homelab-backup
mode: forward_single
external_host: https://backup.ginnoir.com
access_token_validity: hours=24
token_validity: hours=24
refresh_token_validity: days=30
intercept_header_auth: true
internal_host_ssl_validation: true
authorization_flow: !Find [authentik_flows.flow, [slug, default-provider-authorization-implicit-consent]]
invalidation_flow: !Find [authentik_flows.flow, [slug, default-provider-invalidation-flow]]
- model: authentik_core.application
state: present
identifiers:
slug: backup
attrs:
name: Kopia
slug: backup
meta_launch_url: https://backup.ginnoir.com
policy_engine_mode: any
provider: !Find [authentik_providers_proxy.proxyprovider, [name, homelab-backup]]
- model: authentik_providers_proxy.proxyprovider
state: present
identifiers:
name: homelab-gitea
attrs:
name: homelab-gitea
mode: forward_single
external_host: https://gitea.ginnoir.com
access_token_validity: hours=24
token_validity: hours=24
refresh_token_validity: days=30
intercept_header_auth: true
internal_host_ssl_validation: true
authorization_flow: !Find [authentik_flows.flow, [slug, default-provider-authorization-implicit-consent]]
invalidation_flow: !Find [authentik_flows.flow, [slug, default-provider-invalidation-flow]]
- model: authentik_core.application
state: present
identifiers:
slug: gitea
attrs:
name: Gitea
slug: gitea
meta_launch_url: https://gitea.ginnoir.com
policy_engine_mode: any
provider: !Find [authentik_providers_proxy.proxyprovider, [name, homelab-gitea]]
- model: authentik_providers_proxy.proxyprovider
state: present
identifiers:
name: homelab-dbx
attrs:
name: homelab-dbx
mode: forward_single
external_host: https://dbx.ginnoir.com
access_token_validity: hours=24
token_validity: hours=24
refresh_token_validity: days=30
intercept_header_auth: true
internal_host_ssl_validation: true
authorization_flow: !Find [authentik_flows.flow, [slug, default-provider-authorization-implicit-consent]]
invalidation_flow: !Find [authentik_flows.flow, [slug, default-provider-invalidation-flow]]
- model: authentik_core.application
state: present
identifiers:
slug: dbx
attrs:
name: DBX
slug: dbx
meta_launch_url: https://dbx.ginnoir.com
policy_engine_mode: any
provider: !Find [authentik_providers_proxy.proxyprovider, [name, homelab-dbx]]
- model: authentik_providers_proxy.proxyprovider
state: present
identifiers:
name: homelab-bookstack
attrs:
name: homelab-bookstack
mode: forward_single
external_host: https://docs.ginnoir.com
access_token_validity: hours=24
token_validity: hours=24
refresh_token_validity: days=30
intercept_header_auth: true
internal_host_ssl_validation: true
authorization_flow: !Find [authentik_flows.flow, [slug, default-provider-authorization-implicit-consent]]
invalidation_flow: !Find [authentik_flows.flow, [slug, default-provider-invalidation-flow]]
- model: authentik_core.application
state: present
identifiers:
slug: bookstack
attrs:
name: BookStack
slug: bookstack
meta_launch_url: https://docs.ginnoir.com
policy_engine_mode: any
provider: !Find [authentik_providers_proxy.proxyprovider, [name, homelab-bookstack]]
- model: authentik_providers_proxy.proxyprovider
state: present
identifiers:
name: homelab-plane
attrs:
name: homelab-plane
mode: forward_single
external_host: https://plane.ginnoir.com
access_token_validity: hours=24
token_validity: hours=24
refresh_token_validity: days=30
intercept_header_auth: true
internal_host_ssl_validation: true
authorization_flow: !Find [authentik_flows.flow, [slug, default-provider-authorization-implicit-consent]]
invalidation_flow: !Find [authentik_flows.flow, [slug, default-provider-invalidation-flow]]
- model: authentik_core.application
state: present
identifiers:
slug: plane
attrs:
name: Plane
slug: plane
meta_launch_url: https://plane.ginnoir.com
policy_engine_mode: any
provider: !Find [authentik_providers_proxy.proxyprovider, [name, homelab-plane]]
- model: authentik_outposts.outpost
state: present
identifiers:
name: authentik Embedded Outpost
attrs:
name: authentik Embedded Outpost
type: proxy
providers:
- !Find [authentik_providers_proxy.proxyprovider, [name, homelab-portainer]]
- !Find [authentik_providers_proxy.proxyprovider, [name, homelab-code]]
- !Find [authentik_providers_proxy.proxyprovider, [name, homelab-registry-ui]]
- !Find [authentik_providers_proxy.proxyprovider, [name, homelab-vault]]
- !Find [authentik_providers_proxy.proxyprovider, [name, homelab-minio]]
- !Find [authentik_providers_proxy.proxyprovider, [name, homelab-homarr]]
- !Find [authentik_providers_proxy.proxyprovider, [name, homelab-uptime]]
- !Find [authentik_providers_proxy.proxyprovider, [name, homelab-backup]]
- !Find [authentik_providers_proxy.proxyprovider, [name, homelab-gitea]]
- !Find [authentik_providers_proxy.proxyprovider, [name, homelab-dbx]]
- !Find [authentik_providers_proxy.proxyprovider, [name, homelab-bookstack]]
- !Find [authentik_providers_proxy.proxyprovider, [name, homelab-plane]]
+4 -2
View File
@@ -19,8 +19,10 @@ services:
AUTHENTIK_REDIS__HOST: authentik-redis AUTHENTIK_REDIS__HOST: authentik-redis
AUTHENTIK_POSTGRESQL__HOST: authentik-db AUTHENTIK_POSTGRESQL__HOST: authentik-db
AUTHENTIK_ERROR_REPORTING__ENABLED: "false" AUTHENTIK_ERROR_REPORTING__ENABLED: "false"
volumes: # No custom blueprints: providers/apps are managed via the Authentik API and
- ./blueprints:/blueprints/custom:ro # the DB is the source of truth. The old ./blueprints mount resolved to
# Portainer's internal /data/compose/17/... (empty on the host), and the
# June snapshot it held would have stripped the embedded outpost to 11 providers.
ports: ports:
- "9200:9000" - "9200:9000"
logging: logging:
@@ -28,7 +28,6 @@ SITES = [
("homelab-uptime", "uptime", "Uptime Kuma", "https://uptime.ginnoir.com", "http://uptime-kuma:3001", UPTIME_UNAUTH), ("homelab-uptime", "uptime", "Uptime Kuma", "https://uptime.ginnoir.com", "http://uptime-kuma:3001", UPTIME_UNAUTH),
("homelab-backup", "backup", "Kopia", "https://backup.ginnoir.com", None, None), ("homelab-backup", "backup", "Kopia", "https://backup.ginnoir.com", None, None),
("homelab-dbx", "dbx", "DBX", "https://dbx.ginnoir.com", None, None), ("homelab-dbx", "dbx", "DBX", "https://dbx.ginnoir.com", None, None),
("homelab-plane", "plane", "Plane", "https://plane.ginnoir.com", None, None),
# Batch 2 — media *arr stack (internal_only + forward_auth at Caddy) # Batch 2 — media *arr stack (internal_only + forward_auth at Caddy)
("homelab-sonarr", "sonarr", "Sonarr", "https://sonarr.ginnoir.com", None, None), ("homelab-sonarr", "sonarr", "Sonarr", "https://sonarr.ginnoir.com", None, None),
("homelab-radarr", "radarr", "Radarr", "https://radarr.ginnoir.com", None, None), ("homelab-radarr", "radarr", "Radarr", "https://radarr.ginnoir.com", None, None),
@@ -24,7 +24,6 @@ SITES = [
("homelab-uptime", "uptime", "Uptime Kuma", "https://uptime.ginnoir.com", "http://uptime-kuma:3001", UPTIME_UNAUTH), ("homelab-uptime", "uptime", "Uptime Kuma", "https://uptime.ginnoir.com", "http://uptime-kuma:3001", UPTIME_UNAUTH),
("homelab-backup", "backup", "Kopia", "https://backup.ginnoir.com", None, None), ("homelab-backup", "backup", "Kopia", "https://backup.ginnoir.com", None, None),
("homelab-dbx", "dbx", "DBX", "https://dbx.ginnoir.com", None, None), ("homelab-dbx", "dbx", "DBX", "https://dbx.ginnoir.com", None, None),
("homelab-plane", "plane", "Plane", "https://plane.ginnoir.com", None, None),
# Batch 2 — media # Batch 2 — media
("homelab-sonarr", "sonarr", "Sonarr", "https://sonarr.ginnoir.com", None, None), ("homelab-sonarr", "sonarr", "Sonarr", "https://sonarr.ginnoir.com", None, None),
("homelab-radarr", "radarr", "Radarr", "https://radarr.ginnoir.com", None, None), ("homelab-radarr", "radarr", "Radarr", "https://radarr.ginnoir.com", None, None),
+13 -2
View File
@@ -32,8 +32,19 @@ Kopia → Backblaze B2. Backs up `/config`, **selected** `labdata` paths (see `S
| Time | What | | Time | What |
|------|------| |------|------|
| 02:50 | `backup-dump-databases.sh` — SQL dumps | | 02:50 | `backup-dump-databases.sh` — SQL dumps (`backup_scheduler` cron) |
| 03:00 | Kopia snapshots (paths in `snapshot-paths.txt`) | | 03:00 | Kopia snapshots — kopia server's own policy schedule (paths in `snapshot-paths.txt`) |
| hh:15 | `backup-check-freshness.sh` — pushes to Uptime Kuma monitor **Backups fresh** |
## Alerting
`backup-check-freshness.sh` runs hourly and pushes UP/DOWN to the Uptime Kuma push monitor
"Backups fresh (kopia + SQL dumps)" (`KUMA_PUSH_URL` in `stack.env`). DOWN when any Kopia source
or the newest SQL dump is older than 26h, or a dump file is a near-empty stub. Kuma also goes
DOWN if no push arrives for 2h (scheduler dead, kopia crash-looping), and notifies via ntfy.
`backup-run-snapshots.sh` is for manual runs only — cron'ing it would duplicate the server's
scheduled uploads.
## If B2 creds are empty ## If B2 creds are empty
+1 -1
View File
@@ -32,7 +32,7 @@ Legacy pre-RomM tree (EmuDeck, ES-DE, 13T `roms/`, symlinks). **Not backed up of
| Path | Why | | Path | Why |
|------|-----| |------|-----|
| `gitea/repositories`, `gitea/lfs` | Git + LFS | | `gitea/repositories`, `gitea/lfs` | Git + LFS |
| `famapp/minio`, `resume/minio`, `plane/minio` | User uploads | | `famapp/minio`, `resume/minio` | User uploads |
| `romhacks/metadata`, `romhacks/library` | Catalog work + guides/spreadsheets | | `romhacks/metadata`, `romhacks/library` | Catalog work + guides/spreadsheets |
| `romm/assets` | Saves (see RomM above) | | `romm/assets` | Saves (see RomM above) |
+3 -1
View File
@@ -1,3 +1,5 @@
# min hour day month weekday command # min hour day month weekday command
# Kopia snapshots run on the kopia server's own policy schedule (03:00, see init-kopia.sh);
# backup-run-snapshots.sh is kept for manual runs only — cron'ing it duplicates those uploads.
50 2 * * * /bin/sh /scripts/backup-dump-databases.sh 50 2 * * * /bin/sh /scripts/backup-dump-databases.sh
0 3 * * * /bin/sh /scripts/backup-run-snapshots.sh 15 * * * * /bin/sh /scripts/backup-check-freshness.sh
+10 -6
View File
@@ -32,7 +32,6 @@ services:
- /storage1/labdata/gitea/lfs:/backup/labdata/gitea/lfs:ro - /storage1/labdata/gitea/lfs:/backup/labdata/gitea/lfs:ro
- /storage1/labdata/famapp/minio:/backup/labdata/famapp/minio:ro - /storage1/labdata/famapp/minio:/backup/labdata/famapp/minio:ro
- /storage1/labdata/resume/minio:/backup/labdata/resume/minio:ro - /storage1/labdata/resume/minio:/backup/labdata/resume/minio:ro
- /storage1/labdata/plane/minio:/backup/labdata/plane/minio:ro
- /storage1/labdata/romhacks/metadata:/backup/labdata/romhacks/metadata:ro - /storage1/labdata/romhacks/metadata:/backup/labdata/romhacks/metadata:ro
- /storage1/labdata/romhacks/library:/backup/labdata/romhacks/library:ro - /storage1/labdata/romhacks/library:/backup/labdata/romhacks/library:ro
- /storage1/labdata/romm/assets:/backup/labdata/romm/assets:ro - /storage1/labdata/romm/assets:/backup/labdata/romm/assets:ro
@@ -48,7 +47,7 @@ services:
container_name: backup_scheduler container_name: backup_scheduler
image: alpine:3.20 image: alpine:3.20
restart: unless-stopped restart: unless-stopped
networks: [backup] networks: [backup, edge] # edge: push heartbeats to uptime_kuma:3001
env_file: env_file:
- stack.env - stack.env
volumes: volumes:
@@ -56,14 +55,19 @@ services:
- /config/backup/dumps:/dumps - /config/backup/dumps:/dumps
- /config/backup/scripts/backup-dump-databases.sh:/scripts/backup-dump-databases.sh:ro - /config/backup/scripts/backup-dump-databases.sh:/scripts/backup-dump-databases.sh:ro
- /config/backup/scripts/backup-run-snapshots.sh:/scripts/backup-run-snapshots.sh:ro - /config/backup/scripts/backup-run-snapshots.sh:/scripts/backup-run-snapshots.sh:ro
- /config/backup/scripts/backup-check-freshness.sh:/scripts/backup-check-freshness.sh:ro
- /config/backup/snapshot-paths.txt:/snapshot-paths.txt:ro - /config/backup/snapshot-paths.txt:/snapshot-paths.txt:ro
- /config/backup/crontab:/etc/crontab:ro # busybox crond reads <dir>/<user> and SILENTLY skips a crontab not owned by root;
# the host file is ginnoir-owned, so it's copied in root-owned at startup (below)
- /config/backup/crontab:/crontab.src:ro
entrypoint: ["/bin/sh", "-c"] entrypoint: ["/bin/sh", "-c"]
command: command:
- | - |
apk add --no-cache docker-cli curl tzdata >/dev/null apk add --no-cache docker-cli curl jq tzdata >/dev/null
printenv | grep -E '^(NTFY_|TZ=)' > /etc/backup.env || true # crond jobs get a bare env; scripts source this instead
crond -f -l 8 -c /etc printenv | grep -E '^(NTFY_|KUMA_|KOPIA_REPOSITORY_PASSWORD=|TZ=)' | sed "s/=\(.*\)/='\1'/" > /etc/backup.env || true
install -o root -g root -m 600 /crontab.src /etc/crontabs/root
crond -f -l 8 -c /etc/crontabs
depends_on: depends_on:
- kopia - kopia
+60
View File
@@ -0,0 +1,60 @@
#!/bin/sh
# Hourly dead-man check: every Kopia source in snapshot-paths.txt and the newest
# SQL dump must be younger than MAX_AGE_HOURS. Pushes UP/DOWN to the Uptime Kuma
# push monitor "Backups fresh"; Kuma also alerts (via ntfy) if no push arrives
# for 2h, so a dead scheduler or crash-looping kopia is caught too.
# Runs inside backup_scheduler; needs docker.sock + jq.
set -u
[ -f /etc/backup.env ] && . /etc/backup.env
MAX_AGE_HOURS="${MAX_AGE_HOURS:-26}"
KOPIA_PASSWORD="${KOPIA_REPOSITORY_PASSWORD:-}"
PROBLEMS=""
problem() { PROBLEMS="${PROBLEMS:+${PROBLEMS}; }$*"; }
push() {
status="$1"
msg=$(printf '%s' "$2" | jq -sRr @uri)
curl -sf -m 20 "${KUMA_PUSH_URL}?status=${status}&msg=${msg}" >/dev/null 2>&1 || echo "kuma push failed"
}
# --- Kopia snapshots ---------------------------------------------------------
if ! SNAPS=$(docker exec -e KOPIA_PASSWORD="${KOPIA_PASSWORD}" -e KOPIA_CONFIG_PATH=/app/config/repository.config \
kopia kopia snapshot list --all --json 2>/dev/null); then
problem "kopia: cannot list snapshots (container down or repo unreadable)"
else
while IFS= read -r path || [ -n "${path}" ]; do
case "${path}" in ''|\#*) continue ;; esac
age=$(printf '%s' "${SNAPS}" | jq -r --arg p "${path}" '
[.[] | select(.source.path == $p) | .startTime | sub("\\.[0-9]+"; "") | fromdateiso8601]
| if length == 0 then "none" else ((now - max) / 3600 | floor) end')
if [ "${age}" = "none" ]; then
problem "kopia ${path}: no snapshots"
elif [ "${age}" -ge "${MAX_AGE_HOURS}" ]; then
problem "kopia ${path}: ${age}h old"
fi
done < /snapshot-paths.txt
fi
# --- SQL dumps ---------------------------------------------------------------
NEWEST=$(find /dumps -mindepth 1 -maxdepth 1 -type d -name '2*' | sort | tail -1)
if [ -z "${NEWEST}" ]; then
problem "dumps: none found"
else
age=$(( ($(date +%s) - $(stat -c %Y "${NEWEST}")) / 3600 ))
[ "${age}" -ge "${MAX_AGE_HOURS}" ] && problem "dumps: newest is ${age}h old"
# pg_dump/mariadb-dump failures still leave a gzip stub (no pipefail in sh)
tiny=$(find "${NEWEST}" -name '*.sql.gz' -size -1k -exec basename {} \; | tr '\n' ' ')
[ -n "${tiny}" ] && problem "dumps: suspiciously small: ${tiny}"
fi
if [ -z "${PROBLEMS}" ]; then
echo "backup-check: OK"
push up "OK"
else
echo "backup-check: ${PROBLEMS}"
push down "${PROBLEMS}"
exit 1
fi
@@ -23,16 +23,21 @@ dump_postgres() {
} }
# user: root (default) or app account (e.g. bookstack — root password may not match env) # user: root (default) or app account (e.g. bookstack — root password may not match env)
# pwvar: optional name of the container env var holding that user's password
dump_mariadb() { dump_mariadb() {
name="$1" name="$1"
db="$2" db="$2"
user="${3:-root}" user="${3:-root}"
pwvar="${4:-}"
if ! docker ps --format '{{.Names}}' | grep -qx "${name}"; then if ! docker ps --format '{{.Names}}' | grep -qx "${name}"; then
log "skip ${name} (not running)" log "skip ${name} (not running)"
return 0 return 0
fi fi
log "dump ${name} → ${db} (as ${user})" log "dump ${name} → ${db} (as ${user})"
if [ "${user}" = "root" ]; then if [ -n "${pwvar}" ]; then
docker exec "${name}" sh -c "mariadb-dump -u \"${user}\" -p\"\${${pwvar}}\" \"${db}\"" \
| gzip -c > "${DIR}/${name}.sql.gz"
elif [ "${user}" = "root" ]; then
docker exec "${name}" sh -c "mariadb-dump -u root -p\"\${MARIADB_ROOT_PASSWORD:-\$MYSQL_ROOT_PASSWORD}\" \"${db}\"" \ docker exec "${name}" sh -c "mariadb-dump -u root -p\"\${MARIADB_ROOT_PASSWORD:-\$MYSQL_ROOT_PASSWORD}\" \"${db}\"" \
| gzip -c > "${DIR}/${name}.sql.gz" | gzip -c > "${DIR}/${name}.sql.gz"
else else
@@ -44,12 +49,13 @@ dump_mariadb() {
log "starting database dumps → ${DIR}" log "starting database dumps → ${DIR}"
dump_postgres postgres_gitea gitea gitea dump_postgres postgres_gitea gitea gitea
dump_postgres postgres_plane plane plane
dump_postgres postgres_authentik authentik authentik dump_postgres postgres_authentik authentik authentik
dump_postgres postgres_famapp famapp famapp dump_postgres postgres_famapp famapp famapp
dump_postgres postgres_resume postgres postgres dump_postgres postgres_resume postgres postgres
dump_postgres immich-postgres immich immich
dump_postgres nextcloud-postgres nextcloud nextcloud
dump_mariadb mariadb_bookstack bookstack bookstack dump_mariadb mariadb_bookstack bookstack bookstack BOOKSTACK_DB_PASSWORD
dump_mariadb owncloud_mariadb owncloud dump_mariadb owncloud_mariadb owncloud
dump_mariadb romm-db romm dump_mariadb romm-db romm
-1
View File
@@ -5,7 +5,6 @@
/backup/labdata/gitea/lfs /backup/labdata/gitea/lfs
/backup/labdata/famapp/minio /backup/labdata/famapp/minio
/backup/labdata/resume/minio /backup/labdata/resume/minio
/backup/labdata/plane/minio
/backup/labdata/romhacks/metadata /backup/labdata/romhacks/metadata
/backup/labdata/romhacks/library /backup/labdata/romhacks/library
/backup/labdata/romm/assets /backup/labdata/romm/assets
+3
View File
@@ -13,3 +13,6 @@ B2_ENDPOINT=s3.us-west-004.backblazeb2.com
# ntfy alerts (same pattern as watchtower) # ntfy alerts (same pattern as watchtower)
NTFY_URL=https://ntfy.ginnoir.com/backup NTFY_URL=https://ntfy.ginnoir.com/backup
NTFY_TITLE=ValhallaBackup NTFY_TITLE=ValhallaBackup
# Uptime Kuma push monitor "Backups fresh" (id 73) — backup-check-freshness.sh
KUMA_PUSH_URL=http://uptime_kuma:3001/api/push/GTUcqAMJs5k5AfPq940NkEdM
+4 -4
View File
@@ -1,4 +1,4 @@
# cameras stack — Reolink E1 live view, 24/7 recording, detection snapshots, PTZ page. # cameras stack — Reolink E1 live view + PTZ page.
# #
# The E1 (192.168.1.99) has NO RTSP/RTMP/ONVIF: only Reolink's Baichuan protocol on its # The E1 (192.168.1.99) has NO RTSP/RTMP/ONVIF: only Reolink's Baichuan protocol on its
# media port (9001 — set in the Reolink app; neolink breaks if it changes). neolink logs # media port (9001 — set in the Reolink app; neolink breaks if it changes). neolink logs
@@ -6,9 +6,9 @@
# cameras net (unauthenticated, so it is never on edge). frigate's built-in go2rtc is the # cameras net (unauthenticated, so it is never on edge). frigate's built-in go2rtc is the
# only neolink client; the browser gets MSE through Caddy (cam.ginnoir.com). # only neolink client; the browser gets MSE through Caddy (cam.ginnoir.com).
# #
# Recording: 24/7 main stream kept 7 d, person/pet clips 30 d, snapshots 30 d — all under # Recording, snapshots and detection are OFF since 2026-10-26 (live view only). The
# /storage1/labdata/frigate (~310 GB rolling). Detection is OpenVINO on # detector is still declared as OpenVINO on CPU, deliberately not the P100 (llama-swap owns
# CPU, deliberately not the P100 (llama-swap owns its VRAM; CDI breaks after reboots). # its VRAM; CDI breaks after reboots), and only runs if detect is re-enabled.
# #
# Configs are host-managed at /config/<svc>/ (Portainer's checkout won't materialize a # Configs are host-managed at /config/<svc>/ (Portainer's checkout won't materialize a
# relative repo-file bind). The copies under stacks/cameras/*/ are canonical; on change, # relative repo-file bind). The copies under stacks/cameras/*/ are canonical; on change,
+7 -20
View File
@@ -39,27 +39,13 @@ go2rtc:
e1_sub: e1_sub:
- "ffmpeg:rtsp://neolink:8554/e1/subStream#video=copy#audio=aac" - "ffmpeg:rtsp://neolink:8554/e1/subStream#video=copy#audio=aac"
# Recordings → /media/frigate/recordings = /storage1/labdata/frigate/recordings. # Recording, snapshots and detection turned off 2026-10-26 at ginnoir's request: the
# Main stream 24/7 ≈ 4.2 Mbps ≈ 44 GB/day (measured 2026-10-08) → ~310 GB rolling at 7 d. # camera is live-view only now. Existing recordings/clips were deleted.
# Alert/detection clips (person/dog/cat) kept 30 d beyond that.
record: record:
enabled: true enabled: false
continuous:
days: 7
alerts:
retain:
days: 30
mode: motion
detections:
retain:
days: 30
mode: motion
snapshots: snapshots:
enabled: true enabled: false
bounding_box: true
retain:
default: 30
objects: objects:
track: [person, dog, cat] track: [person, dog, cat]
@@ -78,8 +64,9 @@ cameras:
output_args: output_args:
record: preset-record-generic-audio-copy record: preset-record-generic-audio-copy
detect: detect:
# Frigate >=0.14 defaults detect.enabled to false — without this nothing is detected. # Off on purpose (live view only). Frigate >=0.14 defaults this to false anyway;
enabled: true # set true to bring detection back.
enabled: false
width: 640 width: 640
height: 360 height: 360
fps: 5 fps: 5
+4 -222
View File
@@ -1,12 +1,9 @@
# dev stack — developer tooling: code-server, DBX, BookStack, Plane. # dev stack — developer tooling: code-server, DBX, BookStack.
# (Gitea, gitea-runner, postgres_gitea, registry, and registry-ui moved to the # (Gitea, gitea-runner, postgres_gitea, registry, and registry-ui moved to the
# management plane in portainer-compose.yml.) # management plane in portainer-compose.yml. Plane was removed 2026-10-26.)
# #
# Volume -> bind-mount conversions: # Volume -> bind-mount conversions:
# dbx data -> /config/dbx (SSD) # dbx data -> /config/dbx (SSD)
# plane db -> /config/plane/postgres (SSD)
# plane redis -> /config/plane/redis (SSD)
# plane minio -> /storage1/labdata/plane/minio (ZFS; attachments)
services: services:
# ============================================================ CODE-SERVER # ============================================================ CODE-SERVER
@@ -20,7 +17,6 @@ services:
environment: environment:
- PUID=1000 - PUID=1000
- PGID=1000 - PGID=1000
- TZ
- DEFAULT_WORKSPACE=/workspace - DEFAULT_WORKSPACE=/workspace
# Authentik forward_auth at the edge — local password auth disabled via config mount. # Authentik forward_auth at the edge — local password auth disabled via config mount.
volumes: volumes:
@@ -54,16 +50,13 @@ services:
environment: environment:
- PUID=1000 - PUID=1000
- PGID=1000 - PGID=1000
- TZ
- APP_URL=https://docs.ginnoir.com - APP_URL=https://docs.ginnoir.com
- APP_KEY # Laravel prioritizes DATABASE_URL over DB_*; pin it to BookStack's own MariaDB
# stack.env leaks Plane's DATABASE_URL; Laravel prioritizes it over DB_* and # so a stray DATABASE_URL in stack.env can never redirect it.
# would connect BookStack to postgres_plane. Pin it to BookStack's own MariaDB.
- DATABASE_URL=mysql://bookstack:bookstack_d3v_pass@mariadb_bookstack:3306/bookstack - DATABASE_URL=mysql://bookstack:bookstack_d3v_pass@mariadb_bookstack:3306/bookstack
- DB_HOST=mariadb_bookstack - DB_HOST=mariadb_bookstack
- DB_PORT=3306 - DB_PORT=3306
- DB_USER=bookstack - DB_USER=bookstack
- DB_PASS
- DB_DATABASE=bookstack - DB_DATABASE=bookstack
- AUTH_METHOD=oidc - AUTH_METHOD=oidc
- AUTH_AUTO_INITIATE=false - AUTH_AUTO_INITIATE=false
@@ -91,11 +84,8 @@ services:
environment: environment:
- PUID=1000 - PUID=1000
- PGID=1000 - PGID=1000
- TZ
- MYSQL_ROOT_PASSWORD
- MYSQL_DATABASE=bookstack - MYSQL_DATABASE=bookstack
- MYSQL_USER=bookstack - MYSQL_USER=bookstack
- MYSQL_PASSWORD
volumes: volumes:
- /config/bookstack-db:/config - /config/bookstack-db:/config
healthcheck: healthcheck:
@@ -104,214 +94,6 @@ services:
timeout: 5s timeout: 5s
retries: 5 retries: 5
# ============================================================ PLANE
plane-web:
container_name: plane_web
image: makeplane/plane-frontend:latest
restart: unless-stopped
networks: [dev, edge]
command: node web/server.js
env_file:
- stack.env
environment:
- NEXT_PUBLIC_API_BASE_URL=https://plane.ginnoir.com
- HOSTNAME=0.0.0.0
plane-admin:
container_name: plane_admin
image: makeplane/plane-admin:v0.23.1
restart: unless-stopped
networks: [dev, edge]
command: node admin/server.js
env_file:
- stack.env
environment:
- NEXT_PUBLIC_API_BASE_URL=https://plane.ginnoir.com
- HOSTNAME=0.0.0.0
depends_on:
plane-api:
condition: service_started
plane-web:
condition: service_started
plane-api:
container_name: plane_api
image: makeplane/plane-backend:latest
restart: unless-stopped
networks: [dev, edge]
command: ./bin/docker-entrypoint-api.sh
env_file:
- stack.env
environment:
- SECRET_KEY
- DEBUG=0
- DATABASE_URL
- REDIS_URL=redis://redis_plane:6379/
- CELERY_BROKER_URL=redis://redis_plane:6379/0
- USE_MINIO=1
- AWS_REGION=us-east-1
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_S3_ENDPOINT_URL=http://plane_minio:9000
- AWS_S3_BUCKET_NAME=uploads
- WEB_URL=https://plane.ginnoir.com
- CORS_ALLOWED_ORIGINS=https://plane.ginnoir.com
- GUNICORN_WORKERS=2
depends_on:
postgres_plane:
condition: service_healthy
redis_plane:
condition: service_healthy
plane-migrator:
condition: service_completed_successfully
plane-worker:
container_name: plane_worker
image: makeplane/plane-backend:latest
restart: unless-stopped
networks: [dev]
command: ./bin/docker-entrypoint-worker.sh
env_file:
- stack.env
environment:
- SECRET_KEY
- DEBUG=0
- DATABASE_URL
- REDIS_URL=redis://redis_plane:6379/
- CELERY_BROKER_URL=redis://redis_plane:6379/0
- USE_MINIO=1
- AWS_REGION=us-east-1
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_S3_ENDPOINT_URL=http://plane_minio:9000
- AWS_S3_BUCKET_NAME=uploads
depends_on:
postgres_plane:
condition: service_healthy
redis_plane:
condition: service_healthy
plane-migrator:
condition: service_completed_successfully
plane-beat:
container_name: plane_beat
image: makeplane/plane-backend:latest
restart: unless-stopped
networks: [dev]
command: ./bin/docker-entrypoint-beat.sh
env_file:
- stack.env
environment:
- SECRET_KEY
- DEBUG=0
- DATABASE_URL
- REDIS_URL=redis://redis_plane:6379/
- CELERY_BROKER_URL=redis://redis_plane:6379/0
depends_on:
postgres_plane:
condition: service_healthy
redis_plane:
condition: service_healthy
plane-migrator:
condition: service_completed_successfully
plane-migrator:
container_name: plane_migrator
image: makeplane/plane-backend:latest
restart: "no"
networks: [dev]
command: ./bin/docker-entrypoint-migrator.sh
env_file:
- stack.env
environment:
- SECRET_KEY
- DATABASE_URL
- REDIS_URL=redis://redis_plane:6379/
depends_on:
postgres_plane:
condition: service_healthy
redis_plane:
condition: service_healthy
plane-create-bucket:
container_name: plane_create_bucket
image: minio/mc:latest
restart: "no"
networks: [dev]
depends_on:
plane-minio:
condition: service_healthy
entrypoint: >
/bin/sh -c "
until /usr/bin/mc alias set plane_minio http://plane_minio:9000 $$MINIO_USER $$MINIO_PASSWORD; do sleep 1; done;
/usr/bin/mc mb plane_minio/uploads --ignore-existing;
exit 0;
"
env_file:
- stack.env
environment:
- MINIO_USER
- MINIO_PASSWORD
postgres_plane:
container_name: postgres_plane
image: postgres:16-alpine
restart: unless-stopped
labels:
- "com.centurylabs.watchtower.enable=false"
networks: [dev]
env_file:
- stack.env
environment:
- POSTGRES_USER=plane
- POSTGRES_PASSWORD
- POSTGRES_DB=plane
volumes:
- /config/plane/postgres:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U plane -d plane"]
interval: 10s
timeout: 5s
retries: 5
redis_plane:
container_name: redis_plane
image: redis:7-alpine
restart: unless-stopped
labels:
- "com.centurylabs.watchtower.enable=false"
networks: [dev]
command: --save 60 1 --loglevel warning
volumes:
- /config/plane/redis:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
plane-minio:
container_name: plane_minio
image: minio/minio:RELEASE.2025-09-07T16-13-09Z
restart: unless-stopped
labels:
- "com.centurylabs.watchtower.enable=false"
networks: [dev]
command: server /data --console-address ":9001"
env_file:
- stack.env
environment:
- MINIO_ROOT_USER
- MINIO_ROOT_PASSWORD
volumes:
- /storage1/labdata/plane/minio:/data
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:9000/minio/health/live || exit 1"]
interval: 30s
timeout: 20s
retries: 3
start_period: 30s
networks: networks:
dev: dev:
name: dev name: dev
-16
View File
@@ -17,19 +17,3 @@ BOOKSTACK_OIDC_CLIENT_ID=8YV4BI2JVIG1QzS2DbylEgqv56sgfiOVRXOgw2Z5
BOOKSTACK_OIDC_CLIENT_SECRET=wIyiw7LmGBORDyTdc2crSZryXJHzIq4gtajAKSpOU7e8BkBSO6SstM9gGPrnp4tbJhCFSQggYAgtYd5LOjUvQpSWInzm0JLlmLg1BTlPq5EVVieNYuWRCCQrerj8gRZ0 BOOKSTACK_OIDC_CLIENT_SECRET=wIyiw7LmGBORDyTdc2crSZryXJHzIq4gtajAKSpOU7e8BkBSO6SstM9gGPrnp4tbJhCFSQggYAgtYd5LOjUvQpSWInzm0JLlmLg1BTlPq5EVVieNYuWRCCQrerj8gRZ0
OIDC_CLIENT_ID=8YV4BI2JVIG1QzS2DbylEgqv56sgfiOVRXOgw2Z5 OIDC_CLIENT_ID=8YV4BI2JVIG1QzS2DbylEgqv56sgfiOVRXOgw2Z5
OIDC_CLIENT_SECRET=wIyiw7LmGBORDyTdc2crSZryXJHzIq4gtajAKSpOU7e8BkBSO6SstM9gGPrnp4tbJhCFSQggYAgtYd5LOjUvQpSWInzm0JLlmLg1BTlPq5EVVieNYuWRCCQrerj8gRZ0 OIDC_CLIENT_SECRET=wIyiw7LmGBORDyTdc2crSZryXJHzIq4gtajAKSpOU7e8BkBSO6SstM9gGPrnp4tbJhCFSQggYAgtYd5LOjUvQpSWInzm0JLlmLg1BTlPq5EVVieNYuWRCCQrerj8gRZ0
# Plane project management
# Rotate with: openssl rand -hex 32
PLANE_SECRET_KEY=60gp0byfz2dvffa45cxl20p1scy9xbpf6d8c5y0geejgkyp1b52
SECRET_KEY=60gp0byfz2dvffa45cxl20p1scy9xbpf6d8c5y0geejgkyp1b52
PLANE_DB_PASSWORD=plane_d3v_p4ss_8x3m
POSTGRES_PASSWORD=plane_d3v_p4ss_8x3m
DATABASE_URL=postgresql://plane:plane_d3v_p4ss_8x3m@postgres_plane:5432/plane
PLANE_MINIO_USER=planeadmin
MINIO_USER=planeadmin
AWS_ACCESS_KEY_ID=planeadmin
PLANE_MINIO_PASSWORD=plane_minio_p4ss
MINIO_PASSWORD=plane_minio_p4ss
AWS_SECRET_ACCESS_KEY=plane_minio_p4ss
MINIO_ROOT_USER=planeadmin
MINIO_ROOT_PASSWORD=plane_minio_p4ss
+2 -1
View File
@@ -46,7 +46,8 @@ services:
famapp-minio: famapp-minio:
container_name: minio_famapp container_name: minio_famapp
image: minio/minio:RELEASE.2025-09-07T16-13-09Z # minio/minio vanished from Docker Hub 2026-10; self-hosted copy of the last cached tag.
image: registry.ginnoir.com/mirror/minio:RELEASE.2025-09-07T16-13-09Z
command: server /data --console-address ":9003" command: server /data --console-address ":9003"
restart: unless-stopped restart: unless-stopped
labels: labels:
+69
View File
@@ -0,0 +1,69 @@
# Books stack (chaptarr / CWA / audiobookshelf / storyteller)
Lives in the `media` stack. Flow:
```
prowlarr ─► chaptarr ─► qbittorrent / nzbget ─► /storage1/complete
│
├─ ebooks ─► /storage1/complete/books-ingest ─► CWA ─► /storage1/Media/Books (Calibre lib) ─► Send-to-Kindle / OPDS
└─ audiobooks ─► /storage1/Media/Audiobooks ─► audiobookshelf
storyteller reads both libraries :ro ─► /storage1/labdata/storyteller (aligned EPUB 3 + media overlays)
```
| Service | Container:port | Host port | URL |
|---|---|---|---|
| chaptarr | `chaptarr:8789` | 8789 | https://chaptarr.ginnoir.com (native OIDC, LAN + tailnet only) |
| calibre-web-automated | `calibre-web-automated:8083` | 8083 | https://books.ginnoir.com (forward_auth, `/opds*` + `/kobo/*` bypass) |
| audiobookshelf | `audiobookshelf:80` | 13378 | https://audiobooks.ginnoir.com (native OIDC, LAN + tailnet only) |
| storyteller | `storyteller:8001` | 8001 | https://storyteller.ginnoir.com (forward_auth, `/api/*` bypass) |
## 1. Host prep (before the first deploy) — done 2026-10-18
Docker creates missing bind dirs as `root:root`, which breaks chaptarr/CWA/ABS (PUID 1000).
```bash
sudo mkdir -p /config/chaptarr /config/calibre-web-automated \
/config/audiobookshelf/{config,metadata} \
/storage1/Media/Books /storage1/Media/Audiobooks \
/storage1/complete/books-ingest /storage1/labdata/storyteller
sudo chown -R 1000:1000 /config/chaptarr /config/calibre-web-automated /config/audiobookshelf \
/storage1/Media/Books /storage1/Media/Audiobooks \
/storage1/complete/books-ingest /storage1/labdata/storyteller
```
## 2. Authentik — providers done 2026-10-18
`scripts/run-books-auth.sh` creates everything below (idempotent, runs `scripts/setup-books-auth.py` through `ak shell`). **Done on 2026-10-18.**
- **books / storyteller (Pattern B):** proxy providers `homelab-{books,storyteller}` (pk 44–45). They're `forward_single`, cloned from `homelab-sonarr`, attached to the embedded outpost, and each has an app with the same slug.
- **Chaptarr (Pattern A):** OIDC provider `homelab-chaptarr` (pk 47) plus app `chaptarr`, with the strict redirect URI `https://chaptarr.ginnoir.com/signin-oidc`. This replaced the forward_auth provider it started with (pk 43). The client ID and secret are in `stack.env` (`CHAPTARR_OIDC_CLIENT_*`).
In Chaptarr, go to Settings → General → Authentication, choose OIDC, and fill in:
- OIDC Authority: `https://auth.ginnoir.com/application/o/chaptarr/`
- Scopes: `openid profile email`
- Allowed Emails: your Authentik account email(s)
- Authentik's default email mapping sends `email_verified: false`, and Chaptarr requires `true`. So the chaptarr provider uses its own mapping, `homelab: OpenID 'email' (verified)`. The app is also bound to the `ginnoir` user, so no other account can match the allowlist by changing its email.
- Changing anything in `stack.env` makes Portainer recreate every media container. Don't do it while you're in the middle of a login.
- **Audiobookshelf (Pattern A):** OIDC provider `homelab-audiobooks` (pk 46) plus app `audiobooks`. Its strict redirect URIs are `https://audiobooks.ginnoir.com/audiobookshelf/auth/openid/{callback,mobile-redirect}` (current ABS serves under `/audiobookshelf`), the same pair without the prefix, and `audiobookshelf://oauth`. The client ID and secret are in `stack.env` (`ABS_OIDC_CLIENT_*`).
**Still to do in the ABS UI** (it keeps OIDC settings in its own database): go to Settings → Authentication → OpenID Connect.
- Issuer URL: `https://auth.ginnoir.com/application/o/audiobooks/`. Click *Auto-populate*, then paste the client ID and secret.
- Allowed mobile redirect URIs: `audiobookshelf://oauth`.
- Match existing users by username or email. Turn on auto-register if you want it.
- **CWA single sign-on (optional).** In Admin → Edit Basic Configuration → Feature Configuration, turn on *Allow Reverse Proxy Authentication* and set the header to `X-Authentik-Username`. The CWA usernames must match the Authentik usernames.
## 3. Post-deploy checklist
- [ ] **chaptarr:** set the admin login on first launch. Add root folders `/ebooks` (ebook) and `/audiobooks` (audiobook).
- [ ] **chaptarr:** turn on *Unmonitor Deleted Books* (Media Management). CWA deletes files from `/ebooks` after ingest, and without this setting chaptarr will try to grab them again.
- [ ] **Prowlarr → chaptarr app sync:** in Prowlarr, go to Settings → Apps → add Chaptarr (or Readarr if Chaptarr isn't listed yet). Use `http://prowlarr:9696` and `http://chaptarr:8789`, plus the chaptarr API key. Sync, then confirm the indexers show up in chaptarr.
- [ ] **Download clients in chaptarr:** add `qbittorrent:3232` with category `books`, and `nzbget:6789` with category `books`. Both write under `/downloads` on the same `/storage1/complete` mount, so no remote path mapping is needed. Check that the `books` categories exist in both clients.
- [ ] **CWA:** log in as `admin` / `admin123` and change the password right away. The library path is `/calibre-library`. Drop a test EPUB into `/storage1/complete/books-ingest` and confirm it shows up in the library and leaves the ingest folder.
- [ ] **CWA SMTP / Send-to-Kindle:** Admin → Edit Email Server Settings. Add the sender address to Amazon → *Manage Your Content and Devices* → *Personal Document Settings* → *Approved Personal Document E-mail List*. Set the user's Kindle email in their profile, then send the test book.
- [ ] **audiobookshelf:** create the root user and add a library pointed at `/audiobooks`. Scan it, then sign in from the phone app over Tailscale.
- [ ] **storyteller:** create an admin and point the import at `/libraries/books` and `/libraries/audiobooks`. Run one test alignment on a short book (whisper runs on CPU, so this is slow). Open the result in the Storyteller Reader app.
- [ ] **uptime-kuma:** add monitors for the four new hosts.
## Notes
- `STORYTELLER_SECRET_KEY` is in `stack.env` (`secrets.token_hex(64)`). If you rotate it, every Storyteller session is logged out.
- GPU: Storyteller runs the CUDA 12.9 image on the P100 (`nvidia.com/gpu=0`, CDI). Upstream only tags CUDA images by commit SHA, so the tag is pinned and Watchtower is off. To bump it, pick a newer SHA from the registry's `amd64-cuda-12.9.0` repository. Don't use the CUDA 13.x images: they drop Pascal. The whisper build has no sm_60 kernels, so the first GPU run JIT-compiles PTX (~60 s). `CUDA_CACHE_PATH=/data/.nv-compute-cache` keeps that cache across restarts.
- Chaptarr is young and runs on `:latest` with Watchtower. If an update breaks it, pin a tag and add `com.centurylabs.watchtower.enable=false`.
+190 -5
View File
@@ -34,6 +34,10 @@ services:
volumes: volumes:
- /etc/localtime:/etc/localtime:ro - /etc/localtime:/etc/localtime:ro
- /config/sonarr:/config - /config/sonarr:/config
# Unified /storage1 mount enables atomic hardlinks between /storage1/complete
# and /storage1/{TV,Anime} (separate /tv + /downloads mounts force EXDEV copies).
# Legacy mounts kept temporarily during root-folder migration.
- /storage1:/storage1
- /storage1/Media/TV:/tv - /storage1/Media/TV:/tv
- /storage1/Media/Anime:/anime - /storage1/Media/Anime:/anime
- /storage1/complete:/downloads - /storage1/complete:/downloads
@@ -52,6 +56,10 @@ services:
volumes: volumes:
- /etc/localtime:/etc/localtime:ro - /etc/localtime:/etc/localtime:ro
- /config/radarr:/config - /config/radarr:/config
# Unified /storage1 mount enables atomic hardlinks between /storage1/complete
# and /storage1/Movies (separate /movies + /downloads mounts force EXDEV copies).
# Legacy mounts kept temporarily during root-folder migration.
- /storage1:/storage1
- /storage1/Media/Movies:/movies - /storage1/Media/Movies:/movies
- /storage1/complete:/downloads - /storage1/complete:/downloads
ports: ports:
@@ -70,6 +78,8 @@ services:
- UMASK_SET=022 - UMASK_SET=022
volumes: volumes:
- /config/bazarr:/config - /config/bazarr:/config
# Unified /storage1 mount keeps subtitle paths in sync once Sonarr/Radarr move to /storage1/*.
- /storage1:/storage1
- /storage1/Media/Movies:/movies - /storage1/Media/Movies:/movies
- /storage1/Media/TV:/tv - /storage1/Media/TV:/tv
- /storage1/Media/Anime:/anime - /storage1/Media/Anime:/anime
@@ -121,22 +131,61 @@ services:
- "8181:8181" - "8181:8181"
qbittorrent: qbittorrent:
image: lscr.io/linuxserver/qbittorrent:latest # Pinned to the last 5.2.x build (downgraded from 5.3.0); Watchtower off so it stays put.
image: lscr.io/linuxserver/qbittorrent:5.2.4_v2.0.15-ls481
container_name: qbittorrent container_name: qbittorrent
restart: unless-stopped restart: unless-stopped
labels:
- com.centurylabs.watchtower.enable=false
networks: [media, edge] networks: [media, edge]
env_file: env_file:
- stack.env - stack.env
environment: environment:
- WEBUI_PORT=3232 - WEBUI_PORT=3232
- TORRENTING_PORT=6881 # 6881-6889 is banned on many private trackers; 43817 is forwarded on OPNsense.
- TORRENTING_PORT=43817
volumes: volumes:
- /config/qbittorrent:/config - /config/qbittorrent:/config
- /storage1/complete:/downloads - /storage1/complete:/downloads
# Same-path /storage1 mount so cross-seed's hardlinks (which must live on the
# same container mount as their source) resolve identically in both containers.
- /storage1:/storage1
ports: ports:
- "3232:3232" - "3232:3232"
- "6881:6881" - "43817:43817"
- "6881:6881/udp" - "43817:43817/udp"
# cross-seed: matches library files against private-tracker uploads and injects
# them into qbittorrent as hardlinks under /storage1/cross-seed-links. No web UI;
# config is host-managed at /config/cross-seed/config.js (secrets via process.env).
cross-seed:
image: ghcr.io/cross-seed/cross-seed:6
container_name: cross-seed
restart: unless-stopped
networks: [media]
user: 1000:1000
env_file:
- stack.env
command: daemon
volumes:
- /config/cross-seed:/config
- /storage1:/storage1
# autobrr: grabs freeleech uploads from tracker IRC announces into qbittorrent
# (category autobrr) and forwards every announce to cross-seed. Native OIDC via
# Authentik (homelab-autobrr, pk 48); built-in login disabled.
autobrr:
image: ghcr.io/autobrr/autobrr:latest
container_name: autobrr
restart: unless-stopped
networks: [media, edge]
user: 1000:1000
env_file:
- stack.env
volumes:
- /config/autobrr:/config
ports:
- "7474:7474"
whisparr: whisparr:
container_name: whisparr container_name: whisparr
@@ -165,7 +214,11 @@ services:
env_file: env_file:
- stack.env - stack.env
volumes: volumes:
- ./recyclarr:/config # Absolute path: ./recyclarr resolved to Portainer's internal
# /data/compose/10/... and bound an EMPTY dir from 2026-06-17 to 2026-11-21,
# so recyclarr never synced. Canonical config is stacks/media/recyclarr/;
# scp recyclarr.yml + secrets.yml to /config/recyclarr/ after edits.
- /config/recyclarr:/config
stash: stash:
image: stashapp/stash:latest image: stashapp/stash:latest
@@ -196,6 +249,138 @@ services:
ports: ports:
- "6971:6970" - "6971:6970"
# ============================================================ BOOKS
# Prowlarr -> chaptarr -> qbittorrent/nzbget (/storage1/complete). Chaptarr
# imports ebooks into the CWA ingest folder (CWA owns the Calibre library and
# deletes ingested files) and audiobooks straight into the ABS library.
# Storyteller reads both libraries read-only and writes aligned EPUBs to its
# own /data. Readarr is retired upstream — do not add it.
chaptarr:
container_name: chaptarr
image: chaptarr/chaptarr:latest
restart: unless-stopped
networks: [media, edge]
env_file:
- stack.env
ulimits:
nofile: { soft: 65536, hard: 65536 }
environment:
- UMASK=002
volumes:
- /config/chaptarr:/config
- /storage1/complete:/downloads
- /storage1/complete/books-ingest:/ebooks
- /storage1/Media/Audiobooks:/audiobooks
ports:
- "8789:8789"
calibre-web-automated:
container_name: calibre-web-automated
image: crocodilestick/calibre-web-automated:latest
restart: unless-stopped
networks: [media, edge]
env_file:
- stack.env
environment:
- NETWORK_SHARE_MODE=false
volumes:
- /config/calibre-web-automated:/config
- /storage1/complete/books-ingest:/cwa-book-ingest
- /storage1/Media/Books:/calibre-library
ports:
- "8083:8083"
audiobookshelf:
container_name: audiobookshelf
image: ghcr.io/advplyr/audiobookshelf:latest
restart: unless-stopped
networks: [media, edge]
env_file:
- stack.env
volumes:
- /config/audiobookshelf/config:/config
- /config/audiobookshelf/metadata:/metadata
- /storage1/Media/Audiobooks:/audiobooks
ports:
- "13378:80"
storyteller:
container_name: storyteller
# CUDA 12.9 build so whisper runs on the P100 (~6x the CPU build). CUDA 13.x
# images drop Pascal. Upstream publishes CUDA images only as commit-SHA tags
# (no :latest), so this is pinned and out of Watchtower; bump the tag by hand
# from the registry's amd64-cuda-12.9.0 repository.
# 67260c54 = web-v3.0.0-beta.51 (main is the v3 beta; stable v2.14.23 is
# deb8bbf4). The v2->v3 DB migration ran 2026-10-18; its pre-migration
# backup is /storage1/labdata/storyteller/backups/storyteller-pre-v3-*.db.
image: registry.gitlab.com/storyteller-platform/storyteller/amd64-cuda-12.9.0:67260c54
restart: unless-stopped
labels:
- "com.centurylabs.watchtower.enable=false"
networks: [media, edge]
env_file:
- stack.env # STORYTELLER_SECRET_KEY lives here
devices:
- nvidia.com/gpu=0
environment:
# The whisper build has no sm_60 kernels, so the P100 JIT-compiles PTX on
# first use (~60 s). Persist the JIT cache so that only happens once.
- CUDA_CACHE_PATH=/data/.nv-compute-cache
- CUDA_CACHE_MAXSIZE=4294967296
volumes:
- /storage1/labdata/storyteller:/data
- /storage1/Media/Books:/libraries/books:ro
- /storage1/Media/Audiobooks:/libraries/audiobooks:ro
ports:
- "8001:8001"
courarr:
container_name: courarr
# Seasonal anime lists from AniList (no key, no OAuth), mapped to TVDB via
# Fribb/anime-lists. Replaces the Trakt "latest-anime" list whose OAuth
# lapsed 2024-12-02. Sonarr reads http://courarr:6161/feed/<slug> over the
# media network; lists/settings/API key live in /config/courarr/courarr.db.
image: ghcr.io/jpjoseph12/courarr:latest
restart: unless-stopped
networks: [media, edge]
env_file:
- stack.env
volumes:
- /config/courarr:/config
ports:
- "6161:6161"
mam-bonus:
container_name: mam_bonus
# Once a day, spend MAM bonus points on upload credit (json/bonusBuy.php,
# spendtype=upload, "Max Affordable ") so seedbonus never caps out. Uses its
# own dedicated MAM session (MAM_BONUS_MAM_ID); the rotating cookie is kept
# in /config/mam-bonus. Failures go to ntfy topic `mam`.
image: alpine:3.20
restart: unless-stopped
networks: [edge] # egress + ntfy:80 for failure alerts
env_file:
- stack.env
volumes:
# Absolute host path on purpose: a relative ./ mount resolves to
# /data/compose/<id>/... (Portainer-internal) and binds an EMPTY host dir.
# Canonical copy is stacks/media/mam-bonus/buy-upload.sh; scp it here.
- /config/mam-bonus/buy-upload.sh:/app/buy-upload.sh:ro
- /config/mam-bonus:/data
entrypoint: ["/bin/sh", "-c"]
command:
- |
apk add --no-cache curl jq tzdata >/dev/null
# crond jobs get a bare env, so hand the job its vars via a file
printenv | grep -E '^(MAM_BONUS_|TZ=)' | sed "s/^\([^=]*\)=\(.*\)/export \1='\2'/" > /etc/mam-bonus.env
chmod 600 /etc/mam-bonus.env
# busybox crond silently skips a crontab not owned by root
echo '17 4 * * * . /etc/mam-bonus.env && /bin/sh /app/buy-upload.sh >> /proc/1/fd/1 2>&1' > /etc/crontabs/root
chown root:root /etc/crontabs/root && chmod 600 /etc/crontabs/root
exec crond -f -l 8 -c /etc/crontabs
labels:
- "com.centurylabs.watchtower.enable=false"
networks: networks:
media: media:
name: media name: media
+77
View File
@@ -0,0 +1,77 @@
#!/bin/sh
# Daily MAM bonus-point spend: buy as much upload credit as the balance allows
# so seedbonus never sits at the cap. Run by crond in the mam-bonus container.
#
# Session handling: MAM rotates mam_id on responses. Prowlarr survives that by
# saving the new cookie; autobrr didn't and died (2026-11-20). So this keeps a
# curl cookie jar in /data and lets curl re-save the rotated value on each call.
# The jar is (re)seeded from MAM_BONUS_MAM_ID only when that env value changes.
#
# Env (stack.env):
# MAM_BONUS_MAM_ID bare mam_id of a DEDICATED MAM session (not shared w/ autobrr/prowlarr)
# MAM_BONUS_RESERVE points to leave unspent (default 0 = "Max Affordable ")
# MAM_BONUS_NTFY ntfy topic URL for failures (default http://ntfy:80/mam)
# MAM_BONUS_DRY_RUN 1 = check balance + log what would be bought, don't buy
set -eu
BASE=https://www.myanonamouse.net
JAR=/data/cookies.txt
SEED=/data/seed.sha
RESERVE="${MAM_BONUS_RESERVE:-0}"
NTFY="${MAM_BONUS_NTFY:-http://ntfy:80/mam}"
PER_GIB=500 # MAM store price: 500 BP per GiB of upload
MIN_GIB=50 # API rejects < 50 GiB
log() { echo "$(date '+%F %T') mam-bonus: $*"; }
fail() {
log "FAIL: $*"
curl -fsS -m 15 -H "Title: MAM bonus buy failed" -H "Priority: high" -H "Tags: warning" \
-d "$*" "$NTFY" >/dev/null 2>&1 || log "(ntfy post failed too)"
exit 1
}
[ -n "${MAM_BONUS_MAM_ID:-}" ] || fail "MAM_BONUS_MAM_ID is not set in media stack.env"
# (Re)seed the jar when the configured session changes.
want=$(printf %s "$MAM_BONUS_MAM_ID" | sha256sum | cut -d' ' -f1)
if [ ! -s "$JAR" ] || [ "$(cat "$SEED" 2>/dev/null)" != "$want" ]; then
printf '# Netscape HTTP Cookie File\n.myanonamouse.net\tTRUE\t/\tTRUE\t0\tmam_id\t%s\n' \
"$MAM_BONUS_MAM_ID" > "$JAR"
echo "$want" > "$SEED"
chmod 600 "$JAR" "$SEED"
log "cookie jar seeded from MAM_BONUS_MAM_ID"
fi
mam() { curl -sS -m 30 -b "$JAR" -c "$JAR" -A "homelab-mam-bonus/1.0" "$@"; }
# Balance check (also proves the session is alive).
me=$(mam "$BASE/jsonLoad.php") || fail "jsonLoad.php request failed"
bp=$(printf %s "$me" | jq -er '.seedbonus | floor' 2>/dev/null) \
|| fail "session rejected or bad response from jsonLoad.php (mam_id expired/IP-locked?): $(printf %s "$me" | head -c 200)"
spendable=$((bp - RESERVE))
gib=$((spendable / PER_GIB))
log "seedbonus=$bp reserve=$RESERVE -> can buy ${gib} GiB"
if [ "$gib" -lt "$MIN_GIB" ]; then
log "below the ${MIN_GIB} GiB minimum (${MIN_GIB}*${PER_GIB}=$((MIN_GIB * PER_GIB)) BP); nothing to do"
exit 0
fi
if [ "$RESERVE" -eq 0 ]; then amount="Max Affordable "; else amount="$gib"; fi
if [ "${MAM_BONUS_DRY_RUN:-0}" = 1 ]; then
log "DRY RUN: would buy upload amount='$amount'"
exit 0
fi
res=$(mam -G "$BASE/json/bonusBuy.php/" \
--data-urlencode "spendtype=upload" \
--data-urlencode "amount=$amount" \
--data-urlencode "_=$(date +%s)000") || fail "bonusBuy.php request failed"
if [ "$(printf %s "$res" | jq -r '.success // false' 2>/dev/null)" = true ]; then
log "bought upload: $(printf %s "$res" | jq -c 'del(.success)')"
else
fail "bonusBuy rejected (seedbonus was $bp): $(printf %s "$res" | head -c 300)"
fi
+110
View File
@@ -0,0 +1,110 @@
#!/usr/bin/env python3
"""qBittorrent "run on torrent finished" hook.
Host-managed copy lives at /config/qbittorrent/scripts/on-complete.py (container
path /config/scripts/on-complete.py); this file is the canonical source, scp it
over after editing. AutoRun program in qBittorrent.conf:
python3 /config/scripts/on-complete.py "%I" "%L" "%F" "%D" <cross-seed apikey>
1. Every torrent: notify cross-seed's webhook (what the old inline curl did).
2. Category "mam" (autobrr MyAnonamouse grabs): file the payload into the book
libraries without touching the seeding copy. autobrr saves MAM grabs to
/storage1/complete/mam/<Category>/<SubCategory>/<Author>/<Title>/ so the path carries the
metadata the .torrent name lacks.
- Audiobook -> hardlinked into /storage1/Media/Audiobooks/<Author>/<Title>/
(Audiobookshelf). Never use ABS "embed metadata" on these: it rewrites the
shared inode and breaks the seed.
- Ebook -> COPIED into the CWA ingest folder. CWA edits and then deletes
ingest files, so a hardlink would corrupt the seeding data.
"""
import os
import shutil
import sys
import urllib.parse
import urllib.request
from datetime import datetime
MAM_ROOT = "/storage1/complete/mam"
AUDIOBOOKS = "/storage1/Media/Audiobooks"
EBOOK_INGEST = "/storage1/complete/books-ingest"
AUDIO_EXT = {".m4b", ".m4a", ".mp3", ".flac", ".ogg", ".opus", ".aac", ".wma"}
# Sidecars ABS uses for covers/metadata.
AUDIO_SIDECAR_EXT = {".jpg", ".jpeg", ".png", ".webp", ".opf", ".nfo", ".cue"}
EBOOK_EXT = {".epub", ".azw3", ".azw", ".mobi", ".pdf", ".kepub", ".fb2", ".cbz", ".cbr"}
LOG = "/config/scripts/on-complete.log"
def log(msg):
with open(LOG, "a", encoding="utf-8") as f:
f.write(f"{datetime.now():%Y-%m-%d %H:%M:%S} {msg}\n")
def notify_cross_seed(info_hash, apikey):
data = urllib.parse.urlencode({"infoHash": info_hash, "includeSingleEpisodes": "true"}).encode()
url = "http://cross-seed:2468/api/webhook?" + urllib.parse.urlencode({"apikey": apikey})
try:
urllib.request.urlopen(urllib.request.Request(url, data=data, method="POST"), timeout=30)
except Exception as e: # cross-seed being down must not block filing
log(f"cross-seed webhook failed for {info_hash}: {e}")
def payload_files(content_path):
"""Yield (abs_path, path relative to the torrent's root) for every file."""
if os.path.isfile(content_path):
yield content_path, os.path.basename(content_path)
return
for dirpath, _, names in os.walk(content_path):
for n in names:
p = os.path.join(dirpath, n)
yield p, os.path.relpath(p, content_path)
def file_mam(content_path, save_path):
rel = os.path.relpath(save_path, MAM_ROOT).split(os.sep)
if len(rel) < 3 or rel[0].startswith(".."):
log(f"mam: unexpected save path {save_path!r}, skipping")
return
# autobrr's Category renders as "Audiobook/Non-Fiction", so the path is
# <Category>/<SubCategory>/<Author>/<Title>; take author/title from the end.
category, author, title = rel[0], rel[-2], rel[-1]
linked = 0
if category.lower() == "audiobook":
dest = os.path.join(AUDIOBOOKS, author, title)
for src, r in payload_files(content_path):
ext = os.path.splitext(src)[1].lower()
if ext not in AUDIO_EXT | AUDIO_SIDECAR_EXT:
continue
target = os.path.join(dest, r)
if os.path.exists(target):
continue
os.makedirs(os.path.dirname(target), exist_ok=True)
os.link(src, target)
linked += 1
log(f"mam audiobook: {linked} file(s) -> {dest}")
elif category.lower() == "ebook":
for src, _ in payload_files(content_path):
if os.path.splitext(src)[1].lower() not in EBOOK_EXT:
continue
target = os.path.join(EBOOK_INGEST, os.path.basename(src))
if os.path.exists(target):
continue
shutil.copy2(src, target)
linked += 1
log(f"mam ebook: {linked} file(s) copied to ingest from {content_path}")
else:
log(f"mam: category {category!r} not filed ({content_path})")
def main():
info_hash, category, content_path, save_path, apikey = sys.argv[1:6]
notify_cross_seed(info_hash, apikey)
if category == "mam":
try:
file_mam(content_path, save_path)
except Exception as e:
log(f"mam: filing failed for {content_path}: {e!r}")
if __name__ == "__main__":
main()
+7 -4
View File
@@ -1,19 +1,22 @@
# TRaSH Guides sync — WEB-1080p (Sonarr) + HD Bluray + WEB (Radarr). # TRaSH Guides sync — WEB-1080p + [Anime] Remux-1080p (Sonarr), HD Bluray + WEB (Radarr).
# Run manually: docker exec recyclarr recyclarr sync # Run manually: docker exec recyclarr recyclarr sync
sonarr: sonarr:
main: sonarr-main:
base_url: http://sonarr:8989 base_url: http://sonarr:8989
api_key: !secret sonarr_api_key api_key: !secret sonarr_api_key
delete_old_custom_formats: true delete_old_custom_formats: true
quality_definition: quality_definition:
type: series type: series
quality_profiles: quality_profiles:
- trash_id: 72dae194fc92bf828f32cde74482a9dde - trash_id: 72dae194fc92bf828f32cde7744e51a1 # WEB-1080p (standard series)
reset_unmatched_scores:
enabled: true
- trash_id: 20e0fc959f1f1704bed501f23bdae76f # [Anime] Remux-1080p (anime series)
reset_unmatched_scores: reset_unmatched_scores:
enabled: true enabled: true
radarr: radarr:
main: radarr-main:
base_url: http://radarr:7878 base_url: http://radarr:7878
api_key: !secret radarr_api_key api_key: !secret radarr_api_key
delete_old_custom_formats: true delete_old_custom_formats: true
+41
View File
@@ -4,3 +4,44 @@
TZ=America/Chicago TZ=America/Chicago
PUID=1000 PUID=1000
PGID=1000 PGID=1000
# storyteller — auth token signing key (secrets.token_hex(64))
STORYTELLER_SECRET_KEY=5b41f526eb62c2fbe17527b65a0e71ff06d5927fbeb869541f52e812ba8366d28afe1ed26e9986853484995848e3a91ff2b0321ed583d9612af5d82005df22c9
# audiobookshelf — Authentik OIDC client (homelab-audiobooks, pk 46). Reference only:
# ABS stores OIDC config in its own DB (Settings → Authentication).
ABS_OIDC_CLIENT_ID=H617VXaM04KA0URJyWI52ThBpC3crIAZY77UYlzt
ABS_OIDC_CLIENT_SECRET=1Tmw0PLw8CP82JX4Vz5nuOfpykh6XKngrU8a4Vspc6ZsIarJn3mG5GwKre1D5DnVqfF7MXbOc5g83lkR7NUcHPjlj3QgPX4BFnbUdl2r09LHrcH9X8CY4gJP0Sl1hdcr
# chaptarr — Authentik OIDC client (homelab-chaptarr, pk 47). Reference only:
# chaptarr stores OIDC config in its own DB (Settings → General → Authentication).
CHAPTARR_OIDC_CLIENT_ID=BlQNRexLVkgUuH8j0ybmFSiD93dw1mBUF6tsjG6b
CHAPTARR_OIDC_CLIENT_SECRET=THoqN0qLbPuni9cg0vqeid200VsgXKs1WihOSYV8NqciIcp6eCTmvYeRHKYWxF7jOiCBUdL3kP6e4e06SeQr0vwzFSz8rLYYCRomQqizv1iWfRGv0HjfDgkNj49rwrz6
# cross-seed (config.js reads these via process.env)
CROSS_SEED_API_KEY=41ac9aabd275b7c9efd763cb52562d91d90515ccb78761d1
PROWLARR_API_KEY=a02364e8ce5b4a3aa7396d41b189e9f8
SONARR_API_KEY=383c9489253e445baf8514013a4e37a4
RADARR_API_KEY=94159a19beef48f185bd3e330f8dde3a
QBIT_USER=ginnoir
QBIT_PASS=d0fet0th3x
# autobrr — native OIDC via Authentik (homelab-autobrr, pk 48)
AUTOBRR__HOST=0.0.0.0
AUTOBRR__PORT=7474
AUTOBRR__SESSION_SECRET=f553711d2281745aac667fecd91306340c92a81f9a3d0c1e38a69d70a93b062a
AUTOBRR__OIDC_ENABLED=true
AUTOBRR__OIDC_ISSUER=https://auth.ginnoir.com/application/o/autobrr/
AUTOBRR__OIDC_CLIENT_ID=Gz9Ip2b2lTOaGewfkaIi07fjlhz05RTST8DLei5I
AUTOBRR__OIDC_CLIENT_SECRET=sX0qXKzdBiE9N8QGN5LM2x29xxI1Hs2lAhMdnN2qsatp43SQep83LHFTzepHaDD3F2GOBc14oFoLL2EUJyCSk8Pfz8NIHascAnztHNKGk5hdrXAyIUCE7S37twHQRNIF
AUTOBRR__OIDC_REDIRECT_URL=https://autobrr.ginnoir.com/api/auth/oidc/callback
AUTOBRR__OIDC_DISABLE_BUILT_IN_LOGIN=true
# autobrr API key for scripted ops (row "homelab-ops" in api_key table)
AUTOBRR_API_KEY=3076c984c78d9ef477228379faea6b04
# mam-bonus: dedicated MAM session (bare mam_id) for the daily upload-credit buy.
# Seeds /config/mam-bonus/cookies.txt; MAM rotates it and the job re-saves it there.
MAM_BONUS_MAM_ID=JbRgCtBtbsFjCbXsDOUhtMpuUO-oe2dc1i1wT8-8OZRJ0dmBspWkG2SmK5euqhgX-XbtncjiGHWHBYMRS_DSvO4DXsdH--OHZAcZmUgcDuPBaDAcSMEmKSkpvPayUazed0YU3ncV6om380HXPnBgaAvTvocM5lcPruIHWgcji4771TuLriZ7D5xPtqjkO9YdsjOh2A_ckhQQLhFPmejFjgx9mJJ6fc4Xw3ctFwO2CY8EDcH6u3ViF7jD73Qpr8gWnfwGokuHVpKSyJDUzUWPkj7NbldwUhdS-C4l
MAM_BONUS_RESERVE=0
MAM_BONUS_NTFY=http://ntfy:80/mam
+2 -3
View File
@@ -31,7 +31,8 @@ services:
resume-minio: resume-minio:
container_name: minio_resume container_name: minio_resume
image: minio/minio:RELEASE.2025-09-07T16-13-09Z # minio/minio vanished from Docker Hub 2026-10; self-hosted copy of the last cached tag.
image: registry.ginnoir.com/mirror/minio:RELEASE.2025-09-07T16-13-09Z
restart: unless-stopped restart: unless-stopped
labels: labels:
- "com.centurylabs.watchtower.enable=false" - "com.centurylabs.watchtower.enable=false"
@@ -47,8 +48,6 @@ services:
environment: environment:
- MINIO_BROWSER_REDIRECT_URL=https://minio.ginnoir.com - MINIO_BROWSER_REDIRECT_URL=https://minio.ginnoir.com
- MINIO_IDENTITY_OPENID_CONFIG_URL=https://auth.ginnoir.com/application/o/minio/.well-known/openid-configuration - MINIO_IDENTITY_OPENID_CONFIG_URL=https://auth.ginnoir.com/application/o/minio/.well-known/openid-configuration
- MINIO_IDENTITY_OPENID_CLIENT_ID
- MINIO_IDENTITY_OPENID_CLIENT_SECRET
- MINIO_IDENTITY_OPENID_SCOPES=openid,profile,email - MINIO_IDENTITY_OPENID_SCOPES=openid,profile,email
healthcheck: healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:9000/minio/health/live || exit 1"] test: ["CMD-SHELL", "curl -sf http://localhost:9000/minio/health/live || exit 1"]
+22 -1
View File
@@ -22,9 +22,13 @@
services: services:
jellyfin: jellyfin:
container_name: jellyfin container_name: jellyfin
image: lscr.io/linuxserver/jellyfin:latest # Pinned 2026-10-23 (Jellyfin 12.3.0): Watchtower recreates mid-day caused
# ~9 min of 502s while 10.11+/12.x starts silently on virtiofs. Bump manually.
image: lscr.io/linuxserver/jellyfin:12.3ubu2604-ls56
restart: unless-stopped restart: unless-stopped
networks: [streaming, edge] networks: [streaming, edge]
labels:
- "com.centurylabs.watchtower.enable=false"
env_file: env_file:
- stack.env - stack.env
devices: devices:
@@ -82,6 +86,23 @@ services:
ports: ports:
- "5690:5690" - "5690:5690"
# Jellyfin-backed Seerr, alongside the Plex-backed `seerr` in the media stack
# until the Plex cutover. Reaches sonarr/radarr over edge.
jellyseerr:
container_name: jellyseerr
image: ghcr.io/seerr-team/seerr:latest
init: true
restart: unless-stopped
networks: [streaming, edge]
env_file:
- stack.env
environment:
- UMASK=002
volumes:
- /config/jellyseerr:/app/config
ports:
- "5056:5055"
jellyplex-watched: jellyplex-watched:
container_name: jellyplex-watched container_name: jellyplex-watched
image: luigi311/jellyplex-watched:latest image: luigi311/jellyplex-watched:latest
+1 -1
View File
@@ -22,7 +22,7 @@ JWT_SECRET=0dd9fcdb632277b76977dbada8226e547cc773e1deafc8d778d4038f8d59393b
# gets an empty reply. Temporary host socat proxy plex-http-proxy.service # gets an empty reply. Temporary host socat proxy plex-http-proxy.service
# exposes loopback Plex HTTP on :32402 for Docker clients (Plexyfin + jellyplex). # exposes loopback Plex HTTP on :32402 for Docker clients (Plexyfin + jellyplex).
# Tear down that unit after Plex is decommissioned / Plexyfin is done. # Tear down that unit after Plex is decommissioned / Plexyfin is done.
PLEX_URL=http://192.168.1.69:32402 PLEX_BASEURL=http://192.168.1.69:32402
PLEX_TOKEN=hM9aycswHKSsUrxiHqwq PLEX_TOKEN=hM9aycswHKSsUrxiHqwq
JELLYFIN_BASEURL=http://jellyfin:8096 JELLYFIN_BASEURL=http://jellyfin:8096
JELLYFIN_TOKEN=a3d9ee827d5c42298cae087a2c31d3fa JELLYFIN_TOKEN=a3d9ee827d5c42298cae087a2c31d3fa