diff options
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 12 |
1 files changed, 12 insertions, 0 deletions
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::<Vec<_>>(), @@ -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, |
