From 3783f68927a1a13c8ddcf96ffc3e78c06963414e Mon Sep 17 00:00:00 2001 From: Linnnus Date: Wed, 2 Oct 2024 09:23:17 +0200 Subject: Be more verbose when loading configuration --- src/config.rs | 5 +++++ src/main.rs | 1 + 2 files changed, 6 insertions(+) diff --git a/src/config.rs b/src/config.rs index ef3d708..7254887 100644 --- a/src/config.rs +++ b/src/config.rs @@ -34,6 +34,11 @@ impl Config { let file = File::open(path.as_ref()).map_err(ConfigError::IoReadingConfig)?; let mut config: Config = serde_json::from_reader(file)?; + if config.secret_path.is_relative() { + eprintln!("warning: `secret_path` in configuration is a relative path.\ + This will be resolved relative to the server's CWD at runtime,\ + which is most likely not what you want!"); + } config.secret = fs::read_to_string(&config.secret_path) .map_err(ConfigError::IoReadingSecret)?; diff --git a/src/main.rs b/src/main.rs index fefbca7..c67586d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -68,6 +68,7 @@ fn get_listener_from_systemd() -> io::Result { #[tokio::main] async fn main() -> Result<(), Box> { let config = load_config(); + println!("Using config: {:?}", config); let listener = get_listener_from_systemd()?; -- cgit v1.2.3