From f3eb7ee93ee2544cb5afa6a7ffcf88d580214fb9 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 26 Oct 2026 20:16:41 +0100 Subject: detect broken htpasswd files during startup --- src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 99ee1b9..dee0a32 100644 --- a/src/main.rs +++ b/src/main.rs @@ -60,6 +60,8 @@ async fn main() -> Result<()> { // First thing: until a handler is installed, SIGINT and SIGTERM kill the process on // the spot, and startup (spawning Mycelium, bootstrap) can take minutes. let stop = watch_for_shutdown().context("Installing signal handlers")?; + // A broken htpasswd will abort startup. + let auth_state = AuthState::new(&args.htpasswd)?; let mycelium_setup = { let spawn_config = MyceliumSpawnConfig { @@ -223,7 +225,6 @@ async fn main() -> Result<()> { ); swarm::state_file::update(&state, true).await; - let auth_state = AuthState::new(&args.htpasswd); let app = api::router(state.clone(), auth_state, args.debug_api); let listener = tokio::net::TcpListener::bind(args.bind_addr) -- cgit v1.3.1