diff --git a/actions/mumble b/actions/mumble deleted file mode 100755 index c399a659a..000000000 --- a/actions/mumble +++ /dev/null @@ -1,143 +0,0 @@ -#!/usr/bin/python3 - -# SPDX-License-Identifier: AGPL-3.0-or-later -""" -Configure Mumble server. -""" - -import argparse -import pathlib -import sys -from subprocess import PIPE, Popen - -import augeas - -from plinth import action_utils - -CONFIG_FILE = '/etc/mumble-server.ini' -DATA_DIR = '/var/lib/mumble-server' - - -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('setup', help='Setup Mumble server') - subparsers.add_parser('create-password', - help='Setup mumble superuser password') - - subparsers.add_parser('get-domain', help='Print Mumble domain') - subparser = subparsers.add_parser('set-domain', help='Setup Mumble domain') - subparser.add_argument('domain_name', help='Domain name to be allowed') - - subparser = subparsers.add_parser('change-root-channel-name', - help='Set the root channel name') - subparser.add_argument('root_channel_name', help='New root channel name') - - subparsers.add_parser('get-root-channel-name', - help='Print the root channel name') - - subparser = subparsers.add_parser( - 'change-join-password', help='Set the password to join the server') - subparser.add_argument('join_password', help='New join password') - - subparsers.required = True - return parser.parse_args() - - -def subcommand_setup(_): - """Setup Mumble server.""" - aug = load_augeas() - aug.set('.anon/sslCert', DATA_DIR + '/fullchain.pem') - aug.set('.anon/sslKey', DATA_DIR + '/privkey.pem') - aug.save() - - -def read_from_stdin(): - """Read password from stdin""" - - return (''.join(sys.stdin)).strip() - - -def subcommand_create_password(_): - """Save superuser password with murmurd command""" - - password = read_from_stdin() - - cmd = ['murmurd', '-ini', CONFIG_FILE, '-readsupw'] - proc = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE, shell=False) - - # The exit code of the command above seems to be 1 when successful! - # checking if the 'phrase' is included in the error message which - # shows that the password is successfully set. - out, err = proc.communicate(input=password.encode()) - out, err = out.decode(), err.decode() - - phrase = "Superuser password set on server" - if phrase not in err: - print("Error occured while saving password: %s" % err) - sys.exit(1) - - -def subcommand_get_domain(_): - """Print the file containing domain name or empty string.""" - domain_file = pathlib.Path('/var/lib/mumble-server/domain-freedombox') - try: - print(domain_file.read_text()) - except FileNotFoundError: - pass - - -def subcommand_set_domain(arguments): - """Write a file containing domain name.""" - domain_file = pathlib.Path('/var/lib/mumble-server/domain-freedombox') - domain_file.write_text(arguments.domain_name) - - -def subcommand_change_join_password(arguments): - """Change to password that is required to join the server""" - aug = load_augeas() - aug.set('.anon/serverpassword', arguments.join_password) - aug.save() - action_utils.service_try_restart('mumble-server') - - -def subcommand_change_root_channel_name(arguments): - """Change the name of the Root channel.""" - aug = load_augeas() - aug.set('.anon/registerName', arguments.root_channel_name) - aug.save() - action_utils.service_try_restart('mumble-server') - - -def subcommand_get_root_channel_name(_): - aug = load_augeas() - name = aug.get('.anon/registerName') - if name: - print(name) - - -def load_augeas(): - """Initialize Augeas.""" - aug = augeas.Augeas(flags=augeas.Augeas.NO_LOAD + - augeas.Augeas.NO_MODL_AUTOLOAD) - aug.transform('Php', CONFIG_FILE) - aug.set('/augeas/context', '/files' + CONFIG_FILE) - aug.load() - - return aug - - -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/actions/upgrades b/actions/upgrades index 2f78142ec..49069ce55 100755 --- a/actions/upgrades +++ b/actions/upgrades @@ -68,6 +68,12 @@ Explanation: python3-markupsafe >= 2.0 Package: python3-markupsafe Pin: release a=bullseye-backports Pin-Priority: 500 + +Explanation: matrix-synapse >= 1.59.1-1 requires +Explanation: python3-unpaddedbase64 >= 2.1.0~ +Package: python3-unpaddedbase64 +Pin: release a=bullseye-backports +Pin-Priority: 500 ''' DIST_UPGRADE_OBSOLETE_PACKAGES: List[str] = [] diff --git a/debian/changelog b/debian/changelog index 97aed4406..68d80f48c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,34 @@ +freedombox (22.14.1) unstable; urgency=medium + + [ ikmaak ] + * Translated using Weblate (German) + * Translated using Weblate (Dutch) + + [ Burak Yavuz ] + * Translated using Weblate (Turkish) + + [ Eric ] + * Translated using Weblate (Chinese (Simplified)) + + [ 109247019824 ] + * Translated using Weblate (Bulgarian) + + [ Sunil Mohan Adapa ] + * matrixsynapse: Allow new dependency to be installed from backports + * mumble: Use privileged decorator for superuser actions + * actions: Note that privileged actions can't output to stdout + * mumble: Backup/restore the configuration file + * mumble: Don't set the root channel name unless it is changed + * mumble: tests: Add functional tests for setting the passwords + + [ Jiří Podhorecký ] + * Translated using Weblate (Czech) + + [ James Valleroy ] + * doc: Fetch latest manual + + -- James Valleroy Mon, 27 Jun 2022 07:13:07 -0400 + freedombox (22.14~bpo11+1) bullseye-backports; urgency=medium * Rebuild for bullseye-backports. diff --git a/doc/manual/en/Janus.raw.wiki b/doc/manual/en/Janus.raw.wiki new file mode 100644 index 000000000..0eea3486a --- /dev/null +++ b/doc/manual/en/Janus.raw.wiki @@ -0,0 +1,52 @@ +#language en + +##TAG:TRANSLATION-HEADER-START +~- [[FreedomBox/Manual/Janus|English]] - [[es/FreedomBox/Manual/Janus|Español]] - [[DebianWiki/EditorGuide#translation|(+)]] -~ +##TAG:TRANSLATION-HEADER-END + +<> + +## BEGIN_INCLUDE + +== Janus (WebRTC server) == +|| {{attachment:Janus-icon_en_V01.png|Janus icon}} || +'''Available since version''': 22.13 + + +Janus is a lightweight, general purpose WebRTC server. It can support different kinds of real-time communication apps, such as video chat and streaming. + +Currently, in !FreedomBox, a simple video conference room is included with Janus. This video room can be accessed by anyone who visits your !FreedomBox; it does not require logging in with a user account. + +In the future, the simple video room app will be replaced by [[DebianBug:1005877|Jangouts]], a fully-featured video conference app. + +[[FreedomBox/Manual/Coturn|Coturn]] is required to use Janus, so it also needs to be installed and running on your !FreedomBox. + +=== Screenshot === + +{{attachment:freedombox-janus-videoroom.png|Janus Video Room|width=800}} + + +=== Using Janus === + +The Janus shortcut will take you to the Janus Video Room page. From here, press the Start button at the top of the page. + +Next, you will need to provide a display name. Any name can be used here. Press the "Join the room" button to enter the room. + +The first time you enter the video room, your web browser will ask if this page has permission to access your camera and microphone. Press "Allow" to proceed. + +Your own video will be displayed in the "Local Video" window. From here you can mute your audio, or use unpublish to stop sharing your video and audio. If other people join the video room, they will appear in the "Remote Video" windows. + +=== External links === + + * Upstream project: https://janus.conf.meetecho.com + * Upstream end user documentation: https://janus.conf.meetecho.com/docs + + +## END_INCLUDE + +Back to [[FreedomBox/Features|Features introduction]] or [[FreedomBox/Manual|manual]] pages. + +<> + +---- +CategoryFreedomBox diff --git a/doc/manual/en/ReleaseNotes.raw.wiki b/doc/manual/en/ReleaseNotes.raw.wiki index 69b9b2d74..2e0c4dc28 100644 --- a/doc/manual/en/ReleaseNotes.raw.wiki +++ b/doc/manual/en/ReleaseNotes.raw.wiki @@ -8,6 +8,21 @@ For more technical details, see the [[https://salsa.debian.org/freedombox-team/f The following are the release notes for each !FreedomBox version. +== FreedomBox 22.14.1 (2022-06-27) == + +=== Highlights === + + * matrixsynapse: Allow new dependency to be installed from backports + +=== Other Changes === + + * locale: Update translations for Bulgarian, Chinese (Simplified), Czech, Dutch, German, Turkish + * actions: Note that privileged actions can't output to stdout + * mumble: Backup/restore the configuration file + * mumble: Don't set the root channel name unless it is changed + * mumble: Use privileged decorator for superuser actions + * mumble: tests: Add functional tests for setting the passwords + == FreedomBox 22.14 (2022-06-20) == === Highlights === diff --git a/doc/manual/en/freedombox-manual.raw.wiki b/doc/manual/en/freedombox-manual.raw.wiki index 6c5d21f77..786cf3e88 100644 --- a/doc/manual/en/freedombox-manual.raw.wiki +++ b/doc/manual/en/freedombox-manual.raw.wiki @@ -26,6 +26,7 @@ <> <> <> +<> <> <> <> diff --git a/doc/manual/en/images/Janus-icon_en_V01.png b/doc/manual/en/images/Janus-icon_en_V01.png new file mode 100644 index 000000000..912aad4f7 Binary files /dev/null and b/doc/manual/en/images/Janus-icon_en_V01.png differ diff --git a/doc/manual/en/images/freedombox-janus-videoroom.png b/doc/manual/en/images/freedombox-janus-videoroom.png new file mode 100644 index 000000000..73ce501fd Binary files /dev/null and b/doc/manual/en/images/freedombox-janus-videoroom.png differ diff --git a/doc/manual/es/Janus.raw.wiki b/doc/manual/es/Janus.raw.wiki new file mode 100644 index 000000000..f4b48ddcf --- /dev/null +++ b/doc/manual/es/Janus.raw.wiki @@ -0,0 +1,37 @@ +#language es + +<> + +<> + +## BEGIN_INCLUDE + +== Janus (servidor WebRTC) == + +'''Disponible desde''': versión 22.13 + + +Janus es un servidor WebRTC ligero de propósito general. Puede soportar diferentes tipos de aplicaciones de comunicación en tiempo real, como llamdas y retransmisiones de video. + +Actualmente !FreedomBox incluye con Janus una sala simple de videoconferencia. En el futuro será reemplazada por [[DebianBug:1005877|Jangouts]], una app de videoconferencia completa. + +Para usar Janus se necesita un servidor STUN/TURN (como [[es/FreedomBox/Manual/Coturn|Coturn]]). + +/* Captura de pantalla */ + +/* Usar Janus */ + +=== Enlaces externos === + + * Proyecto original: https://janus.conf.meetecho.com + * Documentación de usuario: https://janus.conf.meetecho.com/docs + +## END_INCLUDE + +Volver a la [[es/FreedomBox/Features|descripción de Funcionalidades]] o a las páginas del [[es/FreedomBox/Manual|manual]]. + + +<> + +---- +CategoryFreedomBox diff --git a/doc/manual/es/Manual.raw.wiki b/doc/manual/es/Manual.raw.wiki index 6c5d21f77..786cf3e88 100644 --- a/doc/manual/es/Manual.raw.wiki +++ b/doc/manual/es/Manual.raw.wiki @@ -26,6 +26,7 @@ <> <> <> +<> <> <> <> diff --git a/doc/manual/es/ReleaseNotes.raw.wiki b/doc/manual/es/ReleaseNotes.raw.wiki index 69b9b2d74..2e0c4dc28 100644 --- a/doc/manual/es/ReleaseNotes.raw.wiki +++ b/doc/manual/es/ReleaseNotes.raw.wiki @@ -8,6 +8,21 @@ For more technical details, see the [[https://salsa.debian.org/freedombox-team/f The following are the release notes for each !FreedomBox version. +== FreedomBox 22.14.1 (2022-06-27) == + +=== Highlights === + + * matrixsynapse: Allow new dependency to be installed from backports + +=== Other Changes === + + * locale: Update translations for Bulgarian, Chinese (Simplified), Czech, Dutch, German, Turkish + * actions: Note that privileged actions can't output to stdout + * mumble: Backup/restore the configuration file + * mumble: Don't set the root channel name unless it is changed + * mumble: Use privileged decorator for superuser actions + * mumble: tests: Add functional tests for setting the passwords + == FreedomBox 22.14 (2022-06-20) == === Highlights === diff --git a/doc/manual/es/freedombox-manual.raw.wiki b/doc/manual/es/freedombox-manual.raw.wiki index 9fe136c25..e24551f45 100644 --- a/doc/manual/es/freedombox-manual.raw.wiki +++ b/doc/manual/es/freedombox-manual.raw.wiki @@ -25,6 +25,7 @@ <> <> <> +<> <> <> <> diff --git a/plinth/__init__.py b/plinth/__init__.py index 1ff2f56da..7ae377b0f 100644 --- a/plinth/__init__.py +++ b/plinth/__init__.py @@ -3,4 +3,4 @@ Package init file. """ -__version__ = '22.14' +__version__ = '22.14.1' diff --git a/plinth/actions.py b/plinth/actions.py index 14d3599c1..cb77b4fc7 100644 --- a/plinth/actions.py +++ b/plinth/actions.py @@ -271,6 +271,8 @@ def privileged(func): to models.py, views.py and urls.py. Currently supported types are bool, int, float, str, dict/Dict, list/List, Optional and Union. + Privileged methods many not output to the stdout as it interferes + with the serialization and de-serialization process. """ setattr(func, '_privileged', True) diff --git a/plinth/locale/bg/LC_MESSAGES/django.po b/plinth/locale/bg/LC_MESSAGES/django.po index 4564701dd..040a27275 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-06-20 20:21-0400\n" -"PO-Revision-Date: 2022-06-17 19:15+0000\n" +"PO-Revision-Date: 2022-06-22 17:14+0000\n" "Last-Translator: 109247019824 \n" "Language-Team: Bulgarian \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.13-dev\n" +"X-Generator: Weblate 4.13.1-dev\n" #: doc/dev/_templates/layout.html:11 msgid "Page source" @@ -3321,7 +3321,7 @@ msgstr "Паролата на суперпотребителя е обновен #: plinth/modules/mumble/views.py:46 msgid "Join password changed" -msgstr "" +msgstr "Паролата за присъединяване е променена" #: plinth/modules/mumble/views.py:51 msgid "Root channel name changed." diff --git a/plinth/locale/cs/LC_MESSAGES/django.po b/plinth/locale/cs/LC_MESSAGES/django.po index d94b8a89c..66d53e22d 100644 --- a/plinth/locale/cs/LC_MESSAGES/django.po +++ b/plinth/locale/cs/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-06-20 20:21-0400\n" -"PO-Revision-Date: 2022-06-08 16:16+0000\n" +"PO-Revision-Date: 2022-06-25 00:20+0000\n" "Last-Translator: Jiří Podhorecký \n" "Language-Team: Czech \n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" -"X-Generator: Weblate 4.13-dev\n" +"X-Generator: Weblate 4.13.1-dev\n" #: doc/dev/_templates/layout.html:11 msgid "Page source" @@ -1853,8 +1853,6 @@ msgid "Chat Server" msgstr "Chat server" #: plinth/modules/ejabberd/forms.py:19 -#, fuzzy -#| msgid "Domain Names" msgid "Domain names" msgstr "Názvy domén" @@ -1863,6 +1861,9 @@ msgid "" "Domains to be used by ejabberd. Note that user accounts are unique for each " "domain, and migrating users to a new domain name is not yet implemented." msgstr "" +"Domény, které má ejabberd používat. Všimněte si, že uživatelské účty jsou " +"pro každou doménu jedinečné a migrace uživatelů na nový název domény zatím " +"není implementována." #: plinth/modules/ejabberd/forms.py:26 msgid "Enable Message Archive Management" @@ -3007,11 +3008,10 @@ msgid "A simple video conference room is included." msgstr "Součástí je jednoduchá videokonferenční místnost." #: plinth/modules/janus/__init__.py:26 -#, fuzzy, python-brace-format -#| msgid "A STUN/TURN server (such as Coturn) is required to use Janus." +#, python-brace-format msgid "Coturn is required to use Janus." msgstr "" -"Pro použití systému Janus je vyžadován server STUN/TURN (například Coturn)." +"Coturn je vyžadován pro použití systému Janus." #: plinth/modules/janus/__init__.py:44 msgid "Janus" @@ -3387,14 +3387,12 @@ msgstr "" "\" nebo \"example.onion\"." #: plinth/modules/mediawiki/forms.py:40 -#, fuzzy -#| msgid "Kite name" msgid "Site Name" -msgstr "Kite název" +msgstr "Název stránky" #: plinth/modules/mediawiki/forms.py:41 msgid "Name of the site as displayed throughout the wiki." -msgstr "" +msgstr "Název webu, který se zobrazuje v celé wiki." #: plinth/modules/mediawiki/forms.py:45 msgid "Enable public registrations" @@ -3465,10 +3463,8 @@ msgid "Domain name updated" msgstr "Nastavení doménového názvu aktualizováno" #: plinth/modules/mediawiki/views.py:103 -#, fuzzy -#| msgid "Domain name updated" msgid "Site name updated" -msgstr "Nastavení doménového názvu aktualizováno" +msgstr "Název webu aktualizován" #: plinth/modules/minetest/__init__.py:35 #, python-brace-format @@ -3647,19 +3643,15 @@ msgstr "" #: plinth/modules/mumble/forms.py:40 msgid "Set a password to join the server" -msgstr "" +msgstr "Nastavení hesla pro připojení k serveru" #: plinth/modules/mumble/forms.py:42 -#, fuzzy -#| msgid "" -#| "Set a new upload password for Coquelicot. Leave this field blank to keep " -#| "the current password." msgid "" "Set a password that is required to join the server. Leave empty to use the " "current password." msgstr "" -"Nastavte nové heslo pro nahrávání na Coquelicot. Pro ponechání stávajícího " -"hesla tuto kolonku nevyplňujte." +"Nastavte heslo, které je vyžadováno pro připojení k serveru. Nechte prázdné, " +"chcete-li použít aktuální heslo." #: plinth/modules/mumble/forms.py:48 msgid "Set the name for the root channel" @@ -3686,10 +3678,8 @@ msgid "SuperUser password successfully updated." msgstr "Heslo SuperUser bylo úspěšně aktualizováno." #: plinth/modules/mumble/views.py:46 -#, fuzzy -#| msgid "Upload password updated" msgid "Join password changed" -msgstr "Heslo pro nahrávání aktualizováno" +msgstr "Heslo pro připojení změněno" #: plinth/modules/mumble/views.py:51 msgid "Root channel name changed." @@ -6736,7 +6726,7 @@ msgid "" "A Tor SOCKS port is available on your {box_name} for internal networks on " "TCP port 9050." msgstr "" -"Tor SOCKS port je k dispozici na vašem {box_name} pro interní síť na TCP " +"Tor SOCKS port je k dispozici na vašem {box_name} pro interní síť na TCP " "portu 9050." #: plinth/modules/tor/__init__.py:54 diff --git a/plinth/locale/de/LC_MESSAGES/django.po b/plinth/locale/de/LC_MESSAGES/django.po index baafd2c83..bb88a8b23 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-06-20 20:21-0400\n" -"PO-Revision-Date: 2022-06-08 16:16+0000\n" +"PO-Revision-Date: 2022-06-22 17:14+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.13-dev\n" +"X-Generator: Weblate 4.13.1-dev\n" #: doc/dev/_templates/layout.html:11 msgid "Page source" @@ -1891,8 +1891,6 @@ msgid "Chat Server" msgstr "Chatserver" #: plinth/modules/ejabberd/forms.py:19 -#, fuzzy -#| msgid "Domain Names" msgid "Domain names" msgstr "Domain Namen" @@ -1901,6 +1899,9 @@ msgid "" "Domains to be used by ejabberd. Note that user accounts are unique for each " "domain, and migrating users to a new domain name is not yet implemented." msgstr "" +"Domains, die von ejabberd verwendet werden sollen. Beachten Sie, dass " +"Benutzerkonten für jede Domäne eindeutig sind und die Migration von " +"Benutzern zu einem neuen Domänennamen noch nicht implementiert ist." #: plinth/modules/ejabberd/forms.py:26 msgid "Enable Message Archive Management" @@ -3067,11 +3068,10 @@ msgid "A simple video conference room is included." msgstr "Ein einfacher Videokonferenzraum ist enthalten." #: plinth/modules/janus/__init__.py:26 -#, fuzzy, python-brace-format -#| msgid "A STUN/TURN server (such as Coturn) is required to use Janus." +#, python-brace-format msgid "Coturn is required to use Janus." msgstr "" -"Zur Verwendung von Janus ist ein STUN/TURN-Server (z. B. Coturn) " +"Zur Verwendung von Janus ist Coturn " "erforderlich." #: plinth/modules/janus/__init__.py:44 @@ -3455,14 +3455,12 @@ msgstr "" "\"myfreedombox.example.org\" oder \"example.onion\"." #: plinth/modules/mediawiki/forms.py:40 -#, fuzzy -#| msgid "Kite name" msgid "Site Name" -msgstr "Kite-Name" +msgstr "Website Name" #: plinth/modules/mediawiki/forms.py:41 msgid "Name of the site as displayed throughout the wiki." -msgstr "" +msgstr "Name der Website in der gesamten Wiki." #: plinth/modules/mediawiki/forms.py:45 msgid "Enable public registrations" @@ -3536,10 +3534,8 @@ msgid "Domain name updated" msgstr "Domainname aktualisiert" #: plinth/modules/mediawiki/views.py:103 -#, fuzzy -#| msgid "Domain name updated" msgid "Site name updated" -msgstr "Domainname aktualisiert" +msgstr "Website-Name aktualisiert" #: plinth/modules/minetest/__init__.py:35 #, python-brace-format @@ -3724,19 +3720,15 @@ msgstr "" #: plinth/modules/mumble/forms.py:40 msgid "Set a password to join the server" -msgstr "" +msgstr "Legen Sie ein Passwort fest, um dem Server beizutreten" #: plinth/modules/mumble/forms.py:42 -#, fuzzy -#| msgid "" -#| "Set a new upload password for Coquelicot. Leave this field blank to keep " -#| "the current password." msgid "" "Set a password that is required to join the server. Leave empty to use the " "current password." msgstr "" -"Ein neues Hochladen-Passwort für Coquelicot eingeben. Dieses Feld " -"leerlassen, um das derzeitige Passwort beizubehalten." +"Legen Sie ein Passwort fest, das für den Beitritt zum Server erforderlich " +"ist. Dieses Feld leerlassen, um das derzeitige Passwort beizubehalten." #: plinth/modules/mumble/forms.py:48 msgid "Set the name for the root channel" @@ -3763,10 +3755,8 @@ msgid "SuperUser password successfully updated." msgstr "SuperUser-Kennwort wurde erfolgreich aktualisiert." #: plinth/modules/mumble/views.py:46 -#, fuzzy -#| msgid "Upload password updated" msgid "Join password changed" -msgstr "Hochladen-Passwort geändert" +msgstr "Beitrittspasswort geändert" #: plinth/modules/mumble/views.py:51 msgid "Root channel name changed." diff --git a/plinth/locale/nl/LC_MESSAGES/django.po b/plinth/locale/nl/LC_MESSAGES/django.po index f41dd89a7..593cdaa7f 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-06-20 20:21-0400\n" -"PO-Revision-Date: 2022-06-08 16:16+0000\n" +"PO-Revision-Date: 2022-06-22 17:14+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.13-dev\n" +"X-Generator: Weblate 4.13.1-dev\n" "X-Language: nl_NL\n" "X-Source-Language: C\n" @@ -1871,8 +1871,6 @@ msgid "Chat Server" msgstr "Chatserver" #: plinth/modules/ejabberd/forms.py:19 -#, fuzzy -#| msgid "Domain Names" msgid "Domain names" msgstr "Domeinnamen" @@ -1881,6 +1879,9 @@ msgid "" "Domains to be used by ejabberd. Note that user accounts are unique for each " "domain, and migrating users to a new domain name is not yet implemented." msgstr "" +"Door ejabberd te gebruiken domeinen. Houd er rekening mee dat " +"gebruikersaccounts uniek zijn voor elk domein en dat het migreren van " +"gebruikers naar een nieuwe domeinnaam nog niet is geïmplementeerd." #: plinth/modules/ejabberd/forms.py:26 msgid "Enable Message Archive Management" @@ -3041,10 +3042,9 @@ msgid "A simple video conference room is included." msgstr "Er is ook een eenvoudige videoconferentieruimte." #: plinth/modules/janus/__init__.py:26 -#, fuzzy, python-brace-format -#| msgid "A STUN/TURN server (such as Coturn) is required to use Janus." +#, python-brace-format msgid "Coturn is required to use Janus." -msgstr "Om Janus te gebruiken is een TUN/TURN-server nodig." +msgstr "Om Janus te gebruiken is Coturn nodig." #: plinth/modules/janus/__init__.py:44 msgid "Janus" @@ -3423,14 +3423,12 @@ msgstr "" "example.org\" of \"example.onion\"." #: plinth/modules/mediawiki/forms.py:40 -#, fuzzy -#| msgid "Kite name" msgid "Site Name" -msgstr "Kitenaam" +msgstr "Sitenaam" #: plinth/modules/mediawiki/forms.py:41 msgid "Name of the site as displayed throughout the wiki." -msgstr "" +msgstr "Naam van de site zoals weergegeven in de wiki." #: plinth/modules/mediawiki/forms.py:45 msgid "Enable public registrations" @@ -3502,10 +3500,8 @@ msgid "Domain name updated" msgstr "Domeinnaam bijgewerkt" #: plinth/modules/mediawiki/views.py:103 -#, fuzzy -#| msgid "Domain name updated" msgid "Site name updated" -msgstr "Domeinnaam bijgewerkt" +msgstr "Sitenaam bijgewerkt" #: plinth/modules/minetest/__init__.py:35 #, python-brace-format @@ -3688,19 +3684,15 @@ msgstr "" #: plinth/modules/mumble/forms.py:40 msgid "Set a password to join the server" -msgstr "" +msgstr "Stel een wachtwoord in om mee aan te melden bij de server" #: plinth/modules/mumble/forms.py:42 -#, fuzzy -#| msgid "" -#| "Set a new upload password for Coquelicot. Leave this field blank to keep " -#| "the current password." msgid "" "Set a password that is required to join the server. Leave empty to use the " "current password." msgstr "" -"Stel een nieuw uploadwachtwoord in voor Coquelicot. Laat dit veld leeg om " -"het huidige wachtwoord te behouden." +"Stel een wachtwoord in dat vereist is om lid te worden van de server. Leeg " +"laten om het huidige wachtwoord te gebruiken." #: plinth/modules/mumble/forms.py:48 msgid "Set the name for the root channel" @@ -3727,10 +3719,8 @@ msgid "SuperUser password successfully updated." msgstr "Wachtwoord van de SuperGebruiker succesvol gewijzigd." #: plinth/modules/mumble/views.py:46 -#, fuzzy -#| msgid "Upload password updated" msgid "Join password changed" -msgstr "Uploadwachtwoord aangepast" +msgstr "Deelnamewachtwoord gewijzigd" #: plinth/modules/mumble/views.py:51 msgid "Root channel name changed." diff --git a/plinth/locale/tr/LC_MESSAGES/django.po b/plinth/locale/tr/LC_MESSAGES/django.po index 221f328ed..c1556c0f8 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-06-20 20:21-0400\n" -"PO-Revision-Date: 2022-06-08 16:16+0000\n" +"PO-Revision-Date: 2022-06-22 17:14+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.13-dev\n" +"X-Generator: Weblate 4.13.1-dev\n" #: doc/dev/_templates/layout.html:11 msgid "Page source" @@ -1856,16 +1856,17 @@ msgid "Chat Server" msgstr "Sohbet Sunucusu" #: plinth/modules/ejabberd/forms.py:19 -#, fuzzy -#| msgid "Domain Names" msgid "Domain names" -msgstr "Etki Alanı Adları" +msgstr "Etki alanı adları" #: plinth/modules/ejabberd/forms.py:21 msgid "" "Domains to be used by ejabberd. Note that user accounts are unique for each " "domain, and migrating users to a new domain name is not yet implemented." msgstr "" +"ejabberd tarafından kullanılacak etki alanları. Kullanıcı hesaplarının her " +"etki alanı için benzersiz olduğunu ve kullanıcıları yeni bir etki alanı " +"adına geçirilmesinin henüz uygulanmadığını unutmayın." #: plinth/modules/ejabberd/forms.py:26 msgid "Enable Message Archive Management" @@ -3021,11 +3022,9 @@ msgid "A simple video conference room is included." msgstr "Basit bir video konferans odası dahildir." #: plinth/modules/janus/__init__.py:26 -#, fuzzy, python-brace-format -#| msgid "A STUN/TURN server (such as Coturn) is required to use Janus." +#, python-brace-format msgid "Coturn is required to use Janus." -msgstr "" -"Janus'u kullanmak için bir STUN/TURN sunucusu (Coturn gibi) gereklidir." +msgstr "Janus'u kullanmak için Coturn gereklidir." #: plinth/modules/janus/__init__.py:44 msgid "Janus" @@ -3403,14 +3402,12 @@ msgstr "" "ornek.org\" veya \"ornek.onion\"." #: plinth/modules/mediawiki/forms.py:40 -#, fuzzy -#| msgid "Kite name" msgid "Site Name" -msgstr "Kite adı" +msgstr "Site Adı" #: plinth/modules/mediawiki/forms.py:41 msgid "Name of the site as displayed throughout the wiki." -msgstr "" +msgstr "Viki boyunca görüntülenen sitenin adı." #: plinth/modules/mediawiki/forms.py:45 msgid "Enable public registrations" @@ -3482,10 +3479,8 @@ msgid "Domain name updated" msgstr "Etki alanı adı güncellendi" #: plinth/modules/mediawiki/views.py:103 -#, fuzzy -#| msgid "Domain name updated" msgid "Site name updated" -msgstr "Etki alanı adı güncellendi" +msgstr "Site adı güncellendi" #: plinth/modules/minetest/__init__.py:35 #, python-brace-format @@ -3667,19 +3662,15 @@ msgstr "" #: plinth/modules/mumble/forms.py:40 msgid "Set a password to join the server" -msgstr "" +msgstr "Sunucuya katılmak için parola ayarlayın" #: plinth/modules/mumble/forms.py:42 -#, fuzzy -#| msgid "" -#| "Set a new upload password for Coquelicot. Leave this field blank to keep " -#| "the current password." msgid "" "Set a password that is required to join the server. Leave empty to use the " "current password." msgstr "" -"Coquelicot için yeni bir yükleme parolası ayarlayın. Şu anki parolayı " -"korumak için bu alanı boş bırakın." +"Sunucuya katılmak için gerekli bir parola ayarlayın. Şu anki parolayı " +"kullanmak için boş bırakın." #: plinth/modules/mumble/forms.py:48 msgid "Set the name for the root channel" @@ -3706,10 +3697,8 @@ msgid "SuperUser password successfully updated." msgstr "Süper Kullanıcı parolası başarılı olarak güncellendi." #: plinth/modules/mumble/views.py:46 -#, fuzzy -#| msgid "Upload password updated" msgid "Join password changed" -msgstr "Yükleme parolası güncellendi" +msgstr "Katılma parolası değiştirildi" #: plinth/modules/mumble/views.py:51 msgid "Root channel name changed." diff --git a/plinth/locale/zh_Hans/LC_MESSAGES/django.po b/plinth/locale/zh_Hans/LC_MESSAGES/django.po index 9d7997fe7..a12284135 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-06-20 20:21-0400\n" -"PO-Revision-Date: 2022-06-08 16:16+0000\n" +"PO-Revision-Date: 2022-06-22 17:14+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.13-dev\n" +"X-Generator: Weblate 4.13.1-dev\n" #: doc/dev/_templates/layout.html:11 msgid "Page source" @@ -1775,8 +1775,6 @@ msgid "Chat Server" msgstr "聊天服务器" #: plinth/modules/ejabberd/forms.py:19 -#, fuzzy -#| msgid "Domain Names" msgid "Domain names" msgstr "域名" @@ -3069,7 +3067,7 @@ msgid "" "the initial setup is currently not supported." msgstr "" "Matrix 服务器域名已设置为 %(domain_name)s 。用户 ID 看起来像是这样 " -"@username:%(domain_name)s。尚不支持在初始设置后更改域名。" +"@username:%(domain_name)s。尚不支持在初始设置后更改域名." #: plinth/modules/matrixsynapse/templates/matrix-synapse.html:22 msgid "" @@ -3137,10 +3135,8 @@ msgid "" msgstr "" #: plinth/modules/mediawiki/forms.py:40 -#, fuzzy -#| msgid "Kite name" msgid "Site Name" -msgstr "Kite 名字" +msgstr "站点名" #: plinth/modules/mediawiki/forms.py:41 msgid "Name of the site as displayed throughout the wiki." @@ -3209,10 +3205,8 @@ msgid "Domain name updated" msgstr "域名已更新" #: plinth/modules/mediawiki/views.py:103 -#, fuzzy -#| msgid "Domain name updated" msgid "Site name updated" -msgstr "域名已更新" +msgstr "站点名已更新" #: plinth/modules/minetest/__init__.py:35 #, python-brace-format @@ -3400,10 +3394,8 @@ msgid "SuperUser password successfully updated." msgstr "超级用户密码更新成功。" #: plinth/modules/mumble/views.py:46 -#, fuzzy -#| msgid "Upload password updated" msgid "Join password changed" -msgstr "上传密码已更新" +msgstr "加入密码已更改" #: plinth/modules/mumble/views.py:51 msgid "Root channel name changed." diff --git a/plinth/modules/mumble/__init__.py b/plinth/modules/mumble/__init__.py index 9a5005da1..7268dc04b 100644 --- a/plinth/modules/mumble/__init__.py +++ b/plinth/modules/mumble/__init__.py @@ -8,7 +8,6 @@ import pathlib from django.urls import reverse_lazy from django.utils.translation import gettext_lazy as _ -from plinth import actions from plinth import app as app_module from plinth import frontpage, menu from plinth.daemon import Daemon @@ -20,7 +19,7 @@ from plinth.modules.users.components import UsersAndGroups from plinth.package import Packages from plinth.utils import Version -from . import manifest +from . import manifest, privileged _description = [ _('Mumble is an open source, low-latency, encrypted, high quality ' @@ -98,7 +97,7 @@ class MumbleApp(app_module.App): def setup(helper, old_version=None): """Install and configure the module.""" app.setup(old_version) - helper.call('post', actions.superuser_run, 'mumble', ['setup']) + helper.call('post', privileged.setup) if not old_version: helper.call('post', app.enable) @@ -116,7 +115,7 @@ def force_upgrade(helper, packages): return False helper.install(['mumble-server'], force_configuration='new') - helper.call('post', actions.superuser_run, 'mumble', ['setup']) + helper.call('post', privileged.setup) return True @@ -126,18 +125,12 @@ def get_available_domains(): if domain.domain_type.can_have_certificate) -def set_domain(domain): - """Set the TLS domain by writing a file to data directory.""" - if domain: - actions.superuser_run('mumble', ['set-domain', domain]) - - def get_domain(): """Read TLS domain from config file select first available if none.""" - domain = actions.superuser_run('mumble', ['get-domain']).strip() + domain = privileged.get_domain() if not domain: domain = next(get_available_domains(), None) - set_domain(domain) + privileged.set_domain(domain) return domain @@ -152,8 +145,3 @@ def get_domains(): return [domain] return [] - - -def get_root_channel_name(): - """Return the root channel name.""" - return actions.superuser_run('mumble', ['get-root-channel-name']) diff --git a/plinth/modules/mumble/manifest.py b/plinth/modules/mumble/manifest.py index e5c8b493a..95a4c8fb4 100644 --- a/plinth/modules/mumble/manifest.py +++ b/plinth/modules/mumble/manifest.py @@ -55,6 +55,9 @@ clients = [{ }] backup = { + 'config': { + 'files': ['/etc/mumble-server.ini'] + }, 'data': { 'directories': ['/var/lib/mumble-server'] }, diff --git a/plinth/modules/mumble/privileged.py b/plinth/modules/mumble/privileged.py new file mode 100644 index 000000000..9ef198fab --- /dev/null +++ b/plinth/modules/mumble/privileged.py @@ -0,0 +1,87 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Configure Mumble server. +""" + +import pathlib +import subprocess +from typing import Optional + +import augeas + +from plinth import action_utils +from plinth.actions import privileged + +CONFIG_FILE = '/etc/mumble-server.ini' +DATA_DIR = '/var/lib/mumble-server' + + +@privileged +def setup(): + """Setup Mumble server.""" + aug = _load_augeas() + aug.set('.anon/sslCert', DATA_DIR + '/fullchain.pem') + aug.set('.anon/sslKey', DATA_DIR + '/privkey.pem') + aug.save() + + +@privileged +def set_super_user_password(password: str): + """Set the superuser password with murmurd command.""" + subprocess.run(['murmurd', '-readsupw'], input=password.encode(), + stdout=subprocess.DEVNULL, check=False) + + +@privileged +def get_domain() -> Optional[str]: + """Return domain name set in mumble or empty string.""" + domain_file = pathlib.Path('/var/lib/mumble-server/domain-freedombox') + try: + return domain_file.read_text(encoding='utf-8') + except FileNotFoundError: + return None + + +@privileged +def set_domain(domain_name: Optional[str]): + """Write a file containing domain name.""" + if domain_name: + domain_file = pathlib.Path('/var/lib/mumble-server/domain-freedombox') + domain_file.write_text(domain_name, encoding='utf-8') + + +@privileged +def change_join_password(join_password: str): + """Change to password that is required to join the server""" + aug = _load_augeas() + aug.set('.anon/serverpassword', join_password) + aug.save() + action_utils.service_try_restart('mumble-server') + + +@privileged +def change_root_channel_name(root_channel_name: str): + """Change the name of the Root channel.""" + aug = _load_augeas() + aug.set('.anon/registerName', root_channel_name) + aug.save() + action_utils.service_try_restart('mumble-server') + + +@privileged +def get_root_channel_name() -> Optional[str]: + """Return the currently configured Root channel name.""" + aug = _load_augeas() + name = aug.get('.anon/registerName') + return name or None + + +def _load_augeas(): + """Initialize Augeas.""" + aug = augeas.Augeas(flags=augeas.Augeas.NO_LOAD + + augeas.Augeas.NO_MODL_AUTOLOAD) + aug.transform('Php', CONFIG_FILE) + aug.set('/augeas/context', '/files' + CONFIG_FILE) + aug.load() + + return aug diff --git a/plinth/modules/mumble/tests/test_functional.py b/plinth/modules/mumble/tests/test_functional.py index 4a9912f2e..83cd6ef91 100644 --- a/plinth/modules/mumble/tests/test_functional.py +++ b/plinth/modules/mumble/tests/test_functional.py @@ -18,15 +18,38 @@ class TestMumbleApp(functional.BaseAppTests): # TODO: Requires a valid domain with certificates to complete setup. check_diagnostics = False - # TODO: Improve test_backup_restore to actually check that data such - # as rooms, identity or certificates are restored. + @staticmethod + def test_change_root_channel_name(session_browser): + """Test changing root channel name.""" + functional.set_app_form_value(session_browser, 'mumble', + 'id_root_channel_name', 'test-channel') + assert session_browser.find_by_id( + 'id_root_channel_name').value == 'test-channel' - def test_change_root_channel_name(self, session_browser): - functional.app_enable(session_browser, 'mumble') - functional.nav_to_module(session_browser, 'mumble') - session_browser.find_by_id('id_root_channel_name').fill('testing123') - functional.submit(session_browser, form_class='form-configuration') + @staticmethod + def test_set_super_user_password(session_browser): + """Test setting the super user password.""" + functional.set_app_form_value(session_browser, 'mumble', + 'id_super_user_password', 'testsu123') + @staticmethod + def test_set_join_password(session_browser): + """Test setting join password.""" + functional.set_app_form_value(session_browser, 'mumble', + 'id_join_password', 'testjoin123') + + @pytest.mark.backups + def test_backup_restore(self, session_browser): + """Test that backup and restore operations work on the app.""" + functional.set_app_form_value(session_browser, 'mumble', + 'id_root_channel_name', 'pre-backup') + functional.backup_create(session_browser, self.app_name, + 'test_' + self.app_name) + functional.set_app_form_value(session_browser, 'mumble', + 'id_root_channel_name', 'post-backup') + functional.backup_restore(session_browser, self.app_name, + 'test_' + self.app_name) functional.nav_to_module(session_browser, 'mumble') assert session_browser.find_by_id( - 'id_root_channel_name').value == 'testing123' + 'id_root_channel_name').value == 'pre-backup' + self.assert_app_running(session_browser) diff --git a/plinth/modules/mumble/views.py b/plinth/modules/mumble/views.py index b34817cee..d7406b61a 100644 --- a/plinth/modules/mumble/views.py +++ b/plinth/modules/mumble/views.py @@ -1,12 +1,17 @@ # SPDX-License-Identifier: AGPL-3.0-or-later +""" +Views for mumble app. +""" + from django.contrib import messages from django.utils.translation import gettext_lazy as _ -from plinth import actions from plinth.modules import mumble from plinth.modules.mumble.forms import MumbleForm from plinth.views import AppView +from . import privileged + class MumbleAppView(AppView): app_id = 'mumble' @@ -16,38 +21,33 @@ class MumbleAppView(AppView): """Return the values to fill in the form.""" initial = super().get_initial() initial['domain'] = mumble.get_domain() - initial['root_channel_name'] = mumble.get_root_channel_name() + initial['root_channel_name'] = privileged.get_root_channel_name() return initial def form_valid(self, form): - """Apply new superuser password if it exists""" + """Apply form changes.""" + old_config = self.get_initial() new_config = form.cleaned_data if mumble.get_domain() != new_config['domain']: - mumble.set_domain(new_config['domain']) + privileged.set_domain(new_config['domain']) mumble.app.get_component('letsencrypt-mumble').setup_certificates() messages.success(self.request, _('Configuration updated')) password = new_config.get('super_user_password') if password: - actions.run_as_user( - 'mumble', - ['create-password'], - input=password.encode(), - become_user="mumble-server", - ) + privileged.set_super_user_password(password) messages.success(self.request, _('SuperUser password successfully updated.')) join_password = new_config.get('join_password') if join_password: - actions.superuser_run('mumble', - ['change-join-password', join_password]) + privileged.change_join_password(join_password) messages.success(self.request, _('Join password changed')) name = new_config.get('root_channel_name') - if name: - actions.superuser_run('mumble', ['change-root-channel-name', name]) + if old_config['root_channel_name'] != new_config['root_channel_name']: + privileged.change_root_channel_name(name) messages.success(self.request, _('Root channel name changed.')) return super().form_valid(form) diff --git a/plinth/modules/upgrades/__init__.py b/plinth/modules/upgrades/__init__.py index 418be5d89..646cb3833 100644 --- a/plinth/modules/upgrades/__init__.py +++ b/plinth/modules/upgrades/__init__.py @@ -62,7 +62,7 @@ class UpgradesApp(app_module.App): app_id = 'upgrades' - _version = 13 + _version = 14 can_be_disabled = False diff --git a/plinth/tests/functional/__init__.py b/plinth/tests/functional/__init__.py index 651df6081..07eebec29 100644 --- a/plinth/tests/functional/__init__.py +++ b/plinth/tests/functional/__init__.py @@ -203,6 +203,17 @@ def submit(browser, element=None, form_class=None, expected_url=None): browser.find_by_css('input[type=submit]').click() +def set_app_form_value(browser, app_id, element_id, value): + """Change a value in the form and submit.""" + nav_to_module(browser, app_id) + original_url = browser.url + browser.find_by_id(element_id).fill(value) + submit(browser, form_class='form-configuration') + # Check that there are no errors + assert browser.url == original_url + assert not browser.find_by_css('.alert-danger') + + def change_checkbox_status(browser, app_name, checkbox_id, change_status_to='enabled'): """Change checkbox status."""