Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

Β 

History

157 Commits

Folders and files

Repository files navigation

Docker At Home

Self-hosted Docker stack for home services, organised by functional profiles.

πŸ“ Architecture

A single docker-compose.yml uses profiles to group services:

  • infrastructure β€” Traefik, Tailscale, Arcane, Pocket ID, Tinyauth, Homepage, CrowdSec
  • dashboard β€” Homepage
  • media β€” Jellyfin, Seerr, Radarr, Sonarr, Prowlarr, qBittorrent + Gluetun, qui, Tracearr
  • devtools β€” SonarQube, Pocket ID, Tinyauth
  • security β€” CrowdSec
  • all β€” Every service

The databases (Tracearr, SonarQube) start with their parent service.

🌐 Public vs private (Tailscale)

Only Jellyfin, Seerr, Pocket ID and SonarQube are public (*.${DOMAIN_BASE}, CrowdSec in front), exclusively through a Cloudflare Tunnel: no port is open on the router. Everything else lives on *.lan.${DOMAIN_BASE}, reachable only through the tailnet: a Tailscale sidecar shares Traefik's network namespace, so the node's 100.x IP exposes Traefik :443 to authorized devices. TLS uses a Let's Encrypt DNS-01 wildcard (Cloudflare provider), and SSO (Tinyauth Forward Auth, or native OIDC against Pocket ID where supported) stays on the private UIs as defense-in-depth. Full design, DNS plan and rollback: docs/acces-prive-tailscale.md.

πŸ›‘οΈ Cloudflare Tunnel and real client IPs

cloudflared (remote-managed, token in .env) has a fixed IP 192.168.97.250 on traefik_net. Every public hostname is configured in the Zero Trust dashboard as https://traefik:443 with Match SNI to Host. Traefik only trusts X-Forwarded-For from that IP (access logs for CrowdSec), and the bouncer reads CF-Connecting-IP from it.

πŸš€ Quick start

  1. Configuration

    Secrets live in Proton Pass (vault Docker-At-Home); .env.tpl references them and generates .env:

    pass-cli login
    pass-cli inject -i .env.tpl -o .env --force
  2. Start everything

    docker compose --profile all up -d
  3. Start a specific profile (infrastructure first)

    docker compose --profile infrastructure up -d
    docker compose --profile media up -d
  4. Start several profiles at once

    docker compose --profile infrastructure --profile media up -d

πŸ› οΈ Management

docker compose --profile all down
docker compose --profile media down

docker compose logs -f [service]
docker compose --profile media logs -f

docker compose restart [service]
docker compose --profile media restart

βš™οΈ Services

