Add deletion request configuration options to config struct

This commit is contained in:
DanConwayDev
2026-01-14 10:22:27 +00:00
parent 760b2254ae
commit 9327917452
+19
View File
@@ -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,
}
}
}