Configuration des domaines générique
This commit is contained in:
parent
bfb50ff90c
commit
69c58eb73e
4 changed files with 33 additions and 19 deletions
|
@ -71,7 +71,7 @@ in
|
|||
|
||||
${concatStrings (
|
||||
mapAttrsToList (name: value:
|
||||
" acl ${name}-acl hdr(host) -i ${name}.${cfg.domaine}\n"
|
||||
" acl ${name}-acl hdr(host) -i ${name}\n"
|
||||
+ " use_backend ${name}-backend if ${name}-acl\n"
|
||||
) cfg.services)}
|
||||
|
||||
|
@ -111,9 +111,9 @@ in
|
|||
security.acme.certs = {
|
||||
${cfg.domaine} = {
|
||||
extraDomains = mapAttrs' (name: value:
|
||||
nameValuePair ("${name}.${cfg.domaine}") (null)
|
||||
nameValuePair ("${name}") (null)
|
||||
) cfg.services;
|
||||
webroot = "/var/www/challenges/";
|
||||
webroot = "/var/www/challenges";
|
||||
email = "paul@nyanlout.re";
|
||||
user = "haproxy";
|
||||
group = "haproxy";
|
||||
|
|
|
@ -14,12 +14,18 @@ in
|
|||
example = 54321;
|
||||
description = "Local listening port";
|
||||
};
|
||||
|
||||
domaine = mkOption {
|
||||
type = types.str;
|
||||
example = "example.com";
|
||||
description = "Domaine à utiliser";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
services.haproxy-acme.services = {
|
||||
max = { ip = "127.0.0.1"; port = cfg.port; auth = false; };
|
||||
${cfg.domaine} = { ip = "127.0.0.1"; port = cfg.port; auth = false; };
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts = {
|
||||
|
|
|
@ -14,12 +14,18 @@ in
|
|||
example = 54321;
|
||||
description = "Local listening port";
|
||||
};
|
||||
|
||||
domaine = mkOption {
|
||||
type = types.str;
|
||||
example = "example.com";
|
||||
description = "Domaine à utiliser";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
services.haproxy-acme.services = {
|
||||
musique = { ip = "127.0.0.1"; port = cfg.port; auth = false; };
|
||||
${cfg.domaine} = { ip = "127.0.0.1"; port = cfg.port; auth = false; };
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue