Skip to content

feat: handle file permissions based on config #122

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

Merged
merged 6 commits into from
Apr 16, 2022

Conversation

Shadow53
Copy link
Owner

This adds two methods of specifying file permissions per-pile-config:

  • Unix-style mode
  • Boolean flags

The following behavior is performed now on backup/restore:

  • Set destination parent directories permissions to 0700
    • Also creating directories as needed
    • This applies only to directories under the pile prefix
  • Copy files as necessary
  • After copying a file, set the new file's permissions to:
    • 0600 on backup
    • The configured mode on restore
  • Also set parent directory permissions as with files, but defaulting to
    0700

As usual, the default file mode/permissions can be overridden using the
top-level pile configuration section of the configuration file.

This adds two methods of specifying file permissions per-pile-config:

- Unix-style mode
- Boolean flags

The following behavior is performed now on backup/restore:

- Set destination parent directories permissions to 0700
  - Also creating directories as needed
  - This applies only to directories under the pile prefix
- Copy files as necessary
- After copying a file, set the new file's permissions to:
  - 0600 on backup
  - The configured mode on restore
- Also set parent directory permissions as with files, but defaulting to
  0700

As usual, the default file mode/permissions can be overridden using the
top-level pile configuration section of the configuration file.
@Shadow53 Shadow53 added this to the 0.5.0 milestone Apr 16, 2022
@Shadow53 Shadow53 linked an issue Apr 16, 2022 that may be closed by this pull request
@netlify
Copy link

netlify bot commented Apr 16, 2022

Deploy Preview for hoard-docs ready!

Name Link
🔨 Latest commit 403f84b
🔍 Latest deploy log https://app.netlify.com/sites/hoard-docs/deploys/625a3ffe4a8a71000945de88
😎 Deploy Preview https://deploy-preview-122--hoard-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@codecov
Copy link

codecov bot commented Apr 16, 2022

Codecov Report

Merging #122 (403f84b) into main (77e45ec) will increase coverage by 0.18%.
The diff coverage is 93.79%.

@@            Coverage Diff             @@
##             main     #122      +/-   ##
==========================================
+ Coverage   91.92%   92.11%   +0.18%     
==========================================
  Files          73       74       +1     
  Lines        5808     6176     +368     
==========================================
+ Hits         5339     5689     +350     
- Misses        469      487      +18     
Impacted Files Coverage Δ
src/config/builder/hoard.rs 100.00% <ø> (ø)
src/filters/ignore.rs 100.00% <ø> (ø)
src/filters/mod.rs 100.00% <ø> (ø)
src/hoard/mod.rs 95.45% <75.00%> (-4.55%) ⬇️
src/hoard/pile_config.rs 89.36% <83.60%> (-10.64%) ⬇️
src/command/backup_restore.rs 90.76% <88.63%> (+14.10%) ⬆️
tests/restore_permissions.rs 98.59% <98.59%> (ø)
src/checkers/history/operation/v2.rs 94.55% <100.00%> (+0.21%) ⬆️
src/paths.rs 98.18% <100.00%> (+0.12%) ⬆️
src/checkers/history/last_paths.rs 93.27% <0.00%> (-5.89%) ⬇️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 77e45ec...403f84b. Read the comment docs.

@Shadow53 Shadow53 merged commit 74b6f00 into main Apr 16, 2022
@Shadow53 Shadow53 deleted the 121-manually-set-file-permissions branch April 16, 2022 04:18
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.

Manually set file permissions based on configuration
1 participant