diff --git a/actions/mldonkey b/actions/mldonkey deleted file mode 100755 index f9156fb43..000000000 --- a/actions/mldonkey +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/python3 -# -*- mode: python -*- -# SPDX-License-Identifier: AGPL-3.0-or-later -""" -Configuration helper for mldonkey. -""" - -import argparse - -from plinth import action_utils - - -def parse_arguments(): - """Return parsed command line arguments as dictionary.""" - parser = argparse.ArgumentParser() - subparsers = parser.add_subparsers(dest='subcommand', help='Sub command') - - subparsers.add_parser('pre-install', help='Perform pre-install operations') - - subparsers.required = True - return parser.parse_args() - - -def subcommand_pre_install(_): - """Preseed debconf values before packages are installed.""" - action_utils.debconf_set_selections( - ['mldonkey-server mldonkey-server/launch_at_startup boolean true']) - - -def main(): - """Parse arguments and perform all duties.""" - arguments = parse_arguments() - - subcommand = arguments.subcommand.replace('-', '_') - subcommand_method = globals()['subcommand_' + subcommand] - subcommand_method(arguments) - - -if __name__ == '__main__': - main() diff --git a/debian/copyright b/debian/copyright index af2e62b80..cf2a8d8b0 100644 --- a/debian/copyright +++ b/debian/copyright @@ -7,7 +7,6 @@ License: AGPL-3+ Files: static/themes/default/icons/jsxc.png static/themes/default/icons/jsxc.svg - static/themes/default/icons/mldonkey.svg Copyright: 2011-2019 FreedomBox Authors License: AGPL-3+ diff --git a/debian/freedombox.maintscript b/debian/freedombox.maintscript index 128d02ff6..f299b3cf9 100644 --- a/debian/freedombox.maintscript +++ b/debian/freedombox.maintscript @@ -16,3 +16,4 @@ rm_conffile /etc/plinth/modules-enabled/coquelicot 20.14~ rm_conffile /etc/plinth/modules-enabled/diaspora 21.16~ rm_conffile /etc/plinth/modules-enabled/monkeysphere 21.16~ rm_conffile /etc/plinth/modules-enabled/tahoe 21.16~ +rm_conffile /etc/plinth/modules-enabled/mldonkey 22.4~ diff --git a/plinth/modules/help/tests/test_views.py b/plinth/modules/help/tests/test_views.py index 331ab07d9..dc8b86354 100644 --- a/plinth/modules/help/tests/test_views.py +++ b/plinth/modules/help/tests/test_views.py @@ -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', diff --git a/plinth/modules/mldonkey/__init__.py b/plinth/modules/mldonkey/__init__.py deleted file mode 100644 index 56801ed32..000000000 --- a/plinth/modules/mldonkey/__init__.py +++ /dev/null @@ -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) diff --git a/plinth/modules/mldonkey/data/etc/apache2/conf-available/mldonkey-freedombox.conf b/plinth/modules/mldonkey/data/etc/apache2/conf-available/mldonkey-freedombox.conf deleted file mode 100644 index 263c1361f..000000000 --- a/plinth/modules/mldonkey/data/etc/apache2/conf-available/mldonkey-freedombox.conf +++ /dev/null @@ -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. - - - RewriteEngine On - RewriteCond %{REQUEST_URI} ^/mldonkey$ - RewriteRule .* /mldonkey/ [R=301,L] - - - - - Include includes/freedombox-single-sign-on.conf - ProxyPass http://localhost:4080/ - - TKTAuthToken "admin" "ed2k" - - diff --git a/plinth/modules/mldonkey/data/etc/plinth/modules-enabled/mldonkey b/plinth/modules/mldonkey/data/etc/plinth/modules-enabled/mldonkey deleted file mode 100644 index 71bd026a0..000000000 --- a/plinth/modules/mldonkey/data/etc/plinth/modules-enabled/mldonkey +++ /dev/null @@ -1 +0,0 @@ -plinth.modules.mldonkey diff --git a/plinth/modules/mldonkey/data/usr/lib/systemd/system/mldonkey-server.service.d/freedombox.conf b/plinth/modules/mldonkey/data/usr/lib/systemd/system/mldonkey-server.service.d/freedombox.conf deleted file mode 100644 index d0256a633..000000000 --- a/plinth/modules/mldonkey/data/usr/lib/systemd/system/mldonkey-server.service.d/freedombox.conf +++ /dev/null @@ -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 diff --git a/plinth/modules/mldonkey/manifest.py b/plinth/modules/mldonkey/manifest.py deleted file mode 100644 index 25819b496..000000000 --- a/plinth/modules/mldonkey/manifest.py +++ /dev/null @@ -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'] -} diff --git a/plinth/modules/mldonkey/tests/__init__.py b/plinth/modules/mldonkey/tests/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/plinth/modules/mldonkey/tests/test_functional.py b/plinth/modules/mldonkey/tests/test_functional.py deleted file mode 100644 index ebd25118d..000000000 --- a/plinth/modules/mldonkey/tests/test_functional.py +++ /dev/null @@ -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')) diff --git a/plinth/modules/mldonkey/urls.py b/plinth/modules/mldonkey/urls.py deleted file mode 100644 index f96e85994..000000000 --- a/plinth/modules/mldonkey/urls.py +++ /dev/null @@ -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') -] diff --git a/pyproject.toml b/pyproject.toml index cd2800bfb..5e46e2701 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,6 @@ markers = [ "mediawiki", "minetest", "minidlna", - "mldonkey", "mumble", "openvpn", "pagekite", diff --git a/setup.py b/setup.py index 936690c98..093a046b1 100755 --- a/setup.py +++ b/setup.py @@ -48,6 +48,7 @@ DISABLED_APPS_TO_REMOVE = [ 'restore', 'repro', 'tahoe', + 'mldonkey', ] REMOVED_FILES = [ diff --git a/static/themes/default/icons/mldonkey.png b/static/themes/default/icons/mldonkey.png deleted file mode 100644 index 32bf32ce0..000000000 Binary files a/static/themes/default/icons/mldonkey.png and /dev/null differ diff --git a/static/themes/default/icons/mldonkey.svg b/static/themes/default/icons/mldonkey.svg deleted file mode 100644 index ad2e0d4b8..000000000 --- a/static/themes/default/icons/mldonkey.svg +++ /dev/null @@ -1,812 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -