In a similar fashion like #1637 the commit adds the profile name to the error notification.
* src/vorta/scheduler.py
Co-authored-by: herrwusel <herrwusel@noreply.github.com>
Allows vorta to be called with the command-line flag `--development` or `-D` that will make it use a directory in the project tree to store all the settings, logs, and cache. This default directory will be called `.dev_config` and placed in the projects root.
Also allows for a custom directory path allowing for multiple "configuration" folders at once.
This can be used to prevent the vorta instance that a developer is working on from accessing the configuration files that they have set up for their personal backups.
* .gitignore : Add `.dev_config`.
* src/vorta/utils.py (parse_args): Add `--development` flag. The default will be `DEFAULT_DIR_FLAG`.
* src/vorta/utils.py : Add `DEFAULT_DIR_FLAG`.
* src/vorta/config.py : Add methods for populating the config directories exposed by this module.
* src/vorta/__main__.py (main): Handle `--development` flag and update config directories if its specified.
* Access config constants through the `config` module instead of importing them directly with `from .config import`.
---------
Co-authored-by: yfprojects <62463991+real-yfprojects@users.noreply.github.com>
Fix phonies in Makefile and run pre-commit for lint target.
Instead of running black, flake8 and ruff the lint phony now runs pre-commit which has these tools configured as hooks.
* Makefile
Define common composite action for setting up pre-commit and python.
* .github/actions/setup/action.yml
* .github/workflows/test.yml
Update codecov/codecov-action used in test ci to v3.
* .github/workflows/test.yml
Currently the label `logText` is not cleared after a borg command finished. When creating a backup the label will show the path of the last backuped file even after backup completion.
This changes that and clears `logText` after the backup.
* src/vorta/borg/create.py (BorgCreateJob.process_result)
---------
Co-authored-by: yfprojects <62463991+real-yfprojects@users.noreply.github.com>
This puts Vorta on PyQt6 and starts a new main branch 0.9.
---------
Co-authored-by: real-yfprojects <real-yfprojects@users.noreply.github.com>
Co-authored-by: Manu <3916435+m3nu@users.noreply.github.com>
Co-authored-by: yfprojects <62463991+real-yfprojects@users.noreply.github.com>
* feat: add a setting for files list views
* separate logic from data class
* make mode optional
* rename display mode methods
* refactor
* move code above connect signals comment
* reorder code
---------
Co-authored-by: yfprojects <62463991+real-yfprojects@users.noreply.github.com>
Co-authored-by: Manu <3916435+m3nu@users.noreply.github.com>
Borg v1.2.4 added new change types called `mtime` and `ctime` for the modification and the creation time of a file.
Our diff json parser doesn't support these changes yet.
The plain text parser doesn't need to be updated since it is only used for earlier versions of borg.
This also extends the tooltip in the diff view to show changes in `ctime` or `mtime` in a localised manner.
* src/vorta/views/diff_result.py (ChangeType): Add `CTIME` and `MTIME` linking to `MODIFIED`.
* src/vorta/views/diff_result.py (DiffData): Add fields `ctime_change` and `mtime_change`.
* src/vorta/views/diff_result.py (parse_diff_json): Parse the new change types.
* src/vorta/views/diff_result.py (DiffTree.data): Add time changes to tooltip in a human readable format.
* tests/test_diff.py : Update test data to include new change types. Add additional test cases for unittesting the new change types.
* feat: add profile name to log messages
* update tests
* add profile name to all occurences of backup progress event emit
* update tests
* merge with logs link code
---------
Co-authored-by: Hofer-Julian <30049909+Hofer-Julian@users.noreply.github.com>
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`.
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.
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
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__)
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)
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>
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>
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
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>
* 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.