mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
Merge pull request #20 from fraenki/haproxy_140
net/haproxy new feature "source address"
This commit is contained in:
@@ -40,6 +40,13 @@
|
||||
<help><![CDATA[Add servers to this backend. Use TAB key to complete typing.]]></help>
|
||||
<hint>Type server name or choose from list.</hint>
|
||||
</field>
|
||||
<field>
|
||||
<id>backend.source</id>
|
||||
<label>Source address</label>
|
||||
<type>text</type>
|
||||
<help><![CDATA[Sets the source address which will be used when connecting to the server(s).]]></help>
|
||||
<advanced>true</advanced>
|
||||
</field>
|
||||
<field>
|
||||
<label>Health Checking</label>
|
||||
<type>header</type>
|
||||
|
||||
@@ -58,4 +58,11 @@
|
||||
<help><![CDATA[Provide the TCP communication port to use during check, i.e. 80 or 443.]]></help>
|
||||
<advanced>true</advanced>
|
||||
</field>
|
||||
<field>
|
||||
<id>server.source</id>
|
||||
<label>Source address</label>
|
||||
<type>text</type>
|
||||
<help><![CDATA[Sets the source address which will be used when connecting to the server.]]></help>
|
||||
<advanced>true</advanced>
|
||||
</field>
|
||||
</form>
|
||||
|
||||
@@ -408,6 +408,11 @@
|
||||
<Multiple>Y</Multiple>
|
||||
<Required>N</Required>
|
||||
</linkedServers>
|
||||
<source type="TextField">
|
||||
<mask>/^((([0-9a-zA-Z._\-\*]+:[0-9]+(-[0-9]+)?)([,]){0,1}))*/u</mask>
|
||||
<ValidationMessage>Please specify a valid source address, i.e. 10.0.0.1 or loadbalancer.example.com:50000. Port range as start-end, i.e. 10.0.0.1:50000-60000.</ValidationMessage>
|
||||
<Required>N</Required>
|
||||
</source>
|
||||
<healthCheckEnabled type="BooleanField">
|
||||
<default>1</default>
|
||||
<Required>Y</Required>
|
||||
@@ -577,6 +582,11 @@
|
||||
<ValidationMessage>Please specify a value between 500 and 100000.</ValidationMessage>
|
||||
<Required>Y</Required>
|
||||
</checkInterval>
|
||||
<source type="TextField">
|
||||
<mask>/^((([0-9a-zA-Z._\-\*]+:[0-9]+(-[0-9]+)?)([,]){0,1}))*/u</mask>
|
||||
<ValidationMessage>Please specify a valid source address, i.e. 10.0.0.1 or loadbalancer.example.com:50000. Port range as start-end, i.e. 10.0.0.1:50000-60000.</ValidationMessage>
|
||||
<Required>N</Required>
|
||||
</source>
|
||||
</server>
|
||||
</servers>
|
||||
<healthchecks>
|
||||
|
||||
@@ -624,7 +624,7 @@ frontend {{frontend.name}}
|
||||
{% endif %}
|
||||
|
||||
{% else %}
|
||||
# Frontend (DISABLED): {{frontend.description}}
|
||||
# Frontend (DISABLED): {{frontend.name}} ({{frontend.description}})
|
||||
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
@@ -779,11 +779,18 @@ backend {{backend.name}}
|
||||
{% do server_options.append('weight ' ~ server_data.weight) if server_data.weight|default("") != "" %}
|
||||
{# # server role/mode #}
|
||||
{% do server_options.append(server_data.mode) if server_data.mode|default("") != "active" %}
|
||||
{# # source address #}
|
||||
{% if backend.source|default("") != "" %}
|
||||
{# # prefer backend configuration #}
|
||||
{% do server_options.append('source ' ~ backend.source) %}
|
||||
{% elif server_data.source|default("") != "" %}
|
||||
{% do server_options.append('source ' ~ server_data.source) %}
|
||||
{% endif %}
|
||||
server {{server_data.name}} {{server_data.address}}:{% if backend.tuning_noport != '1' %}{{server_data.port}}{% endif %}{% if server_data.checkport|default("") != "" %} port {{server_data.checkport}}{% endif %} {{server_options|join(' ')}}
|
||||
{% endfor %}
|
||||
|
||||
{% else %}
|
||||
# Backend (DISABLED): {{backend.description}}
|
||||
# Backend (DISABLED): {{backend.name}} ({{backend.description}})
|
||||
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
Reference in New Issue
Block a user