diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-04 17:03:40 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-04 17:03:40 +0000 |
| commit | b167f1b2ae7edbcab95554b5203d22d9e372c8b5 (patch) | |
| tree | 39b3bb879302cb6a4eaabded4a5d20f7d0d68ffc /src/config.rs | |
| parent | fdbc8895e1e9e712882bd854908295a95e7afcb9 (diff) | |
feat(sync): Phase 1 MVP - single relay proactive sync
- Add src/sync/ module with SyncManager
- Add NGIT_SYNC_RELAY_URL config option
- Subscribe to kind 30617 on configured relay
- Validate synced events through Nip34WritePolicy
- Integration test with two TestRelay instances
Diffstat (limited to 'src/config.rs')
| -rw-r--r-- | src/config.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs index 025e020..a2a27be 100644 --- a/src/config.rs +++ b/src/config.rs | |||
| @@ -83,6 +83,10 @@ pub struct Config { | |||
| 83 | /// Number of top bandwidth repos to track in metrics | 83 | /// Number of top bandwidth repos to track in metrics |
| 84 | #[arg(long = "metrics-top-n-repos", env = "NGIT_METRICS_TOP_N_REPOS", default_value_t = 10)] | 84 | #[arg(long = "metrics-top-n-repos", env = "NGIT_METRICS_TOP_N_REPOS", default_value_t = 10)] |
| 85 | pub metrics_top_n_repos: usize, | 85 | pub metrics_top_n_repos: usize, |
| 86 | |||
| 87 | /// URL of relay to sync kind 30617 events from (optional, enables proactive sync) | ||
| 88 | #[arg(long, env = "NGIT_SYNC_RELAY_URL")] | ||
| 89 | pub sync_relay_url: Option<String>, | ||
| 86 | } | 90 | } |
| 87 | 91 | ||
| 88 | impl Config { | 92 | impl Config { |
| @@ -138,6 +142,7 @@ impl Config { | |||
| 138 | metrics_enabled: true, | 142 | metrics_enabled: true, |
| 139 | metrics_connection_per_ip_abuse_threshold: 10, | 143 | metrics_connection_per_ip_abuse_threshold: 10, |
| 140 | metrics_top_n_repos: 10, | 144 | metrics_top_n_repos: 10, |
| 145 | sync_relay_url: None, | ||
| 141 | } | 146 | } |
| 142 | } | 147 | } |
| 143 | } | 148 | } |