Media Server, Pt. 8 - Mylar3
Mylar turned out to need a little surgery to make work. The basic setup is pretty standard - create the directories it needs, modify the compose file:
$ mkdir /srv/data/docker/mylar3/{config,custom-cont-init.d}
$ sudo chown -R 10019:10002 /srv/data/docker/mylar3
$ sudo chmor -R g-rwx,o-rwx /srv/data/docker/mylar3
mylar3:
deploy:
labels:
traefik.enable: "true"
traefik.http.routers.mylar3-rtr.entrypoints: "websecure"
traefik.http.routers.mylar3-rtr.middlewares: "authentik@swarm"
traefik.http.routers.mylar3-rtr.rule: "Host(`mylar3.your.domain`)"
traefik.http.routers.mylar3-rtr.service: "mylar3"
traefik.http.services.mylar3.loadbalancer.server.port: "8090"
replicas: 1
environment:
PUID: 10019
PGID: 10002
UMASK: 0002
TZ: "Etc/UTC"
healthcheck:
test: "curl -f http://mylar3:8090"
interval: 2m
timeout: 5s
start_period: 20s
hostname: "mylar3"
image: "linuxserver/mylar3"
networks:
- homelab
restart: on-failure
volumes:
- "/srv/data/docker/mylar3/config:/config"
- "/srv/data/shared/usenet:/data/usenet"
- "/srv/data/shared/torrent:/data/torrent"
- "/srv/data/shared/media:/data/media"
- "/srv/data/docker/mylar3/custom-cont-init.d:/custom-cont-init.d"
In /srv/data/docker/mylar3/custom-cont-init.d. we place a small script, called "mylar3-listen.sh"
#!/bin/bash
export LOCAL_IP=$(ip addr | grep -E 'inet 10\.64\..*/16' | sed -e 's|.*\(10\.64\..*\..*\)/16.*|\1|')
sed -i -e "/http_host/s| = .*\..*\..*\..*| = ${LOCAL_IP}|" /config/mylar/config.ini
This script grabs the current IP address of the Homelab network from the output of "ip addr", and replaces the current listening address in Mylar's configuration before the process starts. Make it executable, so it actually runs:
$ sudo chmod +x /srv/data/docker/mylar3/custom-cont-init.d/mylar3-listen.sh
We also need to configure Authentik, refer to Part 7 for that. Finally, start up your container.
$ docker stack deploy -c <compose file> --prune homelab
We need to configure Mylar3 and Prowlarr. For Prowlarr, again, check out Part 7. For Mylar, visit the web site, go to Settings > Web Interface. We need to fill in the ComicVine API key, check the "Enable API" box and generate an API key for Mylar. We also need to set the comic location to '/data/media/comics', check 'Enforce Permissions' and set the directory and file CHMODs to '0775' and '0664' respectively.
Under Download Settings, we enable Sabnzbd. Host is http://sabnzbd:8080, we need to enter the API key, and a category. I choose to download comics under "books," but you could also set up its own category in Sabnzbd and use it. Check all the download handling boxes, inform Mylar it's on a separate host from sabnzbd and configure the download directory to "/data/usenet/complete/books."
Under Search Provider, we check "Enable RSS." Use of Direct Downloads is up to you. Enable "Use Newznab," but don't configure anything there. That should give you a (very basic) working Mylar3 install.
Config files are, as always, on Gitea.