2850 Commits

Author SHA1 Message Date
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
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
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
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
Veiko Aasa
80af5142b9
samba: Update client apps information
Samba plugin is now included in F-Droid Ghost Commander
https://gitlab.com/fdroid/fdroiddata/-/merge_requests/11563

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-09-09 13:18:50 -07:00
James Valleroy
4395484ff4
firewall: Allow upgrade from any version to 1.2.*
Closes: #2253

Tests:

- Build a package with this fix included for bullseye-backports
  distribution.

- Install into FreedomBox stable system.

- Start dist-upgrade test.

- At the end of the test, wait for plinth to attempt upgrades, and
  then confirm that firewalld was upgraded.

- Confirm that firewalld is running.

- Confirm that /etc/firewalld/firewalld.conf has DefaultZone=external.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-09-08 21:40:20 -07:00
nbenedek
d1379530db
matrixsynapse: Allow matrix-synapse >= 1.65 to install successfully
Closes: #2263

- matrix-synapse >= 1.65.0-1 requires python3-canonicaljson >= 1.6.2~

Tests:

- On a stable Vagrant Box, matrixsynapse app is not installable.

- With the changes, start FreedomBox service, setup will run on the upgrades
module and /etc/apt/preferences.d/51freedombox-apps.conf will be changed to
include the new entry. After this, matrix-synapse app is installable.

Signed-off-by: nbenedek <contact@nbenedek.me>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-09-08 21:17:46 -07:00
Sunil Mohan Adapa
e87752e065
users: tests: functional: Find forms more accurately
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-09-03 17:29:09 -04:00
Sunil Mohan Adapa
a852e4344e
wordpress: tests: functional: Find forms more specifically
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-09-03 17:29:07 -04:00
Sunil Mohan Adapa
bb4612adc5
snapshot: tests: functional: Minor refactoring for form submission
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-09-03 17:29:05 -04:00
Sunil Mohan Adapa
625146329d
backups: tests: functional: Find forms more accurately
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-09-03 17:29:01 -04:00
Sunil Mohan Adapa
2d3681605e
backups: Use generic form template for create and schedule views
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-09-03 17:28:59 -04:00
Sunil Mohan Adapa
5935ce89a6
sso: tests: functional: Find forms more accruately
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-09-03 17:28:56 -04:00
Sunil Mohan Adapa
20eb6ef817
sharing: tests: functional: Find forms more accurately
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-09-03 17:28:54 -04:00
Sunil Mohan Adapa
7ef98a74d6
first_boot: tests: functional: Find form more specifically
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-09-03 17:28:52 -04:00
Sunil Mohan Adapa
41cf738f8e
bepasty: tests: functional: Minor refactor for form submission
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-09-03 17:28:50 -04:00
Sunil Mohan Adapa
7d0d95d163
bepasty: Use generic form template for add password view
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-09-03 17:28:47 -04:00
Sunil Mohan Adapa
2b48f10cfb
calibre: tests: functional: Find forms more specifically
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-09-03 17:28:45 -04:00
Sunil Mohan Adapa
c608219795
gitweb: Fix issue with page not refreshing during uninstall
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-09-03 17:28:43 -04:00
Sunil Mohan Adapa
2454527740
gitweb: tests: functional: Find forms more accurately
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-09-03 17:28:41 -04:00
Sunil Mohan Adapa
3c5d95ce99
gitweb: Use generic form template for create/edit repository
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-09-03 17:28:38 -04:00
Sunil Mohan Adapa
ac5683cf4d
ikiwiki: tests: functional: Find forms more accurately
Tests:

- Run ikiwiki functional tests

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-09-03 17:28:36 -04:00
Sunil Mohan Adapa
133295238b
shaarli: tests: functional: Specify setup form submission button
Tests:

- Run shaarli functional tests

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-09-03 17:28:33 -04:00
Sunil Mohan Adapa
d645cfa35e
zoph: tests: functional: Simplify finding the form to submit
Tests:

- Run Zoph functional tests.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-09-03 17:28:31 -04:00
Sunil Mohan Adapa
75e5c71020
ejabberd: tests: functional: Ensure jsxc is installed
Fixes: #2259.

Tests:

- Run ejabberd functional tests after uninstalling jsxc

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-09-03 17:28:21 -04:00
Veiko Aasa
54a26f7741
samba: Ignore mounted files when listing mounts
In a testing container, checked that the mount point /run/host/os-release
is not listed on the Samba app page.

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-09-03 07:37:30 -07:00
Sunil Mohan Adapa
0881dae665
jsxc: Allow disabling the app
Closes: #1872.

Previously, JSXC can't be disabled and it's shortcut appears on the homepage
forever. Use the EnableState component which stores a flag in the sqlite
database to maintain the status of app being enabled.

Tests:

