From b0c1f43b9913deb697883c6786272e013fdae1e7 Mon Sep 17 00:00:00 2001 From: thespad Date: Sun, 12 Jan 2025 18:09:20 +0000 Subject: [PATCH] Rebase to 3.21 --- Dockerfile | 6 ++--- Dockerfile.aarch64 | 6 ++--- README.md | 8 +++++- readme-vars.yml | 4 ++- .../s6-overlay/s6-rc.d/init-deluge-config/run | 27 ++++++++++--------- .../etc/s6-overlay/s6-rc.d/svc-deluge-web/run | 13 ++++++--- root/etc/s6-overlay/s6-rc.d/svc-deluged/run | 13 ++++++--- 7 files changed, 48 insertions(+), 29 deletions(-) diff --git a/Dockerfile b/Dockerfile index bd1a6ce..6c3d0b5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,9 +2,9 @@ FROM ghcr.io/linuxserver/unrar:latest AS unrar -FROM ghcr.io/by275/libtorrent:1-alpine3.20 AS libtorrent +FROM ghcr.io/by275/libtorrent:1-alpine3.21 AS libtorrent -FROM ghcr.io/linuxserver/baseimage-alpine:3.20 +FROM ghcr.io/linuxserver/baseimage-alpine:3.21 # set version label ARG BUILD_DATE @@ -37,7 +37,7 @@ RUN \ pip \ setuptools \ wheel && \ - pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.20/ \ + pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.21/ \ deluge[all]==${DELUGE_VERSION} \ pygeoip && \ echo "**** grab GeoIP database ****" && \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 1d84f5d..e5f5f9d 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -2,9 +2,9 @@ FROM ghcr.io/linuxserver/unrar:arm64v8-latest AS unrar -FROM ghcr.io/by275/libtorrent:1-alpine3.20-arm64 AS libtorrent +FROM ghcr.io/by275/libtorrent:1-alpine3.21-arm64 AS libtorrent -FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.20 +FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.21 # set version label ARG BUILD_DATE @@ -37,7 +37,7 @@ RUN \ pip \ setuptools \ wheel && \ - pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.20/ \ + pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.21/ \ deluge[all]==${DELUGE_VERSION} \ pygeoip && \ echo "**** grab GeoIP database ****" && \ diff --git a/README.md b/README.md index 54dea1d..b8c7dd8 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Find us at: * Plugin System * Much more... -[![deluge](https://avatars2.githubusercontent.com/u/6733935?v=3&s=200)](http://deluge-torrent.org/) +[![deluge](https://raw.githubusercontent.com/linuxserver/docker-templates/blob/master/linuxserver.io/img/deluge-logo.png)](http://deluge-torrent.org/) ## Supported Architectures @@ -83,6 +83,10 @@ Change the inbound port to 6881 (or whichever port you've mapped for the contain 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. @@ -150,6 +154,7 @@ Containers are configured using parameters passed at runtime (such as those abov | `-v /config` | deluge configs | | `-v /downloads` | torrent download directory | | `--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) @@ -313,6 +318,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **12.01.25:** - Rebase libtorrentv1 branch to Alpine 3.21. * **19.09.24:** - Prevent race condition related delay during container stop. * **26.08.24:** - Add libtorrentv1 tag. * **26.12.23:** - Replace source for GeoIP database. diff --git a/readme-vars.yml b/readme-vars.yml index 5a9e1d8..92b8065 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -3,7 +3,7 @@ # project information project_name: deluge project_url: "http://deluge-torrent.org/" -project_logo: "https://avatars2.githubusercontent.com/u/6733935?v=3&s=200" +project_logo: "https://raw.githubusercontent.com/linuxserver/docker-templates/blob/master/linuxserver.io/img/deluge-logo.png" project_blurb: | [{{ project_name|capitalize }}]({{ project_url }}) is a lightweight, Free Software, cross-platform BitTorrent client. @@ -40,6 +40,7 @@ opt_param_usage_include_ports: true opt_param_ports: - {external_port: "58846", internal_port: "58846", port_desc: "Default deluged port for thin client connectivity"} readonly_supported: true +nonroot_supported: true # application setup block app_setup_block_enabled: true app_setup_block: | @@ -96,6 +97,7 @@ init_diagram: | "deluge:libtorrentv1" <- Base Images # changelog changelogs: + - {date: "12.01.25:", desc: "Rebase libtorrentv1 branch to Alpine 3.21."} - {date: "19.09.24:", desc: "Prevent race condition related delay during container stop."} - {date: "26.08.24:", desc: "Add libtorrentv1 tag."} - {date: "26.12.23:", desc: "Replace source for GeoIP database."} diff --git a/root/etc/s6-overlay/s6-rc.d/init-deluge-config/run b/root/etc/s6-overlay/s6-rc.d/init-deluge-config/run index e15e365..eb214a8 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-deluge-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-deluge-config/run @@ -7,20 +7,21 @@ fi mkdir -p /run/deluged-temp -# permissions -lsiown -R abc:abc \ - /run/deluged-temp \ - /config - -# chown download directory if currently not set to abc -if [[ -d /downloads ]]; then - if [[ "$(stat -c '%U' /downloads)" != "abc" ]]; then - lsiown -R abc:abc /downloads - fi -fi - # create torrents directory if it does not exist if [[ ! -d /config/torrents ]]; then mkdir -p /config/torrents - lsiown abc:abc /config/torrents +fi + +if [[ -z ${LSIO_NON_ROOT_USER} ]]; then + # permissions + lsiown -R abc:abc \ + /run/deluged-temp \ + /config + + # chown download directory if currently not set to abc + if [[ -d /downloads ]]; then + if [[ "$(stat -c '%U' /downloads)" != "abc" ]]; then + lsiown -R abc:abc /downloads + fi + fi fi diff --git a/root/etc/s6-overlay/s6-rc.d/svc-deluge-web/run b/root/etc/s6-overlay/s6-rc.d/svc-deluge-web/run index bba1589..1209de1 100755 --- a/root/etc/s6-overlay/s6-rc.d/svc-deluge-web/run +++ b/root/etc/s6-overlay/s6-rc.d/svc-deluge-web/run @@ -7,7 +7,12 @@ if [[ -f /config/web.conf ]]; then DELUGE_WEB_PORT=$(grep 'port"' /config/web.conf | tr -cd "[:digit:]") fi -exec \ - s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z 127.0.0.1 ${DELUGE_WEB_PORT:-8112}" \ - s6-setuidgid abc /lsiopy/bin/deluge-web \ - -d -c /config --loglevel="${DELUGE_LOGLEVEL}" +if [[ -z ${LSIO_NON_ROOT_USER} ]]; then + exec \ + s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z 127.0.0.1 ${DELUGE_WEB_PORT:-8112}" \ + s6-setuidgid abc /lsiopy/bin/deluge-web -d -c /config --loglevel="${DELUGE_LOGLEVEL}" +else + exec \ + s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z 127.0.0.1 ${DELUGE_WEB_PORT:-8112}" \ + /lsiopy/bin/deluge-web -d -c /config --loglevel="${DELUGE_LOGLEVEL}" +fi diff --git a/root/etc/s6-overlay/s6-rc.d/svc-deluged/run b/root/etc/s6-overlay/s6-rc.d/svc-deluged/run index 2ec50c9..c6c20ae 100755 --- a/root/etc/s6-overlay/s6-rc.d/svc-deluged/run +++ b/root/etc/s6-overlay/s6-rc.d/svc-deluged/run @@ -7,7 +7,12 @@ if [[ -f /config/core.conf ]]; then DELUGED_PORT=$(grep '"daemon_port"' /config/core.conf | tr -cd "[:digit:]") fi -exec \ - s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z 127.0.0.1 ${DELUGED_PORT:-58846}" \ - s6-setuidgid abc /lsiopy/bin/deluged -c /config \ - -d --loglevel="${DELUGE_LOGLEVEL}" +if [[ -z ${LSIO_NON_ROOT_USER} ]]; then + exec \ + s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z 127.0.0.1 ${DELUGED_PORT:-58846}" \ + s6-setuidgid abc /lsiopy/bin/deluged -c /config -d --loglevel="${DELUGE_LOGLEVEL}" +else + exec \ + s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z 127.0.0.1 ${DELUGED_PORT:-58846}" \ + /lsiopy/bin/deluged -c /config -d --loglevel="${DELUGE_LOGLEVEL}" +fi