From 550f9192ae4e5c4dd486ba08738ecee322929fce Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Tue, 28 Feb 2023 22:24:42 +0530 Subject: [PATCH 1/8] ci: Force pip to install packages to system environment Without the change, pip refuses to install into system environment due to changes outlined in PEP 668. The following error is thrown: 'error: externally-managed-environment'. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- .ci/Dockerfile.gitlabci | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/Dockerfile.gitlabci b/.ci/Dockerfile.gitlabci index 0e22916a6..e89f81c2f 100644 --- a/.ci/Dockerfile.gitlabci +++ b/.ci/Dockerfile.gitlabci @@ -25,4 +25,4 @@ RUN apt-get install -y build-essential \ RUN apt-get install -y $(./run --list-dependencies) # Coverage should know that test_functional.py files are tests -RUN pip3 install splinter pytest-bdd +RUN pip3 install --break-system-packages splinter pytest-bdd From 41e9473a0c877516251bed5c026ce11cf704ed3c Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Tue, 28 Feb 2023 07:22:51 +0530 Subject: [PATCH 2/8] /etc/issue: Update message to reflect that all users can login Closes: #2325. We have recently started allowing all the users to login to FreedomBox console instead of just the administrators accounts. Remove the message that only administrators can login. Tests: - Run ./setup.py install and then notice that login message got updated in a vagrant machine. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- data/etc/issue.d/01freedombox.issue | 1 - 1 file changed, 1 deletion(-) diff --git a/data/etc/issue.d/01freedombox.issue b/data/etc/issue.d/01freedombox.issue index 5cc201733..0a1f78389 100644 --- a/data/etc/issue.d/01freedombox.issue +++ b/data/etc/issue.d/01freedombox.issue @@ -7,5 +7,4 @@ http://\n.local/ http://\4/ http://[\6]/ -Only administrators can login unless otherwise configured in Security section. FreedomBox also provides a web console for system administration using Cockpit. From e974ac735a30d2c52a0e064dbc4f26e2f133e801 Mon Sep 17 00:00:00 2001 From: nbenedek Date: Wed, 22 Feb 2023 23:13:02 +0100 Subject: [PATCH 3/8] samba: make sure shares are not accesible from the internet The reason for this patch is explained in issue #789 . See also: !2250 Signed-off-by: nbenedek Reviewed-by: James Valleroy [jvalleroy: Don't enable app when upgrading] Signed-off-by: James Valleroy --- plinth/modules/samba/__init__.py | 5 +++-- plinth/modules/samba/privileged.py | 8 ++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/plinth/modules/samba/__init__.py b/plinth/modules/samba/__init__.py index cab73b3b8..2a2cd21f2 100644 --- a/plinth/modules/samba/__init__.py +++ b/plinth/modules/samba/__init__.py @@ -41,7 +41,7 @@ class SambaApp(app_module.App): app_id = 'samba' - _version = 2 + _version = 3 def __init__(self): """Create components for the app.""" @@ -99,7 +99,8 @@ class SambaApp(app_module.App): """Install and configure the app.""" super().setup(old_version) privileged.setup() - self.enable() + if not old_version: + self.enable() class SambaBackupRestore(BackupRestore): diff --git a/plinth/modules/samba/privileged.py b/plinth/modules/samba/privileged.py index e91857926..3f6cb267a 100644 --- a/plinth/modules/samba/privileged.py +++ b/plinth/modules/samba/privileged.py @@ -39,6 +39,14 @@ CONF = r''' deadtime = 5 # enable registry based shares registry shares = yes + # Make sure Samba isn't available over the Internet. + # https://en.wikipedia.org/wiki/localhost + # https://en.wikipedia.org/wiki/Private_network + # https://en.wikipedia.org/wiki/Link-local_address + # https://en.wikipedia.org/wiki/Unique_local_address + access control = yes + hosts allow = 127.0.0.0/8 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 169.254.0.0/16 [::1] [fc00::]/7 [fe80::] + hosts deny = all ''' # noqa: E501 From bf2e53f3235729d25c254a4470f382013828a774 Mon Sep 17 00:00:00 2001 From: nbenedek Date: Tue, 7 Mar 2023 23:37:31 +0100 Subject: [PATCH 4/8] ttrss: fix failing backup Closes: #2206 Use pg_dumpall instead of pg_dump. Test I did: 1. Install tt-rss and add a feed 2. Create a backup 3. On a fresh installation restore the backup from file Signed-off-by: nbenedek [jvalleroy: Add a comment about the limitation of this approach] Signed-off-by: James Valleroy Reviewed-by: James Valleroy --- plinth/modules/ttrss/privileged.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plinth/modules/ttrss/privileged.py b/plinth/modules/ttrss/privileged.py index dcc242ef4..8f53f0ff2 100644 --- a/plinth/modules/ttrss/privileged.py +++ b/plinth/modules/ttrss/privileged.py @@ -113,7 +113,10 @@ def dump_database(): """Dump database to file.""" os.makedirs(os.path.dirname(DB_BACKUP_FILE), exist_ok=True) with open(DB_BACKUP_FILE, 'w', encoding='utf-8') as db_backup_file: - _run_as_postgres(['pg_dump', 'ttrss'], stdout=db_backup_file) + # XXX: Currently, ttrss is the only app that uses + # PostgreSQL. If another app was using it, then its data would + # be included in the backup here. + _run_as_postgres(['pg_dumpall'], stdout=db_backup_file) @privileged From 0dc8bbc865d3688daaa4fef6b11c47bc23636b4b Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Tue, 28 Feb 2023 11:22:57 +0530 Subject: [PATCH 5/8] datetime: Use timedatectl to read current timezone Closes: #2326. There are plans to remove /etc/timezone from Debian (Debian bug: #822733). It has been removed temporarily and that caused failures in FreedomBox. Since we use systemd-timesyncd and timedatectl, use timedatectl to retrieve the currently set timezone value. This eliminates the need to read timezone at a lower level. Tests: - Getting and setting the timezone works. - Removing /etc/timezone and /etc/localtime then visiting the Date & Time app works. After setting the timezone, /etc/localtime file is created as symlink. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/datetime/views.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/plinth/modules/datetime/views.py b/plinth/modules/datetime/views.py index 68c228e9e..c10f3b284 100644 --- a/plinth/modules/datetime/views.py +++ b/plinth/modules/datetime/views.py @@ -2,7 +2,7 @@ """FreedomBox app for configuring date and time.""" import logging -import pathlib +import subprocess from django.contrib import messages from django.utils.translation import gettext as _ @@ -24,15 +24,19 @@ class DateTimeAppView(AppView): def get_initial(self): """Return the values to fill in the form.""" status = super().get_initial() - status['time_zone'] = self.get_current_time_zone() + status['time_zone'] = self.get_current_time_zone() or 'none' return status @staticmethod def get_current_time_zone(): """Get current time zone.""" - path = pathlib.Path('/etc/timezone') - time_zone = path.read_text(encoding='utf-8').rstrip() - return time_zone or 'none' + try: + process = subprocess.run( + ['timedatectl', 'show', '--property', 'Timezone', '--value'], + stdout=subprocess.PIPE, check=True) + return process.stdout.decode().strip() + except subprocess.CalledProcessError: + return None def form_valid(self, form): """Change the timezone.""" From 604a1cb2b050a1586603a5d6abb153d00e9074d0 Mon Sep 17 00:00:00 2001 From: James Valleroy Date: Mon, 13 Mar 2023 21:32:47 -0400 Subject: [PATCH 6/8] locale: Update translation strings Signed-off-by: James Valleroy --- plinth/locale/ar/LC_MESSAGES/django.po | 6 +++--- plinth/locale/ar_SA/LC_MESSAGES/django.po | 6 +++--- plinth/locale/bg/LC_MESSAGES/django.po | 6 +++--- plinth/locale/bn/LC_MESSAGES/django.po | 6 +++--- plinth/locale/cs/LC_MESSAGES/django.po | 6 +++--- plinth/locale/da/LC_MESSAGES/django.po | 6 +++--- plinth/locale/de/LC_MESSAGES/django.po | 6 +++--- plinth/locale/django.pot | 6 +++--- plinth/locale/el/LC_MESSAGES/django.po | 6 +++--- plinth/locale/es/LC_MESSAGES/django.po | 6 +++--- plinth/locale/fa/LC_MESSAGES/django.po | 6 +++--- plinth/locale/fake/LC_MESSAGES/django.po | 6 +++--- plinth/locale/fr/LC_MESSAGES/django.po | 6 +++--- plinth/locale/gl/LC_MESSAGES/django.po | 6 +++--- plinth/locale/gu/LC_MESSAGES/django.po | 6 +++--- plinth/locale/hi/LC_MESSAGES/django.po | 6 +++--- plinth/locale/hu/LC_MESSAGES/django.po | 6 +++--- plinth/locale/id/LC_MESSAGES/django.po | 6 +++--- plinth/locale/it/LC_MESSAGES/django.po | 6 +++--- plinth/locale/ja/LC_MESSAGES/django.po | 6 +++--- plinth/locale/kn/LC_MESSAGES/django.po | 6 +++--- plinth/locale/lt/LC_MESSAGES/django.po | 6 +++--- plinth/locale/lv/LC_MESSAGES/django.po | 6 +++--- plinth/locale/nb/LC_MESSAGES/django.po | 6 +++--- plinth/locale/nl/LC_MESSAGES/django.po | 6 +++--- plinth/locale/pl/LC_MESSAGES/django.po | 6 +++--- plinth/locale/pt/LC_MESSAGES/django.po | 6 +++--- plinth/locale/ru/LC_MESSAGES/django.po | 6 +++--- plinth/locale/si/LC_MESSAGES/django.po | 6 +++--- plinth/locale/sl/LC_MESSAGES/django.po | 6 +++--- plinth/locale/sq/LC_MESSAGES/django.po | 6 +++--- plinth/locale/sr/LC_MESSAGES/django.po | 6 +++--- plinth/locale/sv/LC_MESSAGES/django.po | 6 +++--- plinth/locale/ta/LC_MESSAGES/django.po | 6 +++--- plinth/locale/te/LC_MESSAGES/django.po | 6 +++--- plinth/locale/tr/LC_MESSAGES/django.po | 6 +++--- plinth/locale/uk/LC_MESSAGES/django.po | 6 +++--- plinth/locale/vi/LC_MESSAGES/django.po | 6 +++--- plinth/locale/zh_Hans/LC_MESSAGES/django.po | 6 +++--- plinth/locale/zh_Hant/LC_MESSAGES/django.po | 6 +++--- 40 files changed, 120 insertions(+), 120 deletions(-) diff --git a/plinth/locale/ar/LC_MESSAGES/django.po b/plinth/locale/ar/LC_MESSAGES/django.po index f0ddf3036..12f3977ae 100644 --- a/plinth/locale/ar/LC_MESSAGES/django.po +++ b/plinth/locale/ar/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-27 20:10-0500\n" +"POT-Creation-Date: 2023-03-13 21:32-0400\n" "PO-Revision-Date: 2022-03-31 09:12+0000\n" "Last-Translator: abidin toumi \n" "Language-Team: Arabic \n" "Language-Team: Arabic (Saudi Arabia) \n" "Language-Team: Bulgarian \n" "Language-Team: Bengali \n" "Language-Team: Czech \n" "Language-Team: Danish \n" "Language-Team: German \n" "Language-Team: LANGUAGE \n" @@ -1281,12 +1281,12 @@ msgstr "" msgid "-- no time zone set --" msgstr "" -#: plinth/modules/datetime/views.py:49 +#: plinth/modules/datetime/views.py:53 #, python-brace-format msgid "Error setting time zone: {exception}" msgstr "" -#: plinth/modules/datetime/views.py:52 +#: plinth/modules/datetime/views.py:56 msgid "Time zone set" msgstr "" diff --git a/plinth/locale/el/LC_MESSAGES/django.po b/plinth/locale/el/LC_MESSAGES/django.po index f58f4f55f..a3fd9e1c2 100644 --- a/plinth/locale/el/LC_MESSAGES/django.po +++ b/plinth/locale/el/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-27 20:10-0500\n" +"POT-Creation-Date: 2023-03-13 21:32-0400\n" "PO-Revision-Date: 2022-09-14 17:20+0000\n" "Last-Translator: ikmaak \n" "Language-Team: Greek \n" "Language-Team: Spanish \n" "Language-Team: Persian \n" "Language-Team: Plinth Developers \n" "Language-Team: French \n" "Language-Team: Galician \n" "Language-Team: Gujarati \n" "Language-Team: Hindi \n" "Language-Team: Hungarian \n" "Language-Team: Indonesian \n" "Language-Team: Italian \n" "Language-Team: Japanese \n" "Language-Team: Kannada \n" "Language-Team: Lithuanian \n" "Language-Team: Latvian \n" "Language-Team: Norwegian Bokmål \n" "Language-Team: Dutch \n" "Language-Team: Polish \n" "Language-Team: Portuguese \n" "Language-Team: Russian \n" "Language-Team: Sinhala \n" "Language-Team: Slovenian \n" "Language-Team: Albanian \n" "Language-Team: Serbian \n" "Language-Team: Swedish \n" "Language-Team: LANGUAGE \n" @@ -1282,12 +1282,12 @@ msgstr "" msgid "-- no time zone set --" msgstr "" -#: plinth/modules/datetime/views.py:49 +#: plinth/modules/datetime/views.py:53 #, python-brace-format msgid "Error setting time zone: {exception}" msgstr "" -#: plinth/modules/datetime/views.py:52 +#: plinth/modules/datetime/views.py:56 msgid "Time zone set" msgstr "" diff --git a/plinth/locale/te/LC_MESSAGES/django.po b/plinth/locale/te/LC_MESSAGES/django.po index bbd0b0db4..dc2c57542 100644 --- a/plinth/locale/te/LC_MESSAGES/django.po +++ b/plinth/locale/te/LC_MESSAGES/django.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: FreedomBox UI\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-27 20:10-0500\n" +"POT-Creation-Date: 2023-03-13 21:32-0400\n" "PO-Revision-Date: 2022-03-02 12:27+0000\n" "Last-Translator: James Valleroy \n" "Language-Team: Telugu \n" "Language-Team: Turkish \n" "Language-Team: Ukrainian \n" "Language-Team: Vietnamese \n" "Language-Team: Chinese (Simplified) \n" "Language-Team: Chinese (Traditional) Date: Mon, 13 Mar 2023 21:52:25 -0400 Subject: [PATCH 7/8] doc: Fetch latest manual Signed-off-by: James Valleroy --- doc/manual/en/ReleaseNotes.raw.wiki | 8 ++++++++ doc/manual/es/ReleaseNotes.raw.wiki | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/doc/manual/en/ReleaseNotes.raw.wiki b/doc/manual/en/ReleaseNotes.raw.wiki index 4f57cc6a7..c457e3f59 100644 --- a/doc/manual/en/ReleaseNotes.raw.wiki +++ b/doc/manual/en/ReleaseNotes.raw.wiki @@ -8,6 +8,14 @@ For more technical details, see the [[https://salsa.debian.org/freedombox-team/f The following are the release notes for each !FreedomBox version. +== FreedomBox 23.6 (2023-03-13) == + + * /etc/issue: Update message to reflect that all users can login + * ci: Force pip to install packages to system environment + * datetime: Use timedatectl to read current timezone + * samba: Make sure shares are not accessible from the internet + * ttrss: Fix failing backup + == FreedomBox 23.5 (2023-02-27) == * mediawiki: Fix app view error diff --git a/doc/manual/es/ReleaseNotes.raw.wiki b/doc/manual/es/ReleaseNotes.raw.wiki index 4f57cc6a7..c457e3f59 100644 --- a/doc/manual/es/ReleaseNotes.raw.wiki +++ b/doc/manual/es/ReleaseNotes.raw.wiki @@ -8,6 +8,14 @@ For more technical details, see the [[https://salsa.debian.org/freedombox-team/f The following are the release notes for each !FreedomBox version. +== FreedomBox 23.6 (2023-03-13) == + + * /etc/issue: Update message to reflect that all users can login + * ci: Force pip to install packages to system environment + * datetime: Use timedatectl to read current timezone + * samba: Make sure shares are not accessible from the internet + * ttrss: Fix failing backup + == FreedomBox 23.5 (2023-02-27) == * mediawiki: Fix app view error From 0a5d3bd8e725be264125a81ca1c5fbbf17c02da5 Mon Sep 17 00:00:00 2001 From: James Valleroy Date: Mon, 13 Mar 2023 21:53:11 -0400 Subject: [PATCH 8/8] Release v23.6 to unstable Signed-off-by: James Valleroy --- debian/changelog | 17 +++++++++++++++++ plinth/__init__.py | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index e8c0ffbac..79ba1531a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,20 @@ +freedombox (23.6) unstable; urgency=medium + + [ Sunil Mohan Adapa ] + * ci: Force pip to install packages to system environment + * /etc/issue: Update message to reflect that all users can login + * datetime: Use timedatectl to read current timezone + + [ nbenedek ] + * samba: make sure shares are not accessible from the internet + * ttrss: fix failing backup + + [ James Valleroy ] + * locale: Update translation strings + * doc: Fetch latest manual + + -- James Valleroy Mon, 13 Mar 2023 21:52:56 -0400 + freedombox (23.5) unstable; urgency=medium [ Dietmar ] diff --git a/plinth/__init__.py b/plinth/__init__.py index 37cf5efcc..5420964b9 100644 --- a/plinth/__init__.py +++ b/plinth/__init__.py @@ -3,4 +3,4 @@ Package init file. """ -__version__ = '23.5' +__version__ = '23.6'