From 09b4f7daac52b5aa6cebaa9c147a9086b105aac9 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 7 Nov 2026 01:59:38 +0100 Subject: access first users --- src/main.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 114f595..b3eb438 100644 --- a/src/main.rs +++ b/src/main.rs @@ -97,6 +97,17 @@ async fn main() -> Result<()> { // A broken htpasswd will abort startup. let auth_state = AuthState::from_settings(&args)?.context("htpasswd or user-header is required")?; + // A new swarm's first users, before the minutes of startup too: one nobody could + // manage doesn't start. + let first_users = if args.genesis { + let htpasswd = match args.htpasswd.as_deref() { + Some(path) => api::auth::htpasswd_names(path)?, + None => Vec::new(), + }; + access::registry::first_users(&args.bootstrap_users, &htpasswd, &args.protocol_writers)? + } else { + Vec::new() + }; info!( bind_addr = ?args.bind_addr.iter().map(ToString::to_string).collect::>(), @@ -232,6 +243,7 @@ async fn main() -> Result<()> { blob_chunk_bytes: args.blob_chunk as u32, swarm_key, protocol_writers: args.protocol_writers.iter().cloned().collect(), + first_users, files, state_file, document_file, -- cgit v1.3.1