Skip to content
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 preserve local permissions for --extra-files #15

Merged
merged 1 commit into from
Dec 29, 2022

Conversation

phaer
Copy link
Member

@phaer phaer commented Dec 29, 2022

This changes our rsync invocation so that the remote copies of --extra-files always belong to root:root. I believe that's a safer default than copying local permissions in all cases. Without this change, files which should belong to root would need to locally belong to root as well. In cases where one would like other permissions on the remote system, one could chown them after copying.

@Mic92
Copy link
Member

Mic92 commented Dec 29, 2022

I think some of flags where needed though. Now it is failing with: after_install # cat: /var/lib/secrets/key: No such file or directory

@phaer
Copy link
Member Author

phaer commented Dec 29, 2022

Well that's a bit embarrassing tbh, I forgot that -a also implies -rl, only tested with a single file and didn't run the tests locally. Seems to work now

@phaer
Copy link
Member Author

phaer commented Dec 29, 2022

Needed a rebase after the SSH connection changes on main, but conflicts are gone and tests are passing.

@Mic92 Mic92 merged commit f2d7372 into nix-community:main Dec 29, 2022
@phaer phaer deleted the rsync-perms branch December 29, 2022 23:44
phaer added a commit to phaer/nixos-remote that referenced this pull request Jan 15, 2023
After removing -a in nix-community#15, remote extra files are implictly chowned
according to the remote umask. So we (re-)add --perms to apply local
file permissions remotely as this should mostly be expected behavior.
phaer added a commit to phaer/nixos-remote that referenced this pull request Jan 15, 2023
After removing -a in nix-community#15, remote extra files are implictly chowned
according to the remote umask. So we (re-)add --perms to apply local
file permissions remotely as this should mostly be expected behavior.

The second -F disables uploading the .rsync-filter file itself if it exists.
phaer added a commit to phaer/nixos-remote that referenced this pull request Jan 15, 2023
After removing -a in nix-community#15, remote extra files are implictly chowned
according to the remote umask. So we (re-)add --perms to apply local
file permissions remotely as this should mostly be expected behavior.

The second -F disables uploading the .rsync-filter file itself if it exists.
phaer added a commit to phaer/nixos-remote that referenced this pull request Jan 15, 2023
After removing -a in nix-community#15, remote extra files are implictly chowned
according to the remote umask. So we (re-)add --perms to apply local
file permissions remotely as this should mostly be expected behavior.

The second -F disables uploading the .rsync-filter file itself if it exists.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants