From c11e773eba09edc1840a75175b5f3176f1f32673 Mon Sep 17 00:00:00 2001 From: thespad Date: Wed, 3 Jul 2024 19:18:38 +0100 Subject: [PATCH] Don't chown /downloads unless it's mounted --- Dockerfile | 2 +- Dockerfile.aarch64 | 2 +- readme-vars.yml | 6 +++++- root/etc/s6-overlay/s6-rc.d/init-qbittorrent-config/run | 6 ++---- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index c61e3c9..dcc6cb9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 -FROM ghcr.io/linuxserver/unrar:latest as unrar +FROM ghcr.io/linuxserver/unrar:latest AS unrar FROM ghcr.io/linuxserver/baseimage-alpine:3.20 diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 79bb56c..a269c9e 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 -FROM ghcr.io/linuxserver/unrar:arm64v8-latest as unrar +FROM ghcr.io/linuxserver/unrar:arm64v8-latest AS unrar FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.20 diff --git a/readme-vars.yml b/readme-vars.yml index 4de811d..d03982b 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -24,7 +24,6 @@ param_container_name: "{{ project_name }}" param_usage_include_vols: true param_volumes: - { vol_path: "/config", vol_host_path: "/path/to/{{ project_name }}/appdata", desc: "Contains all relevant configuration files." } - - { vol_path: "/downloads", vol_host_path: "/path/to/downloads", desc: "Location of downloads on disk." } param_usage_include_ports: true param_ports: - { external_port: "8080", internal_port: "8080", port_desc: "WebUI" } @@ -34,6 +33,11 @@ param_usage_include_env: true param_env_vars: - { env_var: "WEBUI_PORT", env_value: "8080", desc: "for changing the port of the web UI, see below for explanation"} - { env_var: "TORRENTING_PORT", env_value: "6881", desc: "for changing the port of tcp/udp connection, see below for explanation" } +opt_param_usage_include_vols: true +opt_param_volumes: + - { vol_path: "/downloads", vol_host_path: "/path/to/downloads", desc: "Location of downloads on disk." } + +readonly_supported: true # application setup block app_setup_block_enabled: true diff --git a/root/etc/s6-overlay/s6-rc.d/init-qbittorrent-config/run b/root/etc/s6-overlay/s6-rc.d/init-qbittorrent-config/run index 5b05d8f..0303424 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-qbittorrent-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-qbittorrent-config/run @@ -10,10 +10,8 @@ if [[ ! -f /config/qBittorrent/qBittorrent.conf ]]; then fi # 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 +if grep -qe ' /downloads ' /proc/mounts; then + lsiown abc:abc /downloads fi # permissions