πŸ—οΈ infrastructure

  • Traefik β€” Reverse proxy with automatic SSL (Let's Encrypt, DNS-01 via Cloudflare)
  • Tailscale β€” Sidecar node dah-proxy sharing Traefik's netns; entry point of the private zone
  • Arcane β€” Docker management UI (OIDC SSO via Pocket ID) and image updates: daily check + automatic digest updates (schedules set in the UI, Environments β†’ Local Docker β†’ Automations); infra (Traefik, Tailscale, CrowdSec, Pocket ID, Tinyauth, PostgreSQL, Gluetun, Arcane) is notify-only via the com.getarcaneapp.arcane.updater=false label (getarcaneapp/arcane)
  • Pocket ID β€” OIDC identity provider (passkeys), single user/group directory (SQLite)
  • Tinyauth β€” Traefik Forward Auth, login delegated to Pocket ID
  • Homepage β€” Landing dashboard on lan.${DOMAIN_BASE}, native OIDC login against Pocket ID
  • CrowdSec β€” Intrusion detection; feeds the Traefik bouncer middleware on the public routers

πŸ“Š dashboard

  • Homepage β€” Dashboard with customisable widgets, protected by Pocket ID SSO

🎬 media

  • Jellyfin β€” Media streaming server
  • Jellyseerr β€” Media request interface for Jellyfin
  • Radarr β€” Movie automation
  • Sonarr β€” TV show automation
  • Prowlarr β€” Indexer manager for Radarr/Sonarr
  • qBittorrent β€” Torrent client, all traffic routed through Gluetun
  • qui β€” Modern qBittorrent WebUI with native OIDC, plus a client proxy for external apps (autobrr/qui)
  • Gluetun β€” VPN client (WireGuard)
  • gluetun-qbt-watchdog β€” Syncs Gluetun's forwarded port into qBittorrent and restarts it when the tunnel drops (brunoorsolon/gluetun-qbt-watchdog)
  • Tracearr β€” Jellyfin activity history and stats, OIDC via Pocket ID (TimescaleDB + Redis) (connorgallopo/Tracearr)
  • iSponsorBlockTV β€” Skips/mutes YouTube ads and SponsorBlock segments on the Apple TV via the Lounge API (dmunozv04/iSponsorBlockTV)

🧰 devtools

  • SonarQube β€” Code quality / static analysis (dedicated PostgreSQL)
  • Pocket ID, Tinyauth β€” see infrastructure

πŸ›‘οΈ security

  • CrowdSec β€” Behaviour-based intrusion detection; blocks flagged IPs on the public routers (jellyfin/seerr/id/pdf)

πŸ“‚ Media layout

Unified layout under ${MEDIA_PATH}:

/srv/.../media/
β”œβ”€β”€ downloads/
β”‚   β”œβ”€β”€ movies/
β”‚   └── tv/
β”œβ”€β”€ movies/
└── tv/

Recommended configuration:

  • Radarr β†’ root folder: /data/movies
  • Sonarr β†’ root folder: /data/tv
  • qBittorrent β†’ downloads: /data/downloads
  • Jellyfin β†’ libraries: /data/movies and /data/tv

πŸ“Ί iSponsorBlockTV (Apple TV pairing)

Pairing is required before the daemon can run β€” it exits while devices is empty. Auto-discovery (--net=host) is Linux-only, so pairing uses a TV code.

  1. On the Apple TV: YouTube app β†’ Settings β†’ Link with TV code (leave that screen open).
  2. On the Mac, run the wizard and paste the code:
docker compose run --rm isponsorblocktv setup-cli
  1. Answer n to the API-key and channel-whitelist questions (whitelisting is the only feature needing a YouTube Data API key), then start it:
docker compose --profile media up -d isponsorblocktv

Settings live in isponsorblocktv/config.json (gitignored β€” it holds the pairing screen_id). Defaults: mute_ads and skip_ads enabled, SponsorBlock categories sponsor, selfpromo, interaction, music_offtopic. Also available: intro, outro, preview, filler, hook, exclusive_access.

Notes:

  • YouTube rotates the pairing code format and revokes old screen_ids; re-run the wizard if skipping stops working. A warning is logged for the old 26-character format.
  • Ad muting does not work when the Apple TV audio goes to a speaker over AirPlay.
  • The first unskippable seconds of an ad still play (muted).

πŸ” SSO with Pocket ID + Tinyauth

  • Pocket ID (https://id.${DOMAIN_BASE}) β€” OIDC provider, passkey login, single source of users and groups. Admin created at /setup on first start.
  • Tinyauth (tinyauth.lan.${DOMAIN_BASE}) β€” Forward Auth for apps without native SSO; it has no local users and redirects straight to Pocket ID.

Forward Auth (Traefik β†’ Tinyauth)

Gated on their private hostnames (*.lan.${DOMAIN_BASE}), each behind a dedicated <service>-access group:

radarr, sonarr, prowlarr, tracearr, glances

Routers use the tinyauth@docker middleware (http://tinyauth:3000/api/auth/traefik). Per-app rules are TINYAUTH_APPS_<APP>_CONFIG_DOMAIN / _OAUTH_GROUPS variables on the tinyauth service (no Docker socket). An app without a rule is open to any account allowed by the tinyauth client.

Arr services: Radarr, Sonarr and Prowlarr have their internal auth disabled (<AuthenticationMethod>External</AuthenticationMethod>) and rely entirely on Tinyauth for their web UI. If Tinyauth or Pocket ID is down the UI is unreachable but secured.

API routes outside Forward Auth

API clients send an API key, not a session, so Forward Auth would block them. A higher-priority router exposes each service's API path bypassing Tinyauth, on the private hostname:

Service Router Rule Auth on the API
Radarr radarr-api Host(radarr.lan.…) && PathPrefix(/api) X-Api-Key
Sonarr sonarr-api Host(sonarr.lan.…) && PathPrefix(/api) X-Api-Key
Prowlarr prowlarr-api Host(prowlarr.lan.…) && PathPrefix(/api) X-Api-Key

priority=100 makes the /api prefix win over the catch-all UI router. These routes stay reachable when Tinyauth is down.

qBittorrent has no Traefik route: its UI is served by qui (qui.lan.…), and native clients (Helmarr) go through qui's client proxy (/proxy/<key>). qBittorrent stays reachable internally at gluetun:8080, so keep its WebUI auth enabled.

Native OIDC

Issuer https://id.${DOMAIN_BASE} (discovery /.well-known/openid-configuration); add the groups scope where group claims are needed.

  • qui β€” OIDC (fully managed by Terraform; built-in login disabled, access gated on the qui-access group)
  • Arcane β€” OIDC (fully managed by Terraform; admin role and access gated on the arcane-access group)
  • Homepage β€” OIDC (fully managed by Terraform; access gated on the homepage-access group)
  • Hermes β€” native Hermes Agent on the Mac (gateway Webapp on 127.0.0.1:9120, routed to hermes.lan.${DOMAIN_BASE} by traefik-dynamic.yml); OIDC handled by Hermes (fully managed by Terraform; public PKCE client, no secret; access gated on the hermes-access group)
  • Seerr β€” OIDC (client created manually in Pocket ID)
  • Jellyfin β€” OIDC via the SSO plugin (manual)
  • SonarQube β€” local login (no SAML in Pocket ID)

Pocket ID asks each user to consent once per client.

🧬 Infrastructure as Code (Terraform)

Two independent modules under terraform/:

  • terraform/pocketid/ β€” Pocket ID clients and groups (provider trozz/pocketid)
  • terraform/arr/ β€” Radarr / Sonarr / Prowlarr (providers devopsarr/{radarr,sonarr,prowlarr})

terraform/pocketid/

File Purpose
providers.tf, variables.tf, terraform.tfvars Provider + connection (Pocket ID URL & API key, domain_base)
homepage.tf, qui.tf, arcane.tf, tracearr.tf, hermes.tf OIDC clients (+ <app>-access group, generated env file)
forward_auth.tf <service>-access groups + the single tinyauth client (generated/tinyauth.env)

client_secret is only readable at creation and lives in the state: keep terraform.tfstate out of git (it is).

Usage (from a container on traefik_net, the public URL is not reachable from the host):

cd terraform/pocketid
docker run --rm -it --network traefik_net -v "$PWD":/work -w /work \
  --entrypoint sh hashicorp/terraform:latest -c "terraform init && terraform apply"

After apply, add users to the relevant <service>-access groups in Pocket ID, otherwise access is denied.

Fresh pocketid_data volume: the distroless image runs as uid 65532, so chown 65532:65532 the volume once before the first start.

terraform/arr/

Codifies the Radarr / Sonarr / Prowlarr configuration (quality settings, indexers, download clients, notifications). It talks to each service over its internal URL (container name on traefik_net) authenticated by API key. Requires Terraform β‰₯ 1.7 (conditional import blocks with for_each).

File Purpose
providers.tf, variables.tf, terraform.tfvars Providers + connection (URLs, API keys, qBittorrent, Telegram, paths)
locals.tf TRaSH-style custom formats (MULTi/TRUEFRENCH/FRENCH favoured; VOSTFR/VFQ/unwanted blocked) with per-resolution scores
radarr.tf, sonarr.tf Root folder, qBittorrent download client, custom formats, quality profiles, recycle bin
prowlarr.tf qBittorrent download client, Radarr/Sonarr applications, Telegram notification
indexers.tf Prowlarr Cardigann indexers (Generation-Free, C411, TR4KER, Nostradamus β€” disabled) β€” adopted by import, enable per indexer
sync_profile.tf Prowlarr sync profile (minimum-seeders floor for grabbing)
quality_definitions.tf TRaSH quality sizes (min_size = 0 β€” custom formats do the filtering)
imports.tf Conditional imports β€” empty *_import_id β‡’ resource created; set β‡’ existing config adopted

Usage:

cd terraform/arr
cp terraform.tfvars.example terraform.tfvars
terraform init
terraform plan
terraform apply

Adopting an existing setup: fill the *_import_id / indexer_import_ids values in terraform.tfvars so Terraform adopts the existing resources instead of creating duplicates. Leave them empty on a fresh server.

πŸ”’ Security notes

  • βœ… Private services reachable only through the tailnet (device identity = first auth layer)
  • βœ… Centralised authentication, unified users/groups, passkeys, centralised auth logs
  • βœ… CrowdSec + Traefik bouncer on the remaining public edge (jellyfin/seerr/id/pdf)
  • ⚠️ Single point of failure (assumed): if Pocket ID is down, every Forward Auth / OIDC web UI is inaccessible (Tinyauth too for Forward Auth); the /api routes stay up
  • ⚠️ Arr web UIs (AuthenticationMethod=External) have no protection of their own without Tinyauth β€” mitigated by the tailnet boundary
  • ⚠️ The /api routes (and qui's /proxy/<key>) bypass Tinyauth and rely on the tailnet + the service's own key/token. Keep those keys secret and qBittorrent's WebUI auth enabled.

Recommendations:

  1. Monitor Pocket ID and Tinyauth (healthchecks are configured)
  2. Back up the PostgreSQL databases regularly
  3. Alert on Pocket ID downtime
  4. Periodically test a full-stack startup

Disabling internal auth on Arr services

Only possible by editing config.xml directly:

<AuthenticationMethod>External</AuthenticationMethod>

Procedure:

  1. docker compose stop radarr sonarr prowlarr
  2. Edit the config.xml files in the Docker volumes
  3. docker compose start radarr sonarr prowlarr

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages