From 8aef478c6b1e9e3f6ebbad6d57f59f1a84a261ea Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 10 Apr 2026 19:26:23 +0000 Subject: 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 ] [--git-data-path ] [--execute] The relay itself is now invoked as an implicit 'serve' subcommand, preserving full backward compatibility with existing deployments and env-var configuration. --- src/config.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/config.rs') 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 { } /// Load relay owner key from file, or generate and save a new one - fn load_or_generate_relay_owner_key() -> Result { + pub fn load_or_generate_relay_owner_key() -> Result { let key_path = PathBuf::from(Self::RELAY_OWNER_KEY_FILE); // Try to load existing key -- cgit v1.2.3