diff --git a/actions/avahi b/actions/avahi index 882c08582..7b3657886 100755 --- a/actions/avahi +++ b/actions/avahi @@ -17,7 +17,7 @@ # """ -Configuration helper for service discovery +Configuration helper for service discovery. """ import argparse @@ -38,14 +38,12 @@ def parse_arguments(): def subcommand_enable(_): """Start service.""" - action_utils.service_enable('avahi-daemon.socket') - action_utils.service_enable('avahi-daemon.service') + action_utils.service_enable('avahi-daemon') def subcommand_disable(_): """Stop service.""" - action_utils.service_disable('avahi-daemon.service') - action_utils.service_disable('avahi-daemon.socket') + action_utils.service_disable('avahi-daemon') def main(): diff --git a/plinth/modules/avahi/__init__.py b/plinth/modules/avahi/__init__.py index 782602259..e311f0076 100644 --- a/plinth/modules/avahi/__init__.py +++ b/plinth/modules/avahi/__init__.py @@ -16,7 +16,7 @@ # """ -Plinth module for service discovery +Plinth module for service discovery. """ from gettext import gettext as _ @@ -40,7 +40,7 @@ def init(): menu.add_urlname(_('Service Discovery'), 'glyphicon-lamp', 'avahi:index', 950) - global service # pylint: disable=W0603 + global service # pylint: disable=W0603 service = service_module.Service( 'avahi', _('Service Discovery'), ['mdns'], is_external=False, enabled=is_enabled()) diff --git a/plinth/modules/avahi/forms.py b/plinth/modules/avahi/forms.py index 2c4ddec3b..bf756610b 100644 --- a/plinth/modules/avahi/forms.py +++ b/plinth/modules/avahi/forms.py @@ -16,7 +16,7 @@ # """ -Plinth module for service discovery forms +Plinth module for service discovery forms. """ from django import forms diff --git a/plinth/modules/avahi/templates/avahi.html b/plinth/modules/avahi/templates/avahi.html index a2938a4b0..df40e955f 100644 --- a/plinth/modules/avahi/templates/avahi.html +++ b/plinth/modules/avahi/templates/avahi.html @@ -24,12 +24,12 @@

Service Discovery

-

Service discovery is a program that can discover other machines and services -running on your local network. It can also helps those other machines find your -FreedomBox, and the services running on it. Service discovery is not required, -though. Some users decide to disable it to minimize the -attack surface -of their FreedomBox. +

Service discovery allows other machines on the network to discover + your FreedomBox and services running on it. It also allows + FreedomBox to discover other machines and services running on your + local network. Service discovery is not essential and works only on + internal networks. It may be disabled to improve security + especially when connecting to a hostile local network.

Status

diff --git a/plinth/modules/avahi/urls.py b/plinth/modules/avahi/urls.py index 4f65f4813..837aebe61 100644 --- a/plinth/modules/avahi/urls.py +++ b/plinth/modules/avahi/urls.py @@ -16,12 +16,12 @@ # """ -URLs for the service discovery module +URLs for the service discovery module. """ from django.conf.urls import patterns, url -urlpatterns = patterns( # pylint: disable=C0103 +urlpatterns = patterns( # pylint: disable=C0103 'plinth.modules.avahi.views', url(r'^sys/avahi/$', 'index', name='index'), ) diff --git a/plinth/modules/avahi/views.py b/plinth/modules/avahi/views.py index 0e76ccebd..5093a87ce 100644 --- a/plinth/modules/avahi/views.py +++ b/plinth/modules/avahi/views.py @@ -16,7 +16,7 @@ # """ -Plinth module for service discovery views +Plinth module for service discovery views. """ from django.contrib import messages @@ -30,7 +30,7 @@ from plinth import package from plinth.modules import avahi -logger = logging.getLogger(__name__) # pylint: disable=C0103 +logger = logging.getLogger(__name__) # pylint: disable=C0103 @package.required(['avahi-daemon']) @@ -41,13 +41,13 @@ def index(request): form = None if request.method == 'POST': - form = ServiceDiscoveryForm(request.POST) + form = ServiceDiscoveryForm(request.POST, prefix='avahi') if form.is_valid(): _apply_changes(request, status, form.cleaned_data) status = get_status() - form = ServiceDiscoveryForm(initial=status) + form = ServiceDiscoveryForm(initial=status, prefix='avahi') else: - form = ServiceDiscoveryForm(initial=status) + form = ServiceDiscoveryForm(initial=status, prefix='avahi') return TemplateResponse(request, 'avahi.html', {'title': _('Service Discovery'),