Support sockets

This commit is contained in:
nyanloutre 2018-06-05 14:03:52 +02:00
parent 959801a1d0
commit d70eff7249
1 changed files with 11 additions and 1 deletions

View File

@ -25,6 +25,7 @@ in
type = with types; attrsOf (submodule { options = {
ip = mkOption { type = str; description = "IP address"; };
port = mkOption { type = int; description = "Port number"; };
socket = mkOption { type = str; description = "Emplacement du socket"; default = ""; };
auth = mkOption { type = bool; description = "Enable authentification"; default = false; };
}; });
example = ''
@ -90,7 +91,16 @@ in
''
backend ${name}-backend
mode http
server ${name} ${value.ip}:${toString value.port}
${(
if value.socket == "" then
''
server ${name} ${value.ip}:${toString value.port}
''
else
''
server ${name} ${value.socket}
''
)}
${(if value.auth then (
"\n acl AuthOK_LOUTRE http_auth(LOUTRE)\n"
+ " http-request auth realm LOUTRE if !AuthOK_LOUTRE\n"