7872 Commits

Author SHA1 Message Date
Sunil Mohan Adapa
f9fd1b142a
datetime: Use privileged decorator for actions
Tests:

- Setting timezone shows:
  - In the interface and
  - timedatectl

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-10-08 18:51:45 -04:00
Sunil Mohan Adapa
013caa28bc
coturn: Use privileged decorator for actions
Tests:

- Initial setup of coturn succeeds
  - Configuration file is created and required configuration is set.
  - Coturn is restarted
- Coturn configuration is shown on app page.
- Changing the domain succeeds and coturn configuration reflects the new domain.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-10-08 18:51:42 -04:00
Sunil Mohan Adapa
7ff050511c
config: Minor refactor
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-10-08 18:51:39 -04:00
Sunil Mohan Adapa
b607174434
config: Use privileged decorator for set domainname action
Tests:

- Running flake8 as in .gitlab-ci.yml works.
- Setting the domain name again to update /etc/hosts file after hostname change
  works
- Setting the domain name from the text box works. New domain name is read back
  and shown properly.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-10-08 18:51:36 -04:00
Sunil Mohan Adapa
40bf6add75
config: Use privileged decorator for set-hostname action
Tests:

- Running flake8 as in .gitlab-ci.yml works.
- Changes the hostname works and it is updated in /etc/hostname
  - Avahi daemon is restarted

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-10-08 18:51:33 -04:00
Sunil Mohan Adapa
06b5639986
config: Use privileged decorator for actions
Tests:

- Initial setup succeeds
- (not tested, functionality removed later) During initial setup, if
  /etc/apache2/conf-available/freedombox.conf has home page other than /plinth,
  it will be changed to /plinth.
- Setting the home page to Apache default, plinth, or an app works.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-10-08 18:51:30 -04:00
Sunil Mohan Adapa
b29182a0eb
config: Minor update to privileged method signature
Tests:

- Setting logging method works.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-10-08 18:51:27 -04:00
Sunil Mohan Adapa
d7a60b1aca
calibre: Use privileged decorator for actions
Tests:

- Unit and functional tests work.
- Creating a library works.
  - An error while creating library shows as proper message.
- Deleting a library works.
  - An error while deleting library shows as proper messages.
- Creating/deleting library reflects properly in the list of libraries.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-10-08 18:51:24 -04:00
Sunil Mohan Adapa
cdb04bb46a
bind: Use privileged decorator for actions
Tests:

- Initial setup:
  - Creates zones directory
  - Write default configuration
  - named is restarted
- Forwarders
  - Setting forwarders works as expected.
  - Current list of forwarders is shown as expected
- List of served domains is shown properly

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-10-08 18:51:21 -04:00
Sunil Mohan Adapa
212364ba2a
bepasty: Use privileged decorator for actions
Tests:

- Functional tests
- Initial setup
  - Sets the domain to freedombox.local (SITENAME)
  - Default permissions are set to read
  - Three passwords with varying permissions are create by default
- Current configuration is retrieved properly (default permissions, passwords)
- Adding passwords works, they are list as expected
  - With or without comment
- Removing password works
- Setting default permissions works
- Untested:
  - Upgrade from version 1

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-10-08 18:51:18 -04:00
Sunil Mohan Adapa
3e2900b48b
apache: Use privileged decorator for actions
Tests:

- Initial setup works when a new container is created
- When transmission is enabled/disabled, the web configuration for it is
  enabled/disabled.
- When radicale is enabled/disabled, the uwsgi configuration for it is
  enabled/disabled.
- Sharing web configuration is disabled during backup and re-enabled.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-10-08 18:51:15 -04:00
Sunil Mohan Adapa
fdbe537529
tests: Add fixture to help in testing privileged actions
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-10-08 18:51:12 -04:00
Sunil Mohan Adapa
6e1c8c30fd
dynamicdns: Check action script with flake8
- When the action was converted from shell to python3, it was not removed from
the exclusion list.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-10-08 18:51:08 -04:00
Sunil Mohan Adapa
2bd0ef7c61
config: Drop ability to set hostname on systems without systemd
We depend on systemd for many things anyway and this code path is never tested.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-10-08 18:51:04 -04:00
Sunil Mohan Adapa
5a1f4b6647
actions: Allow actions to be called by other users
There is not much additional risk by doing this. This is needed in case of some
exceptional cases such as storage.validate_directory() which need to run as a
different user other than root.

