Homelab · GitOps · Docker Compose

docker-stacks

One folder per service, deployed by pushing to a self-hosted Forgejo. This page collects every stack's notes next to its compose file. Personal details and infrastructure identifiers have been scrubbed for sharing.

Overview

A collection of all my docker stack files, which will be synced via gitops to my homelab. If you're seeing this and you're not me, I clearly figured out how I wanted to do the whole forgejo thing publicly.

There's a .env file (gitignored) that holds ROOT_FOLDER plus all secrets referenced by the stacks. See .env.example for the full list of variables.

How this works

flowchart LR
    subgraph home["Home Server"]
        direction LR

        subgraph forgejo["Forgejo (Git)"]
            direction TB
            repo["docker-stacks repo"]
            stackA["anime/"]
            stackB["tv-movie/"]
            stackN["plex/"]
            repo --> stackA
            repo --> stackB
            repo --> stackN
        end

        renovate["Renovate"]
        dockhand["Dockhand"]
        containers[("Running containers")]
    end

    discord[("Discord")]

    renovate -->|"scans images"| repo
    renovate -->|"opens PRs to bump image tags"| repo
    repo -->|"webhook on change"| dockhand
    dockhand -->|"deploys / redeploys stacks"| containers
    repo -.->|"webhook: PRs, pushes"| discord
    dockhand -.->|"webhook: deploy status"| discord

Stacks

Each folder under stacks/ holds a compose.yaml and a README with what it's for. One folder per stack so Dockhand's per-directory change detection only redeploys the stack whose file actually changed.

  • anime — All the stuff I used to download anime.
  • books-audiobooks — All the stuff I used to download books and audiobooks.
  • tv-movies — If my docker stacks had a crown jewel, it'd be this.

anime

All the stuff I used to download anime. Flexget is used to automate the download via RSS. Config for it is maintained outside of this.

Diagram

