upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2026-04-10 19:26:23 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2026-04-10 19:26:23 +0000
commit8aef478c6b1e9e3f6ebbad6d57f59f1a84a261ea (patch)
tree2aa56188b13fc4b8e6a2fdf302dea19afb65a5a7 /src/config.rs
parent2161e3c0a8169a85111cd6dc01ffe2b0fed1493f (diff)
feat: add cleanup-empty-repos subcommand to remove stale events for empty git repos
Adds a maintenance subcommand that scans the LMDB database for kind 30617 (repository announcement) events whose bare git repo on disk is empty or missing, then removes both the 30617 and any matching 30618 (state) events. A relay should not serve announcement or state events for a repository with no git data. This was needed to clean up repos leaked by the bug fixed in 2161e3c, and is useful as an ongoing maintenance tool. Usage (dry-run by default, stop relay before --execute): ngit-grasp cleanup-empty-repos [--relay-data-path <path>] [--git-data-path <path>] [--execute] The relay itself is now invoked as an implicit 'serve' subcommand, preserving full backward compatibility with existing deployments and env-var configuration.
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/config.rs b/src/config.rs
index 30e77ab..4dd396a 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -506,7 +506,7 @@ impl Config {
506 } 506 }
507 507
508 /// Load relay owner key from file, or generate and save a new one 508 /// Load relay owner key from file, or generate and save a new one
509 fn load_or_generate_relay_owner_key() -> Result<String> { 509 pub fn load_or_generate_relay_owner_key() -> Result<String> {
510 let key_path = PathBuf::from(Self::RELAY_OWNER_KEY_FILE); 510 let key_path = PathBuf::from(Self::RELAY_OWNER_KEY_FILE);
511 511
512 // Try to load existing key 512 // Try to load existing key