mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
dns/ddclient: ssl=yes is only supported on a global level, since we moved the checkbos to account, the enforcement broke. This commit will explain the account vs global settin and adjusts the template to set ssl=yes on a global level. closes https://github.com/opnsense/plugins/issues/2894
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
PLUGIN_NAME= ddclient
|
||||
PLUGIN_VERSION= 1.3
|
||||
PLUGIN_REVISION= 1
|
||||
PLUGIN_DEPENDS= ddclient
|
||||
PLUGIN_COMMENT= Dynamic DNS client
|
||||
PLUGIN_MAINTAINER= ad@opnsense.org
|
||||
|
||||
+2
-1
@@ -69,7 +69,8 @@
|
||||
<id>account.force_ssl</id>
|
||||
<label>Force SSL</label>
|
||||
<type>checkbox</type>
|
||||
<help>Force update using HTTPS</help>
|
||||
<help>Force update using HTTPS, please note setting this option will enforce https updates on all accounts
|
||||
as ddclient only supports SSL=yes on a global level (check check ip service may still use HTTP on other services)</help>
|
||||
</field>
|
||||
<field>
|
||||
<id>account.interface</id>
|
||||
|
||||
@@ -5,76 +5,87 @@ pid=/var/run/ddclient.pid # record PID in file.
|
||||
{% if not helpers.empty('OPNsense.DynDNS.general.verbose') %}
|
||||
verbose=yes
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% set accounts = [] %}
|
||||
{% set force_ssl = [] %}
|
||||
{% if helpers.exists('OPNsense.DynDNS.accounts.account') %}
|
||||
{% for account in helpers.toList('OPNsense.DynDNS.accounts.account') %}
|
||||
{% if account.enabled|default('0') == '1' %}
|
||||
{% if account.checkip == 'if' %}
|
||||
use=if, if={{physical_interface(account.interface)}}, \
|
||||
{% elif account.checkip.startswith('web_') %}
|
||||
{% if account.interface %}
|
||||
use=cmd, cmd="/usr/local/opnsense/scripts/ddclient/checkip -i {{physical_interface(account.interface)}} -t {{account.force_ssl}} -s {{account.checkip[4:]}}",
|
||||
{% else %}
|
||||
use=cmd, cmd="/usr/local/opnsense/scripts/ddclient/checkip -t {{account.force_ssl}} -s {{account.checkip[4:]}}",
|
||||
{% endif %}
|
||||
{% do accounts.append(account) %}
|
||||
{% if account.force_ssl|default('0') == '1' %}
|
||||
{% do force_ssl.append(1) %}
|
||||
{% endif %}
|
||||
{% if account.service == 'custom' %}
|
||||
protocol={{account.protocol}}, \
|
||||
server={{account.server}}, \
|
||||
{% elif account.service == 'cloudflare' %}
|
||||
protocol=cloudflare, \
|
||||
zone={{account.zone}}, \
|
||||
{% elif account.service == 'dnsmadeeasy' %}
|
||||
protocol=dnsmadeeasy, \
|
||||
{% elif account.service == 'dns-o-matic' %}
|
||||
protocol=dyndns2, \
|
||||
server=updates.dnsomatic.com, \
|
||||
{% elif account.service == 'freedns' %}
|
||||
protocol=freedns, \
|
||||
server=freedns.afraid.org, \
|
||||
{% elif account.service == 'dynu' %}
|
||||
protocol=dyndns2, \
|
||||
server=api.dynu.com, \
|
||||
{% elif account.service == 'he-net' %}
|
||||
protocol=dyndns2, \
|
||||
server=dyn.dns.he.net, \
|
||||
{% elif account.service == 'he-net-tunnel' %}
|
||||
protocol=dyndns2, \
|
||||
server=ipv4.tunnelbroker.net, \
|
||||
{% elif account.service == 'inwx' %}
|
||||
protocol=dyndns2, \
|
||||
server=dyndns.inwx.com, \
|
||||
{% elif account.service == 'loopia' %}
|
||||
protocol=dyndns2, \
|
||||
server=dyndns.loopia.se, \
|
||||
{% elif account.service == 'nsupdatev4' %}
|
||||
protocol=dyndns2, \
|
||||
server=ipv4.nsupdate.info, \
|
||||
{% elif account.service == 'nsupdatev6' %}
|
||||
protocol=dyndns2, \
|
||||
server=ipv6.nsupdate.info, \
|
||||
{% elif account.service == 'spdyn' %}
|
||||
protocol=dyndns2, \
|
||||
server=update.spdyn.de, \
|
||||
{% elif account.service == 'strato' %}
|
||||
protocol=dyndns2, \
|
||||
server=dyndns.strato.com, \
|
||||
{% elif account.service == 'ovh' %}
|
||||
protocol=dyndns2, \
|
||||
server=www.ovh.com, \
|
||||
{% else %}
|
||||
protocol={{account.service}}, \
|
||||
{% endif %}
|
||||
{% if account.wildcard|default('0') == '1' %}
|
||||
wildcard=yes, \
|
||||
{% endif %}
|
||||
{% if account.username %}
|
||||
login={{account.username}}, \
|
||||
{% endif %}
|
||||
password={{account.password}} \
|
||||
{{account.hostnames}}
|
||||
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if force_ssl %}
|
||||
ssl=yes
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% for account in accounts %}
|
||||
{% if account.checkip == 'if' %}
|
||||
use=if, if={{physical_interface(account.interface)}}, \
|
||||
{% elif account.checkip.startswith('web_') %}
|
||||
{% if account.interface %}
|
||||
use=cmd, cmd="/usr/local/opnsense/scripts/ddclient/checkip -i {{physical_interface(account.interface)}} -t {{account.force_ssl}} -s {{account.checkip[4:]}}",
|
||||
{% else %}
|
||||
use=cmd, cmd="/usr/local/opnsense/scripts/ddclient/checkip -t {{account.force_ssl}} -s {{account.checkip[4:]}}",
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if account.service == 'custom' %}
|
||||
protocol={{account.protocol}}, \
|
||||
server={{account.server}}, \
|
||||
{% elif account.service == 'cloudflare' %}
|
||||
protocol=cloudflare, \
|
||||
zone={{account.zone}}, \
|
||||
{% elif account.service == 'dnsmadeeasy' %}
|
||||
protocol=dnsmadeeasy, \
|
||||
{% elif account.service == 'dns-o-matic' %}
|
||||
protocol=dyndns2, \
|
||||
server=updates.dnsomatic.com, \
|
||||
{% elif account.service == 'freedns' %}
|
||||
protocol=freedns, \
|
||||
server=freedns.afraid.org, \
|
||||
{% elif account.service == 'dynu' %}
|
||||
protocol=dyndns2, \
|
||||
server=api.dynu.com, \
|
||||
{% elif account.service == 'he-net' %}
|
||||
protocol=dyndns2, \
|
||||
server=dyn.dns.he.net, \
|
||||
{% elif account.service == 'he-net-tunnel' %}
|
||||
protocol=dyndns2, \
|
||||
server=ipv4.tunnelbroker.net, \
|
||||
{% elif account.service == 'inwx' %}
|
||||
protocol=dyndns2, \
|
||||
server=dyndns.inwx.com, \
|
||||
{% elif account.service == 'loopia' %}
|
||||
protocol=dyndns2, \
|
||||
server=dyndns.loopia.se, \
|
||||
{% elif account.service == 'nsupdatev4' %}
|
||||
protocol=dyndns2, \
|
||||
server=ipv4.nsupdate.info, \
|
||||
{% elif account.service == 'nsupdatev6' %}
|
||||
protocol=dyndns2, \
|
||||
server=ipv6.nsupdate.info, \
|
||||
{% elif account.service == 'spdyn' %}
|
||||
protocol=dyndns2, \
|
||||
server=update.spdyn.de, \
|
||||
{% elif account.service == 'strato' %}
|
||||
protocol=dyndns2, \
|
||||
server=dyndns.strato.com, \
|
||||
{% elif account.service == 'ovh' %}
|
||||
protocol=dyndns2, \
|
||||
server=www.ovh.com, \
|
||||
{% else %}
|
||||
protocol={{account.service}}, \
|
||||
{% endif %}
|
||||
{% if account.wildcard|default('0') == '1' %}
|
||||
wildcard=yes, \
|
||||
{% endif %}
|
||||
{% if account.username %}
|
||||
login={{account.username}}, \
|
||||
{% endif %}
|
||||
password={{account.password}} \
|
||||
{{account.hostnames}}
|
||||
|
||||
{% endfor %}
|
||||
|
||||
Reference in New Issue
Block a user