From b3d5d684484953f902b863705af5d681b4a1191d Mon Sep 17 00:00:00 2001 From: Benedek Nagy Date: Tue, 26 Apr 2022 21:03:07 +0000 Subject: [PATCH 01/24] mediawiki: Add stricter sandbox rules for jobrunner service Tests: - Run ./setup.py install and check that 'systemctl daemon-reload; systemctl show mediawiki-jobrunner.service' shows the required sandbox changes. - Tested a few MediaWiki jobs. See: https://salsa.debian.org/freedombox-team/freedombox/-/issues/299#note_306788 [sunil: Relax the restrictions on read/write paths and networking] Signed-off-by: Sunil Mohan Adapa Reviewed-by: Sunil Mohan Adapa Tested-by: Sunil Mohan Adapa --- .../freedombox.conf | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 plinth/modules/mediawiki/data/usr/lib/systemd/system/mediawiki-jobrunner.service.d/freedombox.conf diff --git a/plinth/modules/mediawiki/data/usr/lib/systemd/system/mediawiki-jobrunner.service.d/freedombox.conf b/plinth/modules/mediawiki/data/usr/lib/systemd/system/mediawiki-jobrunner.service.d/freedombox.conf new file mode 100644 index 000000000..0c9fe63ce --- /dev/null +++ b/plinth/modules/mediawiki/data/usr/lib/systemd/system/mediawiki-jobrunner.service.d/freedombox.conf @@ -0,0 +1,28 @@ +[Service] +CacheDirectory=mediawiki +CapabilityBoundingSet=~CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_SETUID CAP_SETGID CAP_SETPCAP CAP_CHOWN CAP_FSETID CAP_SETFCAP CAP_DAC_OVERRIDE CAP_DAC_READ_SEARCH CAP_FOWNER CAP_IPC_OWNER CAP_NET_ADMIN CAP_AUDIT_CONTROL CAP_AUDIT_READ CAP_AUDIT_WRITE CAP_KILL CAP_NET_BIND_SERVICE CAP_NET_BROADCAST CAP_NET_RAW CAP_LINUX_IMMUTABLE CAP_IPC_LOCK CAP_SYS_CHROOT CAP_BLOCK_SUSPEND CAP_LEASE CAP_SYS_PACCT CAP_SYS_TTY_CONFIG CAP_SYS_BOOT CAP_MAC_ADMIN CAP_MAC_OVERRIDE CAP_SYS_NICE CAP_SYS_RESOURCE +DevicePolicy=closed +LockPersonality=yes +NoNewPrivileges=yes +PrivateMounts=yes +PrivateUsers=yes +ProtectControlGroups=yes +ProtectClock=yes +ProtectHome=yes +ProtectHostname=yes +ProtectKernelLogs=yes +ProtectKernelModules=yes +ProtectKernelTunables=yes +ProtectProc=invisible +ProtectSystem=strict +ReadWritePaths=/var/lib/mediawiki /var/lib/mediawiki-db +RemoveIPC=yes +RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_NETLINK +RestrictNamespaces=yes +RestrictSUIDSGID=yes +RestrictRealtime=yes +SystemCallArchitectures=native +SystemCallFilter=@system-service +SystemCallFilter=~@resources +SystemCallFilter=~@privileged +SystemCallErrorNumber=EPERM From 1dcfa06dd8c1f0cc6d17fdef170e33231cbbfcdd Mon Sep 17 00:00:00 2001 From: Benedek Nagy Date: Sat, 5 Feb 2022 17:49:57 +0000 Subject: [PATCH 02/24] mediawiki: Serve hidden service over http for .onion domains [sunil: rename the form field variable] [sunil: rename the parater to get/set_server_url functions] [sunil: remove unused PrependWidget, can be added back later] [sunil: update functional tests] Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy Reviewed-by: Sunil Mohan Adapa --- plinth/modules/mediawiki/__init__.py | 8 +++-- plinth/modules/mediawiki/forms.py | 35 +++---------------- .../mediawiki/tests/test_functional.py | 13 +++---- .../modules/mediawiki/tests/test_settings.py | 6 ++-- plinth/modules/mediawiki/views.py | 8 ++--- 5 files changed, 24 insertions(+), 46 deletions(-) diff --git a/plinth/modules/mediawiki/__init__.py b/plinth/modules/mediawiki/__init__.py index 5dd860795..f2215ab09 100644 --- a/plinth/modules/mediawiki/__init__.py +++ b/plinth/modules/mediawiki/__init__.py @@ -157,7 +157,11 @@ def get_server_url(): return urlparse(server_url).netloc -def set_server_url(server_url): +def set_server_url(domain): """Set the value of $wgServer.""" + protocol = 'https' + if domain.endswith('.onion'): + protocol = 'http' + actions.superuser_run('mediawiki', - ['set-server-url', f'https://{server_url}']) + ['set-server-url', f'{protocol}://{domain}']) diff --git a/plinth/modules/mediawiki/forms.py b/plinth/modules/mediawiki/forms.py index eac74de63..b672865a8 100644 --- a/plinth/modules/mediawiki/forms.py +++ b/plinth/modules/mediawiki/forms.py @@ -6,8 +6,6 @@ FreedomBox app for configuring MediaWiki. import pathlib from django import forms -from django.forms import Widget -from django.utils.safestring import mark_safe from django.utils.translation import gettext_lazy as _ @@ -21,31 +19,6 @@ def get_skins(): if skin.is_dir()] -class PrependWidget(Widget): - """Widget to create input-groups with prepended text.""" - - def __init__(self, base_widget, data, *args, **kwargs): - """Initialize widget and get base instance""" - super(PrependWidget, self).__init__(*args, **kwargs) - self.base_widget = base_widget(*args, **kwargs) - self.data = data - - def render(self, name, value, attrs=None, renderer=None): - """Render base widget and add bootstrap spans.""" - attrs['class'] = 'form-control' - field = self.base_widget.render(name, value, attrs, renderer) - widget_html = ''' -
- - - %(data)s - - - %(field)s -
''' - return mark_safe((widget_html) % {'field': field, 'data': self.data}) - - class MediaWikiForm(forms.Form): # pylint: disable=W0232 """MediaWiki configuration form.""" password = forms.CharField( @@ -56,11 +29,11 @@ class MediaWikiForm(forms.Form): # pylint: disable=W0232 'Leave this field blank to keep the current password.'), required=False, widget=forms.PasswordInput, min_length=10) - server_url = forms.CharField( - label=_('Server URL'), required=False, help_text=_( + domain = forms.CharField( + label=_('Domain'), required=False, help_text=_( 'Used by MediaWiki to generate URLs that point to the wiki ' - 'such as in footer, feeds and emails.'), - widget=PrependWidget(base_widget=forms.TextInput, data='https://')) + 'such as in footer, feeds and emails. Examples: ' + '"myfreedombox.example.org" or "example.onion".')) enable_public_registrations = forms.BooleanField( label=_('Enable public registrations'), required=False, diff --git a/plinth/modules/mediawiki/tests/test_functional.py b/plinth/modules/mediawiki/tests/test_functional.py index 4382176eb..768521950 100644 --- a/plinth/modules/mediawiki/tests/test_functional.py +++ b/plinth/modules/mediawiki/tests/test_functional.py @@ -6,8 +6,9 @@ Functional, browser based tests for mediawiki app. import pathlib from urllib.parse import urlparse -import requests import pytest +import requests + from plinth.tests import functional from plinth.tests.functional import config @@ -24,7 +25,7 @@ class TestMediawikiApp(functional.BaseAppTests): """Setup the app.""" functional.login(session_browser) functional.install(session_browser, 'mediawiki') - _set_server_url(session_browser) + _set_domain(session_browser) def test_public_registrations(self, session_browser): """Test enabling public registrations.""" @@ -241,9 +242,9 @@ def __has_main_page(browser): return 'This page has been deleted.' not in content.text -def _set_server_url(browser): - """Set the value of server url to the value in the given env_var.""" +def _set_domain(browser): + """Set the value of domain to the value in the given env_var.""" functional.nav_to_module(browser, 'mediawiki') - server_url = urlparse(config['DEFAULT']['url']).netloc - browser.find_by_id('id_server_url').fill(server_url) + domain = urlparse(config['DEFAULT']['url']).netloc + browser.find_by_id('id_domain').fill(domain) functional.submit(browser, form_class='form-configuration') diff --git a/plinth/modules/mediawiki/tests/test_settings.py b/plinth/modules/mediawiki/tests/test_settings.py index e5db63689..3ffc87b18 100644 --- a/plinth/modules/mediawiki/tests/test_settings.py +++ b/plinth/modules/mediawiki/tests/test_settings.py @@ -63,6 +63,6 @@ def test_default_skin(): def test_server_url(): """Test getting and setting $wgServer.""" assert mediawiki.get_server_url() == 'freedombox.local' - new_server_url = 'mydomain.freedombox.rocks' - mediawiki.set_server_url(new_server_url) - assert mediawiki.get_server_url() == new_server_url + new_domain = 'mydomain.freedombox.rocks' + mediawiki.set_server_url(new_domain) + assert mediawiki.get_server_url() == new_domain diff --git a/plinth/modules/mediawiki/views.py b/plinth/modules/mediawiki/views.py index 44401433b..e6f2203b6 100644 --- a/plinth/modules/mediawiki/views.py +++ b/plinth/modules/mediawiki/views.py @@ -32,7 +32,7 @@ class MediaWikiAppView(views.AppView): 'enable_public_registrations': is_public_registration_enabled(), 'enable_private_mode': is_private_mode_enabled(), 'default_skin': get_default_skin(), - 'server_url': get_server_url() + 'domain': get_server_url() }) return initial @@ -93,8 +93,8 @@ class MediaWikiAppView(views.AppView): mediawiki.set_default_skin(new_config['default_skin']) messages.success(self.request, _('Default skin changed')) - if is_changed('server_url'): - mediawiki.set_server_url(new_config['server_url']) - messages.success(self.request, _('Server URL updated')) + if is_changed('domain'): + mediawiki.set_server_url(new_config['domain']) + messages.success(self.request, _('Domain name updated')) return super().form_valid(form) From 10fb0cae749cb45f593b239dabcdac5678b8b014 Mon Sep 17 00:00:00 2001 From: Benedek Nagy Date: Tue, 10 May 2022 20:34:50 +0000 Subject: [PATCH 03/24] tt-rss: Fix description about user access Reviewed-by: Sunil Mohan Adapa --- plinth/modules/ttrss/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plinth/modules/ttrss/__init__.py b/plinth/modules/ttrss/__init__.py index be2926be4..faf970de5 100644 --- a/plinth/modules/ttrss/__init__.py +++ b/plinth/modules/ttrss/__init__.py @@ -24,9 +24,10 @@ _description = [ 'designed to allow reading news from any location, while feeling as ' 'close to a real desktop application as possible.'), format_lazy( - _('When enabled, Tiny Tiny RSS can be accessed by any ' - 'user with a {box_name} login.'), - box_name=_(cfg.box_name), users_url=reverse_lazy('users:index')), + _('When enabled, Tiny Tiny RSS can be accessed by ' + 'any user belonging to the ' + 'feed-reader group.'), box_name=_(cfg.box_name), + users_url=reverse_lazy('users:index')), format_lazy( _('When using a mobile or desktop application for Tiny Tiny RSS, use ' 'the URL /tt-rss-app for connecting.')) From 7531870e4576a0e65795246e802dd87e53dba560 Mon Sep 17 00:00:00 2001 From: ikmaak Date: Tue, 10 May 2022 06:23:39 +0000 Subject: [PATCH 04/24] Translated using Weblate (German) Currently translated at 100.0% (1441 of 1441 strings) --- plinth/locale/de/LC_MESSAGES/django.po | 31 +++++++++++++------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/plinth/locale/de/LC_MESSAGES/django.po b/plinth/locale/de/LC_MESSAGES/django.po index 9740afc0c..e3c821714 100644 --- a/plinth/locale/de/LC_MESSAGES/django.po +++ b/plinth/locale/de/LC_MESSAGES/django.po @@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: FreedomBox UI\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-05-09 22:12-0400\n" -"PO-Revision-Date: 2022-04-26 00:11+0000\n" +"PO-Revision-Date: 2022-05-11 16:16+0000\n" "Last-Translator: ikmaak \n" "Language-Team: German \n" @@ -19,7 +19,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.12.1-dev\n" +"X-Generator: Weblate 4.12.1\n" #: doc/dev/_templates/layout.html:11 msgid "Page source" @@ -3379,10 +3379,6 @@ msgid "Administrator Password" msgstr "Administrator-Passwort" #: plinth/modules/mediawiki/forms.py:53 -#, fuzzy -#| msgid "" -#| "Set a new password for MediaWiki's administrator account (admin). Leave " -#| "this field blank to keep the current password." msgid "" "Set a new password for MediaWiki's administrator account (admin). The " "password cannot be a common one and the minimum required length is " @@ -3390,7 +3386,9 @@ msgid "" "password." msgstr "" "Geben Sie ein neues Passwort für den MediaWiki-Administrator ein (admin). " -"Lassen Sie das Feld leer, bleibt das derzeitige Passwort bestehen." +"Das Passwort darf nicht allgemein bekannt sein und muss mindestens " +"10 Zeichen lang sein. Lassen Sie das Feld leer, bleibt das " +"derzeitige Passwort bestehen." #: plinth/modules/mediawiki/forms.py:60 msgid "Server URL" @@ -3446,12 +3444,10 @@ msgid "Password updated" msgstr "Passwort geändert" #: plinth/modules/mediawiki/views.py:56 -#, fuzzy -#| msgid "Password used to encrypt data. Must match server password." msgid "Password update failed. Please choose a stronger password" msgstr "" -"Passwort, um Daten zu verschlüsseln. Muss mit dem Server-Passwort " -"übereinstimmen." +"Kennwortaktualisierung fehlgeschlagen. Bitte wählen Sie ein stärkeres " +"Passwort" #: plinth/modules/mediawiki/views.py:66 msgid "Public registrations enabled" @@ -6975,18 +6971,17 @@ msgid "" "Compared to Deluge, Transmission is simpler and " "lightweight but is less customizable." msgstr "" +"Im Vergleich zu Deluge ist Transmission " +"einfacher und leichter, aber weniger anpassbar." #: plinth/modules/transmission/__init__.py:35 -#, fuzzy, python-brace-format -#| msgid "" -#| "It can be accessed by any user on {box_name} " -#| "belonging to the admin group." +#, python-brace-format msgid "" "It can be accessed by any user on {box_name} " "belonging to the bit-torrent group." msgstr "" "Auf sie kann von jedem Benutzer auf der " -"{box_name} zugegriffen werden, der zur Administratorgruppe gehören." +"{box_name} zugegriffen werden, der zur Bit-Torrent-Gruppe gehören." #: plinth/modules/transmission/__init__.py:39 #, python-brace-format @@ -6994,6 +6989,8 @@ msgid "" "Samba shares can be set as the default download " "directory from the dropdown menu below." msgstr "" +"Samba Freigaben können über das untenstehende " +"Dropdown-Menü als Standard-Downloadverzeichnis festgelegt werden." #: plinth/modules/transmission/__init__.py:43 #, python-brace-format @@ -7001,6 +6998,8 @@ msgid "" "After a download has completed, you can also access your files using the Sharing app." msgstr "" +"Nachdem ein Download abgeschlossen ist, können Sie auch über die App Sharing auf Ihre Dateien zugreifen." #: plinth/modules/transmission/__init__.py:71 #: plinth/modules/transmission/manifest.py:6 From 7b47fb31571f4743eb89c0acd62730319ca0fdaa Mon Sep 17 00:00:00 2001 From: John Doe Date: Tue, 10 May 2022 15:46:27 +0000 Subject: [PATCH 05/24] Translated using Weblate (French) Currently translated at 100.0% (1441 of 1441 strings) --- plinth/locale/fr/LC_MESSAGES/django.po | 32 +++++++++++++------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/plinth/locale/fr/LC_MESSAGES/django.po b/plinth/locale/fr/LC_MESSAGES/django.po index 582b72b21..e700f87e0 100644 --- a/plinth/locale/fr/LC_MESSAGES/django.po +++ b/plinth/locale/fr/LC_MESSAGES/django.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: FreedomBox UI\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-05-09 22:12-0400\n" -"PO-Revision-Date: 2022-05-04 13:15+0000\n" -"Last-Translator: Coucouf \n" +"PO-Revision-Date: 2022-05-11 16:16+0000\n" +"Last-Translator: John Doe \n" "Language-Team: French \n" "Language: fr\n" @@ -3401,10 +3401,6 @@ msgid "Administrator Password" msgstr "Mot de passe administrateur" #: plinth/modules/mediawiki/forms.py:53 -#, fuzzy -#| msgid "" -#| "Set a new password for MediaWiki's administrator account (admin). Leave " -#| "this field blank to keep the current password." msgid "" "Set a new password for MediaWiki's administrator account (admin). The " "password cannot be a common one and the minimum required length is " @@ -3412,7 +3408,9 @@ msgid "" "password." msgstr "" "Définir un nouveau mot de passe pour le compte d'administration de MediaWiki " -"(admin). Laissez ce champ vide pour conserver le mot de passe actuel." +"(admin). Le mot de passe ne peut pas être courant et la taille minimale " +"requise est de 10 caractères. Laissez ce champ vide pour " +"conserver le mot de passe actuel." #: plinth/modules/mediawiki/forms.py:60 msgid "Server URL" @@ -3468,12 +3466,10 @@ msgid "Password updated" msgstr "Mot de passe mis à jour" #: plinth/modules/mediawiki/views.py:56 -#, fuzzy -#| msgid "Password used to encrypt data. Must match server password." msgid "Password update failed. Please choose a stronger password" msgstr "" -"Mot de passe utilisé pour chiffrer les données. Doit correspondre au mot de " -"passe du serveur." +"Échec de la mise à jour du mot passe. Veuillez utiliser un mot de passe plus " +"fort." #: plinth/modules/mediawiki/views.py:66 msgid "Public registrations enabled" @@ -7019,18 +7015,17 @@ msgid "" "Compared to Deluge, Transmission is simpler and " "lightweight but is less customizable." msgstr "" +"Comparé à Deluge, Transmission est plus simple " +"et léger mais moins personnalisable." #: plinth/modules/transmission/__init__.py:35 -#, fuzzy, python-brace-format -#| msgid "" -#| "It can be accessed by any user on {box_name} " -#| "belonging to the admin group." +#, python-brace-format msgid "" "It can be accessed by any user on {box_name} " "belonging to the bit-torrent group." msgstr "" "L’accès est autorisé à tout utilisateur faisant " -"partie du groupe admin sur la {box_name}." +"partie du groupe bit-torrent sur la {box_name}." #: plinth/modules/transmission/__init__.py:39 #, python-brace-format @@ -7038,6 +7033,9 @@ msgid "" "Samba shares can be set as the default download " "directory from the dropdown menu below." msgstr "" +"Les partages Samba peuvent être définis en tant " +"que répertoire de téléchargement par défaut depuis le menu déroulant ci-" +"dessous." #: plinth/modules/transmission/__init__.py:43 #, python-brace-format @@ -7045,6 +7043,8 @@ msgid "" "After a download has completed, you can also access your files using the Sharing app." msgstr "" +"Une fois qu'un téléchargement est terminé, vous pouvez également accéder à " +"vos fichiers au moyen de l'application Partage." #: plinth/modules/transmission/__init__.py:71 #: plinth/modules/transmission/manifest.py:6 From 1aeb99953c7733f69ff410479ca808a279ee4669 Mon Sep 17 00:00:00 2001 From: ikmaak Date: Tue, 10 May 2022 06:18:16 +0000 Subject: [PATCH 06/24] Translated using Weblate (Dutch) Currently translated at 100.0% (1441 of 1441 strings) --- plinth/locale/nl/LC_MESSAGES/django.po | 32 +++++++++++--------------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/plinth/locale/nl/LC_MESSAGES/django.po b/plinth/locale/nl/LC_MESSAGES/django.po index 74a81276b..660d2fdb6 100644 --- a/plinth/locale/nl/LC_MESSAGES/django.po +++ b/plinth/locale/nl/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-05-09 22:12-0400\n" -"PO-Revision-Date: 2022-04-26 00:11+0000\n" +"PO-Revision-Date: 2022-05-11 16:16+0000\n" "Last-Translator: ikmaak \n" "Language-Team: Dutch \n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.12.1-dev\n" +"X-Generator: Weblate 4.12.1\n" "X-Language: nl_NL\n" "X-Source-Language: C\n" @@ -3351,18 +3351,15 @@ msgid "Administrator Password" msgstr "Beheerderswachtwoord" #: plinth/modules/mediawiki/forms.py:53 -#, fuzzy -#| msgid "" -#| "Set a new password for MediaWiki's administrator account (admin). Leave " -#| "this field blank to keep the current password." msgid "" "Set a new password for MediaWiki's administrator account (admin). The " "password cannot be a common one and the minimum required length is " "10 characters. Leave this field blank to keep the current " "password." msgstr "" -"Stel een nieuw wachtwoord in voor MediaWiki's beheerdersaccount (admin). " -"Laat dit veld leeg om het huidige wachtwoord te behouden." +"Stel een nieuw wachtwoord in voor MediaWiki's beheerdersaccount (admin). Dit " +"wachtwoord moet minimaal 10 tekens zijn, en niet makkelijk " +"te raden. Laat dit veld leeg om het huidige wachtwoord te behouden." #: plinth/modules/mediawiki/forms.py:60 msgid "Server URL" @@ -3418,12 +3415,8 @@ msgid "Password updated" msgstr "Wachtwoord bijgewerkt" #: plinth/modules/mediawiki/views.py:56 -#, fuzzy -#| msgid "Password used to encrypt data. Must match server password." msgid "Password update failed. Please choose a stronger password" -msgstr "" -"Wachtwoord dat wordt gebruikt om gegevens te coderen. Moet overeenkomen met " -"serverwachtwoord." +msgstr "Wachtwoordupdate mislukt. Kies een sterker wachtwoord" #: plinth/modules/mediawiki/views.py:66 msgid "Public registrations enabled" @@ -6910,18 +6903,17 @@ msgid "" "Compared to Deluge, Transmission is simpler and " "lightweight but is less customizable." msgstr "" +"Vergeleken met Deluge is Transmission " +"eenvoudiger en lichter, maar minder aanpasbaar." #: plinth/modules/transmission/__init__.py:35 -#, fuzzy, python-brace-format -#| msgid "" -#| "It can be accessed by any user on {box_name} " -#| "belonging to the admin group." +#, python-brace-format msgid "" "It can be accessed by any user on {box_name} " "belonging to the bit-torrent group." msgstr "" "Het kan geraadpleegd worden door iedere gebruiker op {box_name} die lid is van de systeembeheerdergroep (admin)." +"a> op {box_name} die lid is van de bit-torrent groep (admin)." #: plinth/modules/transmission/__init__.py:39 #, python-brace-format @@ -6929,6 +6921,8 @@ msgid "" "Samba shares can be set as the default download " "directory from the dropdown menu below." msgstr "" +"Samba-shares kunnen worden ingesteld als de " +"standaard downloadmap in het keuzemenu hieronder." #: plinth/modules/transmission/__init__.py:43 #, python-brace-format @@ -6936,6 +6930,8 @@ msgid "" "After a download has completed, you can also access your files using the Sharing app." msgstr "" +"Nadat een download is voltooid, is toegang tot de bestanden ook mogelijk met " +"behulp van de app Sharing." #: plinth/modules/transmission/__init__.py:71 #: plinth/modules/transmission/manifest.py:6 From 45f346d8b70ec2ac967570c1bd4191a5a4e1ab26 Mon Sep 17 00:00:00 2001 From: Burak Yavuz Date: Tue, 10 May 2022 04:43:35 +0000 Subject: [PATCH 07/24] Translated using Weblate (Turkish) Currently translated at 100.0% (1441 of 1441 strings) --- plinth/locale/tr/LC_MESSAGES/django.po | 34 ++++++++++++-------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/plinth/locale/tr/LC_MESSAGES/django.po b/plinth/locale/tr/LC_MESSAGES/django.po index 0174bca54..25bc468a9 100644 --- a/plinth/locale/tr/LC_MESSAGES/django.po +++ b/plinth/locale/tr/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-05-09 22:12-0400\n" -"PO-Revision-Date: 2022-04-21 09:08+0000\n" +"PO-Revision-Date: 2022-05-11 16:16+0000\n" "Last-Translator: Burak Yavuz \n" "Language-Team: Turkish \n" @@ -16,7 +16,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.12-dev\n" +"X-Generator: Weblate 4.12.1\n" #: doc/dev/_templates/layout.html:11 msgid "Page source" @@ -3330,18 +3330,15 @@ msgid "Administrator Password" msgstr "Yönetici Parolası" #: plinth/modules/mediawiki/forms.py:53 -#, fuzzy -#| msgid "" -#| "Set a new password for MediaWiki's administrator account (admin). Leave " -#| "this field blank to keep the current password." msgid "" "Set a new password for MediaWiki's administrator account (admin). The " "password cannot be a common one and the minimum required length is " "10 characters. Leave this field blank to keep the current " "password." msgstr "" -"MediaWiki'nin yönetici hesabı (admin) için yeni bir parola ayarlayın. Şu " -"anki parolayı korumak için bu alanı boş bırakın." +"MediaWiki'nin yönetici hesabı (admin) için yeni bir parola ayarlayın. Parola " +"ortak bir parola olamaz ve gereken en az uzunluk 10 karakterdir. Şu anki parolayı korumak için bu alanı boş bırakın." #: plinth/modules/mediawiki/forms.py:60 msgid "Server URL" @@ -3397,12 +3394,8 @@ msgid "Password updated" msgstr "Parola güncellendi" #: plinth/modules/mediawiki/views.py:56 -#, fuzzy -#| msgid "Password used to encrypt data. Must match server password." msgid "Password update failed. Please choose a stronger password" -msgstr "" -"Verileri şifrelemek için kullanılan parola. Sunucu parolası ile eşleşmek " -"zorundadır." +msgstr "Parola güncelleme başarısız oldu. Lütfen daha güçlü bir parola seçin" #: plinth/modules/mediawiki/views.py:66 msgid "Public registrations enabled" @@ -6873,18 +6866,17 @@ msgid "" "Compared to Deluge, Transmission is simpler and " "lightweight but is less customizable." msgstr "" +"Deluge ile karşılaştırıldığında, Transmission " +"daha basit ve hafiftir ancak daha az özelleştirilebilir." #: plinth/modules/transmission/__init__.py:35 -#, fuzzy, python-brace-format -#| msgid "" -#| "It can be accessed by any user on {box_name} " -#| "belonging to the admin group." +#, python-brace-format msgid "" "It can be accessed by any user on {box_name} " "belonging to the bit-torrent group." msgstr "" -"Admin grubuna ait {box_name} üzerindeki herhangi bir " -"kullanıcı tarafından erişilebilir." +"Bit-torrent grubuna ait {box_name} üzerindeki herhangi bir kullanıcı tarafından erişilebilir." #: plinth/modules/transmission/__init__.py:39 #, python-brace-format @@ -6892,6 +6884,8 @@ msgid "" "Samba shares can be set as the default download " "directory from the dropdown menu below." msgstr "" +"Samba paylaşımları, aşağıdaki açılır menüden " +"varsayılan indirme dizini olarak ayarlanabilir." #: plinth/modules/transmission/__init__.py:43 #, python-brace-format @@ -6899,6 +6893,8 @@ msgid "" "After a download has completed, you can also access your files using the Sharing app." msgstr "" +"İndirme tamamlandıktan sonra, dosyalarınıza Paylaşım uygulamasını kullanarak da erişebilirsiniz." #: plinth/modules/transmission/__init__.py:71 #: plinth/modules/transmission/manifest.py:6 From 1c5de7fab019f702fc2557579689c49b03038705 Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 10 May 2022 03:03:51 +0000 Subject: [PATCH 08/24] Translated using Weblate (Chinese (Simplified)) Currently translated at 70.2% (1012 of 1441 strings) --- plinth/locale/zh_Hans/LC_MESSAGES/django.po | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/plinth/locale/zh_Hans/LC_MESSAGES/django.po b/plinth/locale/zh_Hans/LC_MESSAGES/django.po index 75c0012e7..4b3191836 100644 --- a/plinth/locale/zh_Hans/LC_MESSAGES/django.po +++ b/plinth/locale/zh_Hans/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Plinth\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-05-09 22:12-0400\n" -"PO-Revision-Date: 2022-03-28 05:11+0000\n" +"PO-Revision-Date: 2022-05-11 16:16+0000\n" "Last-Translator: Eric \n" "Language-Team: Chinese (Simplified) \n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 4.12-dev\n" +"X-Generator: Weblate 4.12.1\n" #: doc/dev/_templates/layout.html:11 msgid "Page source" @@ -6229,15 +6229,12 @@ msgid "" msgstr "" #: plinth/modules/transmission/__init__.py:35 -#, fuzzy, python-brace-format -#| msgid "" -#| "It can be accessed by any user on {box_name} " -#| "belonging to the admin group." +#, python-brace-format msgid "" "It can be accessed by any user on {box_name} " "belonging to the bit-torrent group." -msgstr "" -"它可以由属于管理组的{box_name}上的任何用户访问。" +msgstr "它可以由属于 bit-torrent " +"组的{box_name}上的任何用户访问。" #: plinth/modules/transmission/__init__.py:39 #, python-brace-format From af1f45690af2fb065ea8e8706a1a5cd3a61d1b0e Mon Sep 17 00:00:00 2001 From: 109247019824 Date: Tue, 10 May 2022 05:20:20 +0000 Subject: [PATCH 09/24] Translated using Weblate (Bulgarian) Currently translated at 16.2% (234 of 1441 strings) --- plinth/locale/bg/LC_MESSAGES/django.po | 32 +++++++++++++++++++------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/plinth/locale/bg/LC_MESSAGES/django.po b/plinth/locale/bg/LC_MESSAGES/django.po index eecec4bc6..a78d50641 100644 --- a/plinth/locale/bg/LC_MESSAGES/django.po +++ b/plinth/locale/bg/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-05-09 22:12-0400\n" -"PO-Revision-Date: 2022-05-10 02:10+0000\n" +"PO-Revision-Date: 2022-05-11 16:16+0000\n" "Last-Translator: 109247019824 \n" "Language-Team: Bulgarian \n" @@ -1042,6 +1042,8 @@ msgid "" "Only letters of the English alphabet, numbers and the characters _ . and - " "without spaces or special characters. Example: My_Library_2000" msgstr "" +"Само букви от английската азбука, цифри, символите _ . и - без интервали и " +"специални символи. Пример: My_Library_2000" #: plinth/modules/calibre/forms.py:30 msgid "A library with this name already exists." @@ -1925,29 +1927,31 @@ msgstr "" #: plinth/modules/email/templates/email.html:22 msgid "DNS Records" -msgstr "" +msgstr "Записи на DNS" #: plinth/modules/email/templates/email.html:25 msgid "" "The following DNS records must be added manually on your primary domain for " "the mail server to work properly." msgstr "" +"Следните записи на DNS трябва да бъдат добавени ръчно в основния домейн, за " +"да работи правилно пощенският сървър." #: plinth/modules/email/templates/email.html:36 msgid "TTL" -msgstr "" +msgstr "TTL" #: plinth/modules/email/templates/email.html:37 msgid "Class" -msgstr "" +msgstr "Клас" #: plinth/modules/email/templates/email.html:39 msgid "Priority" -msgstr "" +msgstr "Приоритет" #: plinth/modules/email/templates/email.html:40 msgid "Weight" -msgstr "" +msgstr "Тежест" #: plinth/modules/email/templates/email.html:41 #: plinth/modules/minetest/templates/minetest.html:18 @@ -1957,7 +1961,7 @@ msgstr "" #: plinth/modules/email/templates/email.html:42 msgid "Host/Target/Value" -msgstr "" +msgstr "Хост/цел/стойност" #: plinth/modules/firewall/__init__.py:26 #, python-brace-format @@ -2975,6 +2979,9 @@ msgid "" "10 characters. Leave this field blank to keep the current " "password." msgstr "" +"Задайте нова парола за администратора на MediaWiki (admin). Не избирайте " +"често срещана парола, минималната дължина е 10 знака . " +"Оставете полето празно, за да запазите текущата парола." #: plinth/modules/mediawiki/forms.py:60 msgid "Server URL" @@ -3022,7 +3029,7 @@ msgstr "Паролата е променена" #: plinth/modules/mediawiki/views.py:56 msgid "Password update failed. Please choose a stronger password" -msgstr "" +msgstr "Паролата не е променена. Изберете по-сложна парола" #: plinth/modules/mediawiki/views.py:66 msgid "Public registrations enabled" @@ -6034,6 +6041,8 @@ msgid "" "Compared to Deluge, Transmission is simpler and " "lightweight but is less customizable." msgstr "" +"В сравнение с Deluge, Transmission е по-прост и " +"лек, но е с по-малко възможности за настройка." #: plinth/modules/transmission/__init__.py:35 #, python-brace-format @@ -6041,6 +6050,8 @@ msgid "" "It can be accessed by any user on {box_name} " "belonging to the bit-torrent group." msgstr "" +"Достъпът до нея е възможен от всеки потребител " +"на {box_name}, принадлежащ към групата bit-torrent." #: plinth/modules/transmission/__init__.py:39 #, python-brace-format @@ -6048,6 +6059,8 @@ msgid "" "Samba shares can be set as the default download " "directory from the dropdown menu below." msgstr "" +"Споделеното в Samba може да бъде зададено като " +"подразбирана папка за изтегляне от падащото меню по-долу." #: plinth/modules/transmission/__init__.py:43 #, python-brace-format @@ -6055,6 +6068,9 @@ msgid "" "After a download has completed, you can also access your files using the Sharing app." msgstr "" +"След приключване на изтеглянето можете също така да получите достъп до " +"файловете си, като използвате приложението Споделяне." #: plinth/modules/transmission/__init__.py:71 #: plinth/modules/transmission/manifest.py:6 From 5da1ebf00c49d93d47dedf4309ddd4e97b3058fd Mon Sep 17 00:00:00 2001 From: Benedek Nagy Date: Wed, 11 May 2022 10:37:01 +0000 Subject: [PATCH 10/24] ssh, bind: Show 'Learn More...' links Reviewed-by: Sunil Mohan Adapa --- plinth/modules/bind/__init__.py | 2 +- plinth/modules/ssh/__init__.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/plinth/modules/bind/__init__.py b/plinth/modules/bind/__init__.py index 402f38140..8f3a475e1 100644 --- a/plinth/modules/bind/__init__.py +++ b/plinth/modules/bind/__init__.py @@ -75,7 +75,7 @@ class BindApp(app_module.App): info = app_module.Info(app_id=self.app_id, version=self._version, name=_('BIND'), icon='fa-globe-w', short_description=_('Domain Name Server'), - description=_description) + description=_description, manual_page='Bind') self.add(info) menu_item = menu.Menu('menu-bind', info.name, info.short_description, diff --git a/plinth/modules/ssh/__init__.py b/plinth/modules/ssh/__init__.py index 6fb1eb41d..754351e78 100644 --- a/plinth/modules/ssh/__init__.py +++ b/plinth/modules/ssh/__init__.py @@ -43,7 +43,8 @@ class SSHApp(app_module.App): info = app_module.Info(app_id=self.app_id, version=self._version, is_essential=True, name=_('Secure Shell (SSH) Server'), - icon='fa-terminal', description=_description) + icon='fa-terminal', description=_description, + manual_page='SecureShell') self.add(info) menu_item = menu.Menu('menu-ssh', info.name, None, info.icon, From f20e00f55ad7e3d2fe31eb495a5abcc6074347aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asle=20N=C3=A6ss?= Date: Sat, 14 May 2022 09:30:07 +0000 Subject: [PATCH 11/24] =?UTF-8?q?Translated=20using=20Weblate=20(Norwegian?= =?UTF-8?q?=20Bokm=C3=A5l)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently translated at 80.2% (1157 of 1441 strings) --- plinth/locale/nb/LC_MESSAGES/django.po | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/plinth/locale/nb/LC_MESSAGES/django.po b/plinth/locale/nb/LC_MESSAGES/django.po index 6dffc4c62..f022c4ee8 100644 --- a/plinth/locale/nb/LC_MESSAGES/django.po +++ b/plinth/locale/nb/LC_MESSAGES/django.po @@ -16,8 +16,8 @@ msgstr "" "Project-Id-Version: FreedomBox UI\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-05-09 22:12-0400\n" -"PO-Revision-Date: 2022-04-29 20:11+0000\n" -"Last-Translator: Petter Reinholdtsen \n" +"PO-Revision-Date: 2022-05-15 10:15+0000\n" +"Last-Translator: Asle Næss \n" "Language-Team: Norwegian Bokmål \n" "Language: nb\n" @@ -25,7 +25,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.12.1\n" +"X-Generator: Weblate 4.13-dev\n" #: doc/dev/_templates/layout.html:11 msgid "Page source" @@ -6400,7 +6400,6 @@ msgid "Server Fingerprints" msgstr "Tjener-fingeravtrykk" #: plinth/modules/ssh/templates/ssh.html:14 -#, fuzzy msgid "" "When connecting to the server, ensure that the fingerprint shown by the SSH " "client matches one of these fingerprints." @@ -7294,7 +7293,7 @@ msgstr "" "en brukerkonto er en del av gruppen for å klarere brukrens tilgang til det." #: plinth/modules/users/__init__.py:34 -#, fuzzy, python-brace-format +#, python-brace-format msgid "" "Any user may login to {box_name} web interface to see a list of apps " "relevant to them in the home page. However, only users of the admin " @@ -7348,13 +7347,6 @@ msgid "Invalid password." msgstr "Ugyldig passord." #: plinth/modules/users/forms.py:110 -#, fuzzy -#| msgid "" -#| "Select which services should be available to the new user. The user will " -#| "be able to log in to services that support single sign-on through LDAP, " -#| "if they are in the appropriate group.

Users in the admin group " -#| "will be able to log in to all services. They can also log in to the " -#| "system through SSH and have administrative privileges (sudo)." msgid "" "Select which services should be available to the new user. The user will be " "able to log in to services that support single sign-on through LDAP, if they " From 7757e75e8a765082f32f94a985962ccd20e9c5b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asle=20N=C3=A6ss?= Date: Sun, 15 May 2022 14:12:51 +0000 Subject: [PATCH 12/24] =?UTF-8?q?Translated=20using=20Weblate=20(Norwegian?= =?UTF-8?q?=20Bokm=C3=A5l)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently translated at 80.5% (1161 of 1441 strings) --- plinth/locale/nb/LC_MESSAGES/django.po | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/plinth/locale/nb/LC_MESSAGES/django.po b/plinth/locale/nb/LC_MESSAGES/django.po index f022c4ee8..e64410cb4 100644 --- a/plinth/locale/nb/LC_MESSAGES/django.po +++ b/plinth/locale/nb/LC_MESSAGES/django.po @@ -16,7 +16,7 @@ msgstr "" "Project-Id-Version: FreedomBox UI\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-05-09 22:12-0400\n" -"PO-Revision-Date: 2022-05-15 10:15+0000\n" +"PO-Revision-Date: 2022-05-15 14:13+0000\n" "Last-Translator: Asle Næss \n" "Language-Team: Norwegian Bokmål \n" @@ -2316,7 +2316,6 @@ msgid "Setup Complete" msgstr "Oppsett ferdig" #: plinth/modules/gitweb/__init__.py:26 -#, fuzzy msgid "" "Git is a distributed version-control system for tracking changes in source " "code during software development. Gitweb provides a web interface to Git " @@ -2327,10 +2326,10 @@ msgid "" "the world." msgstr "" "Git er et distribuert versjonskontrollsystem for sporing av endringer i " -"kildekode under programvareutvikling. Gitweb tilbyret vevgrensesnitt til Git-" -"kodelagre. Du kan utforske historikk og innholdet av kildekode, og bruke søk " -"til å finne relevante innsendelser og kode. Du kan også klone kodelagre og " -"laste opp kodeendringer med en Git-klient på kommandolinjen, eller med " +"kildekode under programvareutvikling. Gitweb tilbyr et vevgrensesnitt til " +"Git-kodelagre. Du kan utforske historikk og innholdet av kildekode, og bruke " +"søk til å finne relevante innsendelser og kode. Du kan også klone kodelagre " +"og laste opp kodeendringer med en Git-klient på kommandolinjen, eller med " "flerfoldige grafiske klienter. Du kan også dele koden med folk rundt omkring " "i verden." @@ -3455,10 +3454,8 @@ msgid "Password updated" msgstr "Passord oppdatert" #: plinth/modules/mediawiki/views.py:56 -#, fuzzy -#| msgid "Password used to encrypt data. Must match server password." msgid "Password update failed. Please choose a stronger password" -msgstr "Passord brukt for å kryptere data. Må samsvare med tjenerpassord." +msgstr "Passordoppdatering feilet. Vennligst bruk ett sterkere passord" #: plinth/modules/mediawiki/views.py:66 msgid "Public registrations enabled" @@ -4683,10 +4680,8 @@ msgid "unknown error" msgstr "" #: plinth/modules/networks/views.py:60 -#, fuzzy -#| msgid "The device is not mounted." msgid "device is now managed" -msgstr "Enheten er ikke montert." +msgstr "Enheten er nå håndtert." #: plinth/modules/networks/views.py:62 #, fuzzy @@ -6180,12 +6175,12 @@ msgid "Software Installation Snapshots" msgstr "Øyeblikksbilder av programvareinstallasjoner" #: plinth/modules/snapshot/forms.py:27 -#, fuzzy -#| msgid "Enable or disable snapshots before and after software installation" msgid "" "Enable or disable snapshots before and after each software installation and " "update." -msgstr "Skru på eller av øyeblikksbilder før og etter programvareinstallasjon" +msgstr "" +"Skru på eller av øyeblikksbilder før og etter hver programvareinstallasjon " +"og oppdatering." #: plinth/modules/snapshot/forms.py:32 msgid "Hourly Snapshots Limit" From 02fa1dc3c1cc49678ee4b3cd0f2317aa541cfcfe Mon Sep 17 00:00:00 2001 From: Petter Reinholdtsen Date: Sun, 15 May 2022 14:13:52 +0000 Subject: [PATCH 13/24] =?UTF-8?q?Translated=20using=20Weblate=20(Norwegian?= =?UTF-8?q?=20Bokm=C3=A5l)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently translated at 80.6% (1162 of 1441 strings) --- plinth/locale/nb/LC_MESSAGES/django.po | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/plinth/locale/nb/LC_MESSAGES/django.po b/plinth/locale/nb/LC_MESSAGES/django.po index e64410cb4..c99d28775 100644 --- a/plinth/locale/nb/LC_MESSAGES/django.po +++ b/plinth/locale/nb/LC_MESSAGES/django.po @@ -16,8 +16,8 @@ msgstr "" "Project-Id-Version: FreedomBox UI\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-05-09 22:12-0400\n" -"PO-Revision-Date: 2022-05-15 14:13+0000\n" -"Last-Translator: Asle Næss \n" +"PO-Revision-Date: 2022-05-16 14:14+0000\n" +"Last-Translator: Petter Reinholdtsen \n" "Language-Team: Norwegian Bokmål \n" "Language: nb\n" @@ -4681,13 +4681,11 @@ msgstr "" #: plinth/modules/networks/views.py:60 msgid "device is now managed" -msgstr "Enheten er nå håndtert." +msgstr "Enheten er nå håndtert" #: plinth/modules/networks/views.py:62 -#, fuzzy -#| msgid "The device is not mounted." msgid "device is now unmanaged" -msgstr "Enheten er ikke montert." +msgstr "Enheten er nå ikke håndtert" #: plinth/modules/networks/views.py:64 #, fuzzy From 436060fecb286612bb80b7ba27876e1d3e45b14e Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Tue, 10 May 2022 11:57:29 -0700 Subject: [PATCH 14/24] apache: Allow URL diagnostics to work with redirects Upon access of an app URL, it may redirect to another URL that is configured in app settings. This new URL could only be accessed on IPv4 or IPv6 only. When curl is invoked with the IP address version of a different kind, the access fails. In such cases, tell the diagnostics methods not the restrict to a particular address type. Tests: - Unit tests pass. - All of transmission's diagnostics tests pass. The URL tests show that they have been performed on a particular IP address type. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/apache/components.py | 17 ++++++++++----- .../modules/apache/tests/test_components.py | 21 +++++++++++++------ 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/plinth/modules/apache/components.py b/plinth/modules/apache/components.py index c6ac23958..7737dce5e 100644 --- a/plinth/modules/apache/components.py +++ b/plinth/modules/apache/components.py @@ -15,7 +15,8 @@ from plinth import action_utils, actions, app class Webserver(app.LeaderComponent): """Component to enable/disable Apache configuration.""" - def __init__(self, component_id, web_name, kind='config', urls=None): + def __init__(self, component_id, web_name, kind='config', urls=None, + expect_redirects=False): """Initialize the web server component. component_id should be a unique ID across all components of an app and @@ -38,6 +39,7 @@ class Webserver(app.LeaderComponent): self.web_name = web_name self.kind = kind self.urls = urls or [] + self.expect_redirects = expect_redirects def is_enabled(self): """Return whether the Apache configuration is enabled.""" @@ -64,7 +66,9 @@ class Webserver(app.LeaderComponent): for url in self.urls: if '{host}' in url: results.extend( - diagnose_url_on_all(url, check_certificate=False)) + diagnose_url_on_all( + url, check_certificate=False, + expect_redirects=self.expect_redirects)) else: results.append(diagnose_url(url, check_certificate=False)) @@ -128,13 +132,16 @@ def diagnose_url(url, kind=None, env=None, check_certificate=True, return [testname, result] -def diagnose_url_on_all(url, **kwargs): +def diagnose_url_on_all(url, expect_redirects=False, **kwargs): """Run a diagnostic on whether a URL is accessible.""" results = [] for address in action_utils.get_addresses(): current_url = url.format(host=address['url_address']) - results.append( - diagnose_url(current_url, kind=address['kind'], **kwargs)) + diagnose_kwargs = dict(kwargs) + if not expect_redirects: + diagnose_kwargs.setdefault('kind', address['kind']) + + results.append(diagnose_url(current_url, **diagnose_kwargs)) return results diff --git a/plinth/modules/apache/tests/test_components.py b/plinth/modules/apache/tests/test_components.py index 61b71e3b5..7ceba4ca1 100644 --- a/plinth/modules/apache/tests/test_components.py +++ b/plinth/modules/apache/tests/test_components.py @@ -19,15 +19,17 @@ def test_webserver_init(): Webserver(None, None) webserver = Webserver('test-webserver', 'test-config', kind='module', - urls=['url1', 'url2']) + urls=['url1', 'url2'], expect_redirects=True) assert webserver.component_id == 'test-webserver' assert webserver.web_name == 'test-config' assert webserver.kind == 'module' assert webserver.urls == ['url1', 'url2'] + assert webserver.expect_redirects webserver = Webserver('test-webserver', None) assert webserver.kind == 'config' assert webserver.urls == [] + assert not webserver.expect_redirects @patch('plinth.action_utils.webserver_is_enabled') @@ -73,7 +75,7 @@ def test_webserver_disable(superuser_run): def test_webserver_diagnose(diagnose_url_on_all, diagnose_url): """Test running diagnostics.""" - def on_all_side_effect(url, check_certificate): + def on_all_side_effect(url, check_certificate, expect_redirects): return [('test-result-' + url, 'success')] def side_effect(url, check_certificate): @@ -81,15 +83,22 @@ def test_webserver_diagnose(diagnose_url_on_all, diagnose_url): diagnose_url_on_all.side_effect = on_all_side_effect diagnose_url.side_effect = side_effect - webserver = Webserver('test-webserver', 'test-config', - urls=['{host}url1', 'url2']) - results = webserver.diagnose() + webserver1 = Webserver('test-webserver', 'test-config', + urls=['{host}url1', 'url2'], expect_redirects=True) + results = webserver1.diagnose() assert results == [('test-result-{host}url1', 'success'), ('test-result-url2', 'success')] diagnose_url_on_all.assert_has_calls( - [call('{host}url1', check_certificate=False)]) + [call('{host}url1', check_certificate=False, expect_redirects=True)]) diagnose_url.assert_has_calls([call('url2', check_certificate=False)]) + diagnose_url_on_all.reset_mock() + webserver2 = Webserver('test-webserver', 'test-config', + urls=['{host}url1', 'url2'], expect_redirects=False) + results = webserver2.diagnose() + diagnose_url_on_all.assert_has_calls( + [call('{host}url1', check_certificate=False, expect_redirects=False)]) + def test_uwsgi_init(): """Test that uWSGI component can be initialized.""" From 48457dd0d009cf441d52a5145612b176998afaee Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Tue, 10 May 2022 11:59:04 -0700 Subject: [PATCH 15/24] mediawiki: Fix URL diagnostics with redirects involved Upon access of MediaWiki URL, it redirects to the main page with the URL configured. This new URL could only be accessed on IPv4 or IPv6 only. When curl is invoked with the IP address version of a different kind, this fails. Tell the diagnostics methods not the restrict to a particular address type. Tests: - All MediaWiki diagnostic tests pass. URL tests show that they haven't been performed on particular address type but rather generically. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/mediawiki/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plinth/modules/mediawiki/__init__.py b/plinth/modules/mediawiki/__init__.py index f2215ab09..a71903b0d 100644 --- a/plinth/modules/mediawiki/__init__.py +++ b/plinth/modules/mediawiki/__init__.py @@ -80,7 +80,8 @@ class MediaWikiApp(app_module.App): self.add(firewall) webserver = Webserver('webserver-mediawiki', 'mediawiki', - urls=['https://{host}/mediawiki']) + urls=['https://{host}/mediawiki/'], + expect_redirects=True) self.add(webserver) webserver = Webserver('webserver-mediawiki-freedombox', From bf869903829212b9ff0207095a2bcdb41670afb6 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Wed, 11 May 2022 11:06:45 -0700 Subject: [PATCH 16/24] frontpage: Reuse app header template for showing app description - Show the short description under the app name. - Show the link to manual page if available. - Share the header styling with the app page. Tests: - Install OpenVPN app and visit the home page. Select the OpenVPN icon. Along with app title and description, short description is now shown. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/templates/index.html | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/plinth/templates/index.html b/plinth/templates/index.html index a9441b2e4..7b93c0172 100644 --- a/plinth/templates/index.html +++ b/plinth/templates/index.html @@ -27,15 +27,7 @@ {% endif %} {% if selected_shortcut.description %} - {% block pagetitle %} -

{{ selected_shortcut.name }}

- {% endblock %} - - {% block description %} - {% for paragraph in selected_shortcut.description %} -

{{ paragraph|safe }}

- {% endfor %} - {% endblock %} + {% include "app-header.html" with app_info=selected_shortcut %}