From 47b9596c7751b6297ca8ca1be80030990d48580b Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 15 Feb 2026 12:55:25 -0500 Subject: [PATCH 1/2] Respect KEEP_PERMISSIONS env var: skip forced chmod when true --- Jenkinsfile | 4 +++- root/etc/s6-overlay/s6-rc.d/init-ddclient-config/run | 12 +++++++----- root/etc/s6-overlay/s6-rc.d/svc-inotify/run | 4 +++- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index c19b1b3..393ab98 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -45,7 +45,9 @@ pipeline { steps{ sh '''#!/bin/bash cat ${GIT_SIGNING_KEY} > /config/.ssh/id_sign - chmod 600 /config/.ssh/id_sign + if [ "${KEEP_PERMISSIONS:-false}" != "true" ]; then + chmod 600 /config/.ssh/id_sign + fi ssh-keygen -y -f /config/.ssh/id_sign > /config/.ssh/id_sign.pub echo "Using $(ssh-keygen -lf /config/.ssh/id_sign) to sign commits" git config --global gpg.format ssh diff --git a/root/etc/s6-overlay/s6-rc.d/init-ddclient-config/run b/root/etc/s6-overlay/s6-rc.d/init-ddclient-config/run index 3a63275..a76e7bd 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-ddclient-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-ddclient-config/run @@ -19,9 +19,11 @@ if [[ -z ${LSIO_NON_ROOT_USER} ]]; then /run/ddclient-cache fi -chmod 700 \ - /config \ - /run/ddclient-cache +if [ "${KEEP_PERMISSIONS:-false}" != "true" ]; then + chmod 700 \ + /config \ + /run/ddclient-cache -chmod 600 \ - /config/* + chmod 600 \ + /config/* +fi diff --git a/root/etc/s6-overlay/s6-rc.d/svc-inotify/run b/root/etc/s6-overlay/s6-rc.d/svc-inotify/run index f4ec74d..9faf7f5 100755 --- a/root/etc/s6-overlay/s6-rc.d/svc-inotify/run +++ b/root/etc/s6-overlay/s6-rc.d/svc-inotify/run @@ -6,7 +6,9 @@ while inotifywait -e modify /config/ddclient.conf; do if [[ -z ${LSIO_NON_ROOT_USER} ]]; then lsiown abc:abc /config/ddclient.conf fi - chmod 600 /config/ddclient.conf + if [ "${KEEP_PERMISSIONS:-false}" != "true" ]; then + chmod 600 /config/ddclient.conf + fi s6-svc -h /run/service/svc-ddclient echo "ddclient has been restarted" done From 1b7eb1a872f57484b086975f049d14edebec161f Mon Sep 17 00:00:00 2001 From: Matt Date: Thu, 25 Jun 2026 19:00:50 -0400 Subject: [PATCH 2/2] Cache KEEP_PERMISSIONS before inotify loop to avoid re-evaluating env on every file-change event Co-Authored-By: Claude Sonnet 4.6 --- root/etc/s6-overlay/s6-rc.d/svc-inotify/run | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/root/etc/s6-overlay/s6-rc.d/svc-inotify/run b/root/etc/s6-overlay/s6-rc.d/svc-inotify/run index 9faf7f5..2f895eb 100755 --- a/root/etc/s6-overlay/s6-rc.d/svc-inotify/run +++ b/root/etc/s6-overlay/s6-rc.d/svc-inotify/run @@ -1,12 +1,14 @@ #!/usr/bin/with-contenv bash # shellcheck shell=bash +_keep_permissions="${KEEP_PERMISSIONS:-false}" + # starting inotify to watch /config/ddclient.conf and restart ddclient if changed. while inotifywait -e modify /config/ddclient.conf; do if [[ -z ${LSIO_NON_ROOT_USER} ]]; then lsiown abc:abc /config/ddclient.conf fi - if [ "${KEEP_PERMISSIONS:-false}" != "true" ]; then + if [ "${_keep_permissions}" != "true" ]; then chmod 600 /config/ddclient.conf fi s6-svc -h /run/service/svc-ddclient