mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
www/caddy: Change "check_interval" and "ttl" to seconds, add "update_only" option (#4038)
* www/caddy: Change TTL of DNS Records set by dynamic DNS. TTL can be left empty to use system defaults, or a value in seconds. * Add changelog. * Change DynDnsCheckInterval to DynDnsInterval, using seconds. Field is allowed to be empty, it uses the system default of 1800s (30m) from the module if undefined. Improve help text. Add validation range to model. * Add new Update Only field to Dynamic Dns. Add validations to model that were forgot in last commit. * Update parameter comments in Caddyfile. * Forgot to change fieldname in form controller.
This commit is contained in:
@@ -33,6 +33,8 @@ Plugin Changelog
|
||||
* Add: Error message when Auto HTTPS is enabled, and ACME email field is empty, for caddy v2.8.4
|
||||
* Cleanup: Fix crash of searchAction when reverseUuids is null
|
||||
* Cleanup: basicauth directive is now basic_auth in the Caddyfile template, for caddy v2.8.4
|
||||
* Change: Dynamic DNS "TTL" and "Check Interval" have been changed to seconds. Existing values have been reset to use the defaults of the implementation.
|
||||
* Add: Dynamic DNS now supports "Update Only", only updating existing records without creating new ones.
|
||||
* Fix: The subdomain port field has been removed, since it is unsupported. Subdomains track their ports from their parent wildcard domain.
|
||||
* Add: DNS Providers: dnsmadeeasy, bunny, civo, scaleway, acmeproxy, inwx, namedotcom, easydns, infomaniak, directadmin, hosttech, vultr
|
||||
* Remove: DNS Providers: godaddy
|
||||
|
||||
@@ -6,16 +6,23 @@
|
||||
<help><![CDATA[Select the DynDns IP Version: "IPv4+IPv6" to set IPv4 A-Records and IPv6 AAAA-Records, "IPv4 only" for only A-Records, "IPv6 only" for only AAAA-Records.]]></help>
|
||||
</field>
|
||||
<field>
|
||||
<id>caddy.general.DynDnsCheckInterval</id>
|
||||
<label>DynDns Check Interval</label>
|
||||
<type>text</type>
|
||||
<help><![CDATA[Set the interval to poll for changes in the IP address. The default is 5 minutes. Values can range from 1 to 1440 minutes.]]></help>
|
||||
<id>caddy.general.DynDnsUpdateOnly</id>
|
||||
<label>DynDns Update Only</label>
|
||||
<type>checkbox</type>
|
||||
<help><![CDATA[If enabled, no new DNS records will be created. Only existing records will be updated. This means that the A or AAAA records need to be created manually ahead of time.]]></help>
|
||||
</field>
|
||||
<field>
|
||||
<id>caddy.general.DynDnsTTL</id>
|
||||
<id>caddy.general.DynDnsInterval</id>
|
||||
<label>DynDns Check Interval</label>
|
||||
<type>text</type>
|
||||
<hint>1800</hint>
|
||||
<help><![CDATA[Set the interval in seconds to poll for changes in the IP address. Leave empty to use system defaults.]]></help>
|
||||
</field>
|
||||
<field>
|
||||
<id>caddy.general.DynDnsTtl</id>
|
||||
<label>DynDns TTL</label>
|
||||
<type>text</type>
|
||||
<help><![CDATA[Set the TTL (Time to Live) for DNS records. The default is 1 hour. Values can range from 1 to 24 hours.]]></help>
|
||||
<help><![CDATA[Set the TTL (Time to Live) for DNS records in seconds. Leave empty to use the default of an already existing TTL (when updating only) or the default of the provider API (when creating new records). If explicitely set, values should be as defined in rfc2181 section 8.]]></help>
|
||||
</field>
|
||||
<field>
|
||||
<type>header</type>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<model>
|
||||
<mount>//Pischem/caddy</mount>
|
||||
<description>A GUI model for configuring a reverse proxy in the Caddy web server.</description>
|
||||
<version>1.2.1</version>
|
||||
<version>1.2.2</version>
|
||||
<items>
|
||||
<general>
|
||||
<enabled type="BooleanField">
|
||||
@@ -108,13 +108,11 @@
|
||||
<ValidationMessage>Please enter a valid URL, starting with http or https.</ValidationMessage>
|
||||
</DynDnsSimpleHttp>
|
||||
<DynDnsInterface type="InterfaceField"/>
|
||||
<DynDnsCheckInterval type="IntegerField">
|
||||
<Default>5</Default>
|
||||
<DynDnsInterval type="IntegerField">
|
||||
<MinimumValue>1</MinimumValue>
|
||||
<MaximumValue>1440</MaximumValue>
|
||||
<ValidationMessage>Please enter a valid number from 1 to 1440 minutes.</ValidationMessage>
|
||||
<Required>Y</Required>
|
||||
</DynDnsCheckInterval>
|
||||
<MaximumValue>2147483647</MaximumValue>
|
||||
<ValidationMessage>Please enter a valid number from 1 to 2147483647 seconds or leave empty for default.</ValidationMessage>
|
||||
</DynDnsInterval>
|
||||
<DynDnsIpVersions type="OptionField">
|
||||
<BlankDesc>IPv4+IPv6</BlankDesc>
|
||||
<OptionValues>
|
||||
@@ -122,13 +120,12 @@
|
||||
<ipv6>IPv6 only</ipv6>
|
||||
</OptionValues>
|
||||
</DynDnsIpVersions>
|
||||
<DynDnsTTL type="IntegerField">
|
||||
<Default>1</Default>
|
||||
<MinimumValue>1</MinimumValue>
|
||||
<MaximumValue>24</MaximumValue>
|
||||
<ValidationMessage>Please enter a valid number from 1 to 24 hours.</ValidationMessage>
|
||||
<Required>Y</Required>
|
||||
</DynDnsTTL>
|
||||
<DynDnsTtl type="IntegerField">
|
||||
<MinimumValue>0</MinimumValue>
|
||||
<MaximumValue>2147483647</MaximumValue>
|
||||
<ValidationMessage>Please enter a valid number from 0 to 2147483647 seconds or leave empty for default.</ValidationMessage>
|
||||
</DynDnsTtl>
|
||||
<DynDnsUpdateOnly type="BooleanField"/>
|
||||
</general>
|
||||
<reverseproxy>
|
||||
<reverse type="ArrayField">
|
||||
|
||||
@@ -101,10 +101,11 @@
|
||||
# - @param dnsOptionalField1 to 4 (string): Optional configuration field for the DNS provider.
|
||||
# - @param dynDnsSimpleHttp (string): URL for a simple HTTP-based service to discover the server's public IP.
|
||||
# - @param dynDnsInterface (string): Network interface(s) to use for IP discovery.
|
||||
# - @param dynDnsCheckInterval (integer): Interval in minutes to check for IP changes.
|
||||
# - @param dynDnsCheckInterval (integer): Interval in seconds to check for IP changes. Can be empty for defaults.
|
||||
# - @param dynDnsIpVersions (string): The IP version(s) (IPv4, IPv6) for the DDNS update.
|
||||
# - @param dynDnsTTL (integer): Time-To-Live for the DNS records, in hours.
|
||||
# - @param dynDnsTtl (integer): Time-To-Live for the DNS records, in seconds. Can be empty for defaults.
|
||||
# - @param dynDnsDomains (list): Domains and subdomains list for which DDNS updates are enabled.
|
||||
# - @param dynDnsUpdateOnly (boolean): If set, only updates DNS records, not creating new ones.
|
||||
#}
|
||||
{% set dnsProvider = helpers.toList('Pischem.caddy.general.TlsDnsProvider') | first %}
|
||||
{% set dnsApiKey = generalSettings.TlsDnsApiKey %}
|
||||
@@ -115,9 +116,10 @@
|
||||
{% set dnsOptionalField4 = generalSettings.TlsDnsOptionalField4 %}
|
||||
{% set dynDnsSimpleHttp = generalSettings.DynDnsSimpleHttp %}
|
||||
{% set dynDnsInterface = generalSettings.DynDnsInterface %}
|
||||
{% set dynDnsCheckInterval = generalSettings.DynDnsCheckInterval %}
|
||||
{% set dynDnsUpdateOnly = generalSettings.DynDnsUpdateOnly %}
|
||||
{% set dynDnsCheckInterval = generalSettings.DynDnsInterval %}
|
||||
{% set dynDnsIpVersions = generalSettings.DynDnsIpVersions %}
|
||||
{% set dynDnsTTL = generalSettings.DynDnsTTL %}
|
||||
{% set dynDnsTtl = generalSettings.DynDnsTtl %}
|
||||
{% set dynDnsDomains = [] %}
|
||||
|
||||
{% for reverse in helpers.toList('Pischem.caddy.reverseproxy.reverse') %}
|
||||
@@ -330,13 +332,16 @@
|
||||
ip_source interface {{ physicalInterfaceNames | join(',') }}
|
||||
{% endif %}
|
||||
{% if dynDnsCheckInterval %}
|
||||
check_interval {{ dynDnsCheckInterval }}m
|
||||
check_interval {{ dynDnsCheckInterval }}s
|
||||
{% endif %}
|
||||
{% if dynDnsIpVersions %}
|
||||
versions {{ dynDnsIpVersions }}
|
||||
{% endif %}
|
||||
{% if dynDnsTTL %}
|
||||
ttl {{ dynDnsTTL }}h
|
||||
{% if dynDnsTtl %}
|
||||
ttl {{ dynDnsTtl }}s
|
||||
{% endif %}
|
||||
{% if dynDnsUpdateOnly|default("0") == "1" %}
|
||||
update_only
|
||||
{% endif %}
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user