diff --git a/actions/mldonkey b/actions/mldonkey index c4ea9f885..2d3284905 100755 --- a/actions/mldonkey +++ b/actions/mldonkey @@ -25,6 +25,7 @@ import subprocess from plinth import action_utils + def parse_arguments(): """Return parsed command line arguments as dictionary.""" parser = argparse.ArgumentParser() @@ -40,9 +41,9 @@ def parse_arguments(): def subcommand_pre_install(_): """Preseed debconf values before packages are installed.""" - subprocess.check_output( - ['debconf-set-selections'], - input=b'mldonkey-server mldonkey-server/launch_at_startup boolean true') + subprocess.check_output([ + 'debconf-set-selections' + ], input=b'mldonkey-server mldonkey-server/launch_at_startup boolean true') def subcommand_enable(_): diff --git a/data/etc/apache2/conf-available/mldonkey-freedombox.conf b/data/etc/apache2/conf-available/mldonkey-freedombox.conf index 29873dc40..263c1361f 100644 --- a/data/etc/apache2/conf-available/mldonkey-freedombox.conf +++ b/data/etc/apache2/conf-available/mldonkey-freedombox.conf @@ -4,7 +4,6 @@ # Redirect /mldonkey to /mldonkey/ as the MLdonkey server web interface does not # work without a slash at the end. - RewriteEngine On @@ -13,7 +12,6 @@ - Include includes/freedombox-single-sign-on.conf ProxyPass http://localhost:4080/ diff --git a/functional_tests/features/mldonkey.feature b/functional_tests/features/mldonkey.feature index 09d6831b2..4b4420b6a 100644 --- a/functional_tests/features/mldonkey.feature +++ b/functional_tests/features/mldonkey.feature @@ -26,11 +26,13 @@ Background: Scenario: Enable mldonkey application Given the mldonkey application is disabled When I enable the mldonkey application + Then the mldonkey service should be running Then the mldonkey site should be available Scenario: Disable mldonkey application Given the mldonkey application is enabled When I disable the mldonkey application + Then the mldonkey service should not be running Then the mldonkey site should not be available # Scenario: Upload an ed2k file to mldonkey diff --git a/plinth/modules/mldonkey/__init__.py b/plinth/modules/mldonkey/__init__.py index b9052f6b6..134d665c5 100644 --- a/plinth/modules/mldonkey/__init__.py +++ b/plinth/modules/mldonkey/__init__.py @@ -20,28 +20,31 @@ FreedomBox app for mldonkey. from django.utils.translation import ugettext_lazy as _ -from plinth import service as service_module from plinth import action_utils, actions, cfg, frontpage +from plinth import service as service_module from plinth.menu import main_menu from plinth.modules.users import register_group +from plinth.utils import format_lazy from .manifest import clients version = 1 -service = None - managed_services = ['mldonkey-server'] managed_packages = ['mldonkey-server'] name = _('MLDonkey') -short_description = _('Door to the eDonkey network') +short_description = _('Peer-to-peer File Sharing') description = [ - _('MLDonkey is a door to the eDonkey network, a decentralized network ' - 'used to exchange big files on the Internet.'), + _('MLDonkey is a peer-to-peer file sharing application used to exchange ' + 'large files. It can participate in multiple peer-to-peer networks ' + 'including eDonkey, Kademlia, Overnet, BitTorrent and DirectConnect.'), + format_lazy( + _('On {box_name}, downloaded files can be found in /var/lib/mldonkey/ ' + 'directory.'), box_name=cfg.box_name) ] clients = clients @@ -50,13 +53,15 @@ reserved_usernames = ['mldonkey'] group = ('ed2k', _('Download files using eDonkey applications')) +service = None + manual_page = 'MLDonkey' + def init(): - """Intialize the MLDonkey module.""" + """Initialize the MLDonkey module.""" menu = main_menu.get('apps') - menu.add_urlname(name, 'mldonkey', 'mldonkey:index', - short_description) + menu.add_urlname(name, 'mldonkey', 'mldonkey:index', short_description) register_group(group) global service @@ -90,9 +95,9 @@ def setup(helper, old_version=None): def add_shortcut(): """Helper method to add a shortcut to the frontpage.""" - frontpage.add_shortcut('mldonkey', name, short_description=short_description, - url='/mldonkey', login_required=True, - allowed_groups=[group[0]]) + frontpage.add_shortcut( + 'mldonkey', name, short_description=short_description, + url='/mldonkey/', login_required=True, allowed_groups=[group[0]]) def is_running(): @@ -102,8 +107,8 @@ def is_running(): def is_enabled(): """Return whether the module is enabled.""" - return (action_utils.service_is_enabled('mldonkey-server') and - action_utils.webserver_is_enabled('mldonkey-freedombox')) + return (action_utils.service_is_enabled('mldonkey-server') + and action_utils.webserver_is_enabled('mldonkey-freedombox')) def enable(): @@ -123,7 +128,6 @@ def diagnose(): results = [] results.append(action_utils.diagnose_port_listening(4080, 'tcp4')) - results.append(action_utils.diagnose_port_listening(4080, 'tcp6')) results.extend( action_utils.diagnose_url_on_all('https://{host}/mldonkey/', check_certificate=False)) diff --git a/plinth/modules/mldonkey/manifest.py b/plinth/modules/mldonkey/manifest.py index 12a4d67fb..23569293e 100644 --- a/plinth/modules/mldonkey/manifest.py +++ b/plinth/modules/mldonkey/manifest.py @@ -14,6 +14,9 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . # +""" +Application manifest for mldonkey. +""" from django.utils.translation import ugettext_lazy as _ diff --git a/plinth/modules/mldonkey/urls.py b/plinth/modules/mldonkey/urls.py index 5e610c58f..d78b45431 100644 --- a/plinth/modules/mldonkey/urls.py +++ b/plinth/modules/mldonkey/urls.py @@ -20,16 +20,15 @@ URLs for the mldonkey module. from django.conf.urls import url -from plinth.views import ServiceView from plinth.modules import mldonkey +from plinth.views import ServiceView urlpatterns = [ - url(r'^apps/mldonkey/$', - ServiceView.as_view( - service_id=mldonkey.managed_services[0], - diagnostics_module_name='mldonkey', - description=mldonkey.description, - clients=mldonkey.clients, - show_status_block=True), + url( + r'^apps/mldonkey/$', + ServiceView.as_view(service_id=mldonkey.managed_services[0], + diagnostics_module_name='mldonkey', + description=mldonkey.description, + clients=mldonkey.clients, show_status_block=True), name='index'), ]