mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
mldonkey: Drop app not available in Debian Bullseye and Bookworm
Closes: #2157. Original author of the app J. Carlos Romero <juancarlos.romero@gmail.com> has been contacted to see if there is interest in continuing to maintain the app. There has been no response. Since the app is not available even in the current stable (Bullseye), few users are presumably using it on a supported FreedomBox distribution. Any users are advised to maintain the manually instead of relying on FreedomBox for it. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
1 parent
e7399a4d8e
commit
668da20a02
16 files changed
+4
-1163
No files matched your search
@@ -109,8 +109,8 @@ MANUAL_PAGES = ('Apache_userdir', 'APU', 'Backups', 'BananaPro', 'BeagleBone',
|
||||
'freedombox-manual', 'GettingHelp', 'GitWeb', 'Hardware',
|
||||
'I2P', 'Ikiwiki', 'Infinoted', 'Introduction', 'JSXC',
|
||||
'LetsEncrypt', 'Maker', 'MatrixSynapse', 'MediaWiki',
|
||||
'Minetest', 'MiniDLNA', 'MLDonkey', 'Mumble', 'NameServices',
|
||||
'Networks', 'OpenVPN', 'OrangePiZero', 'PageKite', 'pcDuino3',
|
||||
'Minetest', 'MiniDLNA', 'Mumble', 'NameServices', 'Networks',
|
||||
'OpenVPN', 'OrangePiZero', 'PageKite', 'pcDuino3',
|
||||
'Performance', 'PineA64+', 'PioneerEdition', 'Plinth', 'Power',
|
||||
'Privoxy', 'Quassel', 'QuickStart', 'Radicale', 'RaspberryPi2',
|
||||
'RaspberryPi3B+', 'RaspberryPi3B', 'RaspberryPi4B',
|
||||
|
||||
@@ -1,107 +0,0 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
"""
|
||||
FreedomBox app for mldonkey.
|
||||
"""
|
||||
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from plinth import actions
|
||||
from plinth import app as app_module
|
||||
from plinth import cfg, frontpage, menu
|
||||
from plinth.daemon import Daemon
|
||||
from plinth.modules.apache.components import Webserver
|
||||
from plinth.modules.backups.components import BackupRestore
|
||||
from plinth.modules.firewall.components import Firewall
|
||||
from plinth.modules.users import add_user_to_share_group
|
||||
from plinth.modules.users.components import UsersAndGroups
|
||||
from plinth.package import Packages
|
||||
from plinth.utils import format_lazy
|
||||
|
||||
from . import manifest
|
||||
|
||||
_description = [
|
||||
_('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.'),
|
||||
_('Users belonging to admin and ed2k group can control it through the web '
|
||||
'interface. Users in the admin group can also control it through any of '
|
||||
'the separate mobile or desktop front-ends or a telnet interface. See '
|
||||
'manual.'),
|
||||
format_lazy(
|
||||
_('On {box_name}, downloaded files can be found in /var/lib/mldonkey/ '
|
||||
'directory.'), box_name=cfg.box_name)
|
||||
]
|
||||
|
||||
_SYSTEM_USER = 'mldonkey'
|
||||
|
||||
app = None
|
||||
|
||||
|
||||
class MLDonkeyApp(app_module.App):
|
||||
"""FreedomBox app for MLDonkey."""
|
||||
|
||||
app_id = 'mldonkey'
|
||||
|
||||
_version = 2
|
||||
|
||||
DAEMON = 'mldonkey-server'
|
||||
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
|
||||
groups = {'ed2k': _('Download files using eDonkey applications')}
|
||||
|
||||
info = app_module.Info(
|
||||
app_id=self.app_id, version=self._version, name=_('MLDonkey'),
|
||||
icon_filename='mldonkey',
|
||||
short_description=_('Peer-to-peer File Sharing'),
|
||||
description=_description, manual_page='MLDonkey',
|
||||
clients=manifest.clients)
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-mldonkey', info.name,
|
||||
info.short_description, info.icon_filename,
|
||||
'mldonkey:index', parent_url_name='apps')
|
||||
self.add(menu_item)
|
||||
|
||||
shortcuts = frontpage.Shortcut(
|
||||
'shortcut-mldonkey', info.name,
|
||||
short_description=info.short_description, icon=info.icon_filename,
|
||||
url='/mldonkey/', login_required=True, clients=info.clients,
|
||||
allowed_groups=list(groups))
|
||||
self.add(shortcuts)
|
||||
|
||||
packages = Packages('packages-mldonkey', ['mldonkey-server'])
|
||||
self.add(packages)
|
||||
|
||||
firewall = Firewall('firewall-mldonkey', info.name,
|
||||
ports=['http', 'https'], is_external=True)
|
||||
self.add(firewall)
|
||||
|
||||
webserver = Webserver('webserver-mldonkey', 'mldonkey-freedombox',
|
||||
urls=['https://{host}/mldonkey/'])
|
||||
self.add(webserver)
|
||||
|
||||
daemon = Daemon('daemon-mldonkey', self.DAEMON,
|
||||
listen_ports=[(4080, 'tcp4')])
|
||||
self.add(daemon)
|
||||
|
||||
users_and_groups = UsersAndGroups('users-and-groups-mldonkey',
|
||||
reserved_usernames=[_SYSTEM_USER],
|
||||
groups=groups)
|
||||
self.add(users_and_groups)
|
||||
|
||||
backup_restore = BackupRestore('backup-restore-mldonkey',
|
||||
**manifest.backup)
|
||||
self.add(backup_restore)
|
||||
|
||||
|
||||
def setup(helper, old_version=None):
|
||||
"""Install and configure the module."""
|
||||
helper.call('pre', actions.superuser_run, 'mldonkey', ['pre-install'])
|
||||
app.setup(old_version)
|
||||
if not old_version:
|
||||
helper.call('post', app.enable)
|
||||
|
||||
add_user_to_share_group(_SYSTEM_USER, MLDonkeyApp.DAEMON)
|
||||
@@ -1,21 +0,0 @@
|
||||
##
|
||||
## On all sites, provide mldonkey web interface on a path: /mldonkey
|
||||
##
|
||||
|
||||
# Redirect /mldonkey to /mldonkey/ as the MLdonkey server web interface does not
|
||||
# work without a slash at the end.
|
||||
<Location ~ ^/mldonkey$>
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_URI} ^/mldonkey$
|
||||
RewriteRule .* /mldonkey/ [R=301,L]
|
||||
</IfModule>
|
||||
</Location>
|
||||
|
||||
<Location /mldonkey/>
|
||||
Include includes/freedombox-single-sign-on.conf
|
||||
ProxyPass http://localhost:4080/
|
||||
<IfModule mod_auth_pubtkt.c>
|
||||
TKTAuthToken "admin" "ed2k"
|
||||
</IfModule>
|
||||
</Location>
|
||||
@@ -1 +0,0 @@
|
||||
plinth.modules.mldonkey
|
||||
-35
@@ -1,35 +0,0 @@
|
||||
[Unit]
|
||||
Description=MLDonkey: Multi-protocol, peer-to-peer file sharing server
|
||||
After=syslog.target network.target nslcd.service
|
||||
ConditionPathExists=/var/lib/mldonkey/downloads.ini
|
||||
Documentation=man:mlnet(1) http://mldonkey.sourceforge.net/Main_Page
|
||||
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=/usr/bin/mlnet
|
||||
ExecStop=
|
||||
Group=mldonkey
|
||||
IgnoreSIGPIPE=yes
|
||||
KillMode=control-group
|
||||
LockPersonality=yes
|
||||
NoNewPrivileges=yes
|
||||
PrivateDevices=yes
|
||||
PrivateMounts=yes
|
||||
PrivateTmp=yes
|
||||
ProtectControlGroups=yes
|
||||
ProtectHome=yes
|
||||
ProtectKernelLogs=yes
|
||||
ProtectKernelModules=yes
|
||||
ProtectKernelTunables=yes
|
||||
ProtectSystem=full
|
||||
RemainAfterExit=no
|
||||
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
|
||||
RestrictRealtime=yes
|
||||
StateDirectory=mldonkey
|
||||
SystemCallArchitectures=native
|
||||
Type=simple
|
||||
User=mldonkey
|
||||
WorkingDirectory=/var/lib/mldonkey
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -1,57 +0,0 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
"""
|
||||
Application manifest for mldonkey.
|
||||
"""
|
||||
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from plinth.clients import store_url
|
||||
|
||||
clients = [{
|
||||
'name': _('MLDonkey'),
|
||||
'platforms': [{
|
||||
'type': 'web',
|
||||
'url': '/mldonkey/'
|
||||
}]
|
||||
}, {
|
||||
'name':
|
||||
_('KMLDonkey'),
|
||||
'platforms': [{
|
||||
'type': 'download',
|
||||
'os': 'gnu-linux',
|
||||
'url': 'https://www.kde.org/applications/internet/kmldonkey/'
|
||||
}, {
|
||||
'type': 'package',
|
||||
'format': 'deb',
|
||||
'name': 'kmldonkey',
|
||||
}]
|
||||
}, {
|
||||
'name':
|
||||
_('AMLDonkey'),
|
||||
'platforms': [{
|
||||
'type': 'store',
|
||||
'os': 'android',
|
||||
'store_name': 'google-play',
|
||||
'url': store_url('google-play', 'com.devwom.amldonkey'),
|
||||
}]
|
||||
}]
|
||||
|
||||
backup = {
|
||||
'config': {
|
||||
'files': [
|
||||
'/var/lib/mldonkey/bittorrent.ini', '/var/lib/mldonkey/bt_dht.ini',
|
||||
'/var/lib/mldonkey/directconnect.ini',
|
||||
'/var/lib/mldonkey/donkey.ini', '/var/lib/mldonkey/downloads.ini',
|
||||
'/var/lib/mldonkey/files.ini',
|
||||
'/var/lib/mldonkey/file_sources.ini',
|
||||
'/var/lib/mldonkey/fileTP.ini', '/var/lib/mldonkey/friends.ini',
|
||||
'/var/lib/mldonkey/searches.ini', '/var/lib/mldonkey/servers.ini',
|
||||
'/var/lib/mldonkey/shared_files.ini',
|
||||
'/var/lib/mldonkey/shared_files_new.ini',
|
||||
'/var/lib/mldonkey/statistics.ini',
|
||||
'/var/lib/mldonkey/stats_bt.ini', '/var/lib/mldonkey/stats.ini',
|
||||
'/var/lib/mldonkey/stats_mod.ini', '/var/lib/mldonkey/users.ini'
|
||||
]
|
||||
},
|
||||
'services': ['mldonkey-server']
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,73 +0,0 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
"""
|
||||
Functional, browser based tests for mldonkey app.
|
||||
"""
|
||||
|
||||
import pytest
|
||||
from plinth.tests import functional
|
||||
|
||||
pytestmark = [
|
||||
pytest.mark.apps, pytest.mark.mldonkey, pytest.mark.sso, pytest.mark.skip
|
||||
]
|
||||
|
||||
|
||||
class TestMldonkeyApp(functional.BaseAppTests):
|
||||
app_name = 'mldonkey'
|
||||
has_service = True
|
||||
has_web = True
|
||||
|
||||
def test_upload(self, session_browser):
|
||||
"""Test uploading an ed2k file to mldonkey."""
|
||||
functional.app_enable(session_browser, 'mldonkey')
|
||||
_remove_all_ed2k_files(session_browser)
|
||||
_upload_sample_ed2k_file(session_browser)
|
||||
assert _get_number_of_ed2k_files(session_browser) == 1
|
||||
|
||||
def test_backup_restore(self, session_browser):
|
||||
"""Test backup and restore of ed2k files."""
|
||||
functional.app_enable(session_browser, 'mldonkey')
|
||||
_remove_all_ed2k_files(session_browser)
|
||||
_upload_sample_ed2k_file(session_browser)
|
||||
functional.backup_create(session_browser, 'mldonkey', 'test_mldonkey')
|
||||
|
||||
_remove_all_ed2k_files(session_browser)
|
||||
functional.backup_restore(session_browser, 'mldonkey', 'test_mldonkey')
|
||||
|
||||
assert functional.service_is_running(session_browser, 'mldonkey')
|
||||
assert _get_number_of_ed2k_files(session_browser) == 1
|
||||
|
||||
|
||||
def _submit_command(browser, command):
|
||||
"""Submit a command to mldonkey."""
|
||||
with browser.get_iframe('commands') as commands_frame:
|
||||
commands_frame.find_by_css('.txt2').fill(command)
|
||||
commands_frame.find_by_css('.but2').click()
|
||||
|
||||
|
||||
def _remove_all_ed2k_files(browser):
|
||||
"""Remove all ed2k files from mldonkey."""
|
||||
functional.visit(browser, '/mldonkey/')
|
||||
_submit_command(browser, 'cancel all')
|
||||
_submit_command(browser, 'confirm yes')
|
||||
|
||||
|
||||
def _upload_sample_ed2k_file(browser):
|
||||
"""Upload a sample ed2k file into mldonkey."""
|
||||
functional.visit(browser, '/mldonkey/')
|
||||
dllink_command = 'dllink ed2k://|file|foo.bar|123|' \
|
||||
'0123456789ABCDEF0123456789ABCDEF|/'
|
||||
_submit_command(browser, dllink_command)
|
||||
|
||||
|
||||
def _get_number_of_ed2k_files(browser):
|
||||
"""Return the number of ed2k files currently in mldonkey."""
|
||||
functional.visit(browser, '/mldonkey/')
|
||||
|
||||
with browser.get_iframe('commands') as commands_frame:
|
||||
commands_frame.find_by_xpath(
|
||||
'//tr//td[contains(text(), "Transfers")]').click()
|
||||
|
||||
with browser.get_iframe('output') as output_frame:
|
||||
functional.eventually(output_frame.find_by_css, ['.downloaded'])
|
||||
return len(output_frame.find_by_css('.dl-1')) + len(
|
||||
output_frame.find_by_css('.dl-2'))
|
||||
@@ -1,13 +0,0 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
"""
|
||||
URLs for the mldonkey module.
|
||||
"""
|
||||
|
||||
from django.urls import re_path
|
||||
|
||||
from plinth.views import AppView
|
||||
|
||||
urlpatterns = [
|
||||
re_path(r'^apps/mldonkey/$', AppView.as_view(app_id='mldonkey'),
|
||||
name='index')
|
||||
]
|
||||
Reference in new issue
Block a user