diff options
Diffstat (limited to 'src/nostr')
| -rw-r--r-- | src/nostr/builder.rs | 34 | ||||
| -rw-r--r-- | src/nostr/events.rs | 12 |
2 files changed, 19 insertions, 27 deletions
diff --git a/src/nostr/builder.rs b/src/nostr/builder.rs index 10f7648..9819e37 100644 --- a/src/nostr/builder.rs +++ b/src/nostr/builder.rs | |||
| @@ -567,26 +567,24 @@ pub async fn create_relay( | |||
| 567 | // Clone Arc for the write policy so both relay and policy can access the database | 567 | // Clone Arc for the write policy so both relay and policy can access the database |
| 568 | let git_data_path = config.effective_git_data_path(); | 568 | let git_data_path = config.effective_git_data_path(); |
| 569 | 569 | ||
| 570 | // Parse and log archive configuration | 570 | // Log archive configuration (config.validate() must be called at startup) |
| 571 | if let Ok(archive_config) = config.archive_config() { | 571 | let archive_config = config.archive_config(); |
| 572 | if archive_config.enabled() { | 572 | if archive_config.enabled() { |
| 573 | tracing::info!( | 573 | tracing::info!( |
| 574 | "GRASP-05 archive mode enabled: archive_all={}, whitelist_entries={}, read_only={}", | 574 | "GRASP-05 archive mode enabled: archive_all={}, whitelist_entries={}, read_only={}", |
| 575 | archive_config.archive_all, | 575 | archive_config.archive_all, |
| 576 | archive_config.whitelist.len(), | 576 | archive_config.whitelist.len(), |
| 577 | archive_config.read_only | 577 | archive_config.read_only |
| 578 | ); | 578 | ); |
| 579 | } | ||
| 580 | } | 579 | } |
| 581 | 580 | ||
| 582 | // Parse and log repository configuration | 581 | // Log repository configuration |
| 583 | if let Ok(repository_config) = config.repository_config() { | 582 | let repository_config = config.repository_config(); |
| 584 | if repository_config.enabled() { | 583 | if repository_config.enabled() { |
| 585 | tracing::info!( | 584 | tracing::info!( |
| 586 | "Repository whitelist enabled: whitelist_entries={}", | 585 | "Repository whitelist enabled: whitelist_entries={}", |
| 587 | repository_config.whitelist.len() | 586 | repository_config.whitelist.len() |
| 588 | ); | 587 | ); |
| 589 | } | ||
| 590 | } | 588 | } |
| 591 | 589 | ||
| 592 | // Create write policy with purgatory integration | 590 | // Create write policy with purgatory integration |
diff --git a/src/nostr/events.rs b/src/nostr/events.rs index 3ec075d..3b4ef25 100644 --- a/src/nostr/events.rs +++ b/src/nostr/events.rs | |||
| @@ -400,15 +400,9 @@ pub fn validate_announcement( | |||
| 400 | Err(e) => return AnnouncementResult::Reject(format!("Invalid announcement: {}", e)), | 400 | Err(e) => return AnnouncementResult::Reject(format!("Invalid announcement: {}", e)), |
| 401 | }; | 401 | }; |
| 402 | 402 | ||
| 403 | // Get archive and repository configs (fail-secure: reject on config errors) | 403 | // Get validated configs (config.validate() must be called at startup) |
| 404 | let archive_config = match config.archive_config() { | 404 | let archive_config = config.archive_config(); |
| 405 | Ok(c) => c, | 405 | let repository_config = config.repository_config(); |
| 406 | Err(e) => return AnnouncementResult::Reject(format!("Config error: {}", e)), | ||
| 407 | }; | ||
| 408 | let repository_config = match config.repository_config() { | ||
| 409 | Ok(c) => c, | ||
| 410 | Err(e) => return AnnouncementResult::Reject(format!("Config error: {}", e)), | ||
| 411 | }; | ||
| 412 | 406 | ||
| 413 | let npub = announcement.owner_npub(); | 407 | let npub = announcement.owner_npub(); |
| 414 | let lists_service = announcement.lists_service(&config.domain); | 408 | let lists_service = announcement.lists_service(&config.domain); |