diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/Migrations/M4_0_0.php b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/Migrations/M4_0_0.php
new file mode 100644
index 000000000..c13544da5
--- /dev/null
+++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/Migrations/M4_0_0.php
@@ -0,0 +1,50 @@
+getNodeByReference('frontends.frontend')->iterateItems() as $frontend) {
+ switch ((string)$frontend->connectionBehaviour) {
+ case 'http-tunnel':
+ $frontend->connectionBehaviour = 'http-keep-alive';
+ break;
+ case 'forceclose':
+ $frontend->connectionBehaviour = 'http-keep-alive';
+ break;
+ }
+ }
+ }
+}
diff --git a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt
index 2dc92a782..54dd719be 100644
--- a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt
+++ b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt
@@ -717,7 +717,7 @@ POSSIBILITY OF SUCH DAMAGE.
{{ lang._('Lastly, enable HAProxy using the %sService%s settings page.') | format('', '') }}
{{ 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._('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('', '', '', '', '', '') }}
@@ -759,7 +759,7 @@ POSSIBILITY OF SUCH DAMAGE.
{{ lang._('%sConditions:%s HAProxy is capable of extracting data from requests, responses and other connection data and match it against predefined patterns. Use these powerful patterns to compose a condition that may be used in multiple Rules.') | format('', '') }}
{{ lang._('%sRules:%s Perform a large set of actions if one or more %sConditions%s match. These Rules may be used in %sBackend Pools%s as well as %sPublic Services%s.') | format('', '', '', '', '', '', '', '') }}
- {{ lang._("For more information on HAProxy's %sACL feature%s see the %sofficial documentation%s.") | format('', '', '', '') }}
+ {{ 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('', '') }}
@@ -774,7 +774,7 @@ POSSIBILITY OF SUCH DAMAGE.
{{ lang._('%sGroup:%s A optional list containing one or more users. Groups usually make it easier to manage permissions for a large number of users') | format('', '') }}
{{ lang._('Note that users and groups must be selected from the Backend Pool or Public Service configuration in order to be used for authentication. In addition to this users and groups may also be used in Rules/Conditions.') }}
- {{ lang._("For more information on HAProxy's %suser/group management%s see the %sofficial documentation%s.") | format('', '', '', '') }}
+ {{ lang._("For more information on HAProxy's %suser/group management%s see the %sofficial documentation%s.") | format('', '', '', '') }}
@@ -792,7 +792,7 @@ POSSIBILITY OF SUCH DAMAGE.
{{ lang._("%sCache:%s HAProxy's cache which was designed to perform cache on small objects (favicon, css, etc.). This is a minimalist low-maintenance cache which runs in RAM.") | format('', '', '', '') }}
{{ lang._("%sPeers:%s Configure a communication channel between two HAProxy instances. This will propagate entries of any data-types in stick-tables between these HAProxy instances over TCP connections in a multi-master fashion. Useful when aiming for a seamless failover in a HA setup.") | format('', '', '', '') }}
- {{ lang._("For more details visit HAProxy's official documentation regarding the %sStatistics%s, %sCache%s and %sPeers%s features.") | format('', '', '', '', '', '') }}
+ {{ lang._("For more details visit HAProxy's official documentation regarding the %sStatistics%s, %sCache%s and %sPeers%s features.") | format('', '', '', '', '', '') }}
@@ -810,7 +810,7 @@ POSSIBILITY OF SUCH DAMAGE.
{{ lang._("%sResolvers:%s This feature allows in-depth configuration of how HAProxy handles name resolution and interacts with name resolvers (DNS). Each resolver configuration can be used in %sBackend Pools%s to apply individual name resolution configurations.") | format('', '', '', '') }}
{{ lang._("%sE-Mail Alerts:%s It is possible to send email alerts when the state of servers changes. Each configuration can be used in %sBackend Pools%s to send e-mail alerts to the configured recipient.") | format('', '', '', '') }}
- {{ lang._("For more details visit HAProxy's official documentation regarding the %sError Messages%s, %sLua Script%s and the %sMap Files%s features. More information on HAProxy's CPU Affinity is also available %shere%s, %shere%s and %shere%s. A detailed explanation of the resolvers feature can be found %shere%s.") | format('', '', '', '', '', '' ,'', '' ,'', '' ,'', '','', '') }}
+ {{ lang._("For more details visit HAProxy's official documentation regarding the %sError Messages%s, %sLua Script%s and the %sMap Files%s features. More information on HAProxy's CPU Affinity is also available %shere%s, %shere%s and %shere%s. A detailed explanation of the resolvers feature can be found %shere%s.") | format('', '', '', '', '', '' ,'', '' ,'', '' ,'', '','', '') }}
@@ -1131,7 +1131,6 @@ POSSIBILITY OF SUCH DAMAGE.
{{ lang._('CPU Rule ID') }} |
{{ lang._('Enabled') }} |
{{ lang._('Name') }} |
- {{ lang._('Process ID') }} |
{{ lang._('Thread ID') }} |
{{ lang._('CPU ID') }} |
{{ lang._('Commands') }} |
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 e0fb1fd7a..14442a686 100644
--- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf
+++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf
@@ -960,20 +960,22 @@ global
{% else %}
stats socket /var/run/haproxy.socket group proxy mode 775 level admin
{% endif %}
- nbproc {{OPNsense.HAProxy.general.tuning.nbproc}}
{% if OPNsense.HAProxy.general.tuning.nbthread|default('') != '' %}
nbthread {{OPNsense.HAProxy.general.tuning.nbthread}}
{% endif %}
{% if helpers.exists('OPNsense.HAProxy.cpus.cpu') %}
{% for cpu_map in helpers.toList('OPNsense.HAProxy.cpus.cpu') %}
{% if cpu_map.enabled == '1' %}
- cpu-map {{cpu_map.process_id|replace('x', '')}}/{{cpu_map.thread_id|replace('x', '')}} {{cpu_map.cpu_id|replace('x', '')|replace(',', ' ')}}
+ cpu-map 1/{{cpu_map.thread_id|replace('x', '')}} {{cpu_map.cpu_id|replace('x', '')|replace(',', ' ')}}
{% endif %}
{% endfor %}
{% endif %}
{% if OPNsense.HAProxy.general.hardStopAfter|default('') != '' %}
hard-stop-after {{OPNsense.HAProxy.general.hardStopAfter}}
{% endif %}
+{% if OPNsense.HAProxy.general.closeSpreadTime|default('') != '' %}
+ close-spread-time {{OPNsense.HAProxy.general.closeSpreadTime}}
+{% endif %}
{# # Disable strict-limits because a syntax check will not reveal #}
{# # whether kern.maxfilesperproc or kern.maxfiles are too low. #}
no strict-limits
@@ -1372,20 +1374,18 @@ frontend {{frontend.name}}
{% do adv_options.append('proto h2') %}
{% endif %}
{# # CPU affinity configuration #}
-{% set bind_process = [] %}
{% if frontend.linkedCpuAffinityRules|default('') != '' %}
{% for cpu_map in frontend.linkedCpuAffinityRules.split(',') %}
{% set cpu_map_data = helpers.getUUID(cpu_map) %}
{% if cpu_map_data.enabled == '1' %}
-{# # Limit visibility to a certain set of processes #}
-{% do bind_process.append(cpu_map_data.process_id|replace('x', '')) %}
-{# # Restrict the list of processes/threads on which this listener is allowed to run #}
-{% do adv_options.append('process ' ~ cpu_map_data.process_id|replace('x', '') ~ '/' ~ cpu_map_data.thread_id|replace('x', '')) %}
+{# # Restrict the list of threads on which this listener is allowed to run #}
+{% do adv_options.append('thread ' ~ cpu_map_data.thread_id|replace('x', '')) %}
{% endif %}
{% endfor %}
-{% if bind_process|length > 0 %}
- bind-process {{bind_process|join(' ')}}
-{% endif %}
+{% endif %}
+{# # shards / multiple listeners on the same IP:port #}
+{% if frontend.tuning_shards|default('') != '' %}
+{% do adv_options.append('shards ' ~ frontend.tuning_shards) %}
{% endif %}
{# # bind/listen configuration #}
{% if frontend.bind|default("") != "" %}
@@ -1429,14 +1429,12 @@ frontend {{frontend.name}}
{% if frontend.prometheus_enabled == '1' and frontend.mode == 'http' and frontend.prometheus_path|default("") != "" %}
http-request use-service prometheus-exporter if { path {{frontend.prometheus_path}} }
{% endif %}
- # tuning options
+{# # tuning options #}
{% if frontend.tuning_maxConnections is defined %}
maxconn {{frontend.tuning_maxConnections}}
{% endif %}
{% if frontend.tuning_timeoutClient is defined %}
timeout client {{frontend.tuning_timeoutClient}}
-{% elif OPNsense.HAProxy.general.defaults.timeoutClient is defined %}
- timeout client {{OPNsense.HAProxy.general.defaults.timeoutClient}}
{% endif %}
{% if frontend.tuning_timeoutHttpReq|default("") != "" and frontend.mode == 'http' %}
timeout http-request {{frontend.tuning_timeoutHttpReq}}
@@ -1653,21 +1651,15 @@ backend {{backend.name}}
{% endif %}
{# # call macro to evaluate stickiness config #}
{{ StickTableConfig(backend,true) }}
- # tuning options
+{# # tuning options #}
{% if backend.tuning_timeoutConnect|default("") != "" %}
timeout connect {{backend.tuning_timeoutConnect}}
-{% elif OPNsense.HAProxy.general.defaults.timeoutConnect is defined %}
- timeout connect {{OPNsense.HAProxy.general.defaults.timeoutConnect}}
{% endif %}
{% if backend.tuning_timeoutCheck|default("") != "" %}
timeout check {{backend.tuning_timeoutCheck}}
-{% elif OPNsense.HAProxy.general.defaults.timeoutCheck is defined %}
- timeout check {{OPNsense.HAProxy.general.defaults.timeoutCheck}}
{% endif %}
{% if backend.tuning_timeoutServer|default("") != "" %}
timeout server {{backend.tuning_timeoutServer}}
-{% elif OPNsense.HAProxy.general.defaults.timeoutServer is defined %}
- timeout server {{OPNsense.HAProxy.general.defaults.timeoutServer}}
{% endif %}
{% if backend.tuning_retries|default("") != "" %}
retries {{backend.tuning_retries}}