mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-02-04 08:13:38 +00:00
dynamicdns: Use new setup mechanism
This commit is contained in:
parent
28a889c54b
commit
1842db42da
@ -19,9 +19,42 @@
|
||||
Plinth module to configure ez-ipupdate client
|
||||
"""
|
||||
|
||||
from . import dynamicdns
|
||||
from .dynamicdns import init
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
__all__ = ['dynamicdns', 'init']
|
||||
from plinth import cfg
|
||||
from plinth.utils import format_lazy
|
||||
|
||||
version = 1
|
||||
|
||||
depends = ['apps']
|
||||
|
||||
title = _('Dynamic DNS Client')
|
||||
|
||||
description = [
|
||||
format_lazy(
|
||||
_('If your internet provider changes your IP address periodic '
|
||||
'(i.e. every 24h) it may be hard for others to find you in the '
|
||||
'WEB. And for this reason nobody may find the services which are '
|
||||
'provided by {box_name}, such as ownCloud.'),
|
||||
box_name=_(cfg.box_name)),
|
||||
|
||||
_('The solution is to assign a DNS name to your IP address and '
|
||||
'update the DNS name every time your IP is changed by your '
|
||||
'Internet provider. Dynamic DNS allows you to push your current '
|
||||
'public IP address to an '
|
||||
'<a href=\'http://gnudip2.sourceforge.net/\' target=\'_blank\'> '
|
||||
'gnudip </a> server. Afterwards the Server will assign your DNS name '
|
||||
'with the new IP and if someone from the Internet asks for your DNS '
|
||||
'name he will get your current IP answered.')
|
||||
]
|
||||
|
||||
|
||||
def init():
|
||||
"""Initialize the module."""
|
||||
menu = cfg.main_menu.get('apps:index')
|
||||
menu.add_urlname(title, 'glyphicon-refresh', 'dynamicdns:index', 500)
|
||||
|
||||
|
||||
def setup(helper, old_version=None):
|
||||
"""Install and configure the module."""
|
||||
helper.install(['ez-ipupdate'])
|
||||
|
||||
@ -25,7 +25,7 @@ import logging
|
||||
|
||||
from plinth import actions
|
||||
from plinth import cfg
|
||||
from plinth import package
|
||||
from plinth.modules import dynamicdns
|
||||
from plinth.utils import format_lazy
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@ -39,19 +39,11 @@ subsubmenu = [{'url': reverse_lazy('dynamicdns:index'),
|
||||
'text': ugettext_lazy('Status')}]
|
||||
|
||||
|
||||
def init():
|
||||
"""Initialize the dynamicdns module"""
|
||||
menu = cfg.main_menu.get('apps:index')
|
||||
menu.add_urlname(ugettext_lazy('Dynamic DNS'), 'glyphicon-refresh',
|
||||
'dynamicdns:index', 500)
|
||||
|
||||
|
||||
@package.required(['ez-ipupdate'])
|
||||
def index(request):
|
||||
"""Serve Dynamic DNS page."""
|
||||
|
||||
return TemplateResponse(request, 'dynamicdns.html',
|
||||
{'title': _('Dynamic DNS'),
|
||||
{'title': dynamicdns.title,
|
||||
'description': dynamicdns.description,
|
||||
'subsubmenu': subsubmenu})
|
||||
|
||||
|
||||
@ -198,7 +190,6 @@ class ConfigureForm(forms.Form):
|
||||
raise forms.ValidationError(_('Please provide a password'))
|
||||
|
||||
|
||||
@package.required(['ez-ipupdate'])
|
||||
def configure(request):
|
||||
"""Serve the configuration form."""
|
||||
status = get_status()
|
||||
@ -219,7 +210,6 @@ def configure(request):
|
||||
'subsubmenu': subsubmenu})
|
||||
|
||||
|
||||
@package.required(['ez-ipupdate'])
|
||||
def statuspage(request):
|
||||
"""Serve the status page."""
|
||||
check_nat = actions.run('dynamicdns', ['get-nat'])
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{% extends "base.html" %}
|
||||
{% extends "app.html" %}
|
||||
{% comment %}
|
||||
#
|
||||
# This file is part of Plinth.
|
||||
@ -20,32 +20,7 @@
|
||||
|
||||
{% load i18n %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h2>{% trans "Dynamic DNS Client" %}</h2>
|
||||
|
||||
<p>
|
||||
{% blocktrans trimmed %}
|
||||
If your internet provider changes your IP address periodic
|
||||
(i.e. every 24h) it may be hard for others to find you in the
|
||||
WEB. And for this reason nobody may find the services which are
|
||||
provided by {{ box_name }}, such as ownCloud.
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
|
||||
<p>
|
||||
{% blocktrans trimmed %}
|
||||
The solution is to assign a DNS name to your IP address and
|
||||
update the DNS name every time your IP is changed by your
|
||||
Internet provider. Dynamic DNS allows you to push your current
|
||||
public IP address to an
|
||||
<a href='http://gnudip2.sourceforge.net/' target='_blank'> gnudip </a>
|
||||
server. Afterwards the Server will assign your DNS name with the
|
||||
new IP and if someone from the Internet asks for your DNS name
|
||||
he will get your current IP answered.
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
|
||||
{% block configuration %}
|
||||
<p>
|
||||
{% blocktrans trimmed %}
|
||||
If you are looking for a free dynamic DNS account, you may find
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user