diff --git a/Jenkinsfile b/Jenkinsfile index 217f3a0..889da75 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..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,16 @@ #!/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 - chmod 600 /config/ddclient.conf + if [ "${_keep_permissions}" != "true" ]; then + chmod 600 /config/ddclient.conf + fi s6-svc -h /run/service/svc-ddclient echo "ddclient has been restarted" done