Enable dynamicdns module to handle IPv6

Signed-off-by: Matthias Dellweg <2500@gmx.de>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Matthias Dellweg authored and James Valleroy committed 2020-11-15 19:17:50 -05:00
1 parent 451856999f
commit 4b4f8187ef
5 files changed
+53 -9

No files matched your search

+5
View File
@@ -157,6 +157,11 @@ def get_status():
else:
status['use_http_basic_auth'] = False
if len(details) > 9:
status['use_ipv6'] = (output.split()[9] == 'enabled')
else:
status['use_ipv6'] = False
if not status['dynamicdns_server'] and not status['dynamicdns_update_url']:
status['service_type'] = 'GnuDIP'
elif not status['dynamicdns_server'] and status['dynamicdns_update_url']:
+4
View File
@@ -115,6 +115,10 @@ class ConfigureForm(forms.Form):
help_text=help_ip_url,
validators=[validators.URLValidator(schemes=['http', 'https', 'ftp'])])
use_ipv6 = forms.BooleanField(
label=ugettext_lazy('Use IPv6 instead of IPv4'),
required=False)
def clean(self):
cleaned_data = super(ConfigureForm, self).clean()
dynamicdns_secret = cleaned_data.get('dynamicdns_secret')
@@ -116,6 +116,7 @@
$('#id_dynamicdns_update_url').closest('.form-group').hide();
$('#id_disable_SSL_cert_check').closest('.form-group').hide();
$('#id_use_http_basic_auth').closest('.form-group').hide();
$('#id_use_ipv6').closest('.form-group').hide();
$('#id_dynamicdns_server').closest('.form-group').show();
}
@@ -123,6 +124,7 @@
$('#id_dynamicdns_update_url').closest('.form-group').show();
$('#id_disable_SSL_cert_check').closest('.form-group').show();
$('#id_use_http_basic_auth').closest('.form-group').show();
$('#id_use_ipv6').closest('.form-group').show();
$('#id_dynamicdns_server').closest('.form-group').hide();
}
@@ -138,5 +140,6 @@
$('#id_dynamicdns_secret').closest('.form-group').show();
$('#id_showpw').closest('.form-group').show();
$('#id_dynamicdns_ipurl').closest('.form-group').show();
$('#id_use_ipv6').closest('.form-group').show();
}
})(jQuery);
+5 -1
View File
@@ -118,6 +118,7 @@ def _apply_changes(request, old_status, new_status):
if old_status != new_status:
disable_ssl_check = "disabled"
use_http_basic_auth = "disabled"
use_ipv6 = "disabled"
if new_status['disable_SSL_cert_check']:
disable_ssl_check = "enabled"
@@ -125,13 +126,16 @@ def _apply_changes(request, old_status, new_status):
if new_status['use_http_basic_auth']:
use_http_basic_auth = "enabled"
if new_status.get('use_ipv6'):
use_ipv6 = "enabled"
_run([
'configure', '-s', new_status['dynamicdns_server'], '-d',
new_status['dynamicdns_domain'], '-u',
new_status['dynamicdns_user'], '-p', '-I',
new_status['dynamicdns_ipurl'], '-U',
new_status['dynamicdns_update_url'], '-c', disable_ssl_check, '-b',
use_http_basic_auth
use_http_basic_auth, '-6', use_ipv6,
], input=new_status['dynamicdns_secret'].encode())
if old_status['enabled']: