hosts/public-access-proxy: add assertion for haproxy backend
This commit is contained in:
parent
dd73d8ae9c
commit
bd2a66113b
|
@ -97,6 +97,15 @@ in
|
|||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [{
|
||||
assertion = let
|
||||
proxyTo = lib.forEach cfg.proxyHosts (x: x.proxyTo.host);
|
||||
uniqueProxyTo = lib.unique proxyTo;
|
||||
in
|
||||
(builtins.length proxyTo) == (builtins.length uniqueProxyTo);
|
||||
message = "proxyTo must be unique across the list of proxyHosts. Insert your domain you want to proxy to the list of hostNames instead.";
|
||||
}];
|
||||
|
||||
services.haproxy = {
|
||||
enable = true;
|
||||
config = ''
|
||||
|
|
Loading…
Reference in New Issue