system/boot: increase maximum buffer size

References: https://github.com/quic-go/quic-go/wiki/UDP-Buffer-Sizes
This commit is contained in:
Lu Wang 2024-12-20 16:06:23 +08:00
parent a75d3f9ea8
commit 22700c13c7
Signed by: rebmit
SSH key fingerprint: SHA256:3px8QV1zEerIrEWHaqtH5rR9kjetyRST5EipOPrd+bU
8 changed files with 28 additions and 9 deletions

View file

@ -413,11 +413,11 @@
"treefmt-nix": "treefmt-nix" "treefmt-nix": "treefmt-nix"
}, },
"locked": { "locked": {
"lastModified": 1733660317, "lastModified": 1734683762,
"narHash": "sha256-RaMvzfu7rsbYuwvY5DmtV2XHLZrOlzXFkd3n3YuCkkE=", "narHash": "sha256-GnwQCZ9tx9Cb4PjPySnJrCYB4Fc3c288fw+sAeATXJY=",
"owner": "rebmit", "owner": "rebmit",
"repo": "nix-exprs", "repo": "nix-exprs",
"rev": "898ce2046d8066e21713ca2265f56e1ccdd74275", "rev": "13d8ed59016e492edc92407d4691e45b4fc09d4e",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -42,6 +42,7 @@ let
services.resolved services.resolved
services.vnstat services.vnstat
system.boot.sysctl.tcp-bbr system.boot.sysctl.tcp-bbr
system.boot.sysctl.udp-buffer-size
# keep-sorted end # keep-sorted end
]; ];

View file

@ -10,10 +10,11 @@ in
default = { default = {
# standard ports # standard ports
smtp = 25; smtp = 25;
dns = 53;
http = 80; http = 80;
https = 443; https = 443;
smtp-tls = 465; smtp-tls = 465;
smtp-starttls = 587; smtp-submission = 587;
imap-tls = 993; imap-tls = 993;
socks = 1080; socks = 1080;
ssh = 2222; ssh = 2222;
@ -28,6 +29,7 @@ in
mautrix-telegram = 4032; mautrix-telegram = 4032;
rspamd-controller = 4040; rspamd-controller = 4040;
rspamd-redis = 4041; rspamd-redis = 4041;
caddy-admin = 4050;
# public ports # public ports
enthalpy-ipsec = 13000; enthalpy-ipsec = 13000;

View file

@ -25,4 +25,8 @@
}; };
services.restic.backups.b2.paths = [ config.services.caddy.dataDir ]; services.restic.backups.b2.paths = [ config.services.caddy.dataDir ];
services.caddy.globalConfig = ''
admin 127.0.0.1:${toString config.networking.ports.caddy-admin}
'';
} }

View file

@ -17,6 +17,7 @@
http-port = config.networking.ports.keycloak; http-port = config.networking.ports.keycloak;
proxy-headers = "xforwarded"; proxy-headers = "xforwarded";
hostname = "keycloak.rebmit.moe"; hostname = "keycloak.rebmit.moe";
cache = "local";
}; };
}; };

View file

@ -29,11 +29,11 @@ in
mkOpts = opts: lib.concatLists (lib.mapAttrsToList mkKeyVal opts); mkOpts = opts: lib.concatLists (lib.mapAttrsToList mkKeyVal opts);
in in
{ {
"127.0.0.1:${toString config.networking.ports.smtp-starttls}".args = lib.mkBefore (mkOpts { "127.0.0.1:${toString config.networking.ports.smtp-submission}".args = mkOpts {
smtpd_sasl_auth_enable = "yes"; smtpd_sasl_auth_enable = "yes";
smtpd_sasl_type = "dovecot"; smtpd_sasl_type = "dovecot";
smtpd_sasl_path = "/run/dovecot2/auth-postfix"; smtpd_sasl_path = "/run/dovecot2/auth-postfix";
}); };
}; };
}; };
@ -58,9 +58,12 @@ in
''; '';
}; };
}; };
enableDHE = false;
enableImap = true;
enableLmtp = true; enableLmtp = true;
enablePAM = false; enablePAM = false;
enableDHE = false; enablePop3 = false;
enableQuota = false;
mailPlugins.perProtocol.lmtp.enable = [ "sieve" ]; mailPlugins.perProtocol.lmtp.enable = [ "sieve" ];
mailLocation = "maildir:~"; mailLocation = "maildir:~";
mailboxes = { mailboxes = {
@ -160,7 +163,7 @@ in
} }
proxy { proxy {
proxy_protocol v2 proxy_protocol v2
upstream 127.0.0.1:${toString config.networking.ports.smtp-starttls} upstream 127.0.0.1:${toString config.networking.ports.smtp-submission}
} }
} }
} }

View file

@ -66,7 +66,7 @@
lmtp = { lmtp = {
args = [ "flags=O" ]; args = [ "flags=O" ];
}; };
"127.0.0.1:${toString config.networking.ports.smtp-starttls}" = { "127.0.0.1:${toString config.networking.ports.smtp-submission}" = {
type = "inet"; type = "inet";
private = false; private = false;
command = "smtpd"; command = "smtpd";

View file

@ -0,0 +1,8 @@
{ ... }:
{
# https://github.com/quic-go/quic-go/wiki/UDP-Buffer-Sizes
boot.kernel.sysctl = {
"net.core.rmem_max" = 7500000;
"net.core.wmem_max" = 7500000;
};
}