diff --git a/plinth/modules/dynamicdns/dynamicdns.py b/plinth/modules/dynamicdns/dynamicdns.py index e7a261376..bfca1ea2a 100644 --- a/plinth/modules/dynamicdns/dynamicdns.py +++ b/plinth/modules/dynamicdns/dynamicdns.py @@ -70,15 +70,44 @@ class TrimmedCharField(forms.CharField): class ConfigureForm(forms.Form): """Form to configure the dynamic DNS client""" - enabled = forms.BooleanField(label=_('Enable dynamicdns'), + enabled = forms.BooleanField(label=_('Enable Dynamic DNS'), required=False) + dynamicdns_service = forms.ChoiceField(label=_('Service type'), + help_text=_('Please choose a update protocol according to your provider.\ + We recommend the GnudIP protocol. If your provider does not \ + support the GnudIP protocol or your provider is not listed \ + you may use the update URL of your provider.'), + choices=(('1', 'GnudIP'), + ('2', 'noip.com'), + ('3', 'selfhost.bz'), + ('4', 'other Update URL'))) + dynamicdns_server = TrimmedCharField( - label=_('Server Address'), + label=_('GnudIP Server Address'), help_text=_('Example: gnudip.provider.org'), validators=[ validators.RegexValidator(r'^[\w-]{1,63}(\.[\w-]{1,63})*$', _('Invalid server name'))]) + + dynamicdns_update_url = TrimmedCharField( + label=_('Update URL'), + required=False, + help_text=_('The Variables $User, $Pass, $IP, $Domain may be used \ + within this URL.
Example URL:
\ + https://some.tld/up.php?us=$User&pw=$Pass&ip=$IP&dom=$Domain'), + validators=[ + validators.URLValidator(schemes=['http', 'https'])]) + + disable_SSL_cert_check = forms.BooleanField( + label=_('accept all SSL certificates'), + help_text=_('use this option if your provider uses\ + self signed certificates'), + required=False) + + use_http_basic_auth = forms.BooleanField( + label=_('use HTTP basic authentication'), + required=False) dynamicdns_domain = TrimmedCharField( label=_('Domain Name'), @@ -96,7 +125,8 @@ class ConfigureForm(forms.Form): label=_('Password'), widget=forms.PasswordInput(), required=False, help_text=_('You should have been requested to select a password \ - when you created the account.')) + when you created the account. Leave this field empty \ + if you want to keep your previous configured password.')) showpw = forms.BooleanField(label=_('show password'), required=False, diff --git a/plinth/modules/dynamicdns/templates/dynamicdns_configure.html b/plinth/modules/dynamicdns/templates/dynamicdns_configure.html index 630eabca7..da12c40e1 100644 --- a/plinth/modules/dynamicdns/templates/dynamicdns_configure.html +++ b/plinth/modules/dynamicdns/templates/dynamicdns_configure.html @@ -21,25 +21,123 @@ {% load bootstrap %} {% block content %} -

Configuration

+
{% csrf_token %} - {{ form|bootstrap }} + {% include 'bootstrapform/field.html' with field=form.enabled %} - +
+

Dynamic DNS type

+ {% include 'bootstrapform/field.html' with field=form.dynamicdns_service %} +
+ {% include 'bootstrapform/field.html' with field=form.dynamicdns_server %} +
+ +
+ {% include 'bootstrapform/field.html' with field=form.dynamicdns_update_url %} + {% include 'bootstrapform/field.html' with field=form.disable_SSL_cert_check %} + {% include 'bootstrapform/field.html' with field=form.use_http_basic_auth %} +
+ +

Account Information

+ {% include 'bootstrapform/field.html' with field=form.dynamicdns_domain %} + {% include 'bootstrapform/field.html' with field=form.dynamicdns_user %} + {% include 'bootstrapform/field.html' with field=form.dynamicdns_secret %} + {% include 'bootstrapform/field.html' with field=form.showpw %} + +

IP check URL

+ {% include 'bootstrapform/field.html' with field=form.dynamicdns_ipurl %} +
+ +
+ {% endblock %} {% block page_js %} - + + + + {% endblock %}