Configuring NZB services generation two

Introduction

Procedure

  1. Run:
    apt -y install sabnzbdplus
  2. Edit /etc/default/sabnzbdplus and set:
    USER=sabnzbdplus
  3. Determine a UID/GID pair in the range 100-999 (see SYS_{GID,UID}_{MIN,MAX} /etc/login.defs) that is available on the NZB server and all potential NFS clients.
  4. On the NZB server and all potential NFS clients create that user by running:
    groupadd --system sabnzbdplus --gid <gid>
    useradd --system --gid sabnzbdplus --uid <uid> \
            --home-dir /home/sabnzbdplus \
            --create-home sabnzbdplus

    or add the group and user to your centralised maps (e.g. LDAP).

  5. The account will be locked (presumably the default for a system account), which makes ssh impossible. We don’t want to unlock it because then it has no password. Instead run:
    sed -ri 's/(sabnzbdplus):!:/\1:*:/' /etc/shadow
  6. Hopefully storage is available under /srv/nzb. If no then see the page that led you here. If yes run:
    chown sabnzbdplus:sabnzbdplus /srv/nzb
  7. Start sabnzbdplus as follows:
    su - sabnzbdplus
    sabnzbdplus
  8. Just leave the text browser asking its first question.
  9. From the host where your (normal) browser runs run (possibly as root if required):
    ssh -gfNL 8080:localhost:8080 <host-where-sabnzbdplus-is-running>
  10. Visit http://localhost:8080/ and make the following settings:
    • language: <preferred-language>
    • server: news.abc.com (this is just to skip this question for the moment)
    • General->SABnzbd Host: 0.0.0.0
    • General->Launch Browser on Startup: no
    • Folders->Temporary Download Folder: /srv/nzb/incomplete
    • Folders->Completed Download Folder: /srv/nzb/complete
    • Servers->Add Server->… (use SSL if possible)
    • Switches->Queue->Direct unpack: OFF
    • Switches->Post processing: Deobfurscate final filenames: YES
    • Switches->Post processing->History retention: keep completed jobs maximum number of days; 7
    • Notifications->Email Notification On Job Completion: always
    • Notifications->Disk Full Notifications: yes
    • Notifications->SMTP Server: …
    • Notifications->Email Recipient: …
    • Notifications->Email Sender: …
    • Scheduling->Add Schedule->Resume: …
    • Scheduling->Add Schedule->Pause: …
    • Special->Host Whitelist: <unqualified-name-of-the-host-itself>,<fully-qualified-name-of-the-host-itself>
  11. Run:
    rm -fr ~sabnzbdplus/Downloads
  12. Stop the server by killing the sabnzbdplus process.
  13. Finalise sabnzbdplus by stopping sabnzbdplus and then running:
    systemctl enable sabnzbdplus
    reboot
  14. If there is a front-end webserver then have it proxy connections to the site:
    1. Note the port number specified in that sabnzbdplus listens on (probably 8080).
    2. See Configuring web services (revision 2).
  15. To allow download and cleanup access:
    1. Install an NFS server (for LXC containers: package unfs3 and install it).
    2. Add a suitable entry to /etc/exports and have the NFS server reload the file (how this is done depends on which NFS server you installed).
    3. Add a suitable entry to other systems’ /etc/fstab or automounter maps.
  16. Do a test download.

See also