5 Commits

Author SHA1 Message Date
Sunil Mohan Adapa
b1cc874abb
apache: Stop installing uwsgi by default
Closes: Debian #1144740.

- When one of the applications such as bepasty, radicale, or searx need it, then
install it.

- Reduces the number of dependencies for freedombox package.

- Reduces size of the disk image.

- Ensures that uwsgi does not run on every freedombox machine.

- Apache's proxy_uwsgi module (provided by apache2-bin, apache2) can still be
enabled by default because uwsgi is not a dependency for the Apache module and
uwsgi socket connections are not attempted until specific configuration is
enabled and requests arrive.

- Change dependency from uwsgi-core to uwsgi. uwsgi-core does not have init
scripts but uwsgi package has init script (but only on trixie and not forky and
up). The init script is disabled and masked by bepasty, radicale, and searx
apps. So, this should not be a problem.

Tests:

- On a freshly installed Debian forky and trixie machines, install freedombox
deb package built with changes. Installation succeeds. uwsgi is not installed at
all. bepasty and radicale can be installed and basic requests to web UI work.
uwsgi init script is not started and is masked.

- Functional tests for bepasty and radicale work.

- On a Trixie machine, setup freedombox from trixie. Then install freedombox deb
package with the patch. uwsgi is not marked as manually installed and running
unattended-updates will remove it. Install bepasty and uwsgi package is
installed and marked as manually installed.

- On a Trixie machine, setup freedombox from trixie. Install the bepasty app.
Then install freedombox deb package with the patch. uwsgi is marked as manually
installed and running unattended-updates will not remove it.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2026-08-19 20:43:36 -04:00
Sunil Mohan Adapa
ac8dbcfc1c
backups: Add ability to cleanup files before restoring a backup
- Many times, merging old and new data folders is not ideal and could lead to
unexpected outcomes. Perhaps removing all the backup folders and files before
restore is ideal. However, this patch tries to introduce that approach slowly on
an experimental basis.

Tests:

- Unit tests work.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2025-04-01 09:46:15 -04:00
Sunil Mohan Adapa
9a4905e832
backups: Use privileged decorator for backup actions
Tests:

- DONE: Functional tests works
- DONE: Initial setup works
  - DONE: Borg repository is created at /var/lib/freedombox/borgbackup
- DONE: With regular and with encrypted repository
  - DONE: Creating a repository works
  - DONE: Getting information works. When adding a existing location, incorrect
    password leads to error in the add form.
  - DONE: Listing archives works
  - DONE: Creating/restoring an archive works
    - DONE: Backup manifest is created in /var/lib/plinth/backups-manifests/
    - DONE: Including an app that dumps/restores its settings works
  - DONE: Exporting an archive as tar works
    - DONE: Exporting a large archive yields reasonable download speeds. 31
      MB/s. 1GB file in about 30 seconds.
  - DONE: Restoring from an uploaded archive works
  - DONE: Listing the apps inside an archive works before restore
- DONE: Errors during operations are re-raises as simpler errors
  - DONE: Get info
  - DONE: List archives
  - DONE: Delete archive (not handled)
  - FAIL: Export tar
  - DONE: Init repo
  - DONE: Get archive apps (not handled)

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-10-08 18:53:57 -04:00
Sunil Mohan Adapa
59c5e58549
backups: Implement backup/restore of key/value settings
- Implemented within the backup component. Scope for implementing database
backup/restore in similar way.

- Add new 'settings' key in the backup manifest to allow keys to backed up and
restored.

- Implement by dumping/loading settings from DB into the file.

Tests:

- Unit tests.

- Backup/restore tests for dynamicdns workss.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-02-10 20:31:36 -05:00
Sunil Mohan Adapa
f630fb6059
backups: Add new component for backup and restore
- Component performs the validation instead of each app calling the validator.

- Retain the schema for declaring backup information.

- Suitable for usage directly in the backup/restore operation packets instead of
using BackupApp class.

- Backup/restore hooks can be handled by overriding this component instead of
module level methods.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2021-01-04 13:47:37 +02:00