{{ lang._('Welcome to the HAProxy plugin! This plugin is designed to offer all the features and flexibility HAProxy is famous for. If you are using HAProxy for the first time, please take some time to get familiar with it. The following information should help you to get started.')}}
+{{ lang._('Note that you should configure HAProxy in the following order:') }}
+{{ lang._('Please be aware that you need to %smanually%s add the required firewall rules for all configured services.') | format('', '') }}
+{{ lang._('Further information is available in our %sHAProxy plugin documentation%s and of course in the %sofficial HAProxy documentation%s. Be sure to report bugs and request features on our %sGitHub issue page%s. Code contributions are also very welcome!') | format('', '', '', '', '', '') }}
+{{ lang._('HAProxy needs to know which servers should be used to serve content. The following minimum information must be provided for each server:') }}
+{{ lang._("Please note that advanced mode settings allow you to disable a certain server or to configure it as a backup server in a Backend Pool. Another neat option is the possibility to adjust a server's weight relative to other servers in the same Backend Pool.") }}
+{{ lang._('Note that it is possible to directly add options to the HAProxy configuration by using the "option pass-through", a setting that is available for several configuration items. It allows you to implement configurations that are currently not officially supported by this plugin. It is strongly discouraged to rely on this feature. Please report missing features on our GitHub page!') | format('', '') }}
+{{ lang._("HAProxy requires two virtual services for its load balancing and proxying features. The following virtual services must be configured for everything that should be served by HAProxy:") }}
+{{ lang._('Remember to add firewall rules for all configured Public Services.') }}
+{{ lang._('Note that it is possible to directly add options to the HAProxy configuration by using the "option pass-through", a setting that is available for several configuration items. It allows you to implement configurations that are currently not officially supported by this plugin. It is strongly discouraged to rely on this feature. Please report missing features on our GitHub page!') | format('', '') }}
+{{ lang._("After getting acquainted with HAProxy the following optional features may prove useful:") }}
+{{ lang._("For more information on HAProxy's %sACL feature%s see the %sofficial documentation%s.") | format('', '', '', '') }}
+{{ lang._('Note that it is possible to directly add options to the HAProxy configuration by using the "option pass-through", a setting that is available for several configuration items. It allows you to implement configurations that are currently not officially supported by this plugin. It is strongly discouraged to rely on this feature. Please report missing features on our GitHub page!') | format('', '') }}
+{{ lang._("Most of the time these features are not required, but in certain situations they will be handy:") }}
+{{ lang._("For more details visit HAProxy's official documentation regarding the %sError Messages%s and the %sLua Script%s features.") | format('', '', '', '') }}
+{{ lang._('Server id') }} | +{{ lang._('Server ID') }} | {{ lang._('Server Name') }} | {{ lang._('Server Address') }} | {{ lang._('Server Port') }} | @@ -479,8 +640,8 @@ POSSIBILITY OF SUCH DAMAGE.
---|
{{ lang._('Health Check ID') }} | -{{ lang._('Health Check Name') }} | +{{ lang._('Health Monitor ID') }} | +{{ lang._('Health Monitor Name') }} | {{ lang._('Description') }} | {{ lang._('Commands') }} | {{ lang._('ID') }} | @@ -513,8 +674,8 @@ POSSIBILITY OF SUCH DAMAGE.
---|
{{ lang._('Action ID') }} | -{{ lang._('Action Name') }} | +{{ lang._('Rule ID') }} | +{{ lang._('Rule Name') }} | {{ lang._('Description') }} | {{ lang._('Commands') }} | {{ lang._('ID') }} | @@ -547,8 +708,8 @@ POSSIBILITY OF SUCH DAMAGE.
---|
{{ lang._('ACL id') }} | -{{ lang._('ACL Name') }} | +{{ lang._('Condition ID') }} | +{{ lang._('Condition Name') }} | {{ lang._('Description') }} | {{ lang._('Commands') }} | {{ lang._('ID') }} | @@ -582,7 +743,7 @@ POSSIBILITY OF SUCH DAMAGE.|||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{{ lang._('Enabled') }} | -{{ lang._('Lua ID') }} | +{{ lang._('Lua Script ID') }} | {{ lang._('Lua Script Name') }} | {{ lang._('Description') }} | {{ lang._('Commands') }} | @@ -616,8 +777,8 @@ POSSIBILITY OF SUCH DAMAGE.
{{ lang._('Error File ID') }} | -{{ lang._('Name') }} | +{{ lang._('Error Message ID') }} | +{{ lang._('Error Message Name') }} | {{ lang._('Description') }} | {{ lang._('Commands') }} | {{ lang._('ID') }} | @@ -647,11 +808,11 @@ POSSIBILITY OF SUCH DAMAGE. {# include dialogs #} -{{ partial("layout_partials/base_dialog",['fields':formDialogFrontend,'id':'DialogFrontend','label':lang._('Edit Frontend')])}} -{{ partial("layout_partials/base_dialog",['fields':formDialogBackend,'id':'DialogBackend','label':lang._('Edit Backend')])}} +{{ partial("layout_partials/base_dialog",['fields':formDialogFrontend,'id':'DialogFrontend','label':lang._('Edit Public Service')])}} +{{ partial("layout_partials/base_dialog",['fields':formDialogBackend,'id':'DialogBackend','label':lang._('Edit Backend Pool')])}} {{ partial("layout_partials/base_dialog",['fields':formDialogServer,'id':'DialogServer','label':lang._('Edit Server')])}} -{{ partial("layout_partials/base_dialog",['fields':formDialogHealthcheck,'id':'DialogHealthcheck','label':lang._('Edit Health Check')])}} -{{ partial("layout_partials/base_dialog",['fields':formDialogAction,'id':'DialogAction','label':lang._('Edit Action')])}} -{{ partial("layout_partials/base_dialog",['fields':formDialogAcl,'id':'DialogAcl','label':lang._('Edit ACL')])}} +{{ partial("layout_partials/base_dialog",['fields':formDialogHealthcheck,'id':'DialogHealthcheck','label':lang._('Edit Health Monitor')])}} +{{ partial("layout_partials/base_dialog",['fields':formDialogAction,'id':'DialogAction','label':lang._('Edit Rule')])}} +{{ partial("layout_partials/base_dialog",['fields':formDialogAcl,'id':'DialogAcl','label':lang._('Edit Condition')])}} {{ partial("layout_partials/base_dialog",['fields':formDialogLua,'id':'DialogLua','label':lang._('Edit Lua Script')])}} -{{ partial("layout_partials/base_dialog",['fields':formDialogErrorfile,'id':'DialogErrorfile','label':lang._('Edit Error File')])}} +{{ partial("layout_partials/base_dialog",['fields':formDialogErrorfile,'id':'DialogErrorfile','label':lang._('Edit Error Message')])}} 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 aad1fcba0c..ad6ce97004 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf @@ -63,86 +63,93 @@ {% endif %} {% do acls_seen.append(acl_data.id) %} {% set acl_options = [] %} -{% if acl_data.expression == 'host_starts_with' %} -{% if acl_data.value|default("") != "" %} -{% do acl_options.append('hdr_beg(host) -i ' ~ acl_data.value) %} +{% if acl_data.expression == 'hdr_beg' %} +{% if acl_data.hdr_beg|default("") != "" %} +{% do acl_options.append('hdr_beg(host) -i ' ~ acl_data.hdr_beg) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} -{% elif acl_data.expression == 'host_ends_with' %} -{% if acl_data.value|default("") != "" %} -{% do acl_options.append('hdr_end(host) -i ' ~ acl_data.value) %} +{% elif acl_data.expression == 'hdr_end' %} +{% if acl_data.hdr_end|default("") != "" %} +{% do acl_options.append('hdr_end(host) -i ' ~ acl_data.hdr_end) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} -{% elif acl_data.expression == 'host_matches' %} -{% if acl_data.value|default("") != "" %} -{% do acl_options.append('hdr(host) -i ' ~ acl_data.value) %} +{% elif acl_data.expression == 'hdr' %} +{% if acl_data.hdr|default("") != "" %} +{% do acl_options.append('hdr(host) -i ' ~ acl_data.hdr) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} -{% elif acl_data.expression == 'host_regex' %} -{% if acl_data.value|default("") != "" %} -{% do acl_options.append('hdr_reg(host) -i ' ~ acl_data.value) %} +{% elif acl_data.expression == 'hdr_reg' %} +{% if acl_data.hdr_reg|default("") != "" %} +{% do acl_options.append('hdr_reg(host) -i ' ~ acl_data.hdr_reg) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} -{% elif acl_data.expression == 'host_contains' %} -{% if acl_data.value|default("") != "" %} -{% do acl_options.append('hdr_sub(host) -i ' ~ acl_data.value) %} +{% elif acl_data.expression == 'hdr_sub' %} +{% if acl_data.hdr_sub|default("") != "" %} +{% do acl_options.append('hdr_sub(host) -i ' ~ acl_data.hdr_sub) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} -{% elif acl_data.expression == 'path_starts_with' %} -{% if acl_data.value|default("") != "" %} -{% do acl_options.append('path_beg -i ' ~ acl_data.value) %} +{% elif acl_data.expression == 'path_beg' %} +{% if acl_data.path_beg|default("") != "" %} +{% do acl_options.append('path_beg -i ' ~ acl_data.path_beg) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} -{% elif acl_data.expression == 'path_ends_with' %} -{% if acl_data.value|default("") != "" %} -{% do acl_options.append('path_end -i ' ~ acl_data.value) %} +{% elif acl_data.expression == 'path_end' %} +{% if acl_data.path_end|default("") != "" %} +{% do acl_options.append('path_end -i ' ~ acl_data.path_end) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} -{% elif acl_data.expression == 'path_matches' %} -{% if acl_data.value|default("") != "" %} -{% do acl_options.append('path -i ' ~ acl_data.value) %} +{% elif acl_data.expression == 'path' %} +{% if acl_data.path|default("") != "" %} +{% do acl_options.append('path -i ' ~ acl_data.path) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} -{% elif acl_data.expression == 'path_regex' %} -{% if acl_data.value|default("") != "" %} -{% do acl_options.append('path_reg -i ' ~ acl_data.value) %} +{% elif acl_data.expression == 'path_reg' %} +{% if acl_data.path_reg|default("") != "" %} +{% do acl_options.append('path_reg -i ' ~ acl_data.path_reg) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} -{% elif acl_data.expression == 'path_contains' %} -{% if acl_data.value|default("") != "" %} -{% do acl_options.append('path_dir -i ' ~ acl_data.value) %} +{% elif acl_data.expression == 'path_dir' %} +{% if acl_data.path_dur|default("") != "" %} +{% do acl_options.append('path_dir -i ' ~ acl_data.path_dir) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} -{% elif acl_data.expression == 'url_parameter' %} -{% if acl_data.value|default("") != "" and acl_data.urlparam|default("") != "" %} -{% do acl_options.append('url_param(' ~ acl_data.urlparam ~ ') -i ' ~ acl_data.value) %} +{% elif acl_data.expression == 'path_sub' %} +{% if acl_data.path_sub|default("") != "" %} +{% do acl_options.append('path_sub -i ' ~ acl_data.path_sub) %} +{% else %} +{% set acl_enabled = '0' %} + # ERROR: missing parameters +{% endif %} +{% elif acl_data.expression == 'url_param' %} +{% if acl_data.url_param_value|default("") != "" and acl_data.url_param|default("") != "" %} +{% do acl_options.append('url_param(' ~ acl_data.url_param ~ ') -i ' ~ acl_data.url_param_value) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'ssl_c_verify_code' %} -{% if acl_data.value|default("") != "" %} -{% do acl_options.append('ssl_c_verify ' ~ acl_data.value) %} +{% if acl_data.ssl_c_verify_code|default("") != "" %} +{% do acl_options.append('ssl_c_verify ' ~ acl_data.ssl_c_verify_code) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters @@ -150,25 +157,29 @@ {% elif acl_data.expression == 'ssl_c_verify' %} {% do acl_options.append('ssl_c_verify 0') %} {% elif acl_data.expression == 'ssl_c_ca_commonname' %} -{% if acl_data.value|default("") != "" %} -{% do acl_options.append('ssl_c_i_dn(CN) ' ~ acl_data.value) %} +{% if acl_data.ssl_c_ca_commonname|default("") != "" %} +{% do acl_options.append('ssl_c_i_dn(CN) ' ~ acl_data.ssl_c_ca_commonname) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'ssl_fc' %} {% do acl_options.append('ssl_fc') %} -{% elif acl_data.expression == 'source_ip' %} -{% if acl_data.value|default("") != "" %} -{% do acl_options.append('src ' ~ acl_data.value) %} +{% elif acl_data.expression == 'src' %} +{% if acl_data.src|default("") != "" %} +{% do acl_options.append('src ' ~ acl_data.src) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} -{% elif acl_data.expression == 'backendservercount' %} +{% elif acl_data.expression == 'nbsrv' %} {% do acl_options.append('') %} -{% if acl_data.value|default("") != "" and acl_data.queryBackend|default("") != "" %} -{% do acl_options.append('nbsrv(backend_' ~ acl_data.queryBackend ~ ') ge ' ~ acl_data.value) %} +{% 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) %} +{% else %} +{% do acl_options.append('nbsrv ge ' ~ acl_data.nbsrv) %} +{% endif %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters @@ -177,44 +188,44 @@ {% do acl_options.append('req.proto_http') %} {% elif acl_data.expression == 'traffic_is_ssl' %} {% do acl_options.append('req.ssl_ver gt 0') %} -{% elif acl_data.expression == 'ssl_sni_matches' %} -{% if acl_data.value|default("") != "" %} -{% do acl_options.append('req.ssl_sni -i ' ~ acl_data.value) %} +{% elif acl_data.expression == 'ssl_sni' %} +{% if acl_data.ssl_sni|default("") != "" %} +{% do acl_options.append('req.ssl_sni -i ' ~ acl_data.ssl_sni) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} -{% elif acl_data.expression == 'ssl_sni_contains' %} -{% if acl_data.value|default("") != "" %} -{% do acl_options.append('req.ssl_sni -m sub -i ' ~ acl_data.value) %} +{% elif acl_data.expression == 'ssl_sni_sub' %} +{% if acl_data.ssl_sni_sub|default("") != "" %} +{% do acl_options.append('req.ssl_sni -m sub -i ' ~ acl_data.ssl_sni_sub) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} -{% elif acl_data.expression == 'ssl_sni_starts_with' %} -{% if acl_data.value|default("") != "" %} -{% do acl_options.append('req.ssl_sni -m beg -i ' ~ acl_data.value) %} +{% elif acl_data.expression == 'ssl_sni_beg' %} +{% if acl_data.ssl_sni_beg|default("") != "" %} +{% do acl_options.append('req.ssl_sni -m beg -i ' ~ acl_data.ssl_sni_beg) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} -{% elif acl_data.expression == 'ssl_sni_ends_with' %} -{% if acl_data.value|default("") != "" %} -{% do acl_options.append('req.ssl_sni -m end -i ' ~ acl_data.value) %} +{% elif acl_data.expression == 'ssl_sni_end' %} +{% if acl_data.ssl_sni_end|default("") != "" %} +{% do acl_options.append('req.ssl_sni -m end -i ' ~ acl_data.ssl_sni_end) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} -{% elif acl_data.expression == 'ssl_sni_regex' %} -{% if acl_data.value|default("") != "" %} -{% do acl_options.append('req.ssl_sni -m reg -i ' ~ acl_data.value) %} +{% elif acl_data.expression == 'ssl_sni_reg' %} +{% if acl_data.ssl_sni_reg|default("") != "" %} +{% do acl_options.append('req.ssl_sni -m reg -i ' ~ acl_data.ssl_sni_reg) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'custom_acl' %} -{% if acl_data.value|default("") != "" %} -{% do acl_options.append(acl_data.value) %} +{% if acl_data.custom_acl|default("") != "" %} +{% do acl_options.append(acl_data.custom_acl) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters @@ -240,16 +251,16 @@ {% set action_enabled = '1' %} {% set action_options = [] %} {% if action_data.type == 'use_backend' %} -{% if action_data.useBackend|default("") != "" %} -{% set acl_backend_data = helpers.getUUID(action_data.useBackend) %} +{% if action_data.use_backend|default("") != "" %} +{% set acl_backend_data = helpers.getUUID(action_data.use_backend) %} {% do action_options.append('use_backend ' ~ acl_backend_data.name) %} {% else %} {% set action_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif action_data.type == 'use_server' %} -{% if action_data.useServer|default("") != "" %} -{% set server_data = helpers.getUUID(action_data.useServer) %} +{% if action_data.use_server|default("") != "" %} +{% set server_data = helpers.getUUID(action_data.use_server) %} {% do action_options.append('use-server ' ~ server_data.name) %} {% else %} {% set action_enabled = '0' %} @@ -262,64 +273,63 @@ {% elif action_data.type == 'http-request_tarpit' %} {% do action_options.append('http-request tarpit') %} {% elif action_data.type == 'http-request_auth' %} -{% if action_data.actionValue|default("") != "" %} -{% do action_options.append('http-request auth ' ~ action_data.actionValue) %} +{% if action_data.http_request_auth|default("") != "" %} +{% do action_options.append('http-request auth realm ' ~ action_data.http_request_auth) %} {% else %} -{% set action_enabled = '0' %} - # ERROR: missing parameters +{% do action_options.append('http-request auth') %} {% endif %} {% elif action_data.type == 'http-request_redirect' %} -{% if action_data.actionValue|default("") != "" %} -{% do action_options.append('http-request redirect ' ~ action_data.actionValue) %} +{% if action_data.http_request_redirect|default("") != "" %} +{% do action_options.append('http-request redirect ' ~ action_data.http_request_redirect) %} {% else %} {% set action_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif action_data.type == 'http-request_lua' %} -{% if action_data.actionValue|default("") != "" %} -{% do action_options.append('http-request lua.' ~ action_data.actionValue) %} +{% if action_data.http_request_lua|default("") != "" %} +{% do action_options.append('http-request lua.' ~ action_data.http_request_lua) %} {% else %} {% set action_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif action_data.type == 'http-request_use-service' %} -{% if action_data.actionValue|default("") != "" %} -{% do action_options.append('http-request use-service lua.' ~ action_data.actionValue) %} +{% if action_data.http_request_use_service|default("") != "" %} +{% do action_options.append('http-request use-service lua.' ~ action_data.http_request_use_service) %} {% else %} {% set action_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif action_data.type == 'http-request_add-header' %} -{% if action_data.actionValue|default("") != "" and action_data.actionName|default("") != "" %} -{% do action_options.append('http-request add-header ' ~ action_data.actionName ~ ' ' ~ action_data.actionValue) %} +{% if action_data.http_request_add_header_name|default("") != "" and action_data.http_request_add_header_content|default("") != "" %} +{% do action_options.append('http-request add-header ' ~ action_data.http_request_add_header_name ~ ' ' ~ action_data.http_request_add_header_content) %} {% else %} {% set action_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif action_data.type == 'http-request_set-header' %} -{% if action_data.actionValue|default("") != "" and action_data.actionName|default("") != "" %} -{% do action_options.append('http-request set-header ' ~ action_data.actionName ~ ' ' ~ action_data.actionValue) %} +{% if action_data.http_request_set_header_name|default("") != "" and action_data.http_request_set_header_content|default("") != "" %} +{% do action_options.append('http-request set-header ' ~ action_data.http_request_set_header_name ~ ' ' ~ action_data.http_request_set_header_content) %} {% else %} {% set action_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif action_data.type == 'http-request_del-header' %} -{% if action_data.actionName|default("") != "" %} -{% do action_options.append('http-request del-header' ~ action_data.actionName) %} +{% if action_data.http_request_del_header_name|default("") != "" %} +{% do action_options.append('http-request del-header' ~ action_data.http_request_del_header_name) %} {% else %} {% set action_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif action_data.type == 'http-request_replace-header' %} -{% if action_data.actionValue|default("") != "" and action_data.actionName|default("") != "" and action_data.actionFind|default("") != "" %} -{% do action_options.append('http-request replace-header ' ~ action_data.actionName ~ ' ' ~ action_data.actionFind ~ ' ' ~ action_data.actionValue) %} +{% if action_data.http_request_replace_header_name|default("") != "" and action_data.http_request_replace_header_regex|default("") != "" %} +{% do action_options.append('http-request replace-header ' ~ action_data.http_request_replace_header_name ~ ' ' ~ action_data.http_request_replace_header_regex) %} {% else %} {% set action_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif action_data.type == 'http-request_replace-value' %} -{% if action_data.actionValue|default("") != "" and action_data.actionName|default("") != "" and action_data.actionFind|default("") != "" %} -{% do action_options.append('http-request replace-value ' ~ action_data.actionName ~ ' ' ~ action_data.actionFind ~ ' ' ~ action_data.actionValue) %} +{% if action_data.http_request_replace_value_name|default("") != "" and action_data.http_request_replace_value_regex|default("") != "" %} +{% do action_options.append('http-request replace-value ' ~ action_data.http_request_replace_value_name ~ ' ' ~ action_data.http_request_replace_value_regex) %} {% else %} {% set action_enabled = '0' %} # ERROR: missing parameters @@ -329,43 +339,43 @@ {% elif action_data.type == 'http-response_deny' %} {% do action_options.append('http-response deny') %} {% elif action_data.type == 'http-response_lua' %} -{% if action_data.actionValue|default("") != "" %} -{% do action_options.append('http-response lua.' ~ action_data.actionValue) %} +{% if action_data.http_response_lua|default("") != "" %} +{% do action_options.append('http-response lua.' ~ action_data.http_response_lua) %} {% else %} {% set action_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif action_data.type == 'http-response_add-header' %} -{% if action_data.actionValue|default("") != "" and action_data.actionName|default("") != "" %} -{% do action_options.append('http-response add-header ' ~ action_data.actionName ~ ' ' ~ action_data.actionValue) %} +{% if action_data.http_response_add_header_name|default("") != "" and action_data.http_response_add_header_content|default("") != "" %} +{% do action_options.append('http-response add-header ' ~ action_data.http_response_add_header_name ~ ' ' ~ action_data.http_response_add_header_content) %} {% else %} {% set action_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif action_data.type == 'http-response_set-header' %} -{% if action_data.actionValue|default("") != "" and action_data.actionName|default("") != "" %} -{% do action_options.append('http-response set-header ' ~ action_data.actionName ~ ' ' ~ action_data.actionValue) %} +{% if action_data.http_response_set_header_name|default("") != "" and action_data.http_response_set_header_content|default("") != "" %} +{% do action_options.append('http-response set-header ' ~ action_data.http_response_set_header_name ~ ' ' ~ action_data.http_response_set_header_content) %} {% else %} {% set action_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif action_data.type == 'http-response_del-header' %} -{% if action_data.actionName|default("") != "" %} -{% do action_options.append('http-response del-header' ~ action_data.actionName) %} +{% if action_data.http_response_del_header_name|default("") != "" %} +{% do action_options.append('http-response del-header' ~ action_data.http_response_del_header_name) %} {% else %} {% set action_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif action_data.type == 'http-response_replace-header' %} -{% if action_data.actionValue|default("") != "" and action_data.actionName|default("") != "" and action_data.actionFind|default("") != "" %} -{% do action_options.append('http-response replace-header ' ~ action_data.actionName ~ ' ' ~ action_data.actionFind ~ ' ' ~ action_data.actionValue) %} +{% if action_data.http_response_replace_header_name|default("") != "" and action_data.http_response_replace_header_regex|default("") != "" %} +{% do action_options.append('http-response replace-header ' ~ action_data.http_response_replace_header_name ~ ' ' ~ action_data.http_response_replace_header_regex) %} {% else %} {% set action_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif action_data.type == 'http-response_replace-value' %} -{% if action_data.actionValue|default("") != "" and action_data.actionName|default("") != "" and action_data.actionFind|default("") != "" %} -{% do action_options.append('http-response replace-value ' ~ action_data.actionName ~ ' ' ~ action_data.actionFind ~ ' ' ~ action_data.actionValue) %} +{% if action_data.http_response_replace_value_name|default("") != "" and action_data.http_response_replace_value_regex|default("") != "" %} +{% do action_options.append('http-response replace-value ' ~ action_data.http_response_replace_value_name ~ ' ' ~ action_data.http_response_replace_value_regex) %} {% else %} {% set action_enabled = '0' %} # ERROR: missing parameters @@ -379,15 +389,15 @@ {% elif action_data.type == 'tcp-request_content_reject' %} {% do action_options.append('tcp-request content reject') %} {% elif action_data.type == 'tcp-request_content_lua' %} -{% if action_data.actionValue|default("") != "" %} -{% do action_options.append('tcp-request content lua.' ~ action_data.actionValue) %} +{% if action_data.tcp-request_content_lua|default("") != "" %} +{% do action_options.append('tcp-request content lua.' ~ action_data.tcp_request_content_lua) %} {% else %} {% set action_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif action_data.type == 'tcp-request_content_use-service' %} -{% if action_data.actionValue|default("") != "" %} -{% do action_options.append('tcp-request content use-service lua.' ~ action_data.actionValue) %} +{% if action_data.tcp_request_content_use_service|default("") != "" %} +{% do action_options.append('tcp-request content use-service lua.' ~ action_data.tcp_request_content_use_service) %} {% else %} {% set action_enabled = '0' %} # ERROR: missing parameters @@ -399,15 +409,15 @@ {% elif action_data.type == 'tcp-response_content_reject' %} {% do action_options.append('tcp-response content reject') %} {% elif action_data.type == 'tcp-response_content_lua' %} -{% if action_data.actionValue|default("") != "" %} -{% do action_options.append('tcp-response content lua.' ~ action_data.actionValue) %} +{% if action_data.tcp_response_content_lua|default("") != "" %} +{% do action_options.append('tcp-response content lua.' ~ action_data.tcp_response_content_lua) %} {% else %} {% set action_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif action_data.type == 'custom' %} -{% if action_data.actionValue|default("") != "" %} -{% do action_options.append(action_data.actionValue) %} +{% if action_data.custom|default("") != "" %} +{% do action_options.append(action_data.custom) %} {% else %} {% set action_enabled = '0' %} # ERROR: missing parameters @@ -721,25 +731,35 @@ backend {{backend.name}} {% endif %} {% endif %} {% elif healthcheck_data.type == 'agent' %} -{% if healthcheck_data.agentPort|default("") != "" %} -{% do healthcheck_additions.append('agent-check agent-port ' ~ healthcheck_data.agentPort) %} +{% if healthcheck_data.agent_port|default("") != "" %} +{% do healthcheck_additions.append('agent-check agent-port ' ~ healthcheck_data.agent_port) %} {% else %} # ERROR: agent-check configured, but agent-port was not specified {% endif %} {% elif healthcheck_data.type == 'ldap' %} option ldap-check -{% elif healthcheck_data.type == 'mysql' or healthcheck_data.type == 'pgsql' %} -{% if healthcheck_data.dbUser|default("") != "" %} - option {{healthcheck_data.type}}-check user {{healthcheck_data.dbUser}} +{% elif healthcheck_data.type == 'mysql' %} +{% if healthcheck_data.mysql_user|default("") != "" %} +{% if healthcheck_data.mysql_post41|default("") == '1' %} + option mysql-check user {{healthcheck_data.mysql_user}} post-41 +{% else %} + option mysql-check user {{healthcheck_data.mysql_user}} +{% endif %} +{% else %} + # ERROR: {{healthcheck_data.type}} check configured, but db user was not specified +{% endif %} +{% elif healthcheck_data.type == 'pgsql' %} +{% if healthcheck_data.pgsql_user|default("") != "" %} + option pgsql-check user {{healthcheck_data.pgsql_user}} {% else %} # ERROR: {{healthcheck_data.type}} check configured, but db user was not specified {% endif %} {% elif healthcheck_data.type == 'redis' %} option redis-check {% elif healthcheck_data.type == 'smtp' %} - option smtpchk HELO {{healthcheck_data.smtpDomain}} + option smtpchk HELO {{healthcheck_data.smtp_domain}} {% elif healthcheck_data.type == 'esmtp' %} - option smtpchk EHLO {{healthcheck_data.smtpDomain}} + option smtpchk EHLO {{healthcheck_data.esmtp_domain}} {% elif healthcheck_data.type == 'ssl' %} option ssl-hello-chk {% endif %} @@ -888,7 +908,7 @@ backend {{backend.name}} {% if server_data.advanced|default("") != "" %} {% do server_options.append(server_data.advanced) %} {% endif %} - server {{server_data.name}} {{server_data.address}}:{% if backend.tuning_noport != '1' %}{{server_data.port}}{% endif %} {{server_options|join(' ')}} + server {{server_data.name}} {{server_data.address}}:{% if backend.tuning_noport != '1' %}{% if server_data.port|default("") != "" %}{{server_data.port}}{% endif %}{% endif %} {{server_options|join(' ')}} {% endif %} {% endfor %}
---|