diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-03-25 07:19:26 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-03-25 07:19:26 +0000 |
| commit | 28168a7701c897a5b6af13bc472d6f5902e0a96d (patch) | |
| tree | bbb2ad5e238f118a31d4d1b974c0b391c74a12c1 /src/config.rs | |
| parent | 05b7edb5f5797100d8e0f59905e16488680928ec (diff) | |
chore: remove arbitrary default max connections limit
When NGIT_MAX_CONNECTIONS is unset the relay imposes no connection cap,
deferring to OS fd limits and infrastructure controls. The option remains
available for operators who want an explicit ceiling.
Diffstat (limited to 'src/config.rs')
| -rw-r--r-- | src/config.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/config.rs b/src/config.rs index 5c9303c..30e77ab 100644 --- a/src/config.rs +++ b/src/config.rs | |||
| @@ -466,10 +466,9 @@ pub struct Config { | |||
| 466 | #[arg(long, env = "NGIT_EVENT_BLACKLIST", default_value = "")] | 466 | #[arg(long, env = "NGIT_EVENT_BLACKLIST", default_value = "")] |
| 467 | pub event_blacklist: String, | 467 | pub event_blacklist: String, |
| 468 | 468 | ||
| 469 | /// Maximum total connections to the relay (default: 4096) | 469 | /// Maximum total connections to the relay (default: unlimited, defers to OS/infrastructure limits) |
| 470 | /// Prevents connection exhaustion DoS attacks | 470 | #[arg(long, env = "NGIT_MAX_CONNECTIONS")] |
| 471 | #[arg(long, env = "NGIT_MAX_CONNECTIONS", default_value_t = 4096)] | 471 | pub max_connections: Option<usize>, |
| 472 | pub max_connections: usize, | ||
| 473 | 472 | ||
| 474 | /// Log level for application logging | 473 | /// Log level for application logging |
| 475 | #[arg(long, env = "NGIT_LOG_LEVEL", default_value = "info")] | 474 | #[arg(long, env = "NGIT_LOG_LEVEL", default_value = "info")] |
| @@ -755,7 +754,7 @@ impl Config { | |||
| 755 | repository_whitelist: String::new(), | 754 | repository_whitelist: String::new(), |
| 756 | repository_blacklist: String::new(), | 755 | repository_blacklist: String::new(), |
| 757 | event_blacklist: String::new(), | 756 | event_blacklist: String::new(), |
| 758 | max_connections: 500, | 757 | max_connections: None, |
| 759 | log_level: "debug".to_string(), | 758 | log_level: "debug".to_string(), |
| 760 | } | 759 | } |
| 761 | } | 760 | } |