Added an API endpoint to check if a domain is a DynDNS one

This commit is contained in:
theo@manjaro 2022-07-11 15:16:33 +02:00
parent 06db6f7e04
commit 0b5c96e249
2 changed files with 18 additions and 0 deletions

View file

@ -585,6 +585,16 @@ domain:
pattern: *pattern_domain
path:
help: The path to check (e.g. /coffee)
### domain_isdyndns()
isdyndns:
action_help: Check if a domain is a dyndns one
api: GET /domain/<domain>/isdyndns
arguments:
domain:
help: The domain to test (e.g. your.domain.tld)
extra:
pattern: *pattern_domain
subcategories:
dyndns:

View file

@ -458,6 +458,14 @@ def domain_url_available(domain, path):
return len(_get_conflicting_apps(domain, path)) == 0
def domain_isdyndns(domain):
"""
Returns if a domain is a DynDNS one ( used via the web API )
Arguments:
domain -- the domain to check
"""
return is_yunohost_dyndns_domain(domain)
def _get_maindomain():
with open("/etc/yunohost/current_host", "r") as f: