mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[enh] Use https when calling dyndns api.
This commit is contained in:
parent
8e597109be
commit
bd5d74ca28
2 changed files with 4 additions and 4 deletions
|
@ -92,7 +92,7 @@ def domain_add(auth, domain, dyndns=False):
|
||||||
from yunohost.dyndns import dyndns_subscribe
|
from yunohost.dyndns import dyndns_subscribe
|
||||||
|
|
||||||
try:
|
try:
|
||||||
r = requests.get('http://dyndns.yunohost.org/domains')
|
r = requests.get('https://dyndns.yunohost.org/domains')
|
||||||
except ConnectionError:
|
except ConnectionError:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
|
6
tools.py
6
tools.py
|
@ -193,7 +193,7 @@ def tools_maindomain(auth, old_domain=None, new_domain=None, dyndns=False):
|
||||||
|
|
||||||
if dyndns and len(new_domain.split('.')) >= 3:
|
if dyndns and len(new_domain.split('.')) >= 3:
|
||||||
try:
|
try:
|
||||||
r = requests.get('http://dyndns.yunohost.org/domains')
|
r = requests.get('https://dyndns.yunohost.org/domains')
|
||||||
except ConnectionError:
|
except ConnectionError:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
@ -231,14 +231,14 @@ def tools_postinstall(domain, password, ignore_dyndns=False):
|
||||||
|
|
||||||
if len(domain.split('.')) >= 3 and not ignore_dyndns:
|
if len(domain.split('.')) >= 3 and not ignore_dyndns:
|
||||||
try:
|
try:
|
||||||
r = requests.get('http://dyndns.yunohost.org/domains')
|
r = requests.get('https://dyndns.yunohost.org/domains')
|
||||||
except ConnectionError:
|
except ConnectionError:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
dyndomains = json.loads(r.text)
|
dyndomains = json.loads(r.text)
|
||||||
dyndomain = '.'.join(domain.split('.')[1:])
|
dyndomain = '.'.join(domain.split('.')[1:])
|
||||||
if dyndomain in dyndomains:
|
if dyndomain in dyndomains:
|
||||||
if requests.get('http://dyndns.yunohost.org/test/%s' % domain).status_code == 200:
|
if requests.get('https://dyndns.yunohost.org/test/%s' % domain).status_code == 200:
|
||||||
dyndns=True
|
dyndns=True
|
||||||
else:
|
else:
|
||||||
raise MoulinetteError(errno.EEXIST,
|
raise MoulinetteError(errno.EEXIST,
|
||||||
|
|
Loading…
Add table
Reference in a new issue