Commit Graph

741 Commits

Author SHA1 Message Date
Divyansh Singh 1f1278270d
Remove paramiko dependency (#1606)
Paramiko is a encryption key parsing library. It was used for determining which ssh keys are available on the system. This removes that fairly heavy dependency at replaces it with a very basic heuristic to determine ssh key file by their first line containing `-----BEGIN(\s\w+)? PRIVATE KEY-----`.

* src/vorta/utils.py: Implement `is_ssh_private_key_file`.

* src/vorta/utils.py (get_private_keys): Use `is_ssh_private_key_file` instead of paramiko. Enforce `077` permissions on key files.

* src/vorta/views/ssh_dialog.py : Remove paramiko.

* src/vorta/views/repo_tab.py (RepoTab.init_ssh): Show filename only in `sshComboBox`.

* src/vorta/views/repo_add_dialog.py (AddRepoWindow.init_ssh_key): Show filename only in `sshComboBox`.
2023-03-17 15:03:48 +00:00
Chirag Aggarwal c4d16e250d Fixes math error for negative size in diff view in archive tab
Signed-off-by: Chirag Aggarwal <thechiragaggarwal@gmail.com>
2023-03-14 16:08:27 +01:00
Divyansh Singh 6bc532187b
Add link to the logs folder in borg warnings (#1609)
In case a borg job finishes with warning, vorta will display it and tell the user to have a look in the logs. This adds a clickable link to the log message that opens the default file explorer at the log location.

* src/vorta/application.py (VortaApp.check_failed_response): Improve wording of warning message and link logs.

* src/vorta/borg/create.py (BorgCreateJob.process_result): Link logs.
* src/vorta/borg/compact.py (BorgCompactJob.finished_event): ^^
* src/vorta/borg/check.py (BorgCheckJob.finished_event): ^^

* src/vorta/assets/UI/mainwindow.ui : Enable `openExternalLinks` for `progressText` label.
2023-03-12 07:05:46 +00:00
Vamp 961e0b5057
Migrate from appdirs to platformdirs (#1617)
Fixes #1610. Replace deprecated `appdirs` with fork `platformdirs`. Use the new `*_path` api of set fork. This changes the type of the constants defined in `vorta.config` holding locations to `pathlib.Path`.

* setup.cfg : Replace dep `appdirs` with `platformdirs`.

* src/vorta/config.py : Migrate. Simplify code for ensuring that the directories exist.

* src/vorta/log.py
* src/vorta/autostart.py
* src/vorta/application.py
* src/vorta/__main__.py
2023-03-10 16:00:39 +00:00
Divyansh Singh b01fa1056a
Replace print with logging in application.py (#1612)
Log `An instance of Vorta is already running. Opening main window.` and `Creating backup using existing Vorta instance.` with severity *info* instead of printing it.

* src/vorta/application.py (VortaApp.__init__)
2023-03-08 16:47:50 +00:00
Manu e07c022ca3 Add GSoC link 2023-03-07 14:23:22 +00:00
yfprojects 79420c1271 Change check order in PR template. 2023-03-06 11:41:06 +00:00
Divyansh Singh a00ed62e49
Fix detecting whether sources are configured (#1613)
Fixes #1463. This makes the code count the database rows for the current profile only. 
Previously one could run a backup without any sources when one had sources configured in a different profile.

* src/vorta/borg/create.py (BorgCreateJob.prepare)
2023-03-02 16:55:31 +00:00
yfprojects 618a1fe278
Add tooltips to settings. (#1521)
This adds tooltips to the settings as well as a 'info' button that shows the tooltip when hovering over it.

* Add tooltips to settings.

* src/vorta/store/models.py (SettingsModel): Add `tooltip` column.

* src/vorta/store/migrations.py (run_migrations): Create `tooltip` column.

* src/vorta/store/connection.py (init_db): Populate `tooltip` column. Increase `SCHEMA_VERSION`.

* src/vorta/views/misc_tab.py (MiscTab.populate): Set tooltip of checkbox widgets.

* src/vorta/store/settings.py : Add tooltips and update label of `override_mount_permissions`

* Add *help* button to settings.

* src/vorta/assets/icons/help-about.svg: Add info icon.

* src/vorta/views/partials/tooltip_button.py: Implement `ToolTipButton`.

* src/vorta/views/misc_tab.py: Add `ToolTipButton` for each setting with a tooltip.
	Add `set_icons` and connect it to palette change.

* tests/test_misc.py (test_autostart): Update test.

---------

Co-authored-by: real-yfprojects <real-yfprojects@users.noreply.github.com>
2023-02-25 10:10:43 +00:00
Roberto Previdi bcc126b634
Improve size column readability in archives tab (#1598)
Use one size unit for all archives. The unit is selected by a simple algorithm that picks the largest unit that can represent the smallest size with a given precision. Align all sizes in archive and source tab to the left.

* src/vorta/utils.py : Implement `find_best_size_formatting`. Add missing sizes to `sort_sizes`. Simplify `pretty_bytes` and add `fixed_unit` option for use with `find_best_size_formatting`. Implement `clamp` utility function. Add type hints and docstrings.

* src/vorta/views/archive_tab.py (ArchiveTab.populate_from_profile): Use `find_best_sizes_formatting`.

* src/vorta/views/source_tab.py (SizeItem.__init__): Set alignment to left.

* tests/test_utils.py : Add comprehensive tests for `pretty_bytes` and `find_best_sizes_formatting`.

Co-authored-by: yfprojects <62463991+real-yfprojects@users.noreply.github.com>
2023-02-21 21:01:49 +00:00
Joshua Goins a048dad136 Allow copying the public part of the first SSH key
Previously this button would only work if you had more than one SSH key
which prevents the first one from being copied.
2023-02-19 18:02:32 +00:00
ratchek 0cf9f0b36f
Modify pre-commit config file using autoupdate (#1601)
A new version of Poetry broke isort which caused errors when running
pre-commit.

This PR runs `pre-commit autoupdate` which updates the configuration
to use the newest isort, which has a hotfix for the bug. It also
updates pre-commit, black, and flake8 as a side-effect.

* Change black version back to 22.12
2023-02-18 18:10:24 +00:00
yfprojects f1e1ea4538 Update type of `debug_enabled` input. 2023-02-18 16:23:30 +00:00
yfprojects 35d9a3b438
Adjust dev files for borgbase/vorta.borgbase.com#32 (#1585)
* Add `pre-commit` to developer requirements.

* Add virtual python environments to `.gitignore`.

* Update pull request template.

---------

Co-authored-by: real-yfprojects <real-yfprojects@users.noreply.github.com>
2023-02-14 07:38:27 +00:00
Théophile Bastian 1b27b9b499 Allow creating an SSH key when bootstrapping Vorta
Fixes #1579
2023-02-09 19:28:34 +00:00
herrwusel ffafcee05c
Correctly supply prune pattern for borg >=1.2.2 (#1565)
Adds different behaviour when borg version >=1.2.2 but <2.0.0: The prune pattern is supplied without a style prefix like `sh:`.
Fixes #1564.

---------

Co-authored-by: herrwusel <herrwusel@user.noreply.github.com>
Co-authored-by: yfprojects <62463991+real-yfprojects@users.noreply.github.com>
2023-02-06 21:02:55 +00:00
Manu a4ab7e713a
Specify build system (minor) (#1580) 2023-02-04 17:23:34 +00:00
Alan Barros de Oliveira 78863544ae
Remove pip install dependency. By @abdeoliveira (#1578) 2023-02-04 14:43:21 +00:00
Manu aff9fc2d2c Bump version to v0.8.10 2023-01-22 12:54:46 +01:00
Manu 2e589a065a Update translations (and Transifex config) 2023-01-22 12:52:33 +01:00
real-yfprojects 696c3fbfe1 Migrate to `--match-archives` in mount point detection.
* src/vorta/utils.py (get_mount_points)
2023-01-21 21:18:05 +01:00
real-yfprojects 5e046386d7 Specify archive using `-a` for borg v2 `mount`.
* src/vorta/views/archive_tab.py : Move all command building logic into `mount.py`.

* src/vorta/borg/mount.py (BorgMountJob.prepare): Add command building logic previously in other places.

* src/vorta/borg/mount.py (BorgMountJob.prepare): Use `-a` command line option to select a single archive.

* src/vorta/utils.py (SHELL_PATTERN_ELEMENT): A pattern that can be used to detect shell pattern syntax.

* src/vorta/utils.py (get_mount_points): Implement parsing a borg v2 cmd.
2023-01-21 21:18:05 +01:00
yfprojects b4a7c5494e Move umount logic from `archive_tab.py` into existing `BorgUmountJob`. By @real-yfprojects (#1404)
* src/vorta/borg/umount.py (BorgUmountJob.prepare): Add parameters `mount_point` and optional `archive_name`.
	Handle them correctly.

* src/vorta/views/archive_tab.py : Remove code that can now be found in `umount.py`.
	Translate error messages returned by `BorgUmountJob.prepare`.

Co-authored-by: real-yfprojects <real-yfprojects@users.noreply.github.com>
2023-01-21 21:18:05 +01:00
real-yfprojects e275215c71 Specify the use of a `sh:`-style pattern when pruning with borg v2.
With borg v2.0.0b3 the default pattern style was changed to identical matching.

* src/vorta/borg/prune.py (BorgPruneJob.prepare)
2023-01-21 21:18:05 +01:00
Manu ba5c7c5511 Move rename logic for arguments into `BorgRenameJob`.
* src/vorta/borg/rename.py
* src/vorta/views/archive_tab.py
2023-01-21 21:18:05 +01:00
Manu f9d1260316 Remove compression field. Don't store timezone in db.
* src/vorta/borg/create.py (BorgCreateJob.process_result): Remove timezone from snapshot time.
	Don't save compressed size.

* src/vorta/borg/info_repo.py (BorgInfoRepoJob.process_result): Remove compressed size.

* src/vorta/borg/list_repo.py (BorgListRepoJob.process_result): Remove timezone from archive time.
2023-01-21 21:18:05 +01:00
real-yfprojects 2b2d61baa5 Implement borg v2 compatibility for most commands.
Adjust available encryptions for borg v2.
Use `-r` for all/most commands. Implement `rinfo`.
Use `ssh://` style URL as a placeholder.
Implement compatibility for `borg extract`.
Adjust for beta3, use --match-archives for deletions

Co-authored-by: real-yfprojects <real-yfprojects@users.noreply.github.com>
Co-authored-by: Manu <manu@snapdragon.cc>
2023-01-21 21:18:05 +01:00
real-yfprojects fa3a6cf7e6 Add borg v2 compatibility item.
* src/vorta/borg/_compatibility.py: Add `V2` level starting with `2.0.0b1`.
2023-01-21 21:18:05 +01:00
real-yfprojects 78ec74a72c
Fix tray menu on XFCE.
The menu is build ones before the tray icon is clicked so that it is registered correctly.

* src/vorta/tray_menu.py (TrayMenu): Rename `on_user_click` to `build_menu`.

* src/vorta/tray_menu.py (TrayMenu.__init__): Call `build_menu`.
2023-01-21 19:51:56 +01:00
real-yfprojects a6f75775ed
Fix dynamic colouring.
Fixes the paste icon so that vorta can invert the its colour. Fixes #1556.
Updates icons in main window and source tab correctly when the colour palette changes.

* src/vorta/assets/icons/paste.svg : Remove fill of `path` item.

* src/vorta/views/source_tab.py : Connect `QApplication.paletteChange` to `set_icons`.
* src/vorta/views/main_window.py
2023-01-21 11:04:13 +01:00
yfprojects c620c0d9ac
Handle empty path in `FileTreeModel.addItem`. (#1552) 2023-01-20 12:51:53 +00:00
Manu ef297bbf4b
Avoid autostart warning when autostart disabled (#1549) 2023-01-20 12:25:58 +01:00
yfprojects 66340bc2a8
Add support for `--paths-from-command` to extra borg arguments. (#1538)
Backups will run although no sources are specified if `--paths-from-command` is supplied.
Also arguments after `--` will be appended to the end of the command after all other arguments.
Closes #1537.

* src/vorta/borg/create.py

* tests/test_create.py : Add test for using `--path-from-commands`.

Co-authored-by: real-yfprojects <real-yfprojects@users.noreply.github.com>
2023-01-18 15:57:23 +00:00
Sam bf9285a171 Fix typo in issue bug template 2023-01-18 10:54:29 +01:00
yfprojects cb4e3a11b6
Update usage of deprecated features in test.yml. (#1539) 2023-01-16 19:57:28 +01:00
endumiuz cace0778ac Run `borg compact` with the `--progress` option 2023-01-08 08:29:33 +01:00
real-yfprojects 84fdbe547d Pass int to `QPoint` constructor.
Before a float was passed to `QPoint(int, int)`. While this worked fine, on some machines it lead to an error.
Fixes #1535.

* src/vorta/views/main_window.py : cast division value to int.
2023-01-07 17:38:01 +01:00
real-yfprojects b80e617f25
Change label `Folders On Top` to `Folders First` in Extract and Diff view.
* src/vorta/assets/UI/diffresult.ui
* src/vorta/assets/UI/extractdialog.ui
2023-01-06 19:54:32 +01:00
yfprojects 7e7abafb3e
Catch `ProcessLookupError` in `BorgJob.cancel`. (#1520)
Co-authored-by: real-yfprojects <real-yfprojects@users.noreply.github.com>
2022-12-25 17:52:24 +01:00
endumiuz 225e84f115
Show progress on repo check (#1513)
Start `borg check` with option `--progress` and handle the progress messages. Now the long repo check phase won't look like a freeze in vorta because vorta will show status updates. Fixes #1497.

Co-authored-by: yfprojects <62463991+real-yfprojects@users.noreply.github.com>
2022-12-25 12:55:03 +00:00
Manu af8b146acc Bump build- and test versions 2022-12-23 21:52:36 +01:00
Manu 6779baecff
Use new ssh://-style URL format as placeholder and in test (#1473) 2022-12-16 11:19:34 +01:00
fixmeee 667f3b3779
Restart timers after hibernation/sleep (#1511)
Schedules get missed, if system has been in hibernation/sleep state as
described in https://github.com/borgbase/vorta/issues/1214
Although, timers should be refreshed every 15min, it seems that all timers get
deranged by sleep state and schedules is still missed in most cases. This seems
to be a general issue with the underlying QTimer implementation.

This fix doesn't distinguish host OS and has only by tested on Linux.
If 'org.freedesktop.login1.Manager' is not available, Vorta simple doesn't
get notified if system awakes again. No no impact on other OS is expected

Co-authored-by: yfprojects <62463991+real-yfprojects@users.noreply.github.com>
2022-12-16 11:10:40 +01:00
real-yfprojects b072496b31
Populate repo info from profile after populating dropdowns.
* src/vorta/views/repo_tab.py (RepoTab.__init__): Move call to `populate_from_profile` from the beginning to the end.
2022-11-24 17:55:10 +01:00
real-yfprojects 031a498ee0
Don't close temp file before running `borg extract`.
Fixes #1488.
Closing deletes the temp file. This will be done by `BorgJob.run` after running the command.

* src/vorta/borg/extract.py (BorgExtractJob.prepare): Remove call to `close` of temporary file.
2022-11-10 20:19:58 +01:00
Julian Hofer 648c916adb Update flatpak install rule
- Add the necessary flag `--no-build-isolation`
- Use `FLATPAK_DEST` instead of hardcoding `/app`
- Rename FLATPAK_XML to APPSTREAM_METADATA
2022-11-08 12:31:23 +01:00
Julian Hofer d7aff48822 Remove flatpak folder
The building happens at flathub, and we don't use this one for anything at the moment
2022-11-08 12:31:23 +01:00
Manu 99eb2871d7 Add Dutch language update 2022-11-05 20:10:59 +01:00
Manu 7550ae5b29 Pin pyobjc to v8 branch 2022-11-05 20:07:02 +01:00
Manu 9ad57d9ec6 Bump version to v0.8.9 2022-11-05 19:45:32 +01:00