diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/main.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/main.xml index 5e4d58937..c3f131a9a 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/main.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/main.xml @@ -196,6 +196,13 @@ Enter user:password here. Finish with TAB. + + haproxy.general.stats.customOptions + Custom options + textbox + NOTE: The syntax will not be checked, use at your own risk!]]> + true + diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index d28bfeaea..de0949104 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -211,6 +211,9 @@ /^((([0-9a-zA-Z._\-]+:[0-9a-zA-Z._\-]+)([,]){0,1}))*/u Please provide a valid user and password, i.e. user:secret123. + + N + diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf index 34f9989a1..e1996d3e5 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf @@ -796,6 +796,12 @@ listen local_statistics stats uri /haproxy?stats stats realm HAProxy\ statistics stats admin if TRUE +{% if OPNsense.HAProxy.general.stats.customOptions|default("") != "" %} + # WARNING: pass through options below this line +{% for customOpt in OPNsense.HAProxy.general.stats.customOptions.split("\n") %} + {{customOpt}} +{% endfor %} +{% endif %} {# # remote stats are optional #} {% if OPNsense.HAProxy.general.stats.remoteEnabled|default("") == "1" %} @@ -816,9 +822,15 @@ listen remote_statistics {% endfor %} {% endif %} {% endif %} -{% else %} +{% if OPNsense.HAProxy.general.stats.customOptions|default("") != "" %} + # WARNING: pass through options below this line +{% for customOpt in OPNsense.HAProxy.general.stats.customOptions.split("\n") %} + {{customOpt}} +{% endfor %} +{% endif %} +{% else %} # ERROR: remote statistics disabled, because no listen address was specified -{% endif %} +{% endif %} {% endif %} {% else %} # statistics are DISABLED