Context
-------
| | |
| ---------------------------- | --------------------------------------------- |
| public URL | `https://sabnzbd.databasepro.eu` |
| Apache reverse-proxy host | `umbara` |
| sabnzbd server | `ossus:7100` |
Apache (reverse proxy) config
-----------------------------
```
ServerName sabnzbd.databasepro.eu
ServerAdmin admin@sabnzbd.databasepro.eu
Redirect permanent / https://sabnzbd.databasepro.eu
DocumentRoot /usr/local/apache2/wwwroot/sabnzbd
Order allow,deny
AllowOverride All
Allow from all
Require all granted
ErrorLog logs/sabnzbd-error.log
CustomLog logs/sabnzbd-access.log combined
ServerName sabnzbd.databasepro.eu
ServerAdmin admin@sabnzbd.databasepro.eu
DocumentRoot /usr/local/apache2/wwwroot/sabnzbd
Order allow,deny
AllowOverride All
Allow from all
Require all granted
SSLEngine On
SSLProxyEngine On
# Disable SSLProxyCheck
SSLProxyCheckPeerCN Off
SSLProxyCheckPeerName Off
SSLProxyVerify none
ErrorLog logs/sabnzbd-error.log
CustomLog logs/sabnzbd-access.log combined
SSLCertificateFile "/etc/letsencrypt/live/sabnzbd.databasepro.eu/fullchain.pem"
SSLCertificateKeyFile "/etc/letsencrypt/live/sabnzbd.databasepro.eu/privkey.pem"
ProxyPass / http://ossus:7100/
ProxyPassReverse / http://ossus:7100/
```
sabnzbd server setup
-------------------
Because in my case, some sabnzbd directories will be on a CIFS share, I will run sabnzbd container as `smbuser`
Get Docker image
----------------
```
docker pull sabnzbd/sabnzbd
```
Prepare persistent directory
----------------------------
```
mkdir /app/appsdocker/sabnzbd
chown -R smbuser:smbuser /app/appsdocker/sabnzbd
```
> I had resolution name issue from docker container using a bind9 docker container on the same host. The workaround was to use an external nameserver (Google for example) by mapping container file `/etc/resolv.conf` to the local persistent file `/app/appsdocker/sabnzbd/resolv.conf`:
nameserver 8.8.8.8
Run the container
-----------------
Note that the continer will be run with `smbuser` local user `uid/gid` and in addition to standard image directories `/datadir` and `/media` I included my CIFS share `/mnt/yavin4/download/sabnzbd`
```
docker run -d --name sabnzbd \
-e SABNZBD_UID=1000 \
-e SABNZBD_GID=1000 \
-v /app/appsdocker/sabnzbd/resolv.conf:/etc/resolv.conf \
-v /app/appsdocker/sabnzbd:/datadir \
-v /app/appsdocker/sabnzbd:/media \
-v /mnt/yavin4/download/sabnzbd:/mnt/yavin4/download/sabnzbd \
-p 7100:8080 sabnzbd/sabnzbd
```
>Acceding to `https://sabnzbd.databasepro.eu` at this moment will geberate the error: `Access denied - Hostname verification failed: https://sabnzbd.org/hostname-check`
To fix this, add `ossus` to the whitelist in `/app/appsdocker/sabnzbd/config.ini`
```
host_whitelist = ossus
```
and restart the container:
```
docker restart sabnzbd
```
>
Optionally using docker-compose
-------------------------------
`docker-compose.yaml` file:
```
sabnzbd:
image: "sabnzbd/sabnzbd"
container_name: "sabnzbd"
volumes:
- /app/appsdocker/sabnzbd/resolv.conf:/etc/resolv.conf
- /app/appsdocker/sabnzbd:/datadir
- /app/appsdocker/sabnzbd:/media
- /mnt/yavin4/download/sabnzbd:/mnt/yavin4/download/sabnzbd
environment:
- SABNZBD_UID=1502
- SABNZBD_GID=1502
ports:
- "7005:8080"
restart: always
```
Setup sabnzbd
-------------
Run the configuration wizard from `https://sabnzbd.databasepro.eu` and once finished go back to the start page
`https://sabnzbd.databasepro.eu` in order to customize security username/password, download directories, skin etc.