Hash admin passwords

This commit is contained in:
Pascal Engélibert 2022-10-15 17:32:35 +02:00
commit 86495543ce
Signed by: tuxmain
GPG key ID: 3504BC6D362F7DCA
7 changed files with 106 additions and 7 deletions

View file

@ -110,3 +110,9 @@ pub fn read_config(dir: &Path) -> Config {
.expect("Bad JSON in config file")
}
}
pub fn write_config(dir: &Path, config: &Config) {
let path = dir.join(CONFIG_FILE);
std::fs::write(path, toml_edit::easy::to_string_pretty(&config).unwrap())
.expect("Cannot write config file");
}