mirror of
https://relay.ngit.dev/npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr/ngit-grasp.git
synced 2026-10-05 15:08:24 +00:00
Add deletion request configuration options to config struct
This commit is contained in:
@@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user