flowchart LR
    nyaa[("Nyaa RSS feeds")]

    subgraph home["Home Server"]
        direction LR

        config["flexget config
        (feeds + shows to track)"]
        flexget["FlexGet"]
        transmission["Transmission"]
        media["media/anime/< series >/"]

        config -->|"loaded by"| flexget
        flexget -->|"add torrent"| transmission
        transmission -->|"on completion, moves file"| media
    end

    nyaa -->|"polls feeds, matches shows"| flexget

Containers

  • transmission
  • flexget

Compose

stacks/anime/compose.yamlyaml
services:
  transmission:
    container_name: transmission
    image: lscr.io/linuxserver/transmission:4.1.3
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - TRANSMISSION_WEB_HOME= #optional
      - USER= #optional
      - PASS= #optional
      - WHITELIST= #optional
      - PEERPORT= #optional
      - HOST_WHITELIST= #optional
      - RPC_BIND_ADDRESS=0.0.0.0

    volumes:
      - ${ROOT_FOLDER}/appdata/transmission:/config
      - ${ROOT_FOLDER}/data/torrent:/data/torrent
      - ${ROOT_FOLDER}/data/media/anime:/data/media/anime
    ports:
      - 9091:9091
      - 51413:51413
      - 51413:51413/udp
    restart: unless-stopped
  flexget:
    container_name: flexget
    image: lscr.io/linuxserver/flexget:3.21.0
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - FG_LOG_LEVEL=info
      - FG_LOG_FILE=/config/flexget.log
      - FG_CONFIG_FILE=/config/.flexget/config.yml
      - FG_WEBUI_PASSWORD=${FLEXGET_WEBUI_PASSWORD} #optional
    volumes:
      - ${ROOT_FOLDER}/appdata/flexget:/config
      - ${ROOT_FOLDER}/data/torrent:/data/torrent
      - ${ROOT_FOLDER}/data/media/anime:/data/media/anime
    ports:
      - 5050:5050
    restart: unless-stopped

Other files

flexget-config.example.yamlyaml
web_server:
  bind: 0.0.0.0
  port: 5050
  web_ui: yes

templates:
  anime:
    transmission:
      host: transmission
      port: 9091
      username: transmission
      password: transmission
      ratio: 1
    set:
      path: /data/media/anime/{{series_name}}

tasks:
  remove-stale-torrents:
    disable: 
      - seen
      - seen_info_hash
      - torrent_info_hash
    template: anime
    from_transmission:
      host: transmission
      port: 9091
      username: transmission
      password: transmission
    if:
      - transmission_progress == 100: accept
    transmission:
      action: remove
  
  anime-subsplus:
    disable: builtins
    rss: https://nyaa.si/?page=rss&u=SubsPlus
    template: anime
    series:
      - Oshi no Ko:
          identified_by: ep
          ep_regexp:
            - S(\d+)E(\d+).*

  anime-commie:
    disable: builtins
    rss: https://nyaa.si/?page=rss&u=Commie
    template: anime
    series:
      - The Ghost In The Shell

  anime-varyg1001-dual-audio:
    rss: https://nyaa.si/?page=rss&q=Dual&c=0_0&f=0&u=varyg1001
    template: anime
    series:
      - The Ramparts of Ice 
      - Sparks of Tomorrow

  anime-varyg1001-sub-only:
    rss: https://nyaa.si/?page=rss&q=-dual+-multi-audio&c=0_0&f=0&u=varyg1001
    template: anime
    series:
      - Akane Banashi
  
  anime-subsplease:
    rss: https://nyaa.si/?page=rss&q=1080&f=0&u=subsplease
    template: anime
    series:
      - Re Zero kara Hajimeru Isekai Seikatsu
      - Yomi no Tsugai
      - Seihantai na Kimi to Boku
      - Tenkosaki
      - Grand Blue/S3
      - Tai-Ari deshita. Ojousama wa Kakutou Game nante Shinai
      

schedules:
  - tasks: 'anime-*'
    interval:
      minutes: 30
  - tasks: remove-stale-torrents
    interval:
      days: 1

books-audiobooks

All the stuff I used to download books and audiobooks. Shelfmark uses a login for MyAnonaMouse to get all the data. My eReader syncs with calibre-web-automated. I use plappa for connecting with audiobookshelf.

Diagram

flowchart LR
    abb[("AudiobookBay")]
    mam[("MyAnonaMouse")]
    hardcover[("Hardcover")]
    devices(("Phones / players"))
    ereaders(("E-readers"))

    subgraph home["Home Server"]
        direction LR

        abbdl["audiobookbay-downloader"]
        shelfmark["Shelfmark"]
        qbit["qBittorrent"]
        audiobooks["media/audiobooks/"]
        books["media/books/"]
        abs["Audiobookshelf"]
        cwa["Calibre-Web Automated"]
        sb["ShelfBridge"]

        abbdl -->|"add torrent"| qbit
        shelfmark -->|"add torrent"| qbit
        qbit -->|"on completion"| audiobooks
        qbit -->|"on completion"| books
        audiobooks -->|"indexed by"| abs
        books -->|"indexed by"| cwa
        abs -->|"reading progress"| sb
    end

    abb -->|"search audiobooks"| abbdl
    mam -->|"search books"| shelfmark
    abs -->|"playback"| devices
    cwa -->|"auto-send books"| ereaders
    cwa -->|"sync reading progress"| hardcover
    sb -->|"sync listening progress"| hardcover

Containers

  • qbittorrent
  • audiobookbay-downloader
  • audiobookshelf
  • calibre-web-automated
  • shelfmark
  • shelfbridge

Compose

stacks/books-audiobooks/compose.yamlyaml
services:
  qbittorrent:
    image: lscr.io/linuxserver/qbittorrent:5.2.3
    container_name: qbittorrent
    network_mode: host
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - WEBUI_PORT=8112
      - TORRENTING_PORT=49152
    volumes:
      - ${ROOT_FOLDER}/appdata/deluge/config:/config
      - ${ROOT_FOLDER}/data/torrent:/downloads
      - ${ROOT_FOLDER}/data/media/audiobooks:/audiobooks
    restart: unless-stopped

  audiobookshelf:
    image: ghcr.io/advplyr/audiobookshelf:2.38.0
    container_name: audiobookshelf
    environment:
      - TZ=UTC
    volumes:
      - ${ROOT_FOLDER}/appdata/audiobookshelf/config:/config
      - ${ROOT_FOLDER}/appdata/audiobookshelf/metadata:/metadata
      - ${ROOT_FOLDER}/data/media/audiobooks:/audiobooks
    ports:
      - "13378:80"
    restart: unless-stopped

  calibre-web-automated:
    image: crocodilestick/calibre-web-automated:v4.0.8
    container_name: calibre-web-automated
    environment:
      # Only change these if you know what you're doing
      - PUID=1000
      - PGID=1000
      # Edit to match your current timezone https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
      - TZ=UTC
      # Hardcover API Key required for Hardcover as a Metadata Provider, get one here: https://docs.hardcover.app/api/getting-started/
      - HARDCOVER_TOKEN=${HARDCOVER_TOKEN}
      # If your library is on a network share (e.g., NFS/SMB), disable WAL to reduce locking issues
      # Accepts: true/false (default: false)
      - NETWORK_SHARE_MODE=false
      # Override the default port (8083) for the web server.
      # Accepts any valid port number.
      - CWA_PORT_OVERRIDE=8083
    volumes:
      # CW users migrating should stop their existing CW instance, make a copy of the config folder, and bind that here to carry over all of their user settings ect.
      - ${ROOT_FOLDER}/appdata/calibre-web:/config
      # This is an ingest dir, NOT a library one. Anything added here will be automatically added to your library according to the settings you have configured in CWA Settings page. All files placed here are REMOVED AFTER PROCESSING
      - ${ROOT_FOLDER}/appdata/calibre-web/ingest_books:/cwa-book-ingest
      # If you don't have an existing library, CWA will automatically create one at the bind provided here
      - ${ROOT_FOLDER}/data/media/books:/calibre-library
      # If you use calibre plugins, you can bind your plugins folder here to have CWA attempt to add them to its workflow (WIP)
      # If you are starting with a fresh install, you also need to copy customize.py.json to the Calibre config volume above, in /path/to/config/folder/.config/calibre/customize.py.json, see the note below for more info
      - ${ROOT_FOLDER}/appdata/calibre-web/.config/calibre/plugins:/config/.config/calibre/plugins
    ports:
      # Change the first number to change the port you want to access the Web UI, not the second
      - 8083:8083
    # If you set CWA_PORT_OVERRIDE to a port below 1024, you may need to uncomment the following line:
    # cap_add:
    #   - NET_BIND_SERVICE
    restart: unless-stopped
    networks:
      - default
      - caddy

  shelfmark:
    image: ghcr.io/calibrain/shelfmark:v1.8.0
    container_name: shelfmark
    environment:
      PUID: 1000
      PGID: 1000
    ports:
      - 8084:8084
    restart: unless-stopped
    volumes:
      - ${ROOT_FOLDER}/appdata/shelfmark:/config # App configuration
      # Required for torrent / usenet - path must match your download client's volume exactly
      - ${ROOT_FOLDER}/data/torrent:/downloads
      - ${ROOT_FOLDER}/appdata/calibre-web/ingest_books:/books # Default destination for book downloads
      - ${ROOT_FOLDER}/data/media/audiobooks:/audiobooks

  # Syncs audiobook progress from Audiobookshelf to Hardcover. Configured entirely via env vars.
  shelfbridge:
    image: ghcr.io/rohit-purandare/shelfbridge:v1.23.14
    container_name: shelfbridge
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - SHELFBRIDGE_USER_0_ID=default
      - SHELFBRIDGE_USER_0_ABS_URL=http://audiobookshelf:80
      - SHELFBRIDGE_USER_0_ABS_TOKEN=${AUDIOBOOKSHELF_TOKEN}
      - SHELFBRIDGE_USER_0_HARDCOVER_TOKEN=${HARDCOVER_TOKEN}
      - SHELFBRIDGE_AUTO_ADD_BOOKS=true
      - SHELFBRIDGE_TIMEZONE=Etc/UTC
    volumes:
      - ${ROOT_FOLDER}/appdata/shelfbridge/config:/app/config
      - ${ROOT_FOLDER}/appdata/shelfbridge/data:/app/data
    restart: unless-stopped

  # audiobookbay-downloader:
  #   image: ghcr.io/jamesry96/audiobookbay-automated:latest # only publishes :latest, renovate cannot track it
  #   ports:
  #     - "5078:5078"
  #   container_name: audiobookbay-downloader
  #   environment:
  #     - DOWNLOAD_CLIENT=qbittorrent
  #     - DL_SCHEME=http
  #     - DL_HOST=${QBITTORRENT_HOST}
  #     - DL_PORT=8112
  #     - DL_USERNAME=${QBITTORRENT_USERNAME}
  #     - DL_PASSWORD=${QBITTORRENT_PASSWORD}
  #     - DL_CATEGORY=abb-downloader
  #     - SAVE_PATH_BASE=/audiobooks
  #     - ABB_HOSTNAME=audiobookbay.lu #Default
  #     - PAGE_LIMIT=5 #Default
  #     - FLASK_PORT=5078 #Default
  #   restart: unless-stopped

networks:
  caddy:
    external: true

tv-movies

If my docker stacks had a crown jewel, it'd be this. sabnzbd + arr stack for downloading tv and movies via usenet. seerr used for allowing friends to request content to the server. It's a thing of beauty.

Diagram

flowchart LR
    users(("Users"))
    usenet[("Usenet")]

    subgraph home["Home Server"]
        direction LR

        seerr["Seerr
        (request frontend)"]
        approve{"Manual
        approval"}
        prowlarr["Prowlarr
        (indexer config)"]
        radarr["Radarr"]
        sonarr["Sonarr"]
        sab["SABnzbd"]
        movies["media/movies/"]
        tv["media/tv/"]

        seerr --> approve
        approve -->|"movie request"| radarr
        approve -->|"tv request"| sonarr
        prowlarr -.->|"syncs indexers"| radarr
        prowlarr -.->|"syncs indexers"| sonarr
        radarr -->|"send NZB"| sab
        sonarr -->|"send NZB"| sab
        sab -->|"on completion"| movies
        sab -->|"on completion"| tv
    end

    users -->|"request movie / show"| seerr
    usenet -->|"downloads"| sab

Containers

  • prowlarr
  • radarr
  • sonarr
  • seerr
  • sabnzbd

Compose

stacks/tv-movies/compose.yamlyaml
services:
  prowlarr:
    container_name: prowlarr
    image: lscr.io/linuxserver/prowlarr:2.7.0.5723-ls168
    restart: unless-stopped
    ports:
      - 9696:9696
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Australia/Melbourne
    volumes:
      - ${ROOT_FOLDER}/appdata/prowlarr:/config
      - ${ROOT_FOLDER}/data:/data
  radarr:
    container_name: radarr
    image: lscr.io/linuxserver/radarr:6.4.4.10685-ls327
    restart: unless-stopped
    ports:
      - 7878:7878
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Australia/Melbourne
    volumes:
      - ${ROOT_FOLDER}/appdata/radarr:/config
      - ${ROOT_FOLDER}/data:/data
  sonarr:
    container_name: sonarr
    image: lscr.io/linuxserver/sonarr:4.0.20.3014-ls329
    restart: unless-stopped
    ports:
      - 8989:8989
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Australia/Melbourne
    volumes:
      - ${ROOT_FOLDER}/appdata/sonarr:/config
      - ${ROOT_FOLDER}/data:/data
  seerr:
    image: ghcr.io/seerr-team/seerr:v3.5.2
    init: true
    container_name: seerr
    environment:
      - LOG_LEVEL=debug
      - TZ=Australia/Melbourne
      - PORT=5055 #optional
    ports:
      - 5055:5055
    volumes:
      - ${ROOT_FOLDER}/appdata/overseerr:/app/config
    healthcheck:
      test: wget --no-verbose --tries=1 --spider http://localhost:5055/api/v1/settings/public || exit 1
      start_period: 20s
      timeout: 3s
      interval: 15s
      retries: 3
    restart: unless-stopped
    networks:
      - default
      - caddy
  sabnzbd:
    container_name: sabnzbd
    image: ghcr.io/hotio/sabnzbd:release-5.1.3
    restart: unless-stopped
    ports:
      - 8080:8080
      - 9090:9090
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Australia/Melbourne
    volumes:
      - ${ROOT_FOLDER}/appdata/sabnzbd:/config
      - ${ROOT_FOLDER}/data/usenet:/data/usenet:rw
  # bazarr:
  #   container_name: bazarr
  #   image: linuxserver/bazarr
  #   restart: unless-stopped
  #   ports:
  #     - 6767:6767
  #   environment:
  #     - PUID=1000
  #     - PGID=1000
  #     - TZ=Australia/Melbourne
  #   volumes:
  #     - ${ROOT_FOLDER}/appdata/bazarr:/config
  #     - ${ROOT_FOLDER}/data/:/data/media

networks:
  caddy:
    external: true

Repository files

Root-level files the stacks refer to. Secrets are only ever referenced as ${VAR} from the untracked .env.

.env.exampletext
ROOT_FOLDER=/mnt/user
# anime
FLEXGET_WEBUI_PASSWORD=

# books-audiobooks
QBITTORRENT_HOST=
QBITTORRENT_USERNAME=
QBITTORRENT_PASSWORD=
HARDCOVER_TOKEN=
# Audiobookshelf API token (Settings > Users > your user > API Token), used by shelfbridge
AUDIOBOOKSHELF_TOKEN=

# nicotine
SOULSEEK_LOGIN=
SOULSEEK_PASSWORD=

# forgejo
# Tailscale MagicDNS name of the host, e.g. myserver.tailxxxx.ts.net
FORGEJO_DOMAIN=
# http://<FORGEJO_DOMAIN>:3002/
FORGEJO_ROOT_URL=
# hosts forgejo may send webhooks to: same as FORGEJO_DOMAIN if dockhand's webhook URL uses the
# ts.net name, or "private" for any LAN address
FORGEJO_WEBHOOK_ALLOWED_HOSTS=

# renovate
# http://<FORGEJO_DOMAIN>:3002/api/v1/ (scheme and trailing slash required)
RENOVATE_ENDPOINT=
RENOVATE_TOKEN=
RENOVATE_REPOSITORIES=
# Seconds between runs. Keep <= the automergeSchedule window (renovate.json, 2am-4am),
# so a run lands inside the window and automerge can fire.
RENOVATE_INTERVAL=3600
# github.com PAT (classic, no scopes needed for public repos). Renovate runs on Forgejo, so it needs
# this to read release notes/changelogs from github.com when updating Docker images.
GITHUB_COM_TOKEN=

# external-networking (octoDNS -> Cloudflare)
# API token with Zone:Read, DNS:Read, DNS:Edit, scoped to the zones managed here
CLOUDFLARE_TOKEN=

# discord-file-bot
DISCORD_TOKEN=
# Optional: guild id for instant slash-command sync (omit for global commands)
DISCORD_GUILD_ID=
PLEX_URL=http://localhost:32400
PLEX_TOKEN=
FILEBROWSER_URL=http://localhost:5401
FILEBROWSER_USERNAME=
FILEBROWSER_PASSWORD=
FILEBROWSER_SOURCE=Server
FILEBROWSER_PUBLIC_URL=https://share.example.com
# Plex container path prefix -> Filebrowser source-relative path, ;-separated
PLEX_PATH_MAP=/movies=data/media/movies;/tv=data/media/tv;/anime=data/media/anime
# Plex prefixes allowed to be shared as a whole series folder (anime only)
SERIES_FOLDER_PLEX_PREFIXES=/anime
SHARE_EXPIRY_DAYS=7
USER_COOLDOWN_SECONDS=300

# site/build-site.mjs — personal identifiers to scrub from the generated site.
# See site/README.md.
# Comma-separate to scrub several values at once. Leave blank to skip.
SITE_SCRUB_DOMAIN=
SITE_SCRUB_TAILNET_HOST=
SITE_SCRUB_TAILNET=
SITE_SCRUB_HOST=
SITE_SCRUB_USER=
# Which stacks appear on the page (comma-separated; adds to site.config.json).
# Set includeStacks to show only these, or excludeStacks to show all but these — not both.
SITE_INCLUDE_STACKS=
SITE_EXCLUDE_STACKS=
forgejo-renovate.mdmarkdown
# Renovate on Forgejo

Every image in `stacks/` is pinned to a real tag. [Renovate](https://docs.renovatebot.com/) runs as its own stack (`stacks/renovate/`) and checks the registries on a loop. It creates update PRs as soon as a newer tag is found, except for the renovate stack itself, which is gated to a weekly Monday 1–8am Melbourne window; minor updates are automerged, while patch and major updates need manual review. Forgejo's Discord webhook announces PRs, and the gitops sync rolls merged versions out.

Config lives in `renovate.json` at the repo root. This file covers the one-off Forgejo setup.

## 1. Bot user

1. Log into Forgejo as admin → Site Administration → Identity & Access → User Accounts → Create User Account. Username `renovate`. Untick "Require user to change password" if it appears; the user only ever authenticates by token.
2. Open this repo → Settings → Collaborators → add `renovate` with **Write** permission.

## 2. Token

1. Log in as `renovate` → Settings → Applications → Manage Access Tokens → Generate New Token.
2. Scopes: `read:user`, `write:issue`, `write:repository`. Add `read:organization` if the repo lives under an org rather than a user.
3. Copy the token (it's shown once) into `.env`:

```
RENOVATE_ENDPOINT=http://<server>.<tailnet>.ts.net:3002/api/v1/
RENOVATE_TOKEN=<token>
RENOVATE_REPOSITORIES=<owner>/docker-stacks
RENOVATE_INTERVAL=3600   # seconds between runs; keep <= the schedule window in renovate.json (Mon 1-8am)
```

`RENOVATE_ENDPOINT` must be the API root with the scheme and trailing slash, not the web URL. The renovate container can't see MagicDNS, so `stacks/renovate/compose.yaml` maps `FORGEJO_DOMAIN` to `host-gateway` via `extra_hosts` — keep the two in sync.

### github.com token (release notes)

Renovate runs on Forgejo, but almost every image's changelog lives on github.com. To fetch release notes into PR bodies it needs a github.com token, otherwise it uses anonymous access (60 req/hr) and skips most lookups:

1. github.com → Settings → Developer settings → Personal access tokens → generate a classic token. No scopes are needed to read public repos.
2. Add it to `.env` as `GITHUB_COM_TOKEN`. `RENOVATE_GITHUB_COM_TOKEN` is a first-class self-hosted option, so no `hostRules` entry is needed.

## 3. Discord webhook

1. In Discord: channel → Edit Channel → Integrations → Webhooks → New Webhook → Copy Webhook URL.
2. In Forgejo: repo → Settings → Webhooks → Add Webhook → **Discord**.
   - Target URL: the Discord webhook URL
   - Trigger On: Custom Events → tick **Pull Request** (and **Issues** if you want the Dependency Dashboard edits announced too, though that gets noisy)
   - Branch filter: `*`
3. Save, then use "Test Delivery" to confirm a message lands in the channel.

## 4. First run

```sh
docker compose --env-file .env -f stacks/renovate/compose.yaml up
```

Watch the logs. A healthy run looks like:

```
INFO: Repository started (repository=<owner>/docker-stacks)
INFO: Dependency extraction complete (... "docker-compose": 27 ...)
INFO: Repository finished (repository=<owner>/docker-stacks)
```

Then check Forgejo:

- Issues → **Dependency Dashboard**. Every image should be listed. Anything under a heading like "Unsupported version" or "Warnings" means Renovate couldn't parse that tag — add a `versioning` rule for it in `renovate.json` (see the linuxserver and hotio rules for examples).
- Pull Requests → updates are grouped by stack, with major updates in separate PRs.

Common failures:

- `EACCES: permission denied, mkdir '/tmp/renovate/cache'`: the image runs as UID 12021, so `chown -R 12021:0 $ROOT_FOLDER/appdata/renovate` on the host.
- `401`/`403` from the API: token scopes are wrong or `renovate` isn't a collaborator.
- `RENOVATE_REQUIRE_CONFIG` error / "no config file": `renovate.json` isn't on the default branch.
- No dependencies found: the `managerFilePatterns` glob in `renovate.json` doesn't match `stacks/*/compose.yaml`.

Once it's happy, run it detached: `docker compose --env-file .env -f stacks/renovate/compose.yaml up -d`.

## 5. Day to day

- **Minor update**: Renovate creates the PR as soon as a newer tag is found (for renovate itself, during the Monday 1–8am Melbourne window) and automerges it. The gitops sync pulls the new tag.
- **Patch or major update**: review the PR (release notes/changelogs are linked in the PR body when Renovate can find the source repo — see the github.com token note in §2), then merge it to deploy.
- **Major bumps of forgejo and renovate** are held back. They appear in the Dependency Dashboard under "Pending Approval" with a checkbox; tick it and Renovate opens the PR during its next scheduled run.
- **Skip an update**: close the PR. Renovate won't reopen it for that version, only for the next one.
- **Ignore an image entirely**: add a package rule in `renovate.json`:
  ```json
  { "matchPackageNames": ["some/image"], "enabled": false }
  ```
- **Pause everything**: tick the "pause" checkbox at the top of the Dependency Dashboard, or stop the renovate container.
- **Re-run now** instead of waiting for the interval: `docker compose -f stacks/renovate/compose.yaml restart`.

## Known gaps

- `ghcr.io/jamesry96/audiobookbay-automated` only publishes `:latest`, so it stays unpinned and Renovate ignores it.
- Renovate doesn't restart containers. Merging a PR updates the file; whatever syncs this repo to the homelab is responsible for `docker compose up -d`.
- Release notes are only fetchable from GitHub/GitLab/Bitbucket. `codeberg.org/forgejo/forgejo` isn't supported, so its PR gets a `changelogUrl` link instead of inline notes.
renovate.jsonjson
{
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
  "extends": ["config:recommended", ":dependencyDashboard"],
  "timezone": "Australia/Melbourne",
  "enabledManagers": ["docker-compose"],
  "docker-compose": {
    "managerFilePatterns": ["/^stacks/[^/]+/compose\\.ya?ml$/"]
  },
  "packageRules": [
    {
      "description": "Never propose nightly/dev/test/prerelease tags for any image",
      "matchDatasources": ["docker"],
      "allowedVersions": "!/(nightly|develop|dev|test|testing|beta|alpha|rc|preview|legacy)/i"
    },
    {
      "description": "Group updates so each stack directory gets its own PR",
      "matchManagers": ["docker-compose"],
      "groupName": "stack: {{{packageFileDir}}}"
    },
    {
      "description": "Major bumps get their own PR per stack, separate from minor/patch",
      "matchUpdateTypes": ["major"],
      "groupName": "stack: {{{packageFileDir}}} (major)"
    },
    {
      "description": "Automerge non-major updates as soon as they are raised, no schedule gate",
      "matchManagers": ["docker-compose"],
      "matchUpdateTypes": ["minor", "patch", "digest", "pin", "pinDigest"],
      "automerge": true,
      "platformAutomerge": false,
      "ignoreTests": true
    },
    {
      "description": "Only update the renovate stack itself once a week: Mondays 01:00-08:00 Melbourne. Cron hours 1-7 covers 1am through 7:59am; minutes must stay a wildcard.",
      "matchPackageNames": ["ghcr.io/renovatebot/renovate"],
      "schedule": ["* 1-7 * * 1"]
    },
    {
      "description": "linuxserver tag shapes have changed over the years; match only the current shape so old tags aren't parsed as versions. arr images: 4.0.19.2979-ls324",
      "matchPackageNames": ["lscr.io/linuxserver/sonarr", "lscr.io/linuxserver/radarr", "lscr.io/linuxserver/prowlarr"],
      "versioning": "regex:^(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)\\.(?<build>\\d+)-ls(?<revision>\\d+)$"
    },
    {
      "description": "plex: 1.43.4.10903-e5521bd8c-ls324",
      "matchPackageNames": ["lscr.io/linuxserver/plex"],
      "versioning": "regex:^(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)\\.(?<build>\\d+)-[0-9a-f]+-ls(?<revision>\\d+)$"
    },
    {
      "description": "transmission: 4.1.3-r0-ls362",
      "matchPackageNames": ["lscr.io/linuxserver/transmission"],
      "versioning": "regex:^(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)-r(?<build>\\d+)-ls(?<revision>\\d+)$"
    },
    {
      "description": "flexget: v3.20.14-ls374",
      "matchPackageNames": ["lscr.io/linuxserver/flexget"],
      "versioning": "regex:^v(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)-ls(?<build>\\d+)$"
    },
    {
      "description": "qbittorrent: 5.2.3_v2.0.14-ls476 (the _v part is the libtorrent version, ignored)",
      "matchPackageNames": ["lscr.io/linuxserver/qbittorrent"],
      "versioning": "regex:^(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)_v\\d+\\.\\d+\\.\\d+-ls(?<build>\\d+)$"
    },
    {
      "description": "hotio tags are release-x.y.z",
      "matchPackageNames": ["ghcr.io/hotio/sabnzbd"],
      "versioning": "regex:^release-(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)$"
    },
    {
      "description": "Codeberg isn't a changelog host Renovate can read, so link forgejo's release notes instead",
      "matchPackageNames": ["codeberg.org/forgejo/forgejo"],
      "changelogUrl": "https://codeberg.org/forgejo/forgejo/releases"
    }
  ]
}
scripts/create-directories.shsh
TARGET_DIR=$1

# create directories for appdata (e.g. config)
# anime
mkdir -p $TARGET_DIR/appdata/{transmission,flexget}
# books-audiobooks
mkdir -p $TARGET_DIR/appdata/deluge/config
mkdir -p $TARGET_DIR/appdata/audiobookshelf/{config,metadata}
mkdir -p $TARGET_DIR/appdata/calibre-web/{ingest_books,.config/calibre/plugins}
mkdir -p $TARGET_DIR/appdata/shelfmark
mkdir -p $TARGET_DIR/appdata/shelfbridge/{config,data}
# caddy
mkdir -p $TARGET_DIR/appdata/caddy/{data,config}
# dockhand
mkdir -p $TARGET_DIR/appdata/dockhand
# discord-file-bot
mkdir -p $TARGET_DIR/appdata/discord-file-bot
# filebrowser-quantum
mkdir -p $TARGET_DIR/appdata/filebrowser-quantum/data
# forgejo
mkdir -p $TARGET_DIR/appdata/forgejo
# linkding
mkdir -p $TARGET_DIR/appdata/linkding
# manga
mkdir -p $TARGET_DIR/appdata/suwayomi
# nginx-proxy-manager
mkdir -p $TARGET_DIR/appdata/nginxproxymanager
# nicotine
mkdir -p $TARGET_DIR/appdata/nicotine/{config,data}
# plex
mkdir -p $TARGET_DIR/appdata/{plex,tatulli}
# renovate
mkdir -p $TARGET_DIR/appdata/renovate
# subs-fixer
mkdir -p $TARGET_DIR/appdata/subs-fixer
# syncthing
mkdir -p $TARGET_DIR/appdata/syncthing/{config,data/{scrivener,obsidian,scrivfolder_backup}}
# tv-movies
mkdir -p $TARGET_DIR/appdata/{prowlarr,radarr,sonarr,overseerr,sabnzbd}
# websites
mkdir -p $TARGET_DIR/appdata/sites/{maxwell-logs,igbc-stonks,guide,music-grid,exchange,unrecommender,yamhv,tachndb,docker-stacks}

# create directories for media
mkdir -p $TARGET_DIR/data/media/{tv,movies,anime,manga,books,audiobooks,music}

# create directories for downloads
mkdir -p $TARGET_DIR/data/{torrent,usenet,soulseek}