From 93279174529010b99b00e4ff9ff496ab0bc92edb Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Wed, 14 Jan 2026 10:22:27 +0000 Subject: [PATCH] Add deletion request configuration options to config struct --- src/config.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/config.rs b/src/config.rs index 0f0d853..1073382 100644 --- a/src/config.rs +++ b/src/config.rs @@ -469,6 +469,23 @@ pub struct Config { /// All events from these authors are blocked from both relay storage and purgatory #[arg(long, env = "NGIT_EVENT_BLACKLIST", default_value = "")] pub event_blacklist: String, + + /// Deletion request disrespector mode: ignore NIP-09 deletion requests (archival relay mode) + /// When true, the relay ignores all NIP-09 deletion requests and retains all events permanently. + /// This prevents "left-pad" scenarios where critical code is deleted from the network. + #[arg( + long, + env = "NGIT_DELETION_REQUEST_DISRESPECTOR", + default_value_t = false + )] + pub deletion_request_disrespector: bool, + + /// Archive retention period in seconds for deleted events and git data + /// How long to keep archived events and git data before permanent deletion. + /// Default: 7776000 seconds (90 days) + /// Set to lower values for testing (e.g., 60 for 1 minute) + #[arg(long, env = "NGIT_ARCHIVE_RETENTION_SECS", default_value_t = 7776000)] + pub archive_retention_secs: u64, } impl Config { @@ -703,6 +720,8 @@ impl Config { repository_whitelist: String::new(), repository_blacklist: String::new(), event_blacklist: String::new(), + deletion_request_disrespector: false, + archive_retention_secs: 7776000, } } }