Skip to content

Commit 548bced

Browse files
authored
Merge pull request #172 from linuxserver/master-3.21
2 parents 5676bfc + 0aba2bd commit 548bced

6 files changed

Lines changed: 50 additions & 33 deletions

File tree

Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
FROM ghcr.io/linuxserver/unrar:latest AS unrar
44

5-
FROM ghcr.io/linuxserver/baseimage-alpine:3.20 AS buildstage
5+
FROM ghcr.io/linuxserver/baseimage-alpine:3.21 AS buildstage
66

77
# set NZBGET version
88
ARG NZBGET_RELEASE
@@ -37,16 +37,16 @@ RUN \
3737
rm -rf /app/nzbget/bin/ && \
3838
rm -rf /app/nzbget/etc/ && \
3939
sed -i \
40-
-e "s|^MainDir=.*|MainDir=/downloads|g" \
40+
-e "s|^MainDir=.*|MainDir=/config|g" \
4141
-e "s|^ScriptDir=.*|ScriptDir=$\{MainDir\}/scripts|g" \
4242
-e "s|^WebDir=.*|WebDir=$\{AppDir\}/webui|g" \
4343
-e "s|^ConfigTemplate=.*|ConfigTemplate=$\{AppDir\}/webui/nzbget.conf.template|g" \
4444
-e "s|^UnrarCmd=.*|UnrarCmd=unrar|g" \
4545
-e "s|^SevenZipCmd=.*|SevenZipCmd=7z|g" \
4646
-e "s|^CertStore=.*|CertStore=$\{AppDir\}/cacert.pem|g" \
4747
-e "s|^CertCheck=.*|CertCheck=yes|g" \
48-
-e "s|^DestDir=.*|DestDir=$\{MainDir\}/completed|g" \
49-
-e "s|^InterDir=.*|InterDir=$\{MainDir\}/intermediate|g" \
48+
-e "s|^DestDir=.*|DestDir=/downloads/completed|g" \
49+
-e "s|^InterDir=.*|InterDir=/downloads/intermediate|g" \
5050
-e "s|^LogFile=.*|LogFile=$\{MainDir\}/nzbget.log|g" \
5151
-e "s|^AuthorizedIP=.*|AuthorizedIP=127.0.0.1|g" \
5252
/app/nzbget/share/nzbget/nzbget.conf && \
@@ -58,7 +58,7 @@ RUN \
5858
curl -o /app/nzbget/cacert.pem -L "https://curl.se/ca/cacert.pem"
5959

6060
# Runtime Stage
61-
FROM ghcr.io/linuxserver/baseimage-alpine:3.20
61+
FROM ghcr.io/linuxserver/baseimage-alpine:3.21
6262

6363
# set version label
6464
ARG BUILD_DATE
@@ -83,7 +83,7 @@ RUN \
8383
pip install -U --no-cache-dir \
8484
pip \
8585
wheel && \
86-
pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.20/ \
86+
pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.21/ \
8787
apprise \
8888
pynzb \
8989
requests && \

Dockerfile.aarch64

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
FROM ghcr.io/linuxserver/unrar:arm64v8-latest AS unrar
44

5-
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.20 AS buildstage
5+
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.21 AS buildstage
66

77
# set NZBGET version
88
ARG NZBGET_RELEASE
@@ -37,16 +37,16 @@ RUN \
3737
rm -rf /app/nzbget/bin/ && \
3838
rm -rf /app/nzbget/etc/ && \
3939
sed -i \
40-
-e "s|^MainDir=.*|MainDir=/downloads|g" \
40+
-e "s|^MainDir=.*|MainDir=/config|g" \
4141
-e "s|^ScriptDir=.*|ScriptDir=$\{MainDir\}/scripts|g" \
4242
-e "s|^WebDir=.*|WebDir=$\{AppDir\}/webui|g" \
4343
-e "s|^ConfigTemplate=.*|ConfigTemplate=$\{AppDir\}/webui/nzbget.conf.template|g" \
4444
-e "s|^UnrarCmd=.*|UnrarCmd=unrar|g" \
4545
-e "s|^SevenZipCmd=.*|SevenZipCmd=7z|g" \
4646
-e "s|^CertStore=.*|CertStore=$\{AppDir\}/cacert.pem|g" \
4747
-e "s|^CertCheck=.*|CertCheck=yes|g" \
48-
-e "s|^DestDir=.*|DestDir=$\{MainDir\}/completed|g" \
49-
-e "s|^InterDir=.*|InterDir=$\{MainDir\}/intermediate|g" \
48+
-e "s|^DestDir=.*|DestDir=/downloads/completed|g" \
49+
-e "s|^InterDir=.*|InterDir=/downloads/intermediate|g" \
5050
-e "s|^LogFile=.*|LogFile=$\{MainDir\}/nzbget.log|g" \
5151
-e "s|^AuthorizedIP=.*|AuthorizedIP=127.0.0.1|g" \
5252
/app/nzbget/share/nzbget/nzbget.conf && \
@@ -58,7 +58,7 @@ RUN \
5858
curl -o /app/nzbget/cacert.pem -L "https://curl.se/ca/cacert.pem"
5959

