ACL custom HAproxy
This commit is contained in:
parent
71dfe32758
commit
4b9b6df84c
@ -27,6 +27,8 @@ in
|
||||
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; };
|
||||
extraAcls = mkOption { type = str; description = "ACL HaProxy suplémentaires"; default = ""; };
|
||||
aclBool = mkOption { type = str; description = "Logique d'authentification"; default = "!AUTH_OK"; };
|
||||
}; });
|
||||
example = ''
|
||||
haproxy_backends = {
|
||||
@ -102,8 +104,11 @@ in
|
||||
''
|
||||
)}
|
||||
${(if value.auth then (
|
||||
"\n acl AuthOK_LOUTRE http_auth(LOUTRE)\n"
|
||||
+ " http-request auth realm LOUTRE if !AuthOK_LOUTRE\n"
|
||||
value.extraAcls
|
||||
+ ''
|
||||
acl AUTH_OK http_auth(LOUTRE)
|
||||
http-request auth realm LOUTRE if ${value.aclBool}
|
||||
''
|
||||
) else "")}
|
||||
''
|
||||
) cfg.services)}
|
||||
|
@ -30,9 +30,9 @@ in
|
||||
services.haproxy-acme.services = {
|
||||
"grafana.${domaine}" = { ip = "127.0.0.1"; port = 3000; auth = false; };
|
||||
"emby.${domaine}" = { ip = "127.0.0.1"; port = 8096; auth = false; };
|
||||
"radarr.${domaine}" = { ip = "127.0.0.1"; port = 7878; auth = false; };
|
||||
"sonarr.${domaine}" = { ip = "127.0.0.1"; port = 8989; auth = false; };
|
||||
"lidarr.${domaine}" = { ip = "127.0.0.1"; port = 8686; auth = false; };
|
||||
"radarr.${domaine}" = { ip = "127.0.0.1"; port = 7878; auth = true; extraAcls = "acl API url_beg /api\n"; aclBool = "!AUTH_OK !API"; };
|
||||
"sonarr.${domaine}" = { ip = "127.0.0.1"; port = 8989; auth = true; extraAcls = "acl API url_beg /api\n"; aclBool = "!AUTH_OK !API"; };
|
||||
"lidarr.${domaine}" = { ip = "127.0.0.1"; port = 8686; auth = true; extraAcls = "acl API url_beg /api\n"; aclBool = "!AUTH_OK !API"; };
|
||||
"transmission.${domaine}" = { ip = "127.0.0.1"; port = 9091; auth = true; };
|
||||
"syncthing.${domaine}" = { ip = "127.0.0.1"; port = 8384; auth = true; };
|
||||
"jackett.${domaine}" = { ip = "127.0.0.1"; port = 9117; auth = true; };
|
||||
|
Loading…
Reference in New Issue
Block a user