-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't decrypt if secrets haven't changed from previous activation #89
Comments
I agree this is desirable, otherwise it triggers potential path change monitoring unnecessarily. It would still need to decrypt the secret, but it doesn't have to move it into place if the contents, group, user, and mode are unchanged. |
I tried to implement this, and ran into the issue that the way things currently work by default (this seems to have been changed recently), all the secrets get put into |
If it's helpful to anyone else who's trying. my attempt looked like: - mv -f "$TMP_FILE" "$_truePath"
+
+ # only update the file if it's changed in some way
+ # NOTE: diff has opposite return value than expected
+ if ! [ -f $_truePath ] || \
+ ! diff -q $TMP_FILE $_truePath >/dev/null || \
+ [ "$(stat -c '%a' "$TMP_FILE")" -eq "$(stat -c '%a' "$_truePath")" ]
+ then mv -f "$TMP_FILE" "$_truePath"
+ fi |
#132 has a minimal implementation to only create new generations when a secret has changed. |
Currently, agenix decrypts secrets every time the system is activated, even if the secrets haven't changed. Ideally, if the secrets haven't changed, the activation script would detect this and skip decrypting that secret. I can't really think of how this could be implemented though, hence the opening of this issue.
The text was updated successfully, but these errors were encountered: