mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-13 10:30:16 +00:00
mldonkey: Update description and minor updates
- Update description to simply and talk about multiple protocols supported. - Don't diagnose on IPv6 as mldonkey does not listen there. - Run yapf and isort. - Minor styling fixes. - Update functional tests to check for service running. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
548c6b98f3
commit
260dcd4d32
@ -25,6 +25,7 @@ import subprocess
|
|||||||
|
|
||||||
from plinth import action_utils
|
from plinth import action_utils
|
||||||
|
|
||||||
|
|
||||||
def parse_arguments():
|
def parse_arguments():
|
||||||
"""Return parsed command line arguments as dictionary."""
|
"""Return parsed command line arguments as dictionary."""
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
@ -40,9 +41,9 @@ def parse_arguments():
|
|||||||
|
|
||||||
def subcommand_pre_install(_):
|
def subcommand_pre_install(_):
|
||||||
"""Preseed debconf values before packages are installed."""
|
"""Preseed debconf values before packages are installed."""
|
||||||
subprocess.check_output(
|
subprocess.check_output([
|
||||||
['debconf-set-selections'],
|
'debconf-set-selections'
|
||||||
input=b'mldonkey-server mldonkey-server/launch_at_startup boolean true')
|
], input=b'mldonkey-server mldonkey-server/launch_at_startup boolean true')
|
||||||
|
|
||||||
|
|
||||||
def subcommand_enable(_):
|
def subcommand_enable(_):
|
||||||
|
|||||||
@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
# Redirect /mldonkey to /mldonkey/ as the MLdonkey server web interface does not
|
# Redirect /mldonkey to /mldonkey/ as the MLdonkey server web interface does not
|
||||||
# work without a slash at the end.
|
# work without a slash at the end.
|
||||||
|
|
||||||
<Location ~ ^/mldonkey$>
|
<Location ~ ^/mldonkey$>
|
||||||
<IfModule mod_rewrite.c>
|
<IfModule mod_rewrite.c>
|
||||||
RewriteEngine On
|
RewriteEngine On
|
||||||
@ -13,7 +12,6 @@
|
|||||||
</IfModule>
|
</IfModule>
|
||||||
</Location>
|
</Location>
|
||||||
|
|
||||||
|
|
||||||
<Location /mldonkey/>
|
<Location /mldonkey/>
|
||||||
Include includes/freedombox-single-sign-on.conf
|
Include includes/freedombox-single-sign-on.conf
|
||||||
ProxyPass http://localhost:4080/
|
ProxyPass http://localhost:4080/
|
||||||
|
|||||||
@ -26,11 +26,13 @@ Background:
|
|||||||
Scenario: Enable mldonkey application
|
Scenario: Enable mldonkey application
|
||||||
Given the mldonkey application is disabled
|
Given the mldonkey application is disabled
|
||||||
When I enable the mldonkey application
|
When I enable the mldonkey application
|
||||||
|
Then the mldonkey service should be running
|
||||||
Then the mldonkey site should be available
|
Then the mldonkey site should be available
|
||||||
|
|
||||||
Scenario: Disable mldonkey application
|
Scenario: Disable mldonkey application
|
||||||
Given the mldonkey application is enabled
|
Given the mldonkey application is enabled
|
||||||
When I disable the mldonkey application
|
When I disable the mldonkey application
|
||||||
|
Then the mldonkey service should not be running
|
||||||
Then the mldonkey site should not be available
|
Then the mldonkey site should not be available
|
||||||
|
|
||||||
# Scenario: Upload an ed2k file to mldonkey
|
# Scenario: Upload an ed2k file to mldonkey
|
||||||
|
|||||||
@ -20,28 +20,31 @@ FreedomBox app for mldonkey.
|
|||||||
|
|
||||||
from django.utils.translation import ugettext_lazy as _
|
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 action_utils, actions, cfg, frontpage
|
||||||
|
from plinth import service as service_module
|
||||||
from plinth.menu import main_menu
|
from plinth.menu import main_menu
|
||||||
from plinth.modules.users import register_group
|
from plinth.modules.users import register_group
|
||||||
|
from plinth.utils import format_lazy
|
||||||
|
|
||||||
from .manifest import clients
|
from .manifest import clients
|
||||||
|
|
||||||
version = 1
|
version = 1
|
||||||
|
|
||||||
service = None
|
|
||||||
|
|
||||||
managed_services = ['mldonkey-server']
|
managed_services = ['mldonkey-server']
|
||||||
|
|
||||||
managed_packages = ['mldonkey-server']
|
managed_packages = ['mldonkey-server']
|
||||||
|
|
||||||
name = _('MLDonkey')
|
name = _('MLDonkey')
|
||||||
|
|
||||||
short_description = _('Door to the eDonkey network')
|
short_description = _('Peer-to-peer File Sharing')
|
||||||
|
|
||||||
description = [
|
description = [
|
||||||
_('MLDonkey is a door to the eDonkey network, a decentralized network '
|
_('MLDonkey is a peer-to-peer file sharing application used to exchange '
|
||||||
'used to exchange big files on the Internet.'),
|
'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
|
clients = clients
|
||||||
@ -50,13 +53,15 @@ reserved_usernames = ['mldonkey']
|
|||||||
|
|
||||||
group = ('ed2k', _('Download files using eDonkey applications'))
|
group = ('ed2k', _('Download files using eDonkey applications'))
|
||||||
|
|
||||||
|
service = None
|
||||||
|
|
||||||
manual_page = 'MLDonkey'
|
manual_page = 'MLDonkey'
|
||||||
|
|
||||||
|
|
||||||
def init():
|
def init():
|
||||||
"""Intialize the MLDonkey module."""
|
"""Initialize the MLDonkey module."""
|
||||||
menu = main_menu.get('apps')
|
menu = main_menu.get('apps')
|
||||||
menu.add_urlname(name, 'mldonkey', 'mldonkey:index',
|
menu.add_urlname(name, 'mldonkey', 'mldonkey:index', short_description)
|
||||||
short_description)
|
|
||||||
register_group(group)
|
register_group(group)
|
||||||
|
|
||||||
global service
|
global service
|
||||||
@ -90,9 +95,9 @@ def setup(helper, old_version=None):
|
|||||||
|
|
||||||
def add_shortcut():
|
def add_shortcut():
|
||||||
"""Helper method to add a shortcut to the frontpage."""
|
"""Helper method to add a shortcut to the frontpage."""
|
||||||
frontpage.add_shortcut('mldonkey', name, short_description=short_description,
|
frontpage.add_shortcut(
|
||||||
url='/mldonkey', login_required=True,
|
'mldonkey', name, short_description=short_description,
|
||||||
allowed_groups=[group[0]])
|
url='/mldonkey/', login_required=True, allowed_groups=[group[0]])
|
||||||
|
|
||||||
|
|
||||||
def is_running():
|
def is_running():
|
||||||
@ -102,8 +107,8 @@ def is_running():
|
|||||||
|
|
||||||
def is_enabled():
|
def is_enabled():
|
||||||
"""Return whether the module is enabled."""
|
"""Return whether the module is enabled."""
|
||||||
return (action_utils.service_is_enabled('mldonkey-server') and
|
return (action_utils.service_is_enabled('mldonkey-server')
|
||||||
action_utils.webserver_is_enabled('mldonkey-freedombox'))
|
and action_utils.webserver_is_enabled('mldonkey-freedombox'))
|
||||||
|
|
||||||
|
|
||||||
def enable():
|
def enable():
|
||||||
@ -123,7 +128,6 @@ def diagnose():
|
|||||||
results = []
|
results = []
|
||||||
|
|
||||||
results.append(action_utils.diagnose_port_listening(4080, 'tcp4'))
|
results.append(action_utils.diagnose_port_listening(4080, 'tcp4'))
|
||||||
results.append(action_utils.diagnose_port_listening(4080, 'tcp6'))
|
|
||||||
results.extend(
|
results.extend(
|
||||||
action_utils.diagnose_url_on_all('https://{host}/mldonkey/',
|
action_utils.diagnose_url_on_all('https://{host}/mldonkey/',
|
||||||
check_certificate=False))
|
check_certificate=False))
|
||||||
|
|||||||
@ -14,6 +14,9 @@
|
|||||||
# You should have received a copy of the GNU Affero General Public License
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
|
"""
|
||||||
|
Application manifest for mldonkey.
|
||||||
|
"""
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
|
|||||||
@ -20,16 +20,15 @@ URLs for the mldonkey module.
|
|||||||
|
|
||||||
from django.conf.urls import url
|
from django.conf.urls import url
|
||||||
|
|
||||||
from plinth.views import ServiceView
|
|
||||||
from plinth.modules import mldonkey
|
from plinth.modules import mldonkey
|
||||||
|
from plinth.views import ServiceView
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url(r'^apps/mldonkey/$',
|
url(
|
||||||
ServiceView.as_view(
|
r'^apps/mldonkey/$',
|
||||||
service_id=mldonkey.managed_services[0],
|
ServiceView.as_view(service_id=mldonkey.managed_services[0],
|
||||||
diagnostics_module_name='mldonkey',
|
diagnostics_module_name='mldonkey',
|
||||||
description=mldonkey.description,
|
description=mldonkey.description,
|
||||||
clients=mldonkey.clients,
|
clients=mldonkey.clients, show_status_block=True),
|
||||||
show_status_block=True),
|
|
||||||
name='index'),
|
name='index'),
|
||||||
]
|
]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user