From ef4ec80fa091815edb76aa0e3d39861a699909f1 Mon Sep 17 00:00:00 2001 From: Mike Dilger Date: Tue, 11 Feb 2025 09:27:19 +1300 Subject: [PATCH] config.admin_keys (makes no difference until moderation code can adjust users) --- src/config.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/config.rs b/src/config.rs index e4a35ac..b8e4ccd 100644 --- a/src/config.rs +++ b/src/config.rs @@ -23,6 +23,7 @@ pub struct FriendlyConfig { pub contact: Option, pub public_key_hex: Option, pub open_relay: bool, + pub admin_hex_keys: Vec, pub verify_events: bool, pub allow_scraping: bool, pub allow_scrape_if_limited_to: u32, @@ -62,6 +63,7 @@ impl Default for FriendlyConfig { contact: None, public_key_hex: None, open_relay: false, + admin_hex_keys: vec![], verify_events: true, allow_scraping: false, allow_scrape_if_limited_to: 100, @@ -103,6 +105,7 @@ impl FriendlyConfig { contact, public_key_hex, open_relay, + admin_hex_keys, verify_events, allow_scraping, allow_scrape_if_limited_to, @@ -129,6 +132,11 @@ impl FriendlyConfig { public_key = Some(Pubkey::read_hex(pkh.as_bytes())?); }; + let mut admin_keys: Vec = Vec::with_capacity(admin_hex_keys.len()); + for pkh in admin_hex_keys.iter() { + admin_keys.push(Pubkey::read_hex(pkh.as_bytes())?); + } + let hostname = Host::parse(&hostname)?; let server_log_level = @@ -154,6 +162,8 @@ impl FriendlyConfig { contact, public_key, open_relay, + admin_keys, + admin_hex_keys, verify_events, allow_scraping, allow_scrape_if_limited_to, @@ -194,6 +204,8 @@ pub struct Config { pub contact: Option, pub public_key: Option, pub open_relay: bool, + pub admin_keys: Vec, + pub admin_hex_keys: Vec, pub verify_events: bool, pub allow_scraping: bool, pub allow_scrape_if_limited_to: u32,