From 4ce77c0e5f9dffd16514a1ed4c98089df6634a5b Mon Sep 17 00:00:00 2001 From: thespad Date: Mon, 23 Dec 2024 18:02:53 +0000 Subject: [PATCH 1/2] Rebase to 3.21 --- Dockerfile | 4 +-- Dockerfile.aarch64 | 4 +-- Jenkinsfile | 2 +- README.md | 8 +++++- jenkins-vars.yml | 2 +- readme-vars.yml | 4 ++- .../s6-rc.d/init-sabnzbd-config/run | 16 ++++++----- root/etc/s6-overlay/s6-rc.d/svc-sabnzbd/run | 27 ++++++++++++------- 8 files changed, 42 insertions(+), 25 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5795dc5..d242c16 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM ghcr.io/linuxserver/unrar:latest AS unrar -FROM ghcr.io/linuxserver/baseimage-alpine:3.20 +FROM ghcr.io/linuxserver/baseimage-alpine:3.21 # set version label ARG BUILD_DATE @@ -44,7 +44,7 @@ RUN \ pip install -U --no-cache-dir \ pip \ wheel && \ - pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.20/ -r requirements.txt && \ + pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.21/ -r requirements.txt && \ echo "**** build sab translations ****" && \ python3 tools/make_mo.py && \ echo "**** install par2cmdline-turbo from source ****" && \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 7651685..db7310f 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -2,7 +2,7 @@ FROM ghcr.io/linuxserver/unrar:arm64v8-latest AS unrar -FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.20 +FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.21 # set version label ARG BUILD_DATE @@ -44,7 +44,7 @@ RUN \ pip install -U --no-cache-dir \ pip \ wheel && \ - pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.20/ -r requirements.txt && \ + pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.21/ -r requirements.txt && \ echo "**** build sab translations ****" && \ python3 tools/make_mo.py && \ echo "**** install par2cmdline-turbo from source ****" && \ diff --git a/Jenkinsfile b/Jenkinsfile index b235268..4f605e5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -35,7 +35,7 @@ pipeline { CI_WEB='true' CI_PORT='8080' CI_SSL='false' - CI_DELAY='60' + CI_DELAY='120' CI_DOCKERENV='' CI_AUTH='' CI_WEBPATH='' diff --git a/README.md b/README.md index 3b9537b..1d1d28b 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,10 @@ The folks over at servarr.com wrote a good [write-up](https://wiki.servarr.com/d This image can be run with a read-only container filesystem. For details please [read the docs](https://docs.linuxserver.io/misc/read-only/). +## Non-Root Operation + +This image can be run with a non-root user. For details please [read the docs](https://docs.linuxserver.io/misc/non-root/). + ## Usage To help you get started creating a container from this image you can either use docker-compose or the docker cli. @@ -143,6 +147,7 @@ Containers are configured using parameters passed at runtime (such as those abov | `-v /downloads` | Local path for finished downloads. | | `-v /incomplete-downloads` | Local path for incomplete-downloads. | | `--read-only=true` | Run container with a read-only filesystem. Please [read the docs](https://docs.linuxserver.io/misc/read-only/). | +| `--user=1000:1000` | Run container with a non-root user. Please [read the docs](https://docs.linuxserver.io/misc/non-root/). | ## Environment variables from files (Docker secrets) @@ -306,7 +311,8 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions -* **31.05.24:** - Rebase Alpine 3.20. Remove nzbnotify as apprise is now included with SABnzbd. +* **23.12.24:** - Rebase to Alpine 3.21. +* **31.05.24:** - Rebase to Alpine 3.20. Remove nzbnotify as apprise is now included with SABnzbd. * **23.12.23:** - Rebase to Alpine 3.19. * **23.11.23:** - Build translations. * **13.09.23:** - Use par2cmdline-turbo in place of par2cmdline. diff --git a/jenkins-vars.yml b/jenkins-vars.yml index 79bcc3a..f2a305a 100644 --- a/jenkins-vars.yml +++ b/jenkins-vars.yml @@ -23,7 +23,7 @@ repo_vars: - CI_WEB='true' - CI_PORT='8080' - CI_SSL='false' - - CI_DELAY='60' + - CI_DELAY='120' - CI_DOCKERENV='' - CI_AUTH='' - CI_WEBPATH='' diff --git a/readme-vars.yml b/readme-vars.yml index 8c3be77..3cbf4c2 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -31,6 +31,7 @@ opt_param_volumes: - {vol_path: "/downloads", vol_host_path: "/path/to/downloads", desc: "Local path for finished downloads."} - {vol_path: "/incomplete-downloads", vol_host_path: "/path/to/incomplete/downloads", desc: "Local path for incomplete-downloads."} readonly_supported: true +nonroot_supported: true # application setup block app_setup_block_enabled: true app_setup_block: | @@ -90,7 +91,8 @@ init_diagram: | "sabnzbd:latest" <- Base Images # changelog changelogs: - - {date: "31.05.24:", desc: "Rebase Alpine 3.20. Remove nzbnotify as apprise is now included with SABnzbd."} + - {date: "23.12.24:", desc: "Rebase to Alpine 3.21."} + - {date: "31.05.24:", desc: "Rebase to Alpine 3.20. Remove nzbnotify as apprise is now included with SABnzbd."} - {date: "23.12.23:", desc: "Rebase to Alpine 3.19."} - {date: "23.11.23:", desc: "Build translations."} - {date: "13.09.23:", desc: "Use par2cmdline-turbo in place of par2cmdline."} diff --git a/root/etc/s6-overlay/s6-rc.d/init-sabnzbd-config/run b/root/etc/s6-overlay/s6-rc.d/init-sabnzbd-config/run index 97d3822..e68c5f0 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-sabnzbd-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-sabnzbd-config/run @@ -1,12 +1,14 @@ #!/usr/bin/with-contenv bash # shellcheck shell=bash -if grep -qe ' /downloads ' /proc/mounts; then - lsiown abc:abc /downloads -fi +if [[ -z ${LSIO_NON_ROOT_USER} ]]; then + if grep -qe ' /downloads ' /proc/mounts; then + lsiown abc:abc /downloads + fi -if grep -qe ' /incomplete-downloads ' /proc/mounts; then - lsiown abc:abc /incomplete-downloads -fi + if grep -qe ' /incomplete-downloads ' /proc/mounts; then + lsiown abc:abc /incomplete-downloads + fi -find /config -path /config/Downloads -prune -o -exec lsiown abc:abc {} + + find /config -path /config/Downloads -prune -o -exec lsiown abc:abc {} + +fi \ No newline at end of file diff --git a/root/etc/s6-overlay/s6-rc.d/svc-sabnzbd/run b/root/etc/s6-overlay/s6-rc.d/svc-sabnzbd/run index 4fc8ef4..25618b9 100755 --- a/root/etc/s6-overlay/s6-rc.d/svc-sabnzbd/run +++ b/root/etc/s6-overlay/s6-rc.d/svc-sabnzbd/run @@ -3,14 +3,21 @@ FAMILY=:: -if [[ "$HAS_IPV6" = "false" ]]; then - FAMILY=0.0.0.0 - sed '/ip6-/d' /etc/hosts > /etc/hosts.new - cat /etc/hosts.new > /etc/hosts - rm /etc/hosts.new -fi +if [[ -z ${LSIO_NON_ROOT_USER} ]]; then + if [[ "$HAS_IPV6" = "false" ]]; then + FAMILY=0.0.0.0 + sed '/ip6-/d' /etc/hosts > /etc/hosts.new + cat /etc/hosts.new > /etc/hosts + rm /etc/hosts.new + fi -exec \ - s6-notifyoncheck -d -n 300 -w 1000 \ - s6-setuidgid abc python3 /app/sabnzbd/SABnzbd.py \ - --config-file /config --server "$FAMILY" + exec \ + s6-notifyoncheck -d -n 300 -w 1000 \ + s6-setuidgid abc python3 /app/sabnzbd/SABnzbd.py \ + --config-file /config --server "$FAMILY" +else + exec \ + s6-notifyoncheck -d -n 300 -w 1000 \ + python3 /app/sabnzbd/SABnzbd.py \ + --config-file /config --server "$FAMILY" +fi \ No newline at end of file From 0d235aa906e956d4a1bf984ed5d2a349d91c204c Mon Sep 17 00:00:00 2001 From: thespad Date: Mon, 23 Dec 2024 18:06:19 +0000 Subject: [PATCH 2/2] Newlines --- root/etc/s6-overlay/s6-rc.d/init-sabnzbd-config/run | 2 +- root/etc/s6-overlay/s6-rc.d/svc-sabnzbd/run | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/root/etc/s6-overlay/s6-rc.d/init-sabnzbd-config/run b/root/etc/s6-overlay/s6-rc.d/init-sabnzbd-config/run index e68c5f0..7248c9f 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-sabnzbd-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-sabnzbd-config/run @@ -11,4 +11,4 @@ if [[ -z ${LSIO_NON_ROOT_USER} ]]; then fi find /config -path /config/Downloads -prune -o -exec lsiown abc:abc {} + -fi \ No newline at end of file +fi diff --git a/root/etc/s6-overlay/s6-rc.d/svc-sabnzbd/run b/root/etc/s6-overlay/s6-rc.d/svc-sabnzbd/run index 25618b9..0869f8b 100755 --- a/root/etc/s6-overlay/s6-rc.d/svc-sabnzbd/run +++ b/root/etc/s6-overlay/s6-rc.d/svc-sabnzbd/run @@ -20,4 +20,4 @@ else s6-notifyoncheck -d -n 300 -w 1000 \ python3 /app/sabnzbd/SABnzbd.py \ --config-file /config --server "$FAMILY" -fi \ No newline at end of file +fi