6060
# Runtime Stage
61-
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.20
61+
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.21
6262

6363
# set version label
6464
ARG BUILD_DATE
@@ -83,7 +83,7 @@ RUN \
8383
pip install -U --no-cache-dir \
8484
pip \
8585
wheel && \
86-
pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.20/ \
86+
pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.21/ \
8787
apprise \
8888
pynzb \
8989
requests && \

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,14 @@ Use the optional paths if you don't understand, or don't want hardlinks/atomic m
8888

8989
The folks over at servarr.com wrote a good [write-up](https://wiki.servarr.com/docker-guide#consistent-and-well-planned-paths) on how to get started with this.
9090

91+
## Read-Only Operation
92+
93+
This image can be run with a read-only container filesystem. For details please [read the docs](https://docs.linuxserver.io/misc/read-only/).
94+
95+
## Non-Root Operation
96+
97+
This image can be run with a non-root user. For details please [read the docs](https://docs.linuxserver.io/misc/non-root/).
98+
9199
## Usage
92100

93101
To help you get started creating a container from this image you can either use docker-compose or the docker cli.
@@ -148,6 +156,8 @@ Containers are configured using parameters passed at runtime (such as those abov
148156
| `-e NZBGET_PASS=tegbzn6789` | Specify the password for web authentication. |
149157
| `-v /config` | Persistent config |
150158
| `-v /downloads` | Location of downloads on disk. |
159+
| `--read-only=true` | Run container with a read-only filesystem. Please [read the docs](https://docs.linuxserver.io/misc/read-only/). |
160+
| `--user=1000:1000` | Run container with a non-root user. Please [read the docs](https://docs.linuxserver.io/misc/non-root/). |
151161

152162
## Environment variables from files (Docker secrets)
153163

readme-vars.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ opt_param_usage_include_env: true
3434
opt_param_env_vars:
3535
- {env_var: "NZBGET_USER", env_value: "nzbget", desc: "Specify the user for web authentication."}
3636
- {env_var: "NZBGET_PASS", env_value: "tegbzn6789", desc: "Specify the password for web authentication."}
37+
readonly_supported: true
38+
nonroot_supported: true
3739
# application setup block
3840
app_setup_block_enabled: true
3941
app_setup_block: |
Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
11
#!/usr/bin/with-contenv bash
22
# shellcheck shell=bash
33

4-
if [[ ! -d /downloads ]]; then
5-
mkdir -p /downloads
6-
fi
7-
8-
# delete lock file if found
9-
if [[ -f /downloads/nzbget.lock ]]; then
10-
rm /downloads/nzbget.lock
11-
fi
12-
134
# check if config file exists in /config
145
if [[ ! -f /config/nzbget.conf ]]; then
156
cp /app/nzbget/share/nzbget/nzbget.conf /config/nzbget.conf
167
fi
178

18-
# permissions
19-
lsiown abc:abc \
20-
/downloads
9+
# delete lock file if found
10+
if [[ -f /config/nzbget.lock ]]; then
11+
rm /config/nzbget.lock
12+
fi
2113

22-
lsiown -R abc:abc \
23-
/app/nzbget \
24-
/config
14+
if [[ -z ${LSIO_NON_ROOT_USER} ]]; then
15+
if grep -qe ' /downloads ' /proc/mounts; then
16+
lsiown abc:abc \
17+
/downloads
18+
fi
2519

26-
chmod u+rw \
27-
/config/nzbget.conf
20+
lsiown -R abc:abc \
21+
/config
22+
23+
chmod u+rw \
24+
/config/nzbget.conf
25+
fi

root/etc/s6-overlay/s6-rc.d/svc-nzbget/run

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,14 @@ if [[ ${NZBGET_PASS} && ${NZBGET_PASS-x} ]]; then
1111
OPTIONS+="-o ControlPassword=${NZBGET_PASS} "
1212
fi
1313

14-
exec \
15-
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost 6789" \
16-
s6-setuidgid abc /app/nzbget/nzbget -s -c /config/nzbget.conf \
17-
-o OutputMode=log ${OPTIONS}
14+
if [[ -z ${LSIO_NON_ROOT_USER} ]]; then
15+
exec \
16+
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost 6789" \
17+
s6-setuidgid abc /app/nzbget/nzbget -s -c /config/nzbget.conf \
18+
-o OutputMode=log ${OPTIONS}
19+
else
20+
exec \
21+
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost 6789" \
22+
/app/nzbget/nzbget -s -c /config/nzbget.conf \
23+
-o OutputMode=log ${OPTIONS}
24+
fi

0 commit comments

Comments
 (0)