8 Commits

Author SHA1 Message Date
Sunil Mohan Adapa
872e161ec2
backups: Handle error when there is not enough space on disk
Tests:

- Fill up disk to have very little space left. Perform a large backup operation
by writing a large file to one of the directories to be backed up. Try to
perform the backup and notice that a nice error message is shown that there is
not enough disk space instead of a generic error message.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2025-01-13 19:17:25 -05:00
Sunil Mohan Adapa
e0aef43ece
backups: Handle common errors during borg operations
Closes: #2218.

- When borg can't acquire a lock due to it being busy, any borg operation can
fail. Show a readable message instead of a generic error.

- Also handle errors for archive already existing and archive to be deleted not
existing.

Tests:

- Functional tests for backup app work.

- Creating archive works with proper message. Providing the name of existing
archive shows proper error.

- Deleting archive works with proper message. Open two tabs by clicking on the
delete archive button. Then delete with one and try to delete the it again with
the next one. Proper error message is shown.

- While downloading an archive, delete an archive. Proper error message that
borg is busy is shown.

- Upload archive works. A proper success message is shown.

- Restore backup from archive works. A proper success message is shown.

- Restore backup from file upload works. A proper success message is shown after
upload and after restoration.

- Adding local repository works. A proper success message is shown.

- Adding remote repository works. A proper success message is shown when SSH key
is verified and repository is added.

- Removing repository works. A proper success message is shown.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2024-12-30 08:34:14 -05:00
Sunil Mohan Adapa
9368504da5
*.py: Use SPDX license identifier
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-02-19 14:38:55 +02:00
Sunil Mohan Adapa
9db1f186cd
backups: Show error when password is provided for unencrypted repo
- Without this error, users will believe that a repository is encrypted (as
  password is provided) but it is not (repository was created earlier without a
  password).

- Remove the need to send credentials, an instance property, while getting
  encryption data, an instance method.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-09-07 12:53:11 -04:00
Sunil Mohan Adapa
0465ce0efd
backups: Handle errors when adding disk repository
- Simplify repository initialization using inheritance.

- Share the code for saving repository for disk and remote repositories. Error
  messages are properly handled for disk repositories too.

- Move logic to create remote SSH directory to SSH repository class instead of
  views.

- Create a new error for handling borg repository already existing while
  initialization.

- Get information of repository after initializing so that password errors are
  caught early.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-09-07 12:53:03 -04:00
Michael Pimmer
3724dac9e6
Backups: Cleanup and improved error handling
- fixes issues as supposed by jvalleroy
- new repositories always get a UUID so they can immediately be fully
  used (mounted, queried etc) also before saving them
- remove test connection page -- errors are shown on form submission
- improved error handling when creating remote repositories

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-12-13 18:28:24 -05:00
Michael Pimmer
15e26caa23
Backups, remote repositories: create/delete/restore of remote repos
- updated unittests
- implemented create/delete/restore remote archives

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-12-13 18:27:48 -05:00
Michael Pimmer
0e2489ec23
Backups, remote repositories: implement init, info and some test
- added functionality to use remote repositories
- added some tests

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-12-13 18:27:22 -05:00