mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nixos-config.git
synced 2025-01-11 18:09:31 +00:00
use enableACME for all virtualHosts
This commit is contained in:
parent
0c4d57c33d
commit
46366702bc
|
@ -25,15 +25,8 @@ in
|
||||||
dnsPropagationCheck =
|
dnsPropagationCheck =
|
||||||
! (lib.elem cfg.dns.provider dnsPropagationCheckExceptions);
|
! (lib.elem cfg.dns.provider dnsPropagationCheckExceptions);
|
||||||
reloadServices = [ "nginx" ];
|
reloadServices = [ "nginx" ];
|
||||||
};
|
dnsProvider = lib.strings.toLower cfg.dns.provider;
|
||||||
certs = lib.mkForce {
|
credentialsFile = acme-env-filepath;
|
||||||
"${cfg.domain}" = {
|
|
||||||
domain = "*.${cfg.domain}";
|
|
||||||
extraDomainNames = [ "${cfg.domain}" ];
|
|
||||||
group = "acmereceivers";
|
|
||||||
dnsProvider = lib.strings.toLower cfg.dns.provider;
|
|
||||||
credentialsFile = acme-env-filepath;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
systemd.services.acme-secrets = {
|
systemd.services.acme-secrets = {
|
||||||
|
|
|
@ -72,9 +72,8 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
services.nginx.virtualHosts."password.${sp.domain}" = {
|
services.nginx.virtualHosts."password.${sp.domain}" = {
|
||||||
sslCertificate = "/var/lib/acme/${sp.domain}/fullchain.pem";
|
|
||||||
sslCertificateKey = "/var/lib/acme/${sp.domain}/key.pem";
|
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
add_header Strict-Transport-Security $hsts_header;
|
add_header Strict-Transport-Security $hsts_header;
|
||||||
#add_header Content-Security-Policy "script-src 'self'; object-src 'none'; base-uri 'none';" always;
|
#add_header Content-Security-Policy "script-src 'self'; object-src 'none'; base-uri 'none';" always;
|
||||||
|
|
|
@ -85,9 +85,8 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
services.nginx.virtualHosts."git.${sp.domain}" = {
|
services.nginx.virtualHosts."git.${sp.domain}" = {
|
||||||
sslCertificate = "/var/lib/acme/${sp.domain}/fullchain.pem";
|
|
||||||
sslCertificateKey = "/var/lib/acme/${sp.domain}/key.pem";
|
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
add_header Strict-Transport-Security $hsts_header;
|
add_header Strict-Transport-Security $hsts_header;
|
||||||
#add_header Content-Security-Policy "script-src 'self'; object-src 'none'; base-uri 'none';" always;
|
#add_header Content-Security-Policy "script-src 'self'; object-src 'none'; base-uri 'none';" always;
|
||||||
|
|
|
@ -21,11 +21,8 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
services.nginx.virtualHosts."meet.${domain}" = {
|
services.nginx.virtualHosts."meet.${domain}" = {
|
||||||
sslCertificate = "/var/lib/acme/${domain}/fullchain.pem";
|
|
||||||
sslCertificateKey = "/var/lib/acme/${domain}/key.pem";
|
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
useACMEHost = domain;
|
enableACME = true;
|
||||||
enableACME = false;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,9 +69,8 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
services.nginx.virtualHosts.${hostName} = {
|
services.nginx.virtualHosts.${hostName} = {
|
||||||
sslCertificate = "/var/lib/acme/${sp.domain}/fullchain.pem";
|
|
||||||
sslCertificateKey = "/var/lib/acme/${sp.domain}/key.pem";
|
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
add_header Strict-Transport-Security $hsts_header;
|
add_header Strict-Transport-Security $hsts_header;
|
||||||
#add_header Content-Security-Policy "script-src 'self'; object-src 'none'; base-uri 'none';" always;
|
#add_header Content-Security-Policy "script-src 'self'; object-src 'none'; base-uri 'none';" always;
|
||||||
|
|
|
@ -56,9 +56,8 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
services.nginx.virtualHosts."vpn.${domain}" = {
|
services.nginx.virtualHosts."vpn.${domain}" = {
|
||||||
sslCertificate = "/var/lib/acme/${domain}/fullchain.pem";
|
|
||||||
sslCertificateKey = "/var/lib/acme/${domain}/key.pem";
|
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
add_header Strict-Transport-Security $hsts_header;
|
add_header Strict-Transport-Security $hsts_header;
|
||||||
#add_header Content-Security-Policy "script-src 'self'; object-src 'none'; base-uri 'none';" always;
|
#add_header Content-Security-Policy "script-src 'self'; object-src 'none'; base-uri 'none';" always;
|
||||||
|
|
|
@ -100,10 +100,9 @@ in
|
||||||
# seems to be an upstream nixpkgs/nixos bug (missing hexdump)
|
# seems to be an upstream nixpkgs/nixos bug (missing hexdump)
|
||||||
systemd.services.pleroma.path = [ pkgs.util-linux ];
|
systemd.services.pleroma.path = [ pkgs.util-linux ];
|
||||||
services.nginx.virtualHosts."social.${sp.domain}" = {
|
services.nginx.virtualHosts."social.${sp.domain}" = {
|
||||||
sslCertificate = "/var/lib/acme/${sp.domain}/fullchain.pem";
|
|
||||||
sslCertificateKey = "/var/lib/acme/${sp.domain}/key.pem";
|
|
||||||
root = "/var/www/social.${sp.domain}";
|
root = "/var/www/social.${sp.domain}";
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
add_header Strict-Transport-Security $hsts_header;
|
add_header Strict-Transport-Security $hsts_header;
|
||||||
#add_header Content-Security-Policy "script-src 'self'; object-src 'none'; base-uri 'none';" always;
|
#add_header Content-Security-Policy "script-src 'self'; object-src 'none'; base-uri 'none';" always;
|
||||||
|
|
|
@ -11,5 +11,6 @@
|
||||||
[ "services", "postfix", "user" ],
|
[ "services", "postfix", "user" ],
|
||||||
[ "services", "redis" ],
|
[ "services", "redis" ],
|
||||||
[ "services", "rspamd" ],
|
[ "services", "rspamd" ],
|
||||||
|
[ "security", "acme", "certs" ],
|
||||||
[ "selfprivacy", "modules", "simple-nixos-mailserver" ]
|
[ "selfprivacy", "modules", "simple-nixos-mailserver" ]
|
||||||
]
|
]
|
||||||
|
|
|
@ -66,9 +66,7 @@ lib.mkIf sp.modules.simple-nixos-mailserver.enable
|
||||||
"admin@${sp.domain}" = "${sp.username}@${sp.domain}";
|
"admin@${sp.domain}" = "${sp.username}@${sp.domain}";
|
||||||
};
|
};
|
||||||
|
|
||||||
certificateScheme = "manual";
|
certificateScheme = "acme";
|
||||||
certificateFile = "/var/lib/acme/${sp.domain}/fullchain.pem";
|
|
||||||
keyFile = "/var/lib/acme/${sp.domain}/key.pem";
|
|
||||||
|
|
||||||
# Enable IMAP and POP3
|
# Enable IMAP and POP3
|
||||||
enableImap = true;
|
enableImap = true;
|
||||||
|
|
|
@ -21,9 +21,8 @@ in
|
||||||
'';
|
'';
|
||||||
virtualHosts = {
|
virtualHosts = {
|
||||||
"${domain}" = {
|
"${domain}" = {
|
||||||
sslCertificate = "/var/lib/acme/${domain}/fullchain.pem";
|
|
||||||
sslCertificateKey = "/var/lib/acme/${domain}/key.pem";
|
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
add_header Strict-Transport-Security $hsts_header;
|
add_header Strict-Transport-Security $hsts_header;
|
||||||
#add_header Content-Security-Policy "script-src 'self'; object-src 'none'; base-uri 'none';" always;
|
#add_header Content-Security-Policy "script-src 'self'; object-src 'none'; base-uri 'none';" always;
|
||||||
|
@ -41,9 +40,8 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
"api.${domain}" = {
|
"api.${domain}" = {
|
||||||
sslCertificate = "/var/lib/acme/${domain}/fullchain.pem";
|
|
||||||
sslCertificateKey = "/var/lib/acme/${domain}/key.pem";
|
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
add_header Strict-Transport-Security $hsts_header;
|
add_header Strict-Transport-Security $hsts_header;
|
||||||
#add_header Content-Security-Policy "script-src 'self'; object-src 'none'; base-uri 'none';" always;
|
#add_header Content-Security-Policy "script-src 'self'; object-src 'none'; base-uri 'none';" always;
|
||||||
|
|
Loading…
Reference in a new issue