From 7cf47a389edecc6c05590468a10b6aa916881cc5 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Wed, 25 Dec 2024 22:01:13 -0600 Subject: ddclient: T6981: Remove defunct googledomains Since googledomains (domains.google.com) has been shut down, we need to remove any configuration path that refers to googledomains. 1. Remove 'googledomains' as the default web resolver in ddclient.conf.j2 2. Apply migration to remove googledomains from dynamic DNS service configurations. The migration is also necessary to undo a previous migration where we added 'googledomains' as default web resolver to work around lack of tls (ssl) support with default web resolver 'dyndns' (checkip.dyndns.org) in ddclient v3.x. --- src/migration-scripts/dns-dynamic/4-to-5 | 52 ++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 src/migration-scripts/dns-dynamic/4-to-5 (limited to 'src/migration-scripts') diff --git a/src/migration-scripts/dns-dynamic/4-to-5 b/src/migration-scripts/dns-dynamic/4-to-5 new file mode 100644 index 000000000..3a055a122 --- /dev/null +++ b/src/migration-scripts/dns-dynamic/4-to-5 @@ -0,0 +1,52 @@ +# Copyright VyOS maintainers and contributors +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library. If not, see . + +# T6981: +# - remove "service dns dynamic name protocol googledomains" +# - remove "service dns dynamic name address web url ..." +# when url is https://domains.google.com/* + +import re +from vyos.base import Warning +from vyos.configtree import ConfigTree + +base_path = ['service', 'dns', 'dynamic', 'name'] + +def migrate(config: ConfigTree) -> None: + if not config.exists(base_path): + # Nothing to do + return + + for service in config.list_nodes(base_path): + + service_path = base_path + [service] + + # Remove configurations using protocol 'googledomains' + if config.exists(service_path + ['protocol']): + protocol = config.return_value(service_path + ['protocol']) + if protocol == 'googledomains': + Warning(f'Removing {service} using protocol "googledomains" because the service has been shutdown') + config.delete(service_path) + + # Look for 'address web' with 'url' set to 'googledomains' or 'https://domains.google.com' + # and remove them so that ddclient defaults apply for 'address web' + if config.exists(service_path + ['address', 'web']): + web_addr_path = service_path + ['address', 'web'] + if config.exists(web_addr_path + ['url']): + url = config.return_value(web_addr_path + ['url']) + if url == 'googledomains' or re.search(r'^(https?://)?domains\.google\.com', url): + config.delete(web_addr_path + ['url']) + if config.exists(web_addr_path + ['skip']): + config.delete(web_addr_path + ['skip']) -- cgit v1.2.3 From e0c4655c6c06f6fd24adddea7371c6d68615c54c Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Tue, 7 Jan 2025 11:18:12 -0600 Subject: ddclient: T6981: Remove defunct woima Since woima (woima.fi) has been shut down, we need to remove any configuration path that refers to woima. Apply migration to remove woima from dynamic DNS service configurations. --- src/migration-scripts/dns-dynamic/4-to-5 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/migration-scripts') diff --git a/src/migration-scripts/dns-dynamic/4-to-5 b/src/migration-scripts/dns-dynamic/4-to-5 index 3a055a122..3873c00af 100644 --- a/src/migration-scripts/dns-dynamic/4-to-5 +++ b/src/migration-scripts/dns-dynamic/4-to-5 @@ -15,6 +15,7 @@ # T6981: # - remove "service dns dynamic name protocol googledomains" +# - remove "service dns dynamic name protocol woima" # - remove "service dns dynamic name address web url ..." # when url is https://domains.google.com/* @@ -33,11 +34,11 @@ def migrate(config: ConfigTree) -> None: service_path = base_path + [service] - # Remove configurations using protocol 'googledomains' + # Remove configurations using protocol 'googledomains' and 'woima' if config.exists(service_path + ['protocol']): protocol = config.return_value(service_path + ['protocol']) - if protocol == 'googledomains': - Warning(f'Removing {service} using protocol "googledomains" because the service has been shutdown') + if protocol in ['googledomains', 'woima']: + Warning(f'Removing {service} using protocol "{protocol}" because the service has been shutdown') config.delete(service_path) # Look for 'address web' with 'url' set to 'googledomains' or 'https://domains.google.com' -- cgit v1.2.3