Sabnzbd hard coded to use port 8080?

I was recently trying to get sabnzb to run on a port other than 8080 and after doing a bit of research I noticed that the file /run/s6/services/sabnzbd/run has a hard coded value of 8080. Any chance of changing this to use an ENV variable?

No, you can map it to whatever port you like in docker arguments

all that does is change the external port - I am looking to change the internal port so that it can match the sabnzbd.ini file settings I am using. Is there a specific reason its hard coded?

Why?. . . . . . . . .

I have a number of instances running that have a ini file that is auto generate – some are behind proxies, some are running on docker.

if your really set against allowing it to use what is in the ini file, I can take a look at updating the run file using the custom config (love how this is possible).

We have no plans to modify how the container works currently, but you are more than welcome to modify it according to your needs.

the link above can help you ensure you can continue to pull our latest updates while maintaining your custom needs.

That does not turn out to be as simple as it seems at first.

I put the following in custom-cont-init.d/test:

#!/bin/bash
echo "**** CUSTOM ****"
ls -alF /run/s6/services/sabnzbd/
cp /config/run-sabnzbd /run/s6/services/sabnzbd/run
chmod 755 /run/s6/services/sabnzbd/run

where run-sabnzbd is just the adaptated run script to change the port.

While this seems reasonable simple, it results in the following when the container is started:

[cont-init.d] 99-custom-scripts: executing...
[custom-init] files found in /config/custom-cont-init.d executing
[custom-init] run-sabnzbd-without-fixed-port.sh: executing...
**** CUSTOM ****
ls: cannot access '/run/s6/services/sabnzbd/': No such file or directory
cp: cannot create regular file '/run/s6/services/sabnzbd/run': No such file or directory
chmod: cannot access '/run/s6/services/sabnzbd/run': No such file or directory
[custom-init] run-sabnzbd-without-fixed-port.sh: exited 1
[cont-init.d] 99-custom-scripts: exited 0.
[cont-init.d] done.

it seems that the path /run/s6/services/sabnzbd/ is not yet existing at that point of time.
Help appreciated.

Service file is in /etc/services.d/sabnzbd/run

Also, just use sed

I ended up moving everything to run behind traefik. It made maintenance easier (I didn’t want to build my own custom images and maintain them). Bit of a bummer this couldn’t be handled by an ENV variable.

First - things are stacked against using low numbered ports. Like under 1000 (I don’t want to look it up) unless you are “root” for security reasons. But what if you could do something unixy and start as one user and switch - like start as root and switch to linuxserver’s abc user.

The file you need to change is:
./etc/services.d/sabnzbd/run

#!/usr/bin/with-contenv bash

FAMILY=::

if [ “$HAS_IPV6” = “false” ]; then
FAMILY=0.0.0.0
fi

exec
s6-setuidgid abc python3 /app/sabnzbd/SABnzbd.py
–config-file /config --server “$FAMILY”

so the main command that runs this part is: s6-setuidgid

if you change that to: s6-envuidgid

so the new command would be: s6-envuidgid -B abc python3 /app/sabnzbd/SABnzbd.py
–config-file /config --server “$FAMILY”

This starts out as root let you have access to the port - then switches to user abc to run sabnzbd - so less of a security risk.

Now you can put what ever port you want in the config file from the cli or sabnzb gui and next time you restart that will be the port.

Ah you say - what happens if /etc/services.d gets reset next time you update the docker container. Make it part of your permanent docker volume space!

volumes:
    - /Path/on/computer/config:/config     # docker app files
    - /Path/on/computer/etc:/etc/services.d/  #docker container files

some docker images use: /etc/s6-overlay/s6-rc.d for starting up the main docker app.

That is my 1/2 cent comment.