nginx/acme: fix certs

This commit is contained in:
Gerg-L 2024-12-12 22:24:52 -05:00
parent cbd76b3e44
commit 296a6f9af1
Signed by: gerg-l
SSH key fingerprint: SHA256:FPYDHIkvMocr4wdmZXpgpJjsb2Tw6rASs2ISPbOb0KI

View file

@ -10,16 +10,9 @@
}; };
config = { config = {
local.nginx.defaultVhosts = local.nginx.defaultVhosts = builtins.mapAttrs (_: v: {
{
"_" = {
default = true;
locations."/".return = "404";
};
}
// (builtins.mapAttrs (_: v: {
locations."/".proxyPass = v; locations."/".proxyPass = v;
}) config.local.nginx.proxyVhosts); }) config.local.nginx.proxyVhosts;
sops.secrets = { sops.secrets = {
gerg_ssl_key.owner = config.services.nginx.user; gerg_ssl_key.owner = config.services.nginx.user;
@ -31,6 +24,7 @@
certs."gerg-l.com" = { certs."gerg-l.com" = {
email = "GregLeyda@proton.me"; email = "GregLeyda@proton.me";
webroot = "/var/lib/acme/acme-challenge"; webroot = "/var/lib/acme/acme-challenge";
extraDomainNames = builtins.attrNames config.local.nginx.defaultVhosts;
}; };
}; };
@ -47,14 +41,25 @@
recommendedTlsSettings = true; recommendedTlsSettings = true;
# For immich # For immich
clientMaxBodySize = "50000M"; clientMaxBodySize = "50000M";
virtualHosts = builtins.mapAttrs ( virtualHosts =
builtins.mapAttrs
(
_: v: _: v:
{ {
forceSSL = true; forceSSL = true;
useACMEHost = "gerg-l.com"; useACMEHost = "gerg-l.com";
} }
// v // v
) config.local.nginx.defaultVhosts; )
(
config.local.nginx.defaultVhosts
// {
"_" = {
default = true;
locations."/".return = "404";
};
}
);
}; };
networking.firewall.allowedTCPPorts = [ networking.firewall.allowedTCPPorts = [
80 80