Closes: #2342.
- Define a helper method to figure if app has backup. Use the helper method in
main AppView.
- Minor refactor of repeated code in uninstall view that gets the app and
app_id.
- Pass whether an app has backup or not into form. Delete backup related form
fields when backup is not supported. UX when fields are disabled is not nice, it
is not explained why fields are disabled. Better UX seems to be to remove the
backup fields entirely.
Tests:
- Install wireguard. In the uninstall form backup fields don't appear. Uninstall
is successful.
- Install Bepasty. In the uninstall form back fields are shown. Uninstall is
successful with and without a backup. In case backup is chosen, backup is
created and can successfully be restored.
- Run functional tests for bepasty. For wireguard uninstall test succeeds.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Closes: #2343.
- The change is needed due to change in privileged exception handling.
Tests:
- In vagrant machine, while FreedomBox service is running, run unit tests are
root user. Observe that exception is not handled properly without the patch. But
a more reasonable error is printed with the patch.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests:
- Install version 5 of ttrss app. Update to version 6. Notice that apache is
reloaded.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Test:
- From F-droid, install and configure the app. Ensure that it works with
FreedomBox.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Reload apache for new configuration
- Increment app version to ensure new apache configuration is load immediately
after FreedomBox version upgrade.
- Don't re-enable a disabled app during app version upgrade.
- Update description to talk about the remote RPC URL for apps.
Tests:
- Use tremotesf client on LineageOS to connect on the URL /transmission-remote.
- Install transmission app freshly and notice that webserver reload was called
only once. Remote GUI is working.
- Install transmission without patches. Disable app. Apply patches, notice that
webserver was not reloaded. Enable and remote GUI is working.
- Install transmission without patches. Enable app. Apply patches, notice that
webserver was reloaded and remote GUI is working.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
We often change apache configuration for an app and when a new version of the
config is deployed the changes go un-applied until FreedomBox is restarted. Allow
specifying that config has changed in an particular version and reload of
configuration is needed.
Tests:
- Unit tests pass. The feature used in transmission works.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Check that the Hidden service hostname contains 56 bytes before the
.onion.
Helps: #2104
Tests:
- With Hidden service enabled, v3 check is passed.
- With Hidden service disabled, v3 check is skipped.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Tests:
- With relay enable, relay port diagnostic is passed.
- With relay disabled, relay port diagnostic is skipped.
- With bridge relay enabled, obfs ports diagnostics are passed.
- With bridge relay disabled, obfs ports diagnostics are skipped.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Closes: #1615.
Tests:
- Throw an unconditional exception in enable_api_access() method. Reproduce the
problem described by installing ttrss app. Installation fails but ttrss shows up
in enabled list.
- Apply the patch. Try to install ttrss. When it fails, the app is not in the
enabled list.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Tiny Tiny RSS Fork calls itself "Tiny Tiny RSS" on F-Droid and "TTTRSS" on
project page.
- TTRSS-Reader is available on F-Droid and Google Play Store.
- Geekttrss is available on F-Droid.
- The original TTRSS app does not seem to be available on Google Play Store
anymore.
Tests:
- Install each app on respective platforms. Configure them and see if they work.
- Check for free software licenses on project pages.
- Click on each of the clients in the clients list in the web UI and see that
the links redirect to corresponding app pages on the appropriate store.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Mostly to avoid a repeated call to retrieve the list of changes.
- If an unknown value is read, user experience in terms of listed languages and
resetting the new language won't change.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Invoke PHP command to retrieve the list instead of parsing PHP file. This
fixes issue with regex not being generic enough to retrieve languages list using
double quotes. Also make is much more robust to future formatting changes.
- If there is an error in retrieving, which may happen due to future code
changes, fall back to showing a safe list of languages instead of making the app
unusable.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Add doc/*.wiki to the section covered by CC-BY-SA-4.0.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- When tt-rss is accessed via a smart device, authenticate the
user with basic auth, otherwise authenticate with mod_auth_pubtkt.
- I tested logging in with the official TT-RSS Android app and
Fiery Feeds for iPhone.
- Reload apache2 to apply the changes.
Signed-off-by: nbenedek <contact@nbenedek.me>
[sunil: Use Authorization header instead of user agent]
[sunil: Update description to talk about both URLs]
[sunil: Increment app version to reload apache]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
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>
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>
Several tests failed randomly (on a slightly slow machine) while trying to
detect that a page change has occurred. Workaround this by handling the
exception thrown.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
All the apps including OpenVPN now use AppView and therefore using the standard
enable/disable button.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
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>