mirror of
https://github.com/oddlama/nix-config.git
synced 2025-10-11 07:10:39 +02:00
feat: add idmail for aliases
This commit is contained in:
parent
cb4f4f251f
commit
7f7b053e0a
9 changed files with 607 additions and 136 deletions
42
hosts/envoy/idmail.nix
Normal file
42
hosts/envoy/idmail.nix
Normal file
|
@ -0,0 +1,42 @@
|
|||
{config, ...}: let
|
||||
mailDomains = config.repo.secrets.global.domains.mail;
|
||||
primaryDomain = mailDomains.primary;
|
||||
idmailDomain = "alias.${primaryDomain}";
|
||||
in {
|
||||
environment.persistence."/persist".directories = [
|
||||
{
|
||||
directory = "/var/lib/idmail";
|
||||
user = "idmail";
|
||||
group = "idmail";
|
||||
mode = "0700";
|
||||
}
|
||||
];
|
||||
|
||||
globals.services.idmail.domain = idmailDomain;
|
||||
globals.monitoring.http.idmail = {
|
||||
url = "https://${idmailDomain}";
|
||||
expectedBodyRegex = "idmail";
|
||||
network = "internet";
|
||||
};
|
||||
|
||||
services.idmail.enable = true;
|
||||
systemd.services.idmail.serviceConfig.RestartSec = "60"; # Retry every minute
|
||||
|
||||
services.nginx = {
|
||||
upstreams.idmail = {
|
||||
servers."127.0.0.1:3000" = {};
|
||||
extraConfig = ''
|
||||
zone idmail 64k;
|
||||
keepalive 2;
|
||||
'';
|
||||
};
|
||||
virtualHosts.${idmailDomain} = {
|
||||
forceSSL = true;
|
||||
useACMEWildcardHost = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://idmail";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue