periphery doesn't log any secret values on startup

This commit is contained in:
mbecker20
2023-01-05 01:20:19 +00:00
parent bd02b9e281
commit 2b1b88ce3c
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -93,7 +93,7 @@ fn default_core_mongo_db_name() -> String {
"monitor".to_string()
}
#[derive(Serialize, Deserialize, Debug)]
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct PeripheryConfig {
#[serde(default = "default_periphery_port")]
pub port: u16,
+4
View File
@@ -54,6 +54,10 @@ pub fn load() -> (Args, u16, PeripheryConfigExtension) {
fn print_startup_log(config_path: &str, args: &Args, config: &PeripheryConfig) {
println!("\nconfig path: {config_path}");
let mut config = config.clone();
config.github_accounts = config.github_accounts.into_iter().map(|(a, _)| (a, "<SECRET>".to_string())).collect();
config.docker_accounts = config.docker_accounts.into_iter().map(|(a, _)| (a, "<SECRET>".to_string())).collect();
config.secrets = config.secrets.into_iter().map(|(s, _)| (s, "<SECRET>".to_string())).collect();
println!("{config:#?}");
if args.daemon {
println!("daemon mode enabled");