- Enable/disable button appears. Enabling/disabling the app updates the status
currently.

- Enabling the app shows icon on the homepage and disabling removes it.

- Enabling shows the menu item in the apps page as enabled. Disabling shows the
menu item in the apps page as disabled.

- It is possible the uninstall the app. When app is uninstall it is removed from
homepage and shows as disabled in the apps page.

- When app is disabled or uninstalled, trying to visit the
/plinth/apps/jsxc/jsxc/ throws a 404 error.

- Run functional tests.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
[jvalleroy: Enable JSXC for Ejabberd test]
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-08-29 21:06:54 -04:00
Sunil Mohan Adapa
67860385d0
tor: Use AppView and Operation for app page
- Use AppView for app page.

- Handle post enable/disable activities within the App class.

- Use Operation class to perform configuration instead of custom mechanism. Drop
all the older code for it.

Tests:

- DONE: Run functional tests
- DONE: Enabling Tor
  - DONE: Enables the service
  - DONE: Updates the firewall ports
  - DONE: Adds hidden service domain to names app
  - DONE: Shows app enabled
  - DONE: Firewall ports are opened
- DONE: Disabling Tor
  - DONE: Disables apt transport over Tor
  - DONE: Firewall ports are closed
  - DONE: Shows app disabled
  - DONE: Onion domain is removed from names app
- DONE: App page
  - DONE: Running/not-running status is shown properly based on whether tor
    daemon is running.
  - DONE: Port forwarding information is shown properly.
  - DONE: When hidden service is enabled, status of hidden services is shown
- DONE: Configuration update
  - DONE: Form shown correct status of the option
  - DONE: When configuration is being updated, operation progress is shown
  - DONE: Page refreshes once in 3 seconds during operation. Refresh stops after
    operation.
  - Once the operation is complete, success or error message is shown
  - DONE: Javascript to show/hide upstream bridges text box works
  - DONE: Javascript to enable/disable relay checkboxes works
  - DONE: Operation does not show notification.
  - DONE: Enabling apt over Tor does not work when app is disabled
  - DONE: When configuration is changed, the message 'Settings unchanged' is not
    shown.
  - DONE: If an error is thrown during configuration, an error message is shown
    properly.
  - DONE: Tor is restarted after configuration update and hidden service domains
    is updated.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-08-29 08:29:16 -04:00
Sunil Mohan Adapa
493071bfe0
letsencrypt: Use AppView for app page
Tests:

- Enable/disable button is not shown.

- List of certificates in the system is shown.

- Diagnostics menu item is shown and works.

- Certificate operations work.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-08-29 08:29:14 -04:00
Sunil Mohan Adapa
9b6774f279
snapshot: Use AppView for app page
Tests:

- Enable/disable button is not shown.

- Diagnostics menu item is shown and works.

- Both Configure and manage snapshots tabs are shown.

- Changing configuration works, updated configuration is shown.

- Deleting some snapshots works.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-08-29 08:29:11 -04:00
Sunil Mohan Adapa
29bf55dedb
security: Use AppView for app page
Tests:

- Enable/disable button is not shown.

- Diagnostics are shown and work.

- Initial status of the configuration is show properly.

- Enabling/disabling configuration options reflects correct status.

- Status of frequent features updates shows properly.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-08-29 08:29:09 -04:00
Sunil Mohan Adapa
a7eb5e8f0e
power: Use AppView for app page
Tests:

- Enable/disable button is not shown.

- Diagnostics menu item is not shown.

- If apt is busy a warning message is shown.

- Restart and Shutdown buttons are shown and work.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-08-29 08:29:07 -04:00
Sunil Mohan Adapa
0d0c417bcd
networks: Use AppView for app page
Tests:

- Enable/disable button is not shown.

- Diagnostics button is shown and works.

- Connections list, internet connection type and connectivity are shown
properly.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-08-29 08:29:05 -04:00
Sunil Mohan Adapa
6bd9211791
names: Use AppView for app page
Tests:

- App page shows properly. Status of the current domains is shown properly.

- App page does not show enable/disable button.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-08-29 08:29:03 -04:00
Sunil Mohan Adapa
b970b72bb0
diagnostics: Use AppView for app page
Tests:

- Enable/disable button is not present.

- Diagnostics menu item is not present.

- Page shows 'Running diagnostics' button when diagnostics are not running.

- Page shows progress bar and results when diagnostics are running/completed.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-08-29 08:29:00 -04:00
Sunil Mohan Adapa
2eca38299f
backups: Use AppView for the main app page
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-08-29 08:28:58 -04:00
Sunil Mohan Adapa
1908bd5366
package: Implement low-level methods for uninstalling
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-08-29 08:28:35 -04:00
James Valleroy
042dd95de5
janus: Handle upgrades to 1.0.*
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-08-23 09:18:31 -07:00