Notification for dist upgrade started, or not started due to lack of
free space.
Currently, these notifications only appear once.
Tests:
- Checked each notification appears.
- Notification does not appear again after being dismissed.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Separate checking for dist upgrade from other setup. We don't want to
start a dist upgrade during the module's setup.
Tests: Checked logs for the following:
- Up to date.
- Updates not enabled.
- Dist upgrade started.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
With default logging settings, only print the result.
Tests: Checked output for following cases:
- Dist upgrade flag exists.
- System is Debian testing.
- Latest stable release without --test.
- Automatic updates not enabled.
- Not enough free space.
- Dist upgrade started.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Fixes: #2026.
Upgrade from 1.2.1+dfsg-1+b1 to 1.3.x.
Tests:
- Install version 1.2.1+dfsg-1+b1. Change the default media directory. Run
unattended upgrades it will fail to upgrade. With the new patch, run apt update.
This will force upgrade. After upgrade the earlier set media directory is
retained.
- Functional tests run.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests performed:
- Functional tests work as expected.
- Updating the media directory works newly updated media directory is show.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Closes: #2023.
When importing the test module, datetime.now() is executed and value is kept. If
a test suite runs for a long time, the time deltas are being calculated much
later when the test case runs. This creates an difference in expected different
between the two values.
Fix this by completely removing all uses of time relative to current date time.
Only use absolute date time values. This should not reduce the effectiveness of
the test cases.
Tests performed:
- Rerun unit tests for backups module.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
After enabling the calibre app, the app uses IP 127.0.0.1 to advertise
ODPS feeds via BonJour/mDNS. It breaks accessing freedombox.local as it now
points to 127.0.0.1.
This MR disables the BonJour in Calibre.
Fixes#2027.
Tests performed on both Debian stable and testing containers:
- Check the accessability of freedombox.local:
1) Before applying patch:
- Start the container, check on the host that freedombox.local points to
correct IP address of the container:
```
host$ avahi-resolve -4 --name freedombox.local
freedombox.local 10.42.1.166
```
- Enable the calibre app. Check on the host that freedombox.local
points to wrong ip address 127.0.0.1:
```
host$ avahi-resolve -4 --name freedombox.local
freedombox.local 127.0.0.1
```
2) Stop the calibre app, apply patch (update the calibre systemd service file,
reload systemd), restart the Service Discovery app, check on the host that
freedombox.local points to correct address.
3) Start the calibre app, check on the host that freedombox.local points to
correct address.
- All the calibre functional tests pass.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Tests performed:
- Upgrade from old 2.x versions to 3.x has not been tested.
- Fresh installation of radicale 3 works (via FreedomBox). Web interface works.
Able to create a calendar.
- Upgrading from radicale 2 to radicale 3 works (via unattended-upgrades). There
were no configuration file prompts in FreedomBox (where only
/etc/radicale/config is modified).
- After upgrade, all functional test cases for radicale in FreedomBox
passed (including backup and restore of data).
- After upgrade, I have tested that permissions system as configured in
FreedomBox owner_only = allow file permissions, owner_write and authorized are
same as defined in radicale.
- These permissions have worked as expected as tested with Thunderbird.
- Radicale says that file based permissions format has changed, however,
FreedomBox relies on only the right files provided by default.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Tested-by: Sunil Mohan Adapa <sunil@medhas.org>
- Install bash-completion when provisioning container, makes terminal
usage more comfortable.
- Increase default container image size to 16G, so that a distribution
upgrade fits well.
- Check free disk space on host before expanding disk image.
- Make pytest coverage reports writable to the fbx user, closes #2010.
- run-tests command:
- Use DEBIAN_FRONTEND=noninteractive when upgrading packages.
- Do not install sshpass as provision script already installs it.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Ability to use lru_cache(user_function) was only introduced in Python 3.8.
Buster has Python 3.7. This causes startup failure in Buster. Fix this by using
the older API for lru_cache instead of the new one.
Tests:
- On stable and testing, starting the Plinth daemon and visiting the performance
page should work.
- Adding a print statement in the _get_url() method shows that it is only called
once, ever.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Helps: #1962
Shown an alarming warning in connection_show page (only) for the primary
connection. Captions 'Deactivate' and 'Delete' buttons, now explicitly
mention the primary connection and they are placed within the warning
box.
Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Primary connection is not the same as connection user is using]
[sunil: Reduce the importance of primary connection as it is just default route]
[sunil: Update primary connection message]
[sunil: Fix the use of exclamation icon for screen readers as per bootstrap]
[sunil: Don't place buttons inside the warning, as it is non-intuitive UI]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Closes: #1974
BTW: Javascript IPV4/6 hide/show arrangements triggered on page load.
Otherwise page loads form fields inconsistently.
Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Fix the use of RadioSelect widget]
[sunil: Alter the wording of what each type means]
[sunil: Drop the help text for radio group as it is mostly repetitive]
[sunil: js: Make the entire jQuery code run on document ready]
[sunil: js: Revert unneeded double call to change methods, change() is enough]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Made the method private to reduce the exposed API of the module]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Pull the delete button in the connection show page to the right to prevent
hitting it by accident.
Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Use a new consistent style compatible with bootstrap4]
[sunil: Styled the delete button with danger color]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Fixes the issue that after disabling an app which has a daemon alias,
only the alias was disabled and the real service kept still running.
Closes#2019
Test on Debian testing: After disabling the bind app,
check that both 'bind9' and 'named' services are not running.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
With all apps installed, the used space increases by 4.9 GB.
Helps: #1644.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
Closes: #2022.
- Differently URL based on version of Cockpit used.
- Lazily evaluate when necessary.
- Cache the result.
[sunil: Use subprocess.run() instead of getoutput() for security]
[sunil: Use long form arguments in command invocation for readability]
[sunil: Perform isort]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Tests in testing container:
- SSH, Service Discovery, and Web Server are shown as enabled on
Firewall page.
- FreedomBox interface can be accessed after disabling Cockpit.
Closes: #2016.
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
'syncthing' group name was replaced by 'syncthing-access' in MR !1995,
update the sharing app functional test to use this new group name.
Test:
- Update the sharing app Apache2 configuration. Run the sharing app tests.
All tests pass.
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
- Keep a count of number of consecutive failures. Reset the count on a
successful backup.
- Keep the count for each repository.
Tests performed:
- Insert an exception into method for running a scheduled backup.
- When the FreedomBox is run in develop mode, it attempts to take backups every
3 minutes.
- It fails and shows the notification. Text is good. The error count is 1 and
error text is same as exception text. Go to backups button redirects to backup
page.
- In another 3 minutes another attempt is made and count increments this time.
- If the notification is dismissed, after another attempt is made, notification
comes back with incremented count.
- When the exception is removed and FreedomBox is restarted, schedule backup
succeeds and notification is dismissed automatically.
- When backup is deleted and exception is reintroduced, the notification comes
back with count reset to 1.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Tests performed:
- Ensure that backups module is setup from version zero by deleting entry in DB.
Start FreedomBox. Observe the notification comes up.
- Dismiss button dismiss the notification.
- Go to button takes us to the backups module.
- Incrementing the version number of the backups app does not show the
notification again.
- Starting with old code, the notification show up when FreedomBox is run.
Incrementing the version number of the backups app after that does not show the
notification again.
- Enable a schedule and the notification should be dismissed.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- This will lead to backups only once a day or so.
- In case of errors, backups are tried every hour.
- Cleanups are also triggered but cleanups happen only after a successful
backup.
Tests performed:
- In development mode, a new backup is taken after 3 minutes of enabling a
repository's schedule.
- Error in one repository does not effect the backup of other repositories.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This is a simplification of UX by allowing only a single schedule to be attached
to each repository.
Tests performed:
- Editing a schedule works for root, local and remote repositories.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Simplify save() method such that a simple load(uuid).save() does not destroy
data. Currently, the verified parameter is lost.
- Drop unused store_credentials argument to save().
- Make verified a property of the SSH repository and instantiate with
it properly.
Tests performed:
- Adding a new remote repository works with SSH verification from unknown and
known hosts.
- Mounting and unmounting works.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Useful for abstracting the mount() operation that is not available on non-remote
repositories.
- On non-remote repositories do nothing.
- On remote repositories, mount the location in preparation for operations on
the repository.
Tests performed:
- When an SSH repository is unmounted before a schedule backup, it is
automatically mounted for listing, backup and cleanup at scheduled time.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- This allows schedule to be stored along with the repository information.
Tests performed:
- Storing/retrieving a schedule along with root repository works.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>