diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index b8f116930..154c6e31d 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= haproxy -PLUGIN_VERSION= 2.5 +PLUGIN_VERSION= 2.6 PLUGIN_COMMENT= Reliable, high performance TCP/HTTP load balancer PLUGIN_DEPENDS= haproxy-devel PLUGIN_MAINTAINER= opnsense@moov.de diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAction.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAction.xml index 396d7926d..90addff7a 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAction.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAction.xml @@ -283,6 +283,23 @@ text + + + header + + + + action.http_response_set_status_code + + text + + + + action.http_response_set_status_reason + + text + + header 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 9a4a0c0d4..4a3e48460 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 @@ -1528,6 +1528,7 @@ http-response header delete http-response header replace http-response header replace value + Set HTTP status code in response tcp-request connection accept tcp-request connection reject tcp-request content accept @@ -1658,6 +1659,16 @@ /^.{1,4096}$/u N + + 100 + 999 + Please specify a value between 100 and 999. + N + + + /^.{1,4096}$/u + N + /^.{1,4096}$/u 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 05331a290..c3392cfa6 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf @@ -215,7 +215,8 @@ {% do acl_options.append('') %} {% if acl_data.nbsrv|default("") != "" %} {% if acl_data.nbsrv_backend|default("") != "" %} -{% do acl_options.append('nbsrv(backend_' ~ acl_data.nbsrv_backend ~ ') ge ' ~ acl_data.nbsrv) %} +{% set nbsrv_backend_data = helpers.getUUID(acl_data.nbsrv_backend) %} +{% do acl_options.append('nbsrv(' ~ nbsrv_backend_data.name ~ ') ge ' ~ acl_data.nbsrv) %} {% else %} {% do acl_options.append('nbsrv ge ' ~ acl_data.nbsrv) %} {% endif %} @@ -419,6 +420,18 @@ {% set action_enabled = '0' %} # ERROR: missing parameters {% endif %} +{% elif action_data.type == 'http-response_set-status' %} +{% if action_data.http_response_set_status_code|default("") != "" %} +{% if action_data.http_response_set_status_reason|default("") != "" %} +{% set status_reason = ' reason "' ~ action_data.http_response_set_status_reason ~ '"' %} +{% else %} +{% set status_reason = '' %} +{% endif %} +{% do action_options.append('http-response set-status ' ~ action_data.http_response_set_status_code ~ status_reason) %} +{% else %} +{% set action_enabled = '0' %} + # ERROR: missing parameters +{% endif %} {% elif action_data.type == 'tcp-request_connection_accept' %} {% do action_options.append('tcp-request connection accept') %} {% elif action_data.type == 'tcp-request_connection_reject' %}