diff options
| -rw-r--r-- | .env.example | 4 | ||||
| -rw-r--r-- | docs/reference/configuration.md | 8 | ||||
| -rw-r--r-- | nix/module.nix | 2 | ||||
| -rw-r--r-- | src/config.rs | 4 |
4 files changed, 9 insertions, 9 deletions
diff --git a/.env.example b/.env.example index 953ae93..a19a07d 100644 --- a/.env.example +++ b/.env.example | |||
| @@ -286,5 +286,5 @@ | |||
| 286 | # Maximum total connections to the relay | 286 | # Maximum total connections to the relay |
| 287 | # Prevents connection exhaustion DoS attacks | 287 | # Prevents connection exhaustion DoS attacks |
| 288 | # CLI: --max-connections <count> | 288 | # CLI: --max-connections <count> |
| 289 | # Default: 500 | 289 | # Default: 4096 |
| 290 | # NGIT_MAX_CONNECTIONS=500 \ No newline at end of file | 290 | # NGIT_MAX_CONNECTIONS=4096 \ No newline at end of file |
diff --git a/docs/reference/configuration.md b/docs/reference/configuration.md index c3001d3..c1cb712 100644 --- a/docs/reference/configuration.md +++ b/docs/reference/configuration.md | |||
| @@ -931,17 +931,17 @@ Event blacklist does **not** affect NIP-11 metadata: | |||
| 931 | 931 | ||
| 932 | **Description:** Maximum total connections to the relay. Prevents connection exhaustion DoS attacks. | 932 | **Description:** Maximum total connections to the relay. Prevents connection exhaustion DoS attacks. |
| 933 | **Type:** Integer | 933 | **Type:** Integer |
| 934 | **Default:** `500` | 934 | **Default:** `4096` |
| 935 | **Required:** No | 935 | **Required:** No |
| 936 | 936 | ||
| 937 | **Examples:** | 937 | **Examples:** |
| 938 | 938 | ||
| 939 | ```bash | 939 | ```bash |
| 940 | # Default: 500 connections | 940 | # Default: 4096 connections |
| 941 | NGIT_MAX_CONNECTIONS=500 | 941 | NGIT_MAX_CONNECTIONS=4096 |
| 942 | 942 | ||
| 943 | # Higher limit for large public relay | 943 | # Higher limit for large public relay |
| 944 | NGIT_MAX_CONNECTIONS=1000 | 944 | NGIT_MAX_CONNECTIONS=8000 |
| 945 | 945 | ||
| 946 | # Lower limit for private relay | 946 | # Lower limit for private relay |
| 947 | NGIT_MAX_CONNECTIONS=100 | 947 | NGIT_MAX_CONNECTIONS=100 |
diff --git a/nix/module.nix b/nix/module.nix index 4117b6d..5debc9e 100644 --- a/nix/module.nix +++ b/nix/module.nix | |||
| @@ -252,7 +252,7 @@ let | |||
| 252 | 252 | ||
| 253 | maxConnections = mkOption { | 253 | maxConnections = mkOption { |
| 254 | type = types.int; | 254 | type = types.int; |
| 255 | default = 500; | 255 | default = 4096; |
| 256 | description = "Maximum total connections to the relay"; | 256 | description = "Maximum total connections to the relay"; |
| 257 | }; | 257 | }; |
| 258 | 258 | ||
diff --git a/src/config.rs b/src/config.rs index 0014003..320661f 100644 --- a/src/config.rs +++ b/src/config.rs | |||
| @@ -470,9 +470,9 @@ pub struct Config { | |||
| 470 | #[arg(long, env = "NGIT_EVENT_BLACKLIST", default_value = "")] | 470 | #[arg(long, env = "NGIT_EVENT_BLACKLIST", default_value = "")] |
| 471 | pub event_blacklist: String, | 471 | pub event_blacklist: String, |
| 472 | 472 | ||
| 473 | /// Maximum total connections to the relay (default: 500) | 473 | /// Maximum total connections to the relay (default: 4096) |
| 474 | /// Prevents connection exhaustion DoS attacks | 474 | /// Prevents connection exhaustion DoS attacks |
| 475 | #[arg(long, env = "NGIT_MAX_CONNECTIONS", default_value_t = 500)] | 475 | #[arg(long, env = "NGIT_MAX_CONNECTIONS", default_value_t = 4096)] |
| 476 | pub max_connections: usize, | 476 | pub max_connections: usize, |
| 477 | } | 477 | } |
| 478 | 478 | ||