Self-hosted BitTorrent + arr-stack + catalog-update pipeline targeting
nullstone (Debian 13). Replaces the legacy onyx -> rsync -> import
round-trip.
Contents:
- README.md headline + ASCII architecture diagram + quickstart
- CLAUDE.md project rules (mirrors beta-flix style)
- .gitignore secrets dirs (.env, gluetun, qbt config, ssh keys)
- .gitleaksignore allowlist nullstone LAN addr + Tailscale CGNAT
- docs/architecture.md the plan in detail (gluetun + qbt + arr + catalog)
- docs/migration.md onyx-qbt -> nullstone-qbt runbook (3 phases)
- docs/trackers.md tracker schema + IP-pinning + ratio notes (user-curated)
- compose/docker-compose.yml gluetun v3.40 + qbt 5.0.5 (netns=gluetun) +
sonarr/radarr/prowlarr (hotio) + betaflix-catalog
- compose/.env.example documented env-var template (no secrets)
- compose/traefik/arr.yml file-provider for qbt/sonarr/radarr/prowlarr
.s8n.ru subdomains, LAN+TS only via
trusted-only@file + authentik-forwardauth@file
- catalog/catalog.py Flask service, ~340 LoC, /sonarr + /radarr +
/healthz; pulls beta-flix, inserts alphabetic
row into MEDIA-LIST.md, writes run log, commits
+ pushes as obsidian-ai. Idempotent via
payload-hash cache.
- catalog/Dockerfile python:3.12-slim + git + tini
- catalog/requirements.txt flask + jinja2 + requests + gitpython + pyyaml (pinned)
- catalog/templates/*.j2 run log + catalog row Jinja templates
- catalog/README.md service docs
- scripts/migrate-onyx.sh phase-2 helper (rsync + .torrent ship, dry-run by default)
- scripts/add-tracker.sh Prowlarr API helper
- scripts/killswitch-test.sh gluetun kill-switch verification (3 steps)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
74 lines
2.6 KiB
Bash
Executable file
74 lines
2.6 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# scripts/add-tracker.sh — register a tracker with Prowlarr via API.
|
|
#
|
|
# Usage:
|
|
# PROWLARR_API_KEY=xxx ./add-tracker.sh <indexer-name> <indexer-id>
|
|
#
|
|
# Where <indexer-id> is Prowlarr's internal ID for the indexer type (look it
|
|
# up via `curl /api/v1/indexer/schema` — see "Discovering indexer IDs" below).
|
|
#
|
|
# This script POSTs a minimal indexer config to Prowlarr. For trackers that
|
|
# need cookies / passkeys / 2FA, finish the setup in the Prowlarr webui
|
|
# afterwards.
|
|
#
|
|
# Pre-reqs:
|
|
# - Prowlarr container up.
|
|
# - PROWLARR_API_KEY exported (Prowlarr → Settings → General → Security).
|
|
# - PROWLARR_URL defaults to http://127.0.0.1:9696.
|
|
|
|
set -euo pipefail
|
|
|
|
NAME="${1:-}"
|
|
INDEXER_ID="${2:-}"
|
|
PROWLARR_URL="${PROWLARR_URL:-http://127.0.0.1:9696}"
|
|
PROWLARR_API_KEY="${PROWLARR_API_KEY:-}"
|
|
|
|
if [ -z "$NAME" ] || [ -z "$INDEXER_ID" ] || [ -z "$PROWLARR_API_KEY" ]; then
|
|
cat <<EOF >&2
|
|
Usage: PROWLARR_API_KEY=xxx $0 <indexer-name> <indexer-id>
|
|
|
|
Env:
|
|
PROWLARR_URL default: http://127.0.0.1:9696
|
|
PROWLARR_API_KEY required — Prowlarr → Settings → General → Security.
|
|
|
|
Discovering indexer IDs:
|
|
curl -s "\$PROWLARR_URL/api/v1/indexer/schema" \\
|
|
-H "X-Api-Key: \$PROWLARR_API_KEY" | \\
|
|
jq -r '.[] | "\\(.implementation)\\t\\(.implementationName)"' | sort -u
|
|
|
|
Find the row matching your tracker, then look up its integer id via the
|
|
full schema entry. Many private trackers use the "Cardigann" implementation
|
|
with a YAML config — see Prowlarr docs for the full attribute list.
|
|
EOF
|
|
exit 2
|
|
fi
|
|
|
|
echo "Querying schema for '$INDEXER_ID'..."
|
|
SCHEMA_JSON="$(curl -fsS \
|
|
-H "X-Api-Key: $PROWLARR_API_KEY" \
|
|
"$PROWLARR_URL/api/v1/indexer/schema" \
|
|
| jq --arg id "$INDEXER_ID" '.[] | select(.id == ($id | tonumber))')"
|
|
|
|
if [ -z "$SCHEMA_JSON" ]; then
|
|
echo "No schema entry for indexer id=$INDEXER_ID" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# Override name with the user-provided one and keep all other fields as-is.
|
|
PAYLOAD="$(jq --arg name "$NAME" '. + {name: $name, enable: true}' <<<"$SCHEMA_JSON")"
|
|
|
|
echo "POSTing indexer config..."
|
|
RESPONSE="$(curl -fsS -X POST \
|
|
-H "X-Api-Key: $PROWLARR_API_KEY" \
|
|
-H "Content-Type: application/json" \
|
|
-d "$PAYLOAD" \
|
|
"$PROWLARR_URL/api/v1/indexer")"
|
|
|
|
NEW_ID="$(jq -r '.id' <<<"$RESPONSE")"
|
|
echo "OK — indexer '$NAME' added with id=$NEW_ID"
|
|
echo
|
|
echo "Next steps:"
|
|
echo " 1. Open Prowlarr → Indexers → $NAME → fill in cookies/passkey/API key."
|
|
echo " 2. Test indexer (Settings → Indexers → Test)."
|
|
echo " 3. Add a row to docs/trackers.md with IP-pinning + ratio notes."
|
|
echo " 4. Push to Sonarr/Radarr via Prowlarr's Apps → Sync."
|