mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
Merge pull request #3243 from fraenki/haproxy26
net/haproxy: release 4.0 [only for 23.1]
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
PLUGIN_NAME= haproxy
|
||||
PLUGIN_VERSION= 3.12
|
||||
PLUGIN_VERSION= 4.0
|
||||
PLUGIN_COMMENT= Reliable, high performance TCP/HTTP load balancer
|
||||
PLUGIN_DEPENDS= haproxy24
|
||||
PLUGIN_DEPENDS= haproxy
|
||||
PLUGIN_MAINTAINER= opnsense@moov.de
|
||||
|
||||
.include "../../Mk/plugins.mk"
|
||||
|
||||
@@ -6,6 +6,25 @@ very high loads while needing persistence or Layer7 processing.
|
||||
Plugin Changelog
|
||||
================
|
||||
|
||||
4.0
|
||||
|
||||
Added:
|
||||
* add new service option "Gradual connection close time" (close-spread-time) (#3026)
|
||||
* add new frontend option "shards" (#3026)
|
||||
|
||||
Changed:
|
||||
* upgrade to HAProxy 2.6 release series (#3026)
|
||||
* rename frontend option "Type" to "Connection Mode" (#3026)
|
||||
* migrate options "http-tunnel" and "forceclose" to "http-keep-alive" (#3026)
|
||||
* replace "process" with "threads" bind keyword for CPU Affinity (#3026)
|
||||
* no longer duplicate global defaults in backends/frontends (#2642)
|
||||
|
||||
Removed:
|
||||
* remove Processes/nbproc option (use Threads/nbthread instead) (#3026)
|
||||
* remove "Process ID" from CPU Affinity settings (now always 1) (#3026)
|
||||
* remove "bind-process" option (replaced by the "threads" bind keyword) (#3026)
|
||||
* remove options "http-tunnel" and "forceclose" from "Connection Mode" (#3026)
|
||||
|
||||
3.12
|
||||
|
||||
Added:
|
||||
|
||||
+1
-1
@@ -343,7 +343,7 @@ class SettingsController extends ApiMutableModelControllerBase
|
||||
|
||||
public function searchCpusAction()
|
||||
{
|
||||
return $this->searchBase('cpus.cpu', array('enabled', 'name', 'process_id', 'thread_id', 'cpu_id'), 'name');
|
||||
return $this->searchBase('cpus.cpu', array('enabled', 'name', 'thread_id', 'cpu_id'), 'name');
|
||||
}
|
||||
|
||||
public function getGroupAction($uuid = null)
|
||||
|
||||
+6
-6
@@ -89,7 +89,7 @@
|
||||
<id>action.http_request_redirect</id>
|
||||
<label>HTTP Redirect</label>
|
||||
<type>text</type>
|
||||
<help><![CDATA[Use HAProxy's redirect function to return a HTTP redirection. See <a href="http://docs.haproxy.org/2.4/configuration.html#redirect">HAProxy's documentation</a> for further details and examples.]]></help>
|
||||
<help><![CDATA[Use HAProxy's redirect function to return a HTTP redirection. See <a href="http://docs.haproxy.org/2.6/configuration.html#redirect">HAProxy's documentation</a> for further details and examples.]]></help>
|
||||
</field>
|
||||
<field>
|
||||
<label>Parameters</label>
|
||||
@@ -128,7 +128,7 @@
|
||||
<id>action.http_request_add_header_content</id>
|
||||
<label>Header Content</label>
|
||||
<type>text</type>
|
||||
<help><![CDATA[The value that should be set for the specified HTTP header. Note that it is possible to use pre-defined variables, see <a href="http://docs.haproxy.org/2.4/configuration.html#8.2.4">HAProxy's documentation</a> for further details and examples.]]></help>
|
||||
<help><![CDATA[The value that should be set for the specified HTTP header. Note that it is possible to use pre-defined variables, see <a href="http://docs.haproxy.org/2.6/configuration.html#8.2.4">HAProxy's documentation</a> for further details and examples.]]></help>
|
||||
</field>
|
||||
<field>
|
||||
<label>Parameters</label>
|
||||
@@ -145,7 +145,7 @@
|
||||
<id>action.http_request_set_header_content</id>
|
||||
<label>Header Content</label>
|
||||
<type>text</type>
|
||||
<help><![CDATA[The value that should be set for the specified HTTP header. Note that it's possible to use pre-defined variables, see <a href="http://docs.haproxy.org/2.4/configuration.html#8.2.4">HAProxy's documentation</a> for further details and examples.]]></help>
|
||||
<help><![CDATA[The value that should be set for the specified HTTP header. Note that it's possible to use pre-defined variables, see <a href="http://docs.haproxy.org/2.6/configuration.html#8.2.4">HAProxy's documentation</a> for further details and examples.]]></help>
|
||||
</field>
|
||||
<field>
|
||||
<label>Parameters</label>
|
||||
@@ -251,7 +251,7 @@
|
||||
<id>action.http_response_add_header_content</id>
|
||||
<label>Header Content</label>
|
||||
<type>text</type>
|
||||
<help><![CDATA[The value that should be set for the specified HTTP header. Note that it's possible to use pre-defined variables, see <a href="http://docs.haproxy.org/2.4/configuration.html#8.2.4">HAProxy's documentation</a> for further details and examples.]]></help>
|
||||
<help><![CDATA[The value that should be set for the specified HTTP header. Note that it's possible to use pre-defined variables, see <a href="http://docs.haproxy.org/2.6/configuration.html#8.2.4">HAProxy's documentation</a> for further details and examples.]]></help>
|
||||
</field>
|
||||
<field>
|
||||
<label>Parameters</label>
|
||||
@@ -268,7 +268,7 @@
|
||||
<id>action.http_response_set_header_content</id>
|
||||
<label>Header Content</label>
|
||||
<type>text</type>
|
||||
<help><![CDATA[The value that should be set for the specified HTTP header. Note that it's possible to use pre-defined variables, see <a href="http://docs.haproxy.org/2.4/configuration.html#8.2.4">HAProxy's documentation</a> for further details and examples.]]></help>
|
||||
<help><![CDATA[The value that should be set for the specified HTTP header. Note that it's possible to use pre-defined variables, see <a href="http://docs.haproxy.org/2.6/configuration.html#8.2.4">HAProxy's documentation</a> for further details and examples.]]></help>
|
||||
</field>
|
||||
<field>
|
||||
<label>Parameters</label>
|
||||
@@ -468,6 +468,6 @@
|
||||
<id>action.fcgi_set_param</id>
|
||||
<label>Parameter</label>
|
||||
<type>text</type>
|
||||
<help><![CDATA[Set a FastCGI parameter that should be passed to the application. Its value must follow HAProxy's <a href="http://docs.haproxy.org/2.4/configuration.html#8.2.4">Custom Log format rules</a>. With this directive, it is possible to overwrite the value of default FastCGI parameters.]]></help>
|
||||
<help><![CDATA[Set a FastCGI parameter that should be passed to the application. Its value must follow HAProxy's <a href="http://docs.haproxy.org/2.6/configuration.html#8.2.4">Custom Log format rules</a>. With this directive, it is possible to overwrite the value of default FastCGI parameters.]]></help>
|
||||
</field>
|
||||
</form>
|
||||
|
||||
+5
-5
@@ -28,7 +28,7 @@
|
||||
<id>backend.algorithm</id>
|
||||
<label>Balancing Algorithm</label>
|
||||
<type>dropdown</type>
|
||||
<help><![CDATA[Define the load balancing algorithm to be used in a Backend Pool. See the <a target="_blank" href="http://docs.haproxy.org/2.4/configuration.html#balance">HAProxy documentation</a> for a full description.]]></help>
|
||||
<help><![CDATA[Define the load balancing algorithm to be used in a Backend Pool. See the <a target="_blank" href="http://docs.haproxy.org/2.6/configuration.html#balance">HAProxy documentation</a> for a full description.]]></help>
|
||||
<hint>Choose a load balancing algorithm.</hint>
|
||||
</field>
|
||||
<field>
|
||||
@@ -42,7 +42,7 @@
|
||||
<id>backend.proxyProtocol</id>
|
||||
<label>Proxy Protocol</label>
|
||||
<type>dropdown</type>
|
||||
<help><![CDATA[Enforces use of the PROXY protocol over any connection established to the configured servers. The PROXY protocol informs the other end about the layer 3/4 addresses of the incoming connection, so that it can know the client's address or the public address it accessed to, whatever the upper layer protocol. This setting must not be used if the servers are not aware of the PROXY protocol. See the <a target="_blank" href="http://docs.haproxy.org/2.4/configuration.html#send-proxy">HAProxy documentation</a> for a full description.]]></help>
|
||||
<help><![CDATA[Enforces use of the PROXY protocol over any connection established to the configured servers. The PROXY protocol informs the other end about the layer 3/4 addresses of the incoming connection, so that it can know the client's address or the public address it accessed to, whatever the upper layer protocol. This setting must not be used if the servers are not aware of the PROXY protocol. See the <a target="_blank" href="http://docs.haproxy.org/2.6/configuration.html#send-proxy">HAProxy documentation</a> for a full description.]]></help>
|
||||
<advanced>true</advanced>
|
||||
</field>
|
||||
<field>
|
||||
@@ -192,7 +192,7 @@
|
||||
<id>backend.persistence_cookiemode</id>
|
||||
<label>Cookie handling</label>
|
||||
<type>dropdown</type>
|
||||
<help><![CDATA[Usually it is better to reuse an existing cookie. In this case HAProxy prefixes the cookie with the required information. See the <a target="_blank" href="http://docs.haproxy.org/2.4/configuration.html#4.2-cookie">HAProxy documentation</a> for a full description.]]></help>
|
||||
<help><![CDATA[Usually it is better to reuse an existing cookie. In this case HAProxy prefixes the cookie with the required information. See the <a target="_blank" href="http://docs.haproxy.org/2.6/configuration.html#4.2-cookie">HAProxy documentation</a> for a full description.]]></help>
|
||||
</field>
|
||||
<field>
|
||||
<id>backend.persistence_cookiename</id>
|
||||
@@ -214,14 +214,14 @@
|
||||
<id>backend.stickiness_pattern</id>
|
||||
<label>Table type</label>
|
||||
<type>dropdown</type>
|
||||
<help><![CDATA[Choose a request pattern to associate a user to a server. See the <a target="_blank" href="http://docs.haproxy.org/2.4/configuration.html#stick on">HAProxy documentation</a> for a full description.<br/><div class="text-info"><b>NOTE:</b> Consider not using this feature in multi-process mode, it can result in random behaviours.</div>]]></help>
|
||||
<help><![CDATA[Choose a request pattern to associate a user to a server. See the <a target="_blank" href="http://docs.haproxy.org/2.6/configuration.html#stick on">HAProxy documentation</a> for a full description.<br/><div class="text-info"><b>NOTE:</b> Consider not using this feature in multi-process mode, it can result in random behaviours.</div>]]></help>
|
||||
<hint>Choose a persistence type.</hint>
|
||||
</field>
|
||||
<field>
|
||||
<id>backend.stickiness_dataTypes</id>
|
||||
<label>Stored data types</label>
|
||||
<type>select_multiple</type>
|
||||
<help><![CDATA[This is used to store additional information in the stick-table. It may be used by ACLs in order to control various criteria related to the activity of the client matching the stick-table. Note that this directly impacts memory usage. See the <a target="_blank" href="http://docs.haproxy.org/2.4/configuration.html#stick-table">HAProxy documentation</a> for a full description.]]></help>
|
||||
<help><![CDATA[This is used to store additional information in the stick-table. It may be used by ACLs in order to control various criteria related to the activity of the client matching the stick-table. Note that this directly impacts memory usage. See the <a target="_blank" href="http://docs.haproxy.org/2.6/configuration.html#stick-table">HAProxy documentation</a> for a full description.]]></help>
|
||||
</field>
|
||||
<field>
|
||||
<id>backend.stickiness_expire</id>
|
||||
|
||||
@@ -11,12 +11,6 @@
|
||||
<type>text</type>
|
||||
<help>Choose a name for this CPU affinity rule.</help>
|
||||
</field>
|
||||
<field>
|
||||
<id>cpu.process_id</id>
|
||||
<label>Process ID</label>
|
||||
<type>dropdown</type>
|
||||
<help>Process ID that should bind to a specific CPU set. Any process IDs above nbproc are ignored.</help>
|
||||
</field>
|
||||
<field>
|
||||
<id>cpu.thread_id</id>
|
||||
<label>Thread ID</label>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<id>fcgi.path_info</id>
|
||||
<label>Path Info</label>
|
||||
<type>text</type>
|
||||
<help><![CDATA[Define a regular expression to extract the script-name and the path-info from the URL-decoded path, see <a href="http://docs.haproxy.org/2.4/configuration.html#10.1.1-path-info">HAProxy's documentation</a> for further details and examples.]]></help>
|
||||
<help><![CDATA[Define a regular expression to extract the script-name and the path-info from the URL-decoded path, see <a href="http://docs.haproxy.org/2.6/configuration.html#10.1.1-path-info">HAProxy's documentation</a> for further details and examples.]]></help>
|
||||
</field>
|
||||
<field>
|
||||
<id>fcgi.log_stderr</id>
|
||||
|
||||
+17
-10
@@ -225,6 +225,13 @@
|
||||
<help><![CDATA[The path where the Prometheus exporter can be accessed.]]></help>
|
||||
<advanced>true</advanced>
|
||||
</field>
|
||||
<field>
|
||||
<id>frontend.connectionBehaviour</id>
|
||||
<label>Connection Mode</label>
|
||||
<type>dropdown</type>
|
||||
<help><![CDATA[By default HAProxy operates in <b>keep-alive</b> mode with regards to persistent connections. Option <b>"httpclose"</b> configures HAProxy to close connections with the server and the client as soon as the request and the response are received. It will also check if a "Connection: close" header is already set in each direction, and will add one if missing. Option <b>"http-server-close"</b> enables HTTP connection-close mode on the server side while keeping the ability to support HTTP keep-alive and pipelining on the client side.]]></help>
|
||||
<advanced>true</advanced>
|
||||
</field>
|
||||
<field>
|
||||
<label>Basic Authentication</label>
|
||||
<type>header</type>
|
||||
@@ -290,6 +297,13 @@
|
||||
<hint>Choose CPU affinity rules.</hint>
|
||||
<advanced>true</advanced>
|
||||
</field>
|
||||
<field>
|
||||
<id>frontend.tuning_shards</id>
|
||||
<label>Shards</label>
|
||||
<type>text</type>
|
||||
<help><![CDATA[This option automatically creates the specified number of listeners for every IP:port combination and evenly distributes them among available threads. This can sometimes be useful when using very large thread counts where the in-kernel locking on a single socket starts to cause a significant overhead.]]></help>
|
||||
<advanced>true</advanced>
|
||||
</field>
|
||||
<field>
|
||||
<label>Logging Options</label>
|
||||
<type>header</type>
|
||||
@@ -336,14 +350,14 @@
|
||||
<id>frontend.stickiness_pattern</id>
|
||||
<label>Table type</label>
|
||||
<type>dropdown</type>
|
||||
<help><![CDATA[Choose the type of data that should be stored in this stick-table. Note that this stick-table cannot be used for session persistence, it is only used to store additional per-connection data (select below). See the <a target="_blank" href="http://docs.haproxy.org/2.4/configuration.html#stick-table">HAProxy documentation</a> for further information.]]></help>
|
||||
<help><![CDATA[Choose the type of data that should be stored in this stick-table. Note that this stick-table cannot be used for session persistence, it is only used to store additional per-connection data (select below). See the <a target="_blank" href="http://docs.haproxy.org/2.6/configuration.html#stick-table">HAProxy documentation</a> for further information.]]></help>
|
||||
<hint>Choose a stick-table type.</hint>
|
||||
</field>
|
||||
<field>
|
||||
<id>frontend.stickiness_dataTypes</id>
|
||||
<label>Stored data types</label>
|
||||
<type>select_multiple</type>
|
||||
<help><![CDATA[This is used to store additional information in the stick-table. It may be used by ACLs in order to control various criteria related to the activity of the client matching the stick-table. Note that this directly impacts memory usage. See the <a target="_blank" href="http://docs.haproxy.org/2.4/configuration.html#stick-table">HAProxy documentation</a> for a full description.]]></help>
|
||||
<help><![CDATA[This is used to store additional information in the stick-table. It may be used by ACLs in order to control various criteria related to the activity of the client matching the stick-table. Note that this directly impacts memory usage. See the <a target="_blank" href="http://docs.haproxy.org/2.6/configuration.html#stick-table">HAProxy documentation</a> for a full description.]]></help>
|
||||
</field>
|
||||
<field>
|
||||
<id>frontend.stickiness_expire</id>
|
||||
@@ -370,7 +384,7 @@
|
||||
<id>frontend.stickiness_counter_key</id>
|
||||
<label>Sticky counter key</label>
|
||||
<type>text</type>
|
||||
<help><![CDATA[It describes what elements of the incoming request or connection will be analyzed, extracted, combined, and used to select which table entry to update the counters. Defaults to "src" to track elements of the source IP. See the <a target="_blank" href="http://docs.haproxy.org/2.4/configuration.html#tcp-request connection">HAProxy documentation</a> for a full description.]]></help>
|
||||
<help><![CDATA[It describes what elements of the incoming request or connection will be analyzed, extracted, combined, and used to select which table entry to update the counters. Defaults to "src" to track elements of the source IP. See the <a target="_blank" href="http://docs.haproxy.org/2.6/configuration.html#tcp-request connection">HAProxy documentation</a> for a full description.]]></help>
|
||||
<advanced>true</advanced>
|
||||
</field>
|
||||
<field>
|
||||
@@ -426,13 +440,6 @@
|
||||
<label>Advanced settings</label>
|
||||
<type>header</type>
|
||||
</field>
|
||||
<field>
|
||||
<id>frontend.connectionBehaviour</id>
|
||||
<label>Type</label>
|
||||
<type>dropdown</type>
|
||||
<help><![CDATA[By default HAProxy operates in <b>keep-alive</b> mode with regards to persistent connections. Option <b>"http-tunnel"</b> disables any HTTP processing past the first request and the first response. Option <b>"httpclose"</b> configures HAProxy to work in HTTP tunnel mode and check if a "Connection: close" header is already set in each direction, and will add one if missing. Option <b>"http-server-close"</b> enables HTTP connection-close mode on the server side while keeping the ability to support HTTP keep-alive and pipelining on the client side. With Option <b>"forceclose"</b> HAProxy will actively close the outgoing server channel as soon as the server has finished to respond and release some resources earlier.]]></help>
|
||||
<advanced>true</advanced>
|
||||
</field>
|
||||
<field>
|
||||
<id>frontend.customOptions</id>
|
||||
<label>Option pass-through</label>
|
||||
|
||||
+2
-2
@@ -96,7 +96,7 @@
|
||||
<id>healthcheck.http_value</id>
|
||||
<label>Value</label>
|
||||
<type>text</type>
|
||||
<help><![CDATA[Specify a value to match with the expression. <br/><div class="text-info"><b>NOTE:</b> It is important to note that the responses will be limited to a certain size defined by the global "tune.chksize" option, which defaults to 16384 bytes.</div>]]></help>
|
||||
<help><![CDATA[Specify a value to match with the expression.]]></help>
|
||||
</field>
|
||||
<field>
|
||||
<label>Custom TCP check</label>
|
||||
@@ -112,7 +112,7 @@
|
||||
<id>healthcheck.tcp_sendValue</id>
|
||||
<label>Send data</label>
|
||||
<type>text</type>
|
||||
<help><![CDATA[Specify a value to match with the expression. <br/><div class="text-info"><b>NOTE:</b> It is important to note that the responses will be limited to a certain size defined by the global "tune.chksize" option, which defaults to 16384 bytes.</div>]]></help>
|
||||
<help><![CDATA[Specify a value to match with the expression.]]></help>
|
||||
</field>
|
||||
<field>
|
||||
<id>healthcheck.tcp_matchType</id>
|
||||
|
||||
+1
-1
@@ -15,6 +15,6 @@
|
||||
<id>mapfile.content</id>
|
||||
<label>Content</label>
|
||||
<type>textbox</type>
|
||||
<help><![CDATA[Paste the content of your map file here. See the <a target="_blank" href="http://docs.haproxy.org/2.4/configuration.html#map">HAProxy documentation</a> for a full description.]]></help>
|
||||
<help><![CDATA[Paste the content of your map file here. See the <a target="_blank" href="http://docs.haproxy.org/2.6/configuration.html#map">HAProxy documentation</a> for a full description.]]></help>
|
||||
</field>
|
||||
</form>
|
||||
|
||||
+6
@@ -21,6 +21,12 @@
|
||||
<type>text</type>
|
||||
<help><![CDATA[Set the maximum time allowed to perform a clean graceful stop. HAProxy will terminate all open connections when the timeout is reached. This may be used to ensure that the instance will quit even if connections remain opened. Defaults to milliseconds. Optionally the unit may be specified as either "d", "h", "m", "s", "ms" or "us".]]></help>
|
||||
</field>
|
||||
<field>
|
||||
<id>haproxy.general.closeSpreadTime</id>
|
||||
<label>Gradual connection close time</label>
|
||||
<type>text</type>
|
||||
<help><![CDATA[Specifies a time window during which connection closing will be spread during a soft-stop operation. Idle connections will all be closed at once if this option is not set, which may cause reconnecting clients to rush against the process. For best results, it should set lower than the "Graceful stop timout" option. Defaults to milliseconds. Optionally the unit may be specified as either "d", "h", "m", "s", "ms" or "us".]]></help>
|
||||
</field>
|
||||
<field>
|
||||
<id>haproxy.general.seamlessReload</id>
|
||||
<label>Seamless reload</label>
|
||||
|
||||
@@ -10,13 +10,6 @@
|
||||
<help><![CDATA[Enable or disable HAProxy running as user root. Enabling this option is strongly discouraged.<br/><div class="text-info"><b>NOTE:</b> Running as user root could be a security issue but it may be required by some features.</div>]]></help>
|
||||
<advanced>true</advanced>
|
||||
</field>
|
||||
<field>
|
||||
<id>haproxy.general.tuning.nbproc</id>
|
||||
<label>HAProxy processes (DEPRECATED)</label>
|
||||
<type>text</type>
|
||||
<help><![CDATA[Number of HAProxy processes to start.<br/><div class="text-info"><b>WARNING:</b> This option is deprecated and will be removed in a future version of HAProxy, threads should be used instead.</div>]]></help>
|
||||
<advanced>true</advanced>
|
||||
</field>
|
||||
<field>
|
||||
<id>haproxy.general.tuning.nbthread</id>
|
||||
<label>HAProxy threads</label>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<model>
|
||||
<mount>//OPNsense/HAProxy</mount>
|
||||
<version>3.8.0</version>
|
||||
<version>4.0.0</version>
|
||||
<description>the HAProxy load balancer</description>
|
||||
<items>
|
||||
<general>
|
||||
@@ -18,6 +18,11 @@
|
||||
<ValidationMessage>Should be a number between 1 and 8 characters, optionally followed by either "d", "h", "m", "s", "ms" or "us".</ValidationMessage>
|
||||
<Required>N</Required>
|
||||
</hardStopAfter>
|
||||
<closeSpreadTime type="TextField">
|
||||
<mask>/^([0-9]{1,8}(?:us|ms|s|m|h|d)?)/u</mask>
|
||||
<ValidationMessage>Should be a number between 1 and 8 characters, optionally followed by either "d", "h", "m", "s", "ms" or "us".</ValidationMessage>
|
||||
<Required>N</Required>
|
||||
</closeSpreadTime>
|
||||
<seamlessReload type="BooleanField">
|
||||
<default>0</default>
|
||||
<Required>Y</Required>
|
||||
@@ -72,13 +77,6 @@
|
||||
<ValidationMessage>Please specify a value between 0 and 10000000.</ValidationMessage>
|
||||
<Required>N</Required>
|
||||
</maxConnections>
|
||||
<nbproc type="IntegerField">
|
||||
<default>1</default>
|
||||
<MinimumValue>1</MinimumValue>
|
||||
<MaximumValue>128</MaximumValue>
|
||||
<ValidationMessage>Please specify a value between 1 and 128.</ValidationMessage>
|
||||
<Required>Y</Required>
|
||||
</nbproc>
|
||||
<nbthread type="IntegerField">
|
||||
<default>1</default>
|
||||
<MinimumValue>1</MinimumValue>
|
||||
@@ -657,6 +655,12 @@
|
||||
<Multiple>Y</Multiple>
|
||||
<Required>N</Required>
|
||||
</linkedCpuAffinityRules>
|
||||
<tuning_shards type="IntegerField">
|
||||
<MinimumValue>2</MinimumValue>
|
||||
<MaximumValue>1000</MaximumValue>
|
||||
<ValidationMessage>Please specify a value between 2 and 1000.</ValidationMessage>
|
||||
<Required>N</Required>
|
||||
</tuning_shards>
|
||||
<logging_dontLogNull type="BooleanField">
|
||||
<default>0</default>
|
||||
<Required>Y</Required>
|
||||
@@ -810,10 +814,8 @@
|
||||
<default>http-keep-alive</default>
|
||||
<OptionValues>
|
||||
<http-keep-alive>http-keep-alive [default]</http-keep-alive>
|
||||
<http-tunnel>http-tunnel</http-tunnel>
|
||||
<httpclose>httpclose</httpclose>
|
||||
<http-server-close>http-server-close</http-server-close>
|
||||
<forceclose>forceclose</forceclose>
|
||||
</OptionValues>
|
||||
</connectionBehaviour>
|
||||
<customOptions type="TextField">
|
||||
@@ -2712,77 +2714,6 @@
|
||||
<ValidationMessage>Should be a string between 1 and 255 characters.</ValidationMessage>
|
||||
<Required>Y</Required>
|
||||
</name>
|
||||
<process_id type="OptionField">
|
||||
<Required>Y</Required>
|
||||
<OptionValues>
|
||||
<all>All HAProxy processes</all>
|
||||
<odd>Processes with odd ID</odd>
|
||||
<even>Processes with even ID</even>
|
||||
<x1>Process 1</x1>
|
||||
<x2>Process 2</x2>
|
||||
<x3>Process 3</x3>
|
||||
<x4>Process 4</x4>
|
||||
<x5>Process 5</x5>
|
||||
<x6>Process 6</x6>
|
||||
<x7>Process 7</x7>
|
||||
<x8>Process 8</x8>
|
||||
<x9>Process 9</x9>
|
||||
<x10>Process 10</x10>
|
||||
<x11>Process 11</x11>
|
||||
<x12>Process 12</x12>
|
||||
<x13>Process 13</x13>
|
||||
<x14>Process 14</x14>
|
||||
<x15>Process 15</x15>
|
||||
<x16>Process 16</x16>
|
||||
<x17>Process 17</x17>
|
||||
<x18>Process 18</x18>
|
||||
<x19>Process 19</x19>
|
||||
<x20>Process 20</x20>
|
||||
<x21>Process 21</x21>
|
||||
<x22>Process 22</x22>
|
||||
<x23>Process 23</x23>
|
||||
<x24>Process 24</x24>
|
||||
<x25>Process 25</x25>
|
||||
<x26>Process 26</x26>
|
||||
<x27>Process 27</x27>
|
||||
<x28>Process 28</x28>
|
||||
<x29>Process 29</x29>
|
||||
<x30>Process 30</x30>
|
||||
<x31>Process 31</x31>
|
||||
<x32>Process 32</x32>
|
||||
<x33>Process 33</x33>
|
||||
<x34>Process 34</x34>
|
||||
<x35>Process 35</x35>
|
||||
<x36>Process 36</x36>
|
||||
<x37>Process 37</x37>
|
||||
<x38>Process 38</x38>
|
||||
<x39>Process 39</x39>
|
||||
<x40>Process 40</x40>
|
||||
<x41>Process 41</x41>
|
||||
<x42>Process 42</x42>
|
||||
<x43>Process 43</x43>
|
||||
<x44>Process 44</x44>
|
||||
<x45>Process 45</x45>
|
||||
<x46>Process 46</x46>
|
||||
<x47>Process 47</x47>
|
||||
<x48>Process 48</x48>
|
||||
<x49>Process 49</x49>
|
||||
<x50>Process 50</x50>
|
||||
<x51>Process 51</x51>
|
||||
<x52>Process 52</x52>
|
||||
<x53>Process 53</x53>
|
||||
<x54>Process 54</x54>
|
||||
<x55>Process 55</x55>
|
||||
<x56>Process 56</x56>
|
||||
<x57>Process 57</x57>
|
||||
<x58>Process 58</x58>
|
||||
<x59>Process 59</x59>
|
||||
<x60>Process 60</x60>
|
||||
<x61>Process 61</x61>
|
||||
<x62>Process 62</x62>
|
||||
<x63>Process 63</x63>
|
||||
</OptionValues>
|
||||
</process_id>
|
||||
<thread_id type="OptionField">
|
||||
<Required>Y</Required>
|
||||
<OptionValues>
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Copyright (C) 2022 Frank Wall
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
||||
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace OPNsense\HAProxy\Migrations;
|
||||
|
||||
use OPNsense\Base\BaseModelMigration;
|
||||
|
||||
class M4_0_0 extends BaseModelMigration
|
||||
{
|
||||
public function run($model)
|
||||
{
|
||||
foreach ($model->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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -717,7 +717,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
<li>{{ lang._('Lastly, enable HAProxy using the %sService%s settings page.') | format('<b>', '</b>') }}</li>
|
||||
</ul>
|
||||
<p>{{ lang._('Please be aware that you need to %smanually%s add the required firewall rules for all configured services.') | format('<b>', '</b>') }}</p>
|
||||
<p>{{ 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('<a href="https://docs.opnsense.org/manual/how-tos/haproxy.html" target="_blank">', '</a>', '<a href="http://docs.haproxy.org/2.4/configuration.html" target="_blank">', '</a>', '<a href="https://github.com/opnsense/plugins/issues/" target="_blank">', '</a>') }}</p>
|
||||
<p>{{ 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('<a href="https://docs.opnsense.org/manual/how-tos/haproxy.html" target="_blank">', '</a>', '<a href="http://docs.haproxy.org/2.6/configuration.html" target="_blank">', '</a>', '<a href="https://github.com/opnsense/plugins/issues/" target="_blank">', '</a>') }}</p>
|
||||
<br/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -759,7 +759,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
<li>{{ 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('<b>', '</b>') }}</li>
|
||||
<li>{{ 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('<b>', '</b>', '<b>', '</b>', '<b>', '</b>', '<b>', '</b>') }}</li>
|
||||
</ul>
|
||||
<p>{{ lang._("For more information on HAProxy's %sACL feature%s see the %sofficial documentation%s.") | format('<b>', '</b>', '<a href="http://docs.haproxy.org/2.4/configuration.html#7" target="_blank">', '</a>') }}</p>
|
||||
<p>{{ lang._("For more information on HAProxy's %sACL feature%s see the %sofficial documentation%s.") | format('<b>', '</b>', '<a href="http://docs.haproxy.org/2.6/configuration.html#7" target="_blank">', '</a>') }}</p>
|
||||
<p>{{ 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('<b>', '</b>') }}</p>
|
||||
<br/>
|
||||
</div>
|
||||
@@ -774,7 +774,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
<li>{{ 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('<b>', '</b>') }}</li>
|
||||
</ul>
|
||||
<p>{{ 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.') }}</p>
|
||||
<p>{{ lang._("For more information on HAProxy's %suser/group management%s see the %sofficial documentation%s.") | format('<b>', '</b>', '<a href="http://docs.haproxy.org/2.4/configuration.html#3.4" target="_blank">', '</a>') }}</p>
|
||||
<p>{{ lang._("For more information on HAProxy's %suser/group management%s see the %sofficial documentation%s.") | format('<b>', '</b>', '<a href="http://docs.haproxy.org/2.6/configuration.html#3.4" target="_blank">', '</a>') }}</p>
|
||||
<br/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -792,7 +792,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
<li>{{ 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('<b>', '</b>', '<b>', '</b>') }}</li>
|
||||
<li>{{ 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('<b>', '</b>', '<b>', '</b>') }}</li>
|
||||
</ul>
|
||||
<p>{{ lang._("For more details visit HAProxy's official documentation regarding the %sStatistics%s, %sCache%s and %sPeers%s features.") | format('<a href="http://docs.haproxy.org/2.4/configuration.html#stats%20enable" target="_blank">', '</a>', '<a href="http://docs.haproxy.org/2.4/configuration.html#10" target="_blank">', '</a>', '<a href="http://docs.haproxy.org/2.4/configuration.html#3.5" target="_blank">', '</a>') }}</p>
|
||||
<p>{{ lang._("For more details visit HAProxy's official documentation regarding the %sStatistics%s, %sCache%s and %sPeers%s features.") | format('<a href="http://docs.haproxy.org/2.6/configuration.html#stats%20enable" target="_blank">', '</a>', '<a href="http://docs.haproxy.org/2.6/configuration.html#10" target="_blank">', '</a>', '<a href="http://docs.haproxy.org/2.6/configuration.html#3.5" target="_blank">', '</a>') }}</p>
|
||||
<br/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -810,7 +810,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
<li>{{ 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('<b>', '</b>', '<b>', '</b>') }}</li>
|
||||
<li>{{ 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('<b>', '</b>', '<b>', '</b>') }}</li>
|
||||
</ul>
|
||||
<p>{{ 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('<a href="http://docs.haproxy.org/2.4/configuration.html#4-errorfile" target="_blank">', '</a>', '<a href="http://docs.haproxy.org/2.4/configuration.html#lua-load" target="_blank">', '</a>', '<a href="http://docs.haproxy.org/2.4/configuration.html#map" target="_blank">', '</a>' ,'<a href="http://docs.haproxy.org/2.4/configuration.html#cpu-map" target="_blank">', '</a>' ,'<a href="http://docs.haproxy.org/2.4/configuration.html#bind-process" target="_blank">', '</a>' ,'<a href="http://docs.haproxy.org/2.4/configuration.html#process" target="_blank">', '</a>','<a href="http://docs.haproxy.org/2.4/configuration.html#5.3.2" target="_blank">', '</a>') }}</p>
|
||||
<p>{{ 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('<a href="http://docs.haproxy.org/2.6/configuration.html#4-errorfile" target="_blank">', '</a>', '<a href="http://docs.haproxy.org/2.6/configuration.html#lua-load" target="_blank">', '</a>', '<a href="http://docs.haproxy.org/2.6/configuration.html#map" target="_blank">', '</a>' ,'<a href="http://docs.haproxy.org/2.6/configuration.html#cpu-map" target="_blank">', '</a>' ,'<a href="http://docs.haproxy.org/2.6/configuration.html#bind-process" target="_blank">', '</a>' ,'<a href="http://docs.haproxy.org/2.6/configuration.html#process" target="_blank">', '</a>','<a href="http://docs.haproxy.org/2.6/configuration.html#5.3.2" target="_blank">', '</a>') }}</p>
|
||||
<br/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1131,7 +1131,6 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
<th data-column-id="cpuid" data-type="number" data-visible="false">{{ lang._('CPU Rule ID') }}</th>
|
||||
<th data-column-id="enabled" data-width="6em" data-type="string" data-formatter="rowtoggle">{{ lang._('Enabled') }}</th>
|
||||
<th data-column-id="name" data-type="string">{{ lang._('Name') }}</th>
|
||||
<th data-column-id="process_id" data-type="string">{{ lang._('Process ID') }}</th>
|
||||
<th data-column-id="thread_id" data-type="string">{{ lang._('Thread ID') }}</th>
|
||||
<th data-column-id="cpu_id" data-type="string">{{ lang._('CPU ID') }}</th>
|
||||
<th data-column-id="commands" data-width="7em" data-formatter="commands" data-sortable="false">{{ lang._('Commands') }}</th>
|
||||
|
||||
@@ -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}}
|
||||
|
||||
Reference in New Issue
Block a user