Tests:

- Directory validation works in transmission and deluge.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-10-08 18:50:49 -04:00
Sunil Mohan Adapa
0dff0fc293
actions: Implement getting raw output from the process
Tests:

- export-tar for a backup archive works. Yields reasonable speeds > 30 MB/s.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-10-08 18:50:40 -04:00
Sunil Mohan Adapa
6f5410931e
actions: Use separate IPC for communicating results
Currently privileged actions use stdout for returning the results. If any of the
sub-processes accidentally output to stdout, decoding errors occur. Prevent this
by opening a pipe to the privileged action and returning the output in that
pipe.

Tests:

- Run unit tests
- Functional tests for other apps pass

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-10-08 18:50:37 -04:00
Sunil Mohan Adapa
585092ca63
actions: Allow nested and top-level actions
- Currently, privileged actions are not allowed under top-level plinth module.
They are only allowed under each app module. Allow privileged actions under
plinth module.

- Currently, privileged actions are not allowed under a sub-module of
'privileged' package. They are allowed only in 'privileged' module. Allow
sub-modules under 'privileged' package.

Tests:

- Email app functional tests pass
- Functional tests for apps using package and service privileged methods pass

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-10-08 18:50:34 -04:00
Sunil Mohan Adapa
74678c1d69
doc: dev: Minor example code refactor
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-10-08 18:50:31 -04:00
Sunil Mohan Adapa
0e326cfea3
templates: Update HTML meta tags for better description and app-name
- 'application-name' is not meant for regular web pages, just web apps.
FreedomBox qualifies as a web app. Browsers may use this over title.

- 'description' should rather talk about FreedomBox rather than just what role
the web interface plays in the FreedomBox project.

Tests:

- Verify formatting in output HTML.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-10-08 09:14:01 -04:00
Tymofii Lytvynenko
4fada0a23e
Translated using Weblate (Ukrainian)
Currently translated at 87.9% (1311 of 1491 strings)
2022-10-06 22:22:59 +02:00
Jiří Podhorecký
6268ae1779
Translated using Weblate (Czech)
Currently translated at 100.0% (1491 of 1491 strings)
2022-10-05 11:23:37 +02:00
Tymofii Lytvynenko
2712da4c5d
Translated using Weblate (Ukrainian)
Currently translated at 87.0% (1298 of 1491 strings)
2022-10-03 16:15:39 +02:00
Michael Breidenbach
4c2743451f
Translated using Weblate (Swedish)
Currently translated at 100.0% (1491 of 1491 strings)
2022-10-03 16:15:39 +02:00
James Valleroy
aa47619719
Release v22.21.1 to unstable
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
v22.21.1
2022-10-01 10:07:29 -04:00
109247019824
cd6bdf6bd7
Translated using Weblate (Bulgarian)
Currently translated at 39.8% (594 of 1491 strings)
2022-10-01 15:58:59 +02:00
Andrij Mizyk
b2ec39ec5e
Translated using Weblate (Ukrainian)
Currently translated at 86.1% (1285 of 1491 strings)
2022-10-01 15:58:58 +02:00
Sunil Mohan Adapa
d69167bcfa
notification: Don't fail when formatting message strings
- When a notification's message contains unexpected formatting characters such
as '{}', showing the notification and consequently the entire FreedomBox web
interface fails. Prevent that by make sure that that message formatting never
fails.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-10-01 08:02:51 -04:00
Andrij Mizyk
d8da0a41e5
Translated using Weblate (Ukrainian)
Currently translated at 85.9% (1281 of 1491 strings)
2022-09-28 18:23:25 +02:00
James Valleroy
23e760c9a0
setup.py: Move distutils import after setuptools import
Fixes: #2267

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
v22.21
2022-09-26 21:57:28 -04:00
James Valleroy
bc26cfa4cf
Release v22.21 to unstable
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2022-09-26 20:48:05 -04:00
James Valleroy
02239e6747
doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2022-09-26 20:45:55 -04:00
James Valleroy
355c43cb35
locale: Update translation strings
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2022-09-26 19:52:24 -04:00
Sunil Mohan Adapa
31d7471405
d/install: mediawiki: Install the new powered by file
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-09-26 13:22:31 -07:00
nbenedek
178941079e
mediawiki: Add powered by freedombox logo
Signed-off-by: nbenedek <contact@nbenedek.me>
[sunil: Convert the PNG to SVG and use it for all sizes]S
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-09-26 12:31:47 -07:00
109247019824
1494c3cf8b
Translated using Weblate (Bulgarian)
Currently translated at 39.1% (584 of 1491 strings)
2022-09-26 16:19:38 +02:00
Michael Breidenbach
f365cf555b
Translated using Weblate (Swedish)
Currently translated at 96.0% (1432 of 1491 strings)
2022-09-26 16:19:37 +02:00
nbenedek
663cd4ac22
wordpress: Add fail2ban filter and jail
- I tested the changes with the VirtualBox image with a bridged network adapter.
After ten failed authentication attempts, my IP got blocked as expected.

