The older code is likely before the card approach was implemented and cached copy
had to updated. It is no longer needed as the shortcuts are not filtered based
on login required property in the template code.
Tests:
- When public visibility is enabled/disabled shortcut is properly shown on the
frontpage.
- When restarting the service the public visibility properly dictates whether
shortcut is show properly.
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Drop all Samba shares when app is uninstalled
Test:
1. Install app, enable Open Share and Group Share
2. Reinstall app and confirm all shares get dropped
Signed-off-by: nbenedek <contact@nbenedek.me>
[sunil: Update docstrings]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Remove /etc/openvpn when the app is uninstalled
* Tests:
1. Uninstall app and manually check if /etc/openvpn gets removed
2. Sucessfully install app
3. Functional tests: passed
4. In case we choose to purge packages in the future: I checked purging openvpn and it will not
remove /etc/openvpn.
Signed-off-by: nbenedek <contact@nbenedek.me>
[sunil: Update docstrings]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Remove DATA_DIR, KEY_DIR, CONF_PATH and SYSTEMD_SERVICE_PATH
during the uninstall process. I manually ran apt-get --purge autoremove infinoted
and these files did not get deleted.
Tests:
1. Compare the output of tree -ra /etc/infinoted/ /etc/infinoted/
before and after reinstalling the app: all the files get reinstalled properly
2. Functional tests: passed
Signed-off-by: nbenedek <contact@nbenedek.me>
[sunil: Update docstrings]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
In case apt full-upgrade fails for any reason, do not
continue. Otherwise, may get stuck unattended-upgrade later (#2266).
Since the dist-upgrade flag remains set, Plinth should retry the
dist-upgrade later.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Set debconf values so that the database gets dropped when the package is removed
Tests:
* Install App and subscribe to a feed
* Apply patches, then reinstall app: confirm the feed is purged
* Functional tests passed
Signed-off-by: nbenedek <contact@nbenedek.me>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Tests:
1. Install Mediawiki, set the admin password and edit the main page
2. Reinstall app: password and wiki content are set back to default
3. After the reinstall, I test uploading an image and backing up/restoring the
app
Signed-off-by: nbenedek <contact@nbenedek.me>
[sunil: Update docstrings, make uninstall fail-safe]
[sunil: Fix functional tests by setting up after re-install]
[sunil: Fix functional test by account for change in delete button ID]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
* When app is uninstalled, remove config files and drop the database
* Declare PUBLIC_ACCESS_FILE with pathlib.Path
* Add public access file to the backup manifest
Tests:
1. Install and setup wordpress
2. Reinstall the app and confirm that the initial setup page is shown to the user
3. Functional tests passed
Signed-off-by: nbenedek <contact@nbenedek.me>
[sunil: Update docstrings, minor refactoring]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Remove config file when app is uninstalled
Tests:
1. Install app and add a share
2. Reinstall app and confirm that the share doesn't exist
The order of the functional tests should be modified
since 'test_add_remove_folder' fails
Signed-off-by: nbenedek <contact@nbenedek.me>
[sunil: Update docstrings, make uninstall fail-safe]
[sunil: Remove the entire configuration directory]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
* remove data directory when app is uninstalled
Tests:
1. Install and configure the app
2. Reinstall app and confirm the initial setup page is shown
Signed-off-by: nbenedek <contact@nbenedek.me>
[sunil: Update docstrings, make uninstall fail-safe]
[sunil: Fix uninstall test by setting up after reinstall]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
* If only the SETTINGS_FILE gets removed, the setup
process fails afterwards
* Don't remove the public access file since the setup process
will remove it anyway
Test: Functional tests passed
Signed-off-by: nbenedek <contact@nbenedek.me>
[sunil: Update docstrings, make uninstall fail-safe]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
* make ENABLE_LIST a constant
and declare PUBLIC_ACCESS_FILE with pathlib.Path()
* add PUBLIC_ACCESS_FILE to the backup manifest
* Remove PUBLIC_ACCESS_FILE and ENABLE_LIST
Tests:
1. Install the app and enable public access
2. Reinstall the app and confirm the public access is reset to default
3. Functional tests passed
Signed-off-by: nbenedek <contact@nbenedek.me>
[sunil: Update docstrings, make uninstall fail-safe]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Remove database, mediafiles and freedombox configs.
Removal of certs are not neccessary since the next setup will
overwrite them
Test:
1. Install the app and set a domain
2. Reinstall the app and confirm the domain can be set like it's the first time
Signed-off-by: nbenedek <contact@nbenedek.me>
[sunil: Update docstrings, make uninstall fail-safe]
[sunil: Fix uninstall functional test]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Tests:
1. Create a wiki and a blog
2. Reinstall the app and confirm the sites get deleted
Signed-off-by: nbenedek <contact@nbenedek.me>
[sunil: Update docstrings, make uninstall fail-safe]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Remove deluge default file, config directory, and systemd service file
Test:
1. In a Vagrant box manually install the app
2. Modify the default download path and change the default password
3. Uninstall the app
4. Confirm that the download path and password are reset to default
5. Also test enabling and disabling the app after reinstallation
Signed-off-by: nbenedek <contact@nbenedek.me>
[sunil: Update docstings and make uninstall fail-safe]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Tests:
* Verify from the UI that after reinstalling the app a new secret is generated
* Functional tests passed
Signed-off-by: nbenedek <contact@nbenedek.me>
[sunil: Update docstrings, make uninstall fail-safe]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
During the uninstall process:
* Remove bepasty data directory
* Remove freedombox config file
* Remove bepasty user (and group)
Test:
* Manually test if data is indeed removed
* Run functional tests
Signed-off-by: nbenedek <contact@nbenedek.me>
[sunil: Update docstrings, make uninstall fail-safe]
[sunil: Remove bapasty group as well]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
The original change worked ok in a container, but failed in
virtualbox. This was due to the component being replaced by the Daemon
component that had the same ID, on systems where time is managed.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Mediawiki on Bullseye ships with a different location for the Names.php file.
This patch makes sure that the old location is also checked for the file.
Signed-off-by: nbenedek <contact@nbenedek.me>
[sunil: Fix checking if the file exists.]
[sunil: Use similar paths for both versions of MediaWiki]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Closes: #2328.
Coturn depends on sqlite3 package. As sqlite3 is listed as a package in
roundcube, it is removed when roundcube is uninstalled. This results in the
removal of coturn as well. Prevent this by listing sqlite3 package explicitly in
coturn app.
Tests:
- Without the patch, install coturn and roundcube. When roundcube is
uninstalled, coturn package is no longer installed.
- Apply the patch, install coturn and roundcube. When roundcube is uninstalled,
coturn and sqlite3 packages are still installed.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Closes: #2326.
Earlier /etc/timezone was used to store timezone. Now, we use /etc/localtime
symlink instead. Since the change, backup/restore for timezone has not been
working. Implement this by backing up and restoring the new symlink. Borg
understands symlinks so it properly backs them up and restore them.
When the symlink is restored, timedatectl does not immediately show the new
timezone. This is because a DBus activated daemon 'systemd-timedated' which
supplies the information for timedatectl needs to be reloaded. Add this service
to list of services that backup framework needs to restart.
Tests:
- Set a new timezone. Backup datetime app. Set another timezone. Restore the
datetime app. Visiting the datetime app shows the restored timezone as expected
and timedatectl on command line also immediately shows the expected timezone.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Test:
1. Install Calibre, add a few books and libraries
2. Uninstall, then install Calibre
3. The default Library is present and empty
Signed-off-by: nbenedek <contact@nbenedek.me>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- Allow setting registration verification to token based registration
verification.
- Configure the server with registration secret. Use the registration secret to
register an admin account for FreedomBox's use. Store the access token provided
during registration for future use.
- Use Admin API and the access token to create a registration verification
token. Show list of all registration tokens on app page.
Tests:
- On a fresh installation, setup succeeds, public registration is disabled.
Enabling public registration sets verification to be disabled by default.
Registration tokens are not shown in status.
- Without the patch, install the app and enable public registration. Apply the
patches. After update registration verification will show as disabled.
- Setting verification method to registration token works.
freedombox-registration-secret.yaml file is created. This file has 0o600
permissions and is owned by matrix-synapse:nogroup.
freedombox-admin-access-token.txt file is created. This file has 0o600
permissions and is owned by root:root. List of registration tokens are shown in
status section. Registration with Element app works with the token listed.
- Disabling registration verification works. Registration tokens are not shown
in status section. Registration with Element app works without verification.
- Disable app. Try to update the verification configuration to use tokens. An
error should be thrown that configuration can't be updated when app is disabled.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
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 <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
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 <contact@nbenedek.me>
[jvalleroy: Add a comment about the limitation of this approach]
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
The reason for this patch is explained in issue #789 .
See also: !2250
Signed-off-by: nbenedek <contact@nbenedek.me>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
[jvalleroy: Don't enable app when upgrading]
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
This was changed by mistake in
89a404fb7d32af1667110480dcaf142c4868fd86.
Tests:
- MediaWiki app page is shown without error.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Closes: #2323.
- Monal is BSD 2-Clause licensed.
- Siskin IM is GPLv3 licensed.
Tests:
- In app install page, clicking on clients shows the two new clients and old
client removed. Clicking on the buttons takes us to correct pages on the iOS app
store.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Closes: #2321.
- Without verification configuration being set, if public registrations are
enabled, matrix-synapse server does not start. Fix this by disabling
registration verification.
Tests:
- Without the patch, install matrix and enable public registrations. Matrix
daemon will no longer be running. Apply patches and restart. Matrix app will be
updated. 'enable_registration_without_verification: true' will appear in
/etc/matrix-synapse/conf.d/freedombox-registration.yaml. Server will be running.
- Enabling/disabling the public registration option works. The option will be
added and removed. enable_public_registration is set to true/false.
- Functional tests for matrix-synapse work.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Consistency with rest of the apps, more robustness and extensibility.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- test_uninstall is skipped for dynamicdns.
- test_uninstall is passed for bepasty.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Take app_id in a URL fragment and fill that as the default selected app in
create backup form. This URL can be used in apps to create a backup link.
Tests:
- Visit /plinth/sys/backups/create/bepasty/. Only bepasty app will be selected.
- Visit /plinth/sys/backups/create/foo/. No apps are selected.
- Visit /plinth/sys/backups/create/. All apps are selected.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Closes: #2313.
systemd-journald does not (never did) accept size values given in percent of
file system size. Only the defaults work with percent values. Hence our addition
of RuntimeMaxUse= as percent value in configuration file did not work.
systemd-journald outputs a warning to dmesg and ignores the value.
We could change the value to fixed size. We would have to choose a value that
works for systems with less memory (such as 1GiB) and that value would serve
poorly for systems with more memory. Instead, leaving the default value of 10%
for RuntimeMaxUse= might be better. Additional configuration of MaxFileSec=6h
and MaxRetentionSec=2day would also ease the burden in most cases for the low
memory devices. Considering that people did not report issues with status
quo (where the value we have set did not work and default size was used) also
suggests that default value will work. Further, /run filesystem itself seems to
be allocated only 10% of available memory.
Tests:
- Without the patch, start a vagrant machine. Notice that dmesg shows the error
mentioned in the issue #2313. Apply patch and restart the service. Setup is run
for config app. The file /etc/systemd/journald.conf.d/50-freedombox.conf will no
longer have the RuntimeMaxUse= directive.
- After reboot, dmesg will no longer show the error. systemctl status
systemd-journald shows that 10% of the size of /run is the max for journal file.
- In config app page, setting various values of log persistence works.
- On a fresh container with the patch, initial setup succeeds and
journald.conf.d file is setup without the RuntimeMaxUse= directive.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Closes: #2085.
- Read the list of snapshots and properly determine the full subvolume name to
be used for mounting the .snapshots subvolume.
- Use systemd .mount units instead of editing fstab. Fstab editing is dangerous
and could result in system not booting properly. systemd units are better suited
for tool based editing while /etc/fstab is recommended for humans.
- Use automount feature provided by systemd using autofs to perform mounting. This
means that the backing filesystem is only accessed and mounted when the mount
point is accessed by a program. Parse errors in the mount/automount file and
incorrect mount parameters are also tolerated well with failure to boot.
Tests:
- On a fresh Debian Bullseye install with btrfs. Install FreedomBox with the
changes, create and delete manual snapshots. Rollback to a snapshot should also
work. /.snapshots should contain all the files inside each of the snapshots.
- After rebooting into a rolled back snapshot, create/delete and restore to a
snapshot should work. /.snapshots should contain all the files inside each of
the snapshots.
- Introduce an error in .mount file such the mount operation will fail. Reboot
the machine. Reboot is successful. /.snapshots is still mounted as autofs.
Trying to access /.snapshots will result in error during mount operation.
- On a vagrant box without changes. Install freedombox and ensure snapshot app
setup has been run. This creates the /etc/fstab entry. Apply the patches.
snapshot app will run and remove the mount line in /etc/fstab and create the
.mount entry. /.snapshots is still mounted but not because of .automount. After
reboot, /.snapshots is mounted with autofs and also with btrfs. Unmounting
/.snapshots and then trying to run 'ls /.snapshots' will perform the mount again.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Closes: #2144.
- '--ambit' seems to a required argument if there is no default subvolume set on
the filesystem. Add it to prevent error during rollback.
- Description is not a required option for rollback (anymore?) and default
descriptions for the two snapshots are more descriptive.
Tests:
- On a fresh vagrant machine, run snapshot rollback with the patch. It fails.
With the patch, rollback succeeds.
- The description created for the rollback is the default one 'rollback backup'
and 'writable copy of #x'.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Closes: #2318.
We currently set 'restricted: false' to both stun and turn server configuration
in ejabberd. This works for stun but for turn, ejabberd assumes that
authentication is not needed even though it is needed for our coturn setup. Drop
the configuration option entirely as the desired values are already default in
both stun and turn cases.
Tests:
- On a fresh setup, install coturn and ejabberd. In ejabberd.yaml, the stun/turn
configuration does not have the restricted option.
- On a container without the patch, install coturn and ejabberd. Configuration
has restricted option. Apply the patch, ejabberd setup is updated and restricted
option is removed.
- Test that calls can't be made with TURN with 'restricted: false' set. Changing
it to true for TURN configuration allows the calls to be established. Remove the
restricted option entirely also works. This was tested by @Znoteer in #2318.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
If Roundcube is not yet installed and the user clicks on 'Launch web client',
redirect to the installation page instead of Apache's Not Found page.
Signed-off-by: nbenedek <contact@nbenedek.me>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Closes: #2028.
Tests:
- Backup and restore with no sites.
- Backup and restore with one wiki and one blog. Confirm that login
works for both sites.
- Backup from one container, and restore in another container. Confirm
that login works for both sites.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
libjs-bootstrap is a transitive dependency of searx package. It is
also listed as a package to be installed by Janus app. This is a quick
fix to prevent accidental uninstall of searx package, when Janus app
is uninstalled.
Closes#2298.
Tests:
- Install Searx.
- Install Janus, and then uninstall it. searx package is still
installed. Searx diagnostics are passed.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>