Update permissions for peach home dir in peach-config
This commit is contained in:
parent
1866e289a6
commit
315b04a63e
|
@ -2380,7 +2380,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "peach-config"
|
name = "peach-config"
|
||||||
version = "0.1.19"
|
version = "0.1.20"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap",
|
"clap",
|
||||||
"env_logger 0.6.2",
|
"env_logger 0.6.2",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "peach-config"
|
name = "peach-config"
|
||||||
version = "0.1.19"
|
version = "0.1.20"
|
||||||
authors = ["Andrew Reid <gnomad@cryptolab.net>", "Max Fowler <max@mfowler.info>"]
|
authors = ["Andrew Reid <gnomad@cryptolab.net>", "Max Fowler <max@mfowler.info>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
description = "Command line tool for installing, updating and configuring PeachCloud"
|
description = "Command line tool for installing, updating and configuring PeachCloud"
|
||||||
|
|
|
@ -5,6 +5,7 @@ use crate::utils::cmd;
|
||||||
/// so they can be read and written by all PeachCloud services.
|
/// so they can be read and written by all PeachCloud services.
|
||||||
pub const CONFIGS_DIR: &str = "/var/lib/peachcloud";
|
pub const CONFIGS_DIR: &str = "/var/lib/peachcloud";
|
||||||
pub const PEACH_WEB_DIR: &str = "/usr/share/peach-web";
|
pub const PEACH_WEB_DIR: &str = "/usr/share/peach-web";
|
||||||
|
pub const PEACH_HOME_DIR: &str = "/home/peach";
|
||||||
|
|
||||||
/// Utility function to set correct file permissions on the PeachCloud device.
|
/// Utility function to set correct file permissions on the PeachCloud device.
|
||||||
/// Accidentally changing file permissions is a fairly common thing to happen,
|
/// Accidentally changing file permissions is a fairly common thing to happen,
|
||||||
|
@ -15,7 +16,8 @@ pub fn set_permissions() -> Result<(), PeachConfigError> {
|
||||||
cmd(&["chown", "-R", "peach", CONFIGS_DIR])?;
|
cmd(&["chown", "-R", "peach", CONFIGS_DIR])?;
|
||||||
cmd(&["chgrp", "-R", "peach", CONFIGS_DIR])?;
|
cmd(&["chgrp", "-R", "peach", CONFIGS_DIR])?;
|
||||||
cmd(&["chmod", "-R", "u+rwX,g+rwX", PEACH_WEB_DIR])?;
|
cmd(&["chmod", "-R", "u+rwX,g+rwX", PEACH_WEB_DIR])?;
|
||||||
cmd(&["chown", "-R", "peach-web:peach", PEACH_WEB_DIR])?;
|
cmd(&["chown", "-R", "peach:peach", PEACH_WEB_DIR])?;
|
||||||
|
cmd(&["chown", "-R", "peach:peach", PEACH_HOME_DIR])?;
|
||||||
println!("[ PERMISSIONS SUCCESSFULLY UPDATED ]");
|
println!("[ PERMISSIONS SUCCESSFULLY UPDATED ]");
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue