Hide smtp password when printing the configuration
authorGreg Burri <greg.burri@gmail.com>
Fri, 29 Sep 2023 19:06:31 +0000 (21:06 +0200)
committerGreg Burri <greg.burri@gmail.com>
Fri, 29 Sep 2023 19:06:31 +0000 (21:06 +0200)
deploy.nu
doc/staking_watchdog.service
src/main.rs

index db0e16b..b8fb962 100644 (file)
--- a/deploy.nu
+++ b/deploy.nu
@@ -27,9 +27,9 @@ def main [host: string, destination: string, ssh_key: path] {
         cargo zigbuild --target $target
     }
 
         cargo zigbuild --target $target
     }
 
-    # invoke_ssh [sudo systemctl stop $app_name]
+    # invoke_ssh $"sudo systemctl stop ($app_name)"
     copy_ssh ./target/($target)/($build)/($app_name) $destination
     invoke_ssh $"chmod u+x ($destination)/($app_name)"
     copy_ssh ./target/($target)/($build)/($app_name) $destination
     invoke_ssh $"chmod u+x ($destination)/($app_name)"
-    # invoke_ssh [sudo systemctl start $app_name]
+    # invoke_ssh $"sudo systemctl start ($app_name)"
     print "Deployment finished"
 }
\ No newline at end of file
     print "Deployment finished"
 }
\ No newline at end of file
index dfda77a..52a73b3 100644 (file)
@@ -2,6 +2,7 @@
 Description=staking_watchdog
 
 [Service]
 Description=staking_watchdog
 
 [Service]
+User=gburri
 WorkingDirectory=/home/gburri/staking_watchdog
 ExecStart=/home/gburri/staking_watchdog/staking_watchdog
 SyslogIdentifier=staking_watchdog
 WorkingDirectory=/home/gburri/staking_watchdog
 ExecStart=/home/gburri/staking_watchdog/staking_watchdog
 SyslogIdentifier=staking_watchdog
index 0b7c9c4..114b915 100644 (file)
@@ -35,7 +35,13 @@ fn main() -> Result<()> {
 
     let config = Config::read(FILE_CONF)?;
 
 
     let config = Config::read(FILE_CONF)?;
 
-    println!("Configuration: {:?}", config);
+    println!(
+        "Configuration: {:?}",
+        Config {
+            smtp_password: "*****".to_string(),
+            ..config.clone()
+        }
+    );
 
     let mut time_last_email_send = time::Instant::now() - EMAIL_RESEND_PERIOD;
 
 
     let mut time_last_email_send = time::Instant::now() - EMAIL_RESEND_PERIOD;