Add permissions function peach-config #56
No reviewers
Labels
No Label
bug
documentation
duplicate
enhancement
help wanted
invalid
maintenance
peach-lib
peach-network
peach-oled
peach-stats
peach-web
question
refactor
wontfix
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: PeachCloud/peach-workspace#56
Loading…
Reference in New Issue
No description provided.
Delete Branch "permissions"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR adds a command to peach-config which correctly updates the file permissions on the PeachCloud device.
I find during development that sometimes I accidentally get file permissions into a weird state, and that it would be helpful to have an idempotent function to get permissions back into the correct state. This could also be helpful for helping users debug their systems in the future remotely.
For now it just sets /var/lib/peachcloud to 660 peach:peach. Having one function to declare the permissions also helps us reason more specifically in one place about what the permissions model is supposed to be.
Besides the Rust-specific feedback, I really love this permissions feature! I've been perplexed many times by permissions-related issues in the past, especially in the context of sysadmin tasks.
I wonder if this should also set permissions for
/usr/share/peach-web
?@ -17,6 +18,7 @@ use crate::change_password::set_peach_web_password;
use crate::generate_manifest::generate_manifest;
I recommend not specifying paths all the way down to the function level when importing. It makes it neater when calling the function (only having to type
generate_manifest()
and notgenerate_manifest::generate_manifest()
) but more difficult to navigate the codebase, especially as a 2nd party dev / contributor.Idiomatic imports are covered in the Rust Book.
cool makes sense! I changed the imports and added some chmod commands to set the permissions for /usr/share/peach-web
Great, thanks! Clear for merge 🟢