Sonarr and Radarr need to read finished downloads, which live on the ultra.cc slot. The slot's download folder is therefore mounted read-only on oreobox-hetzner over SFTP. On import, Sonarr and Radarr copy each file once from the mount into the library.
The mount runs on the host as a systemd service, outside of Komodo.
| Item | Location |
|---|---|
| rclone remote | ultra (type sftp) in /home/gooner/.config/rclone/rclone.conf |
| SSH key | /home/gooner/.ssh/ultra, public key in the slot's ~/.ssh/authorized_keys |
| Host key check | /home/gooner/.ssh/known_hosts (rclone known_hosts_file) |
| FUSE | fuse3, user_allow_other in /etc/fuse.conf |
| Mountpoint | /mnt/seedbox/downloads, owned by gooner |
| Unit | /etc/systemd/system/rclone-ultra.service |
As gooner on oreobox-hetzner:
sudo apt install rclone fuse3
ssh-keygen -t ed25519 -f ~/.ssh/ultra -N ''
ssh-copy-id -i ~/.ssh/ultra.pub oreobox@<server>.usbx.me
cat >> ~/.ssh/config <<'EOF'
Host ultra
HostName <server>.usbx.me
User oreobox
IdentityFile ~/.ssh/ultra
EOF
rclone config create ultra sftp host <server>.usbx.me user oreobox \
key_file ~/.ssh/ultra known_hosts_file ~/.ssh/known_hosts
echo user_allow_other | sudo tee -a /etc/fuse.conf
sudo install -d -o gooner -g gooner /mnt/seedbox/downloads
ultra:downloads in the unit is relative to the slot home, so it points at /home/oreobox/downloads.
/etc/systemd/system/rclone-ultra.service:
[Unit]
Description=rclone SFTP mount of ultra.cc downloads (read-only)
Wants=network-online.target
After=network-online.target
[Service]
Type=notify
User=gooner
Group=gooner
# Clean up a stale mount left behind by a crash, otherwise the remount fails
ExecStartPre=-/usr/bin/fusermount3 -uz /mnt/seedbox/downloads
ExecStart=/usr/bin/rclone mount ultra:downloads /mnt/seedbox/downloads \
--config /home/gooner/.config/rclone/rclone.conf \
--read-only \
--allow-other \
--default-permissions \
--umask 007 \
--dir-cache-time 15s \
--vfs-cache-mode off
ExecStop=/usr/bin/fusermount3 -uz /mnt/seedbox/downloads
Restart=on-failure
RestartSec=15
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable --now rclone-ultra
| Flag | Why |
|---|---|
--read-only |
Sonarr and Radarr only copy from here. A wrong path mapping can't touch the seeding data. |
--allow-other |
Docker and the containers have to see the mount. Needs user_allow_other in /etc/fuse.conf. |
--default-permissions, --umask 007 |
The kernel enforces file modes, and only the owning UID/GID can read the mount. |
--dir-cache-time 15s |
SFTP has no change notifications. With rclone's default of 5 minutes, a finished torrent would stay invisible for a long time. |
--vfs-cache-mode off |
No local cache; Sonarr copies each file into the library anyway. |
The files in the mount belong to the user rclone runs as, because rclone's
--uid/--giddefault to that user. It has to be the stack user (gooner): with--umask 007, nobody else can read the mount. If the unit ever runs as another user, set--uidand--gidto gooner's IDs explicitly.
Sonarr and Radarr bind the parent directory with rslave propagation:
- type: bind
source: /mnt/seedbox
target: /seedbox
bind:
propagation: rslave
That way the mount shows up inside the containers even if they start before rclone, and a remount after an rclone restart propagates without restarting the containers. /mnt/seedbox has to exist before the stack is deployed.
systemctl status rclone-ultra
journalctl -u rclone-ultra -f
sudo systemctl restart rclone-ultra
ls /mnt/seedbox/downloads # host view
docker exec sonarr ls /seedbox/downloads # container view
A sync job (lftp or Syncthing) into a local staging folder would allow faster transfers over FTPS and hardlinked imports, but needs a staging area, timing around partial files and its own cleanup. The mount was chosen because Sonarr and Radarr control everything and nothing else can go stale. If imports over SFTP ever become a bottleneck for large files, that's the fallback design.