Media Server, Pt 4 - Sabnzbd

Now we're starting the fun. Note that the current configuration of the main branch does not include outbound connectivity for the media server, nor will it. This is to make it a conscious choice on the part of my readers to permit, or not permit, their containers to access the internet on their behalf. To allow outbound connectivity, simply remove the line "internal: true" in the networking configuration of your compose file.

Sabnzbd is a Usenet downloader. Yes, I know, the '80s called and want their networking protocol back, but there is still life and use in NNTP. The configuration detailed here is extremely basic - it will work, but there are more involved ways to do things.

First, we obviously need to set up our directories for the bind mounts.

$ mkdir -p /srv/data/docker/sabnzbd/{config,incomplete}
$ mkdir -p /srv/data/shared/usenet/{books,movies,music,tv}
$ sudo chown -R 10005:10002 /srv/data/docker/sabnzbd
$ sudo chmod -R g-rwx,o-rwx /srv/data/docker/sabnzbd
$ sudo chown -R root:root /srv/data/shared
$ sudo chgrp -R 10002 /srv/data/shared/{media,usenet}
$ sudo chmod -R g+w /srv/data/shared/{media,usenet}

Just making sure the permissions are as our media services will expect.

Next, we add sabnzbd to our compose file:

  sabnzbd:
    deploy:
      labels:
        traefik.enable: "true"
        traefik.http.routers.sabnzbd-rtr.entrypoints: "websecure"
        traefik.http.routers.sabnzbd-rtr.middlewares: "authentik@swarm"
        traefik.http.routers.sabnzbd-rtr.rule: "Host(`sabnzbd.your.domain`)"
        traefik.http.routers.sabnzbd-rtr.service: "sabnzbd"
        traefik.http.services.sabnzbd.loadbalancer.server.port: "8080"
      replicas: 1
    environment:
      PUID: 10005
      PGID: 10002
      UMASK: 002
      TZ: "Etc/UTC"
    healthcheck:
      test: "curl -f http:///localhost:8080"
      interval: 2m
      timeout: 5s
      start_period: 1m
    hostname: "sabnzbd"
    image: "hotio/sabnzbd:release"
    networks:
      - homelab
    restart: on-failure
    volumes:
      - "/srv/data/docker/sabnzbd/config:/config"
      - "/srv/data/docker/sabnzbd/incomplete:/data/usenet/incomplete"
      - "/srv/data/shared/usenet:/data/usenet"

And bring the stack up.

$ docker stack deploy -c <compose file> --prune homelab

Wait for 5 minutes for all servers to properly come up and do their thing, then bring the stack back down.

$ docker stack rm homelab

We need to make a change to sabnzbd's configuration file so we are permitted to access the web UI. Edit /srv/data/docker/sabnzbd/config/sabnzbd.ini, find the line "host_whitelist" and change it as follows. Also change "local_range".

host_whitelist=sabnzbd.your.domain
local_range=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16

The latter should be default, but it never hurts to be explicit about these things.

Then bring the stack back online.

$ docker stack deploy -c <compose file> --prune homelab

You should now be able to visit https://sabnzbd.your.domain, go through the setup wizard, and configure your usenet server. From there, the only significant changes you probably want to make is to go to Settings > Folders > User Folders, and point incomplete and complete folders, respectively, to /data/usenet/incomplete and /data/usenet/complete. I'd recommend to also head to Categories and set up tv, music, movies and books categories pointing to their respective subdirectories in /data/usenet/complete. It will make PVR set up easier later.

Configuration files are, as usual, on https://gitea.turriff.net/andreas/Homelab/releases/tag/Media_Server_Pt_4

Subscribe to Homelab Adventures

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
jamie@example.com
Subscribe