diff options
author | Linnnus <[email protected]> | 2024-10-02 09:23:17 +0200 |
---|---|---|
committer | Linnnus <[email protected]> | 2024-10-02 09:23:17 +0200 |
commit | 3783f68927a1a13c8ddcf96ffc3e78c06963414e (patch) | |
tree | 36e717c0589325c27a872e4bf2a80c14c6130fa4 | |
parent | dbaf06284985617b3e6cabe04377f8bb34c2d378 (diff) |
Be more verbose when loading configuration
-rw-r--r-- | src/config.rs | 5 | ||||
-rw-r--r-- | src/main.rs | 1 |
2 files changed, 6 insertions, 0 deletions
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<TokioUnixListener> { #[tokio::main] async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> { let config = load_config(); + println!("Using config: {:?}", config); let listener = get_listener_from_systemd()?; |