feat: switch to stalwart

This commit is contained in:
Patrick 2024-11-29 21:20:08 +01:00
parent 00f45973b8
commit 57454a768b
Signed by: patrick
GPG key ID: 451F95EFB8BECD0F
6 changed files with 9 additions and 4 deletions

View file

@ -73,6 +73,8 @@ in
systemd.services.idmail.serviceConfig.RestartSec = "60"; # Retry every minute systemd.services.idmail.serviceConfig.RestartSec = "60"; # Retry every minute
services.nginx = { services.nginx = {
enable = true;
recommendedSetup = true;
upstreams.idmail = { upstreams.idmail = {
servers."127.0.0.1:3000" = { }; servers."127.0.0.1:3000" = { };
extraConfig = '' extraConfig = ''
@ -82,7 +84,7 @@ in
}; };
virtualHosts.${idmailDomain} = { virtualHosts.${idmailDomain} = {
forceSSL = true; forceSSL = true;
useACMEWildcardHost = true; useACMEHost = domain;
locations."/" = { locations."/" = {
proxyPass = "http://idmail"; proxyPass = "http://idmail";
proxyWebsockets = true; proxyWebsockets = true;

View file

@ -125,6 +125,8 @@ in
} }
]; ];
services.nginx = { services.nginx = {
enable = true;
recommendedSetup = true;
upstreams.stalwart = { upstreams.stalwart = {
servers."127.0.0.1:8080" = { }; servers."127.0.0.1:8080" = { };
extraConfig = '' extraConfig = ''
@ -136,7 +138,7 @@ in
{ {
${domain} = { ${domain} = {
forceSSL = true; forceSSL = true;
useACMEWildcardHost = true; useACMEHost = domain;
extraConfig = '' extraConfig = ''
client_max_body_size 512M; client_max_body_size 512M;
''; '';
@ -154,7 +156,7 @@ in
] ]
(_: { (_: {
forceSSL = true; forceSSL = true;
useACMEWildcardHost = true; useACMEHost = domain;
locations."/".proxyPass = "http://stalwart"; locations."/".proxyPass = "http://stalwart";
}); });
}; };

View file

@ -2,7 +2,7 @@
imports = [ imports = [
../../config/basic ../../config/basic
../../config/support/initrd-ssh.nix ../../config/support/initrd-ssh.nix
../../config/services/maddy.nix # ../../config/services/maddy.nix
../../config/support/zfs.nix ../../config/support/zfs.nix
./net.nix ./net.nix

View file

@ -52,6 +52,7 @@
}; };
}; };
networking.nftables.firewall.zones.untrusted.interfaces = [ "lan01" ]; networking.nftables.firewall.zones.untrusted.interfaces = [ "lan01" ];
users.groups.acme.members = [ "nginx" ];
security.acme.certs = { security.acme.certs = {
"${config.secrets.secrets.global.domains.mail_public}" = { "${config.secrets.secrets.global.domains.mail_public}" = {
domain = config.secrets.secrets.global.domains.mail_public; domain = config.secrets.secrets.global.domains.mail_public;

Binary file not shown.