Feat/keep permissions#107
Open
mpalermo73 wants to merge 3 commits into
Open
Conversation
… on every file-change event Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Thanks for opening this pull request! Be sure to follow the pull request template!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Adds a
KEEP_PERMISSIONSenvironment variable that, when set totrue, skips the forcedchmodoperations the container applies to/config,/run/ddclient-cache, and/config/ddclient.confon startup and on every inotify-triggered config reload.Changed files:
root/etc/s6-overlay/s6-rc.d/init-ddclient-config/run— skipchmod 700on/configand/run/ddclient-cache, andchmod 600on/config/*, whenKEEP_PERMISSIONS=trueroot/etc/s6-overlay/s6-rc.d/svc-inotify/run— skipchmod 600on/config/ddclient.confafter inotify-detected changes whenKEEP_PERMISSIONS=true; the env var is cached before the inotify loop to avoid re-evaluating it on every file-change eventDefault behaviour (
KEEP_PERMISSIONSunset or any value other thantrue) is unchanged.Benefits of this PR and context:
Users running with NFS-mounted
/configvolumes, custom ACLs, rootless runtimes, or any setup where they own and manage file permissions find that the container silently resets their permissions to700/600on every restart and every timeddclient.confis touched. There is currently no escape hatch short of patching the s6 scripts themselves.Setting
KEEP_PERMISSIONS=truelets these users opt out of the forced permission resets while keeping the safe default for everyone else.How Has This Been Tested?
Tested locally with a bind-mounted
/configdirectory whose files were set to custom permissions before container start:KEEP_PERMISSIONS(default): permissions on/configandddclient.confare reset to700/600on container start and on each config-file save — confirmed existing behavior is intact.KEEP_PERMISSIONS=true: permissions on/config,/run/ddclient-cache, andddclient.confare left untouched on startup; touchingddclient.confto trigger the inotify loop also leaves permissions unchanged. ddclient restarts correctly in both cases.Test environment: Manjaro Linux, Docker,
linux/amd64.Source / References: