mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[enh] Use https to retrieve public IP address
This commit is contained in:
parent
b27c5208d5
commit
5f08eb06ae
3 changed files with 4 additions and 4 deletions
|
@ -83,7 +83,7 @@ def domain_add(auth, domain, dyndns=False):
|
|||
|
||||
attr_dict = { 'objectClass' : ['mailDomain', 'top'] }
|
||||
try:
|
||||
ip = str(urlopen('http://ip.yunohost.org').read())
|
||||
ip = str(urlopen('https://ip.yunohost.org').read())
|
||||
except IOError:
|
||||
ip = "127.0.0.1"
|
||||
now = datetime.datetime.now()
|
||||
|
@ -233,7 +233,7 @@ def domain_dns_conf(domain, ttl=None):
|
|||
|
||||
# A/AAAA records
|
||||
try:
|
||||
ip4 = urlopen("http://ip.yunohost.org").read().strip()
|
||||
ip4 = urlopen("https://ip.yunohost.org").read().strip()
|
||||
except IOError:
|
||||
raise MoulinetteError(errno.ENETUNREACH,
|
||||
m18n.n('no_internet_connection'))
|
||||
|
|
|
@ -131,7 +131,7 @@ def dyndns_update(dyn_host="dynhost.yunohost.org", domain=None, key=None, ip=Non
|
|||
# IPv4
|
||||
if ip is None:
|
||||
try:
|
||||
new_ip = requests.get('http://ip.yunohost.org').text
|
||||
new_ip = requests.get('https://ip.yunohost.org').text
|
||||
except requests.ConnectionError:
|
||||
raise MoulinetteError(errno.ENETUNREACH, m18n.n('no_internet_connection'))
|
||||
else:
|
||||
|
|
|
@ -210,7 +210,7 @@ def monitor_network(units=None, human_readable=False):
|
|||
logger.debug('interface name %s was not found', iname)
|
||||
elif u == 'infos':
|
||||
try:
|
||||
p_ip = str(urlopen('http://ip.yunohost.org').read())
|
||||
p_ip = str(urlopen('https://ip.yunohost.org').read())
|
||||
except:
|
||||
p_ip = 'unknown'
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue