summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-12-26 20:12:28 +0100
committerGitHub <noreply@github.com>2023-12-26 20:12:28 +0100
commitb86f13a1e41513c929acffdb693b358b42b234af (patch)
tree66f4c8c7afef1b3f28f5cac4f0a1a4defc114030
parent3b6f2e35db7955cb212b01bb412070e0861bab7a (diff)
parent78beafea3a8385e3595d80f3f2dd246dfecb9276 (diff)
downloadvyos-1x-b86f13a1e41513c929acffdb693b358b42b234af.tar.gz
vyos-1x-b86f13a1e41513c929acffdb693b358b42b234af.zip
Merge pull request #2691 from indrajitr/ddclient-update-20231224-02
ddclient: T5144: Warn against configuration with broken IP lookup service
-rwxr-xr-xsrc/conf_mode/dns_dynamic.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/conf_mode/dns_dynamic.py b/src/conf_mode/dns_dynamic.py
index 809c650d9..99fa8feee 100755
--- a/src/conf_mode/dns_dynamic.py
+++ b/src/conf_mode/dns_dynamic.py
@@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
-
+import re
from sys import exit
from vyos.base import Warning
@@ -103,6 +103,16 @@ def verify(dyndns):
raise ConfigError(f'"web-options" is applicable only when using HTTP(S) '
f'web request to obtain the IP address')
+ # Warn if using checkip.dyndns.org, as it does not support HTTPS
+ # See: https://github.com/ddclient/ddclient/issues/597
+ if 'web_options' in config:
+ if 'url' not in config['web_options']:
+ raise ConfigError(f'"url" in "web-options" {error_msg_req} '
+ f'with protocol "{config["protocol"]}"')
+ elif re.search("^(https?://)?checkip\.dyndns\.org", config['web_options']['url']):
+ Warning(f'"checkip.dyndns.org" does not support HTTPS requests for IP address '
+ f'lookup. Please use a different IP address lookup service.')
+
# RFC2136 uses 'key' instead of 'password'
if config['protocol'] != 'nsupdate' and 'password' not in config:
raise ConfigError(f'"password" {error_msg_req}')