From 1cb712b5e32b6dff1f37a4a83f8f0da558518366 Mon Sep 17 00:00:00 2001 From: MDLeom <2809763-curben@users.noreply.gitlab.com> Date: Wed, 9 Sep 2020 08:42:42 +0000 Subject: [PATCH] post(nixos): fix systemd start rate-limits - https://github.com/NixOS/nixpkgs/pull/97512 --- source/_posts/caddy-nixos-part-3.md | 6 +++--- source/_posts/caddy-v2-nixos.md | 6 +++--- source/_posts/i2p-eepsite-nixos.md | 6 +++--- source/_posts/tor-hidden-onion-nixos.md | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/source/_posts/caddy-nixos-part-3.md b/source/_posts/caddy-nixos-part-3.md index 7fb7068..94d4202 100644 --- a/source/_posts/caddy-nixos-part-3.md +++ b/source/_posts/caddy-nixos-part-3.md @@ -2,7 +2,7 @@ title: "Setup Caddy as a reverse proxy on NixOS (Part 3: Caddy)" excerpt: "Part 3: Configure Caddy" date: 2020-03-14 -updated: 2020-04-08 +updated: 2020-09-09 tags: - server - linux @@ -100,6 +100,8 @@ in { wantedBy = [ "multi-user.target" ]; environment = mkIf (versionAtLeast config.system.stateVersion "17.09") { CADDYPATH = cfg.dataDir; }; + startLimitIntervalSec = 86400; + startLimitBurst = 5; serviceConfig = { ExecStart = '' ${cfg.package}/bin/caddy -root=/var/tmp -conf=${cfg.config} @@ -109,8 +111,6 @@ in { User = "caddyProxy"; Group = "caddyProxy"; Restart = "on-failure"; - StartLimitInterval = 86400; - StartLimitBurst = 5; NoNewPrivileges = true; LimitNPROC = 64; LimitNOFILE = 1048576; diff --git a/source/_posts/caddy-v2-nixos.md b/source/_posts/caddy-v2-nixos.md index d37f449..4bffa1f 100644 --- a/source/_posts/caddy-v2-nixos.md +++ b/source/_posts/caddy-v2-nixos.md @@ -2,7 +2,7 @@ title: Running Caddy 2 in NixOS 20.03 excerpt: Use stable v2 instead of beta release date: 2020-05-24 -updated: 2020-08-30 +updated: 2020-09-09 tags: - server - caddy @@ -79,6 +79,8 @@ in { wantedBy = [ "multi-user.target" ]; environment = mkIf (versionAtLeast config.system.stateVersion "17.09" && !isCaddy2) { CADDYPATH = cfg.dataDir; }; + startLimitIntervalSec = 86400; + startLimitBurst = 5; serviceConfig = { ExecStart = if isCaddy2 then '' ${cfg.package}/bin/caddy run --config ${cfg.config} --adapter ${cfg.adapter} @@ -95,8 +97,6 @@ in { User = "caddy"; Group = "caddy"; Restart = "on-failure"; - StartLimitInterval = 86400; - StartLimitBurst = 5; NoNewPrivileges = true; LimitNPROC = 64; LimitNOFILE = 1048576; diff --git a/source/_posts/i2p-eepsite-nixos.md b/source/_posts/i2p-eepsite-nixos.md index 4547aae..91b2a69 100644 --- a/source/_posts/i2p-eepsite-nixos.md +++ b/source/_posts/i2p-eepsite-nixos.md @@ -2,7 +2,7 @@ title: "How to make your website available over I2P Eepsite on NixOS" excerpt: "A guide on I2P Eepsite on NixOS" date: 2020-03-21 -updated: 2020-04-22 +updated: 2020-09-09 tags: - server - linux @@ -148,6 +148,8 @@ in { wantedBy = [ "multi-user.target" ]; environment = mkIf (versionAtLeast config.system.stateVersion "17.09") { CADDYPATH = cfg.dataDir; }; + startLimitIntervalSec = 86400; + startLimitBurst = 5; serviceConfig = { ExecStart = '' ${cfg.package}/bin/caddy -root=/var/tmp -conf=${cfg.config} @@ -157,8 +159,6 @@ in { User = "caddyI2p"; Group = "caddyI2p"; Restart = "on-failure"; - StartLimitInterval = 86400; - StartLimitBurst = 5; NoNewPrivileges = true; LimitNPROC = 64; LimitNOFILE = 1048576; diff --git a/source/_posts/tor-hidden-onion-nixos.md b/source/_posts/tor-hidden-onion-nixos.md index da0e46b..113e0ae 100644 --- a/source/_posts/tor-hidden-onion-nixos.md +++ b/source/_posts/tor-hidden-onion-nixos.md @@ -2,7 +2,7 @@ title: "How to make your website available over Tor hidden service on NixOS" excerpt: "A guide on Tor hidden service on NixOS" date: 2020-03-16 -updated: 2020-04-22 +updated: 2020-09-09 tags: - server - linux @@ -123,6 +123,8 @@ in { wantedBy = [ "multi-user.target" ]; environment = mkIf (versionAtLeast config.system.stateVersion "17.09") { CADDYPATH = cfg.dataDir; }; + startLimitIntervalSec = 86400; + startLimitBurst = 5; serviceConfig = { ExecStart = '' ${cfg.package}/bin/caddy -root=/var/tmp -conf=${cfg.config} @@ -132,8 +134,6 @@ in { User = "caddyTor"; Group = "caddyTor"; Restart = "on-failure"; - StartLimitInterval = 86400; - StartLimitBurst = 5; NoNewPrivileges = true; LimitNPROC = 64; LimitNOFILE = 1048576;