mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
base64 dns key
This commit is contained in:
parent
5d9d87f20d
commit
12b399c6d9
1 changed files with 2 additions and 1 deletions
|
@ -28,6 +28,7 @@ import sys
|
|||
import requests
|
||||
import json
|
||||
import glob
|
||||
import base64
|
||||
from yunohost import YunoHostError, YunoHostLDAP, validate, colorize, win_msg
|
||||
|
||||
def dyndns_subscribe(subscribe_host="dyndns.yunohost.org", domain=None, key=None):
|
||||
|
@ -59,7 +60,7 @@ def dyndns_subscribe(subscribe_host="dyndns.yunohost.org", domain=None, key=None
|
|||
raise YunoHostError(17, _("Domain is already taken"))
|
||||
|
||||
# Send subscription
|
||||
r = requests.post('http://'+ subscribe_host +'/key/'+ key, data={ 'subdomain': domain })
|
||||
r = requests.post('http://'+ subscribe_host +'/key/'+ base64.b64encode(key), data={ 'subdomain': domain })
|
||||
if r.status_code != 201:
|
||||
error = json.loads(r.text)['error']
|
||||
raise YunoHostError(1, _("An error occured during DynDNS registration: "+ error))
|
||||
|
|
Loading…
Add table
Reference in a new issue