- This setup uses apache's logs to filter the attempts. A wordpress
[plugin](https://wordpress.org/plugins/wp-fail2ban/) exists for redirecting the
logs to syslog, but that needs to be packaged.

Signed-off-by: nbenedek <contact@nbenedek.me>
[sunil: Drop logpath as logs are expected to go to journald]
[sunil: Update regex to match only failures and not successful logins]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-09-23 14:18:54 -07:00
James Valleroy
9a0be419f5
janus: Allow AF_UNIX and AF_NETLINK
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2022-09-23 08:01:57 -04:00
Sunil Mohan Adapa
2f8ccf3dd0 wordpress: Reload apache after app update
- So that the new configuration file to disable
readme.html/xmlrpc.php/wp-cron.php takes effect.

Tests:

- Install wordpress without the security changes. Notice that the three URLs are
accessible. Apply the patch, run ./setup install and restart FreedomBox service.
Wordpress app is updated and the security changes take effect. The three URLs
are return forbidden response without manually restarting apache2.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-09-22 14:13:33 -07:00
nbenedek
f702e044f3 wordpress: disable readme.html, xmlrpc.php, wp-cron.php
Closes: #2244.

This patch disabled xmlrpc.php functionality entirely. For interacting with
WordPress using app, the new REST API functionality is recommended. However, for
the Pingback API XML-RPC is still a necessity. If this is an important feature
for FreedomBox users, we intend to re-enable XML-RPC functionality in WordPress.

Signed-off-by: nbenedek <contact@nbenedek.me>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-09-22 13:52:55 -07:00
James Valleroy
43532e8349 janus: Enable systemd sandboxing
Helps #299.

Tests:

- janus functional tests pass.

- Sandbox coverage for janus is 81%.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-09-22 11:09:28 -07:00
Andrij Mizyk
b4225a305a
Translated using Weblate (Ukrainian)
Currently translated at 85.7% (1279 of 1491 strings)
2022-09-21 13:20:40 +02:00
Andrij Mizyk
c9d78153ea
Translated using Weblate (Ukrainian)
Currently translated at 85.7% (1278 of 1491 strings)
2022-09-19 21:16:03 +02:00
ikmaak
b638da5ed9
Translated using Weblate (Latvian)
Currently translated at 2.8% (43 of 1491 strings)
2022-09-14 19:20:02 +02:00
Besnik Bleta
805bb8234f
Translated using Weblate (Albanian)
Currently translated at 92.8% (1385 of 1491 strings)
2022-09-14 19:20:02 +02:00
ikmaak
e82c483a7e
Translated using Weblate (Albanian)
Currently translated at 92.8% (1385 of 1491 strings)
2022-09-14 19:20:01 +02:00
ikmaak
3e200f77ce
Translated using Weblate (Serbian)
Currently translated at 11.7% (175 of 1491 strings)
2022-09-14 19:20:01 +02:00
ikmaak
310ae9589e
Translated using Weblate (Greek)
Currently translated at 64.3% (959 of 1491 strings)
2022-09-14 19:20:01 +02:00
109247019824
50d5e8357a
Translated using Weblate (Bulgarian)
Currently translated at 39.0% (582 of 1491 strings)
2022-09-14 19:20:00 +02:00