From 59babf81304db3a81c0a07608d177538ac0cc2c6 Mon Sep 17 00:00:00 2001 From: Divyansh Singh Date: Wed, 22 Feb 2023 17:01:12 +0530 Subject: [PATCH 01/16] feat: remove paramiko --- setup.cfg | 1 - src/vorta/borg/init.py | 1 - src/vorta/qt_single_application.py | 1 - src/vorta/scheduler.py | 3 -- src/vorta/utils.py | 60 +++++++++++++++--------------- src/vorta/views/repo_add_dialog.py | 2 +- src/vorta/views/repo_tab.py | 2 +- 7 files changed, 33 insertions(+), 37 deletions(-) diff --git a/setup.cfg b/setup.cfg index f5a5036b7..810ee8c97 100644 --- a/setup.cfg +++ b/setup.cfg @@ -38,7 +38,6 @@ include_package_data = true python_requires = >=3.7 install_requires = appdirs - paramiko pyqt5 peewee psutil diff --git a/src/vorta/borg/init.py b/src/vorta/borg/init.py index b26b4b7de..73dfe040b 100644 --- a/src/vorta/borg/init.py +++ b/src/vorta/borg/init.py @@ -9,7 +9,6 @@ def started_event(self): @classmethod def prepare(cls, params): - # Build fake profile because we don't have it in the DB yet. profile = FakeProfile( 999, diff --git a/src/vorta/qt_single_application.py b/src/vorta/qt_single_application.py index 8e5be661f..e45519957 100644 --- a/src/vorta/qt_single_application.py +++ b/src/vorta/qt_single_application.py @@ -40,7 +40,6 @@ class QtSingleApplication(QApplication): message_received_event = pyqtSignal(str) def __init__(self, id, *argv): - super().__init__(*argv) self._id = id diff --git a/src/vorta/scheduler.py b/src/vorta/scheduler.py index 4cace732c..e7fdbdd28 100644 --- a/src/vorta/scheduler.py +++ b/src/vorta/scheduler.py @@ -32,7 +32,6 @@ class ScheduleStatus(NamedTuple): class VortaScheduler(QtCore.QObject): - #: The schedule for the profile with the given id changed. schedule_changed = QtCore.pyqtSignal(int) @@ -196,7 +195,6 @@ def set_timer_for_profile(self, profile_id: int): return with self.lock: # Acquire lock - self.remove_job(profile_id) # reset schedule pause = self.pauses.get(profile_id) @@ -290,7 +288,6 @@ def set_timer_for_profile(self, profile_id: int): # handle missing of a scheduled time if next_time <= dt.now(): - if profile.schedule_make_up_missed: self.lock.release() try: diff --git a/src/vorta/utils.py b/src/vorta/utils.py index 6217fb518..b5966dfbc 100644 --- a/src/vorta/utils.py +++ b/src/vorta/utils.py @@ -12,10 +12,6 @@ from functools import reduce from typing import Any, Callable, Iterable, Optional, Tuple, TypeVar import psutil -from paramiko import SSHException -from paramiko.ecdsakey import ECDSAKey -from paramiko.ed25519key import Ed25519Key -from paramiko.rsakey import RSAKey from PyQt5 import QtCore from PyQt5.QtCore import QFileInfo, QThread, pyqtSignal from PyQt5.QtWidgets import QApplication, QFileDialog, QSystemTrayIcon @@ -179,9 +175,17 @@ def choose_file_dialog(parent, title, want_folder=True): return dialog +def get_ssh_file_fingerprint(filename): + """Check if the file is a SSH key.""" + filepath = os.path.expanduser('~/.ssh/' + filename) + with open(filepath, 'rb') as f: + first_line = f.readline() + if not first_line.startswith(b'-----BEGIN OPENSSH PRIVATE KEY-----'): + return None + + def get_private_keys(): """Find SSH keys in standard folder.""" - key_formats = [RSAKey, ECDSAKey, Ed25519Key] ssh_folder = os.path.expanduser('~/.ssh') @@ -191,35 +195,33 @@ def get_private_keys(): key_file = os.path.join(ssh_folder, key) if not os.path.isfile(key_file): continue - for key_format in key_formats: - try: - parsed_key = key_format.from_private_key_file(key_file) + # ignore config, known_hosts*, *.pub, etc. + if key.endswith('.pub') or key.startswith('known_hosts') or key == 'config': + continue + try: + ssh_fingerprint = get_ssh_file_fingerprint(key) + if ssh_fingerprint: key_details = { 'filename': key, - 'format': parsed_key.get_name(), - 'bits': parsed_key.get_bits(), - 'fingerprint': parsed_key.get_fingerprint().hex(), + 'fingerprint': "abc", } available_private_keys.append(key_details) - except ( - SSHException, - UnicodeDecodeError, - IsADirectoryError, - IndexError, - ValueError, - PermissionError, - NotImplementedError, - ): - logger.debug( - f'Expected error parsing file in .ssh: {key} (You can safely ignore this)', exc_info=True - ) + except ( + UnicodeDecodeError, + IsADirectoryError, + IndexError, + ValueError, + PermissionError, + NotImplementedError, + ): + logger.debug(f'Expected error parsing file in .ssh: {key} (You can safely ignore this)', exc_info=True) + continue + except OSError as e: + if e.errno == errno.ENXIO: + # when key_file is a (ControlPath) socket continue - except OSError as e: - if e.errno == errno.ENXIO: - # when key_file is a (ControlPath) socket - continue - else: - raise + else: + raise return available_private_keys diff --git a/src/vorta/views/repo_add_dialog.py b/src/vorta/views/repo_add_dialog.py index dbb88a299..55076c86f 100644 --- a/src/vorta/views/repo_add_dialog.py +++ b/src/vorta/views/repo_add_dialog.py @@ -183,7 +183,7 @@ def init_ssh_key(self): keys = get_private_keys() for key in keys: self.sshComboBox.addItem( - f'{key["filename"]} ({key["format"]}:{key["fingerprint"]})', + f'{key["filename"]} :{key["fingerprint"]})', key['filename'], ) diff --git a/src/vorta/views/repo_tab.py b/src/vorta/views/repo_tab.py index f531f2fa0..c5313c162 100644 --- a/src/vorta/views/repo_tab.py +++ b/src/vorta/views/repo_tab.py @@ -175,7 +175,7 @@ def init_ssh(self): self.sshComboBox.clear() self.sshComboBox.addItem(self.tr('Automatically choose SSH Key (default)'), None) for key in keys: - self.sshComboBox.addItem(f'{key["filename"]} ({key["format"]})', key['filename']) + self.sshComboBox.addItem(f'{key["filename"]}', key['filename']) def toggle_available_compression(self): use_zstd = borg_compat.check('ZSTD') From 7e5260665f297d7b4596d1d073a93d50ab9c7592 Mon Sep 17 00:00:00 2001 From: Divyansh Singh Date: Wed, 22 Feb 2023 20:09:11 +0530 Subject: [PATCH 02/16] show filename only in the combobox --- src/vorta/utils.py | 9 ++++----- src/vorta/views/repo_add_dialog.py | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/vorta/utils.py b/src/vorta/utils.py index b5966dfbc..327963f03 100644 --- a/src/vorta/utils.py +++ b/src/vorta/utils.py @@ -175,13 +175,14 @@ def choose_file_dialog(parent, title, want_folder=True): return dialog -def get_ssh_file_fingerprint(filename): +def is_ssh_file(filename): """Check if the file is a SSH key.""" filepath = os.path.expanduser('~/.ssh/' + filename) with open(filepath, 'rb') as f: first_line = f.readline() if not first_line.startswith(b'-----BEGIN OPENSSH PRIVATE KEY-----'): - return None + return False + return True def get_private_keys(): @@ -199,11 +200,9 @@ def get_private_keys(): if key.endswith('.pub') or key.startswith('known_hosts') or key == 'config': continue try: - ssh_fingerprint = get_ssh_file_fingerprint(key) - if ssh_fingerprint: + if is_ssh_file(key): key_details = { 'filename': key, - 'fingerprint': "abc", } available_private_keys.append(key_details) except ( diff --git a/src/vorta/views/repo_add_dialog.py b/src/vorta/views/repo_add_dialog.py index 55076c86f..11c38829e 100644 --- a/src/vorta/views/repo_add_dialog.py +++ b/src/vorta/views/repo_add_dialog.py @@ -183,7 +183,7 @@ def init_ssh_key(self): keys = get_private_keys() for key in keys: self.sshComboBox.addItem( - f'{key["filename"]} :{key["fingerprint"]})', + f'{key["filename"]}', key['filename'], ) From 369b64e1df9340b58bc3a46a61072abb1b988475 Mon Sep 17 00:00:00 2001 From: Divyansh Singh Date: Thu, 23 Feb 2023 01:17:36 +0530 Subject: [PATCH 03/16] remove extra error handling --- src/vorta/utils.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/vorta/utils.py b/src/vorta/utils.py index 327963f03..d5af39862 100644 --- a/src/vorta/utils.py +++ b/src/vorta/utils.py @@ -207,11 +207,9 @@ def get_private_keys(): available_private_keys.append(key_details) except ( UnicodeDecodeError, - IsADirectoryError, IndexError, ValueError, PermissionError, - NotImplementedError, ): logger.debug(f'Expected error parsing file in .ssh: {key} (You can safely ignore this)', exc_info=True) continue From 04fc9934d97f8cd64cfd9ce79b709df30b021c64 Mon Sep 17 00:00:00 2001 From: Divyansh Singh Date: Thu, 23 Feb 2023 02:37:09 +0530 Subject: [PATCH 04/16] remove unnecessary imports --- src/vorta/views/ssh_dialog.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/vorta/views/ssh_dialog.py b/src/vorta/views/ssh_dialog.py index 7720ba74b..df7402814 100644 --- a/src/vorta/views/ssh_dialog.py +++ b/src/vorta/views/ssh_dialog.py @@ -1,7 +1,4 @@ import os -from paramiko.ecdsakey import ECDSAKey -from paramiko.ed25519key import Ed25519Key -from paramiko.rsakey import RSAKey from PyQt5 import uic from PyQt5.QtCore import QProcess, Qt from PyQt5.QtWidgets import QApplication, QDialogButtonBox @@ -10,8 +7,6 @@ uifile = get_asset('UI/sshadd.ui') SSHAddUI, SSHAddBase = uic.loadUiType(uifile) -FORMAT_MAPPING = {'ed25519': Ed25519Key, 'rsa': RSAKey, 'ecdsa': ECDSAKey} - class SSHAddWindow(SSHAddBase, SSHAddUI): def __init__(self): From c5fd48ff15562a2dd75daffa4de4c37f0a8ecd0a Mon Sep 17 00:00:00 2001 From: Divyansh Singh Date: Thu, 23 Feb 2023 02:46:24 +0530 Subject: [PATCH 05/16] refactor --- src/vorta/utils.py | 12 ++---------- src/vorta/views/repo_add_dialog.py | 5 +---- src/vorta/views/repo_tab.py | 2 +- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/vorta/utils.py b/src/vorta/utils.py index d5af39862..4fb35473c 100644 --- a/src/vorta/utils.py +++ b/src/vorta/utils.py @@ -201,16 +201,8 @@ def get_private_keys(): continue try: if is_ssh_file(key): - key_details = { - 'filename': key, - } - available_private_keys.append(key_details) - except ( - UnicodeDecodeError, - IndexError, - ValueError, - PermissionError, - ): + available_private_keys.append(key) + except (PermissionError,): logger.debug(f'Expected error parsing file in .ssh: {key} (You can safely ignore this)', exc_info=True) continue except OSError as e: diff --git a/src/vorta/views/repo_add_dialog.py b/src/vorta/views/repo_add_dialog.py index 11c38829e..4c8c988ee 100644 --- a/src/vorta/views/repo_add_dialog.py +++ b/src/vorta/views/repo_add_dialog.py @@ -182,10 +182,7 @@ def init_encryption(self): def init_ssh_key(self): keys = get_private_keys() for key in keys: - self.sshComboBox.addItem( - f'{key["filename"]}', - key['filename'], - ) + self.sshComboBox.addItem(f'{key}', key) def validate(self): """Pre-flight check for valid input and borg binary.""" diff --git a/src/vorta/views/repo_tab.py b/src/vorta/views/repo_tab.py index c5313c162..99d3613b4 100644 --- a/src/vorta/views/repo_tab.py +++ b/src/vorta/views/repo_tab.py @@ -175,7 +175,7 @@ def init_ssh(self): self.sshComboBox.clear() self.sshComboBox.addItem(self.tr('Automatically choose SSH Key (default)'), None) for key in keys: - self.sshComboBox.addItem(f'{key["filename"]}', key['filename']) + self.sshComboBox.addItem(f'{key}', key) def toggle_available_compression(self): use_zstd = borg_compat.check('ZSTD') From 1504f9da6d9240ace924fde0e02988317a0f89ee Mon Sep 17 00:00:00 2001 From: Divyansh Singh Date: Thu, 23 Feb 2023 17:52:41 +0530 Subject: [PATCH 06/16] use filepath instead of filename and add typing --- src/vorta/utils.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/vorta/utils.py b/src/vorta/utils.py index 4fb35473c..227f736f7 100644 --- a/src/vorta/utils.py +++ b/src/vorta/utils.py @@ -10,7 +10,8 @@ import unicodedata from datetime import datetime as dt from functools import reduce -from typing import Any, Callable, Iterable, Optional, Tuple, TypeVar +from pathlib import Path +from typing import Any, Callable, Iterable, List, Optional, Tuple, TypeVar import psutil from PyQt5 import QtCore from PyQt5.QtCore import QFileInfo, QThread, pyqtSignal @@ -175,9 +176,8 @@ def choose_file_dialog(parent, title, want_folder=True): return dialog -def is_ssh_file(filename): +def is_ssh_file(filepath: str) -> bool: """Check if the file is a SSH key.""" - filepath = os.path.expanduser('~/.ssh/' + filename) with open(filepath, 'rb') as f: first_line = f.readline() if not first_line.startswith(b'-----BEGIN OPENSSH PRIVATE KEY-----'): @@ -185,7 +185,7 @@ def is_ssh_file(filename): return True -def get_private_keys(): +def get_private_keys() -> List[str]: """Find SSH keys in standard folder.""" ssh_folder = os.path.expanduser('~/.ssh') @@ -200,7 +200,8 @@ def get_private_keys(): if key.endswith('.pub') or key.startswith('known_hosts') or key == 'config': continue try: - if is_ssh_file(key): + filepath = Path.home() / '.ssh' / key + if is_ssh_file(filepath): available_private_keys.append(key) except (PermissionError,): logger.debug(f'Expected error parsing file in .ssh: {key} (You can safely ignore this)', exc_info=True) @@ -209,8 +210,6 @@ def get_private_keys(): if e.errno == errno.ENXIO: # when key_file is a (ControlPath) socket continue - else: - raise return available_private_keys From fe6fb5e5ce166f9dab526b05137d41fa17f25bcf Mon Sep 17 00:00:00 2001 From: Divyansh Singh Date: Fri, 24 Feb 2023 01:11:46 +0530 Subject: [PATCH 07/16] remove extra path reference --- src/vorta/utils.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/vorta/utils.py b/src/vorta/utils.py index 227f736f7..18979c12d 100644 --- a/src/vorta/utils.py +++ b/src/vorta/utils.py @@ -10,7 +10,6 @@ import unicodedata from datetime import datetime as dt from functools import reduce -from pathlib import Path from typing import Any, Callable, Iterable, List, Optional, Tuple, TypeVar import psutil from PyQt5 import QtCore @@ -200,8 +199,7 @@ def get_private_keys() -> List[str]: if key.endswith('.pub') or key.startswith('known_hosts') or key == 'config': continue try: - filepath = Path.home() / '.ssh' / key - if is_ssh_file(filepath): + if is_ssh_file(key_file): available_private_keys.append(key) except (PermissionError,): logger.debug(f'Expected error parsing file in .ssh: {key} (You can safely ignore this)', exc_info=True) From 08cef65a5b49f52995249c28fc78bc86961e3ae9 Mon Sep 17 00:00:00 2001 From: Divyansh Singh Date: Fri, 24 Feb 2023 17:59:29 +0530 Subject: [PATCH 08/16] check for all ssh key headers --- src/vorta/utils.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/vorta/utils.py b/src/vorta/utils.py index 18979c12d..5a800b15b 100644 --- a/src/vorta/utils.py +++ b/src/vorta/utils.py @@ -177,11 +177,10 @@ def choose_file_dialog(parent, title, want_folder=True): def is_ssh_file(filepath: str) -> bool: """Check if the file is a SSH key.""" - with open(filepath, 'rb') as f: + with open(filepath, 'r') as f: first_line = f.readline() - if not first_line.startswith(b'-----BEGIN OPENSSH PRIVATE KEY-----'): - return False - return True + pattern = r'^-----BEGIN(\s\w+)? PRIVATE KEY-----' + return re.match(pattern, first_line) is not None def get_private_keys() -> List[str]: From 726c2fec8be2ccbc13e10e79b55fc360351d3d78 Mon Sep 17 00:00:00 2001 From: Divyansh Singh Date: Fri, 24 Feb 2023 18:59:59 +0530 Subject: [PATCH 09/16] add UnicodeDecodeError handling --- src/vorta/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vorta/utils.py b/src/vorta/utils.py index 5a800b15b..14400176a 100644 --- a/src/vorta/utils.py +++ b/src/vorta/utils.py @@ -200,7 +200,7 @@ def get_private_keys() -> List[str]: try: if is_ssh_file(key_file): available_private_keys.append(key) - except (PermissionError,): + except (PermissionError, UnicodeDecodeError): logger.debug(f'Expected error parsing file in .ssh: {key} (You can safely ignore this)', exc_info=True) continue except OSError as e: From 4cea44727f33a0ffe75d18e9665a910c4b4d8473 Mon Sep 17 00:00:00 2001 From: Divyansh Singh Date: Fri, 24 Feb 2023 22:04:49 +0530 Subject: [PATCH 10/16] add explanation for explicitly handling errors --- src/vorta/utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/vorta/utils.py b/src/vorta/utils.py index 14400176a..51b1a7e6d 100644 --- a/src/vorta/utils.py +++ b/src/vorta/utils.py @@ -201,6 +201,9 @@ def get_private_keys() -> List[str]: if is_ssh_file(key_file): available_private_keys.append(key) except (PermissionError, UnicodeDecodeError): + # Handling PermissionError separately from OSError because it can be safely ignored + # (If the user doesn't have permission to read the file, it's not an unexpected error) + # If UnicodeDecodeError is raised, it's because the file is not a valid SSH key logger.debug(f'Expected error parsing file in .ssh: {key} (You can safely ignore this)', exc_info=True) continue except OSError as e: From 07bf041097aceb12b02af296ddd2195bf4597fa7 Mon Sep 17 00:00:00 2001 From: Divyansh Singh Date: Thu, 2 Mar 2023 17:01:18 +0530 Subject: [PATCH 11/16] code review --- src/vorta/utils.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/vorta/utils.py b/src/vorta/utils.py index 51b1a7e6d..129c99167 100644 --- a/src/vorta/utils.py +++ b/src/vorta/utils.py @@ -175,12 +175,15 @@ def choose_file_dialog(parent, title, want_folder=True): return dialog -def is_ssh_file(filepath: str) -> bool: +def is_ssh_private_key_file(filepath: str) -> bool: """Check if the file is a SSH key.""" - with open(filepath, 'r') as f: - first_line = f.readline() - pattern = r'^-----BEGIN(\s\w+)? PRIVATE KEY-----' - return re.match(pattern, first_line) is not None + try: + with open(filepath, 'r') as f: + first_line = f.readline() + pattern = r'^-----BEGIN(\s\w+)? PRIVATE KEY-----' + return re.match(pattern, first_line) is not None + except UnicodeDecodeError: + return False def get_private_keys() -> List[str]: @@ -198,18 +201,19 @@ def get_private_keys() -> List[str]: if key.endswith('.pub') or key.startswith('known_hosts') or key == 'config': continue try: - if is_ssh_file(key_file): + if is_ssh_private_key_file(key_file): available_private_keys.append(key) - except (PermissionError, UnicodeDecodeError): + except PermissionError: # Handling PermissionError separately from OSError because it can be safely ignored - # (If the user doesn't have permission to read the file, it's not an unexpected error) - # If UnicodeDecodeError is raised, it's because the file is not a valid SSH key + # (if the user doesn't have permission to read the file, it's not an unexpected error). logger.debug(f'Expected error parsing file in .ssh: {key} (You can safely ignore this)', exc_info=True) continue except OSError as e: if e.errno == errno.ENXIO: # when key_file is a (ControlPath) socket continue + else: + raise return available_private_keys From 2be6fd024b7bca50824e4e816ba9c37c152ef67e Mon Sep 17 00:00:00 2001 From: Divyansh Singh Date: Fri, 3 Mar 2023 03:00:01 +0530 Subject: [PATCH 12/16] remove else --- src/vorta/utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/vorta/utils.py b/src/vorta/utils.py index 129c99167..989f8ed48 100644 --- a/src/vorta/utils.py +++ b/src/vorta/utils.py @@ -212,8 +212,7 @@ def get_private_keys() -> List[str]: if e.errno == errno.ENXIO: # when key_file is a (ControlPath) socket continue - else: - raise + raise return available_private_keys From d96afaf75eccf02a70b37e37278db659c33f9f4c Mon Sep 17 00:00:00 2001 From: Divyansh Singh Date: Tue, 7 Mar 2023 21:45:10 +0530 Subject: [PATCH 13/16] check for too open permissions --- src/vorta/utils.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/vorta/utils.py b/src/vorta/utils.py index 989f8ed48..10138aa2a 100644 --- a/src/vorta/utils.py +++ b/src/vorta/utils.py @@ -202,11 +202,16 @@ def get_private_keys() -> List[str]: continue try: if is_ssh_private_key_file(key_file): - available_private_keys.append(key) + if os.stat(key_file).st_mode & 0o077 == 0: + available_private_keys.append(key) + else: + logger.warning(f'Permissions for {key_file} are too open.') + else: + logger.debug(f'Not a private SSH key file: {key}') except PermissionError: # Handling PermissionError separately from OSError because it can be safely ignored # (if the user doesn't have permission to read the file, it's not an unexpected error). - logger.debug(f'Expected error parsing file in .ssh: {key} (You can safely ignore this)', exc_info=True) + logger.debug(f'Permission error while opening file in .ssh: {key}', exc_info=True) continue except OSError as e: if e.errno == errno.ENXIO: From b1d2e09aa8e82579ccf29d316866d9d50b24ad10 Mon Sep 17 00:00:00 2001 From: Divyansh Singh Date: Thu, 9 Mar 2023 01:47:53 +0530 Subject: [PATCH 14/16] remove unnecessary comment and use warning --- src/vorta/utils.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/vorta/utils.py b/src/vorta/utils.py index 10138aa2a..56207b454 100644 --- a/src/vorta/utils.py +++ b/src/vorta/utils.py @@ -209,9 +209,7 @@ def get_private_keys() -> List[str]: else: logger.debug(f'Not a private SSH key file: {key}') except PermissionError: - # Handling PermissionError separately from OSError because it can be safely ignored - # (if the user doesn't have permission to read the file, it's not an unexpected error). - logger.debug(f'Permission error while opening file in .ssh: {key}', exc_info=True) + logger.warning(f'Permission error while opening file in .ssh: {key}', exc_info=True) continue except OSError as e: if e.errno == errno.ENXIO: From ab0a33ee6a1bf4edc6edb6a0e4bda75363b5483f Mon Sep 17 00:00:00 2001 From: Divyansh Singh Date: Thu, 9 Mar 2023 14:50:39 +0530 Subject: [PATCH 15/16] use filepath instead of file name --- src/vorta/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vorta/utils.py b/src/vorta/utils.py index 56207b454..e589972b3 100644 --- a/src/vorta/utils.py +++ b/src/vorta/utils.py @@ -209,7 +209,7 @@ def get_private_keys() -> List[str]: else: logger.debug(f'Not a private SSH key file: {key}') except PermissionError: - logger.warning(f'Permission error while opening file in .ssh: {key}', exc_info=True) + logger.warning(f'Permission error while opening file: {key_file}', exc_info=True) continue except OSError as e: if e.errno == errno.ENXIO: From 9fdee761c8ef3730bc003059eb02ec356dae5914 Mon Sep 17 00:00:00 2001 From: real-yfprojects Date: Fri, 17 Mar 2023 15:46:19 +0100 Subject: [PATCH 16/16] Revert out-of-scope formatting. --- src/vorta/borg/init.py | 1 + src/vorta/qt_single_application.py | 1 + src/vorta/scheduler.py | 3 +++ 3 files changed, 5 insertions(+) diff --git a/src/vorta/borg/init.py b/src/vorta/borg/init.py index 73dfe040b..b26b4b7de 100644 --- a/src/vorta/borg/init.py +++ b/src/vorta/borg/init.py @@ -9,6 +9,7 @@ def started_event(self): @classmethod def prepare(cls, params): + # Build fake profile because we don't have it in the DB yet. profile = FakeProfile( 999, diff --git a/src/vorta/qt_single_application.py b/src/vorta/qt_single_application.py index e45519957..8e5be661f 100644 --- a/src/vorta/qt_single_application.py +++ b/src/vorta/qt_single_application.py @@ -40,6 +40,7 @@ class QtSingleApplication(QApplication): message_received_event = pyqtSignal(str) def __init__(self, id, *argv): + super().__init__(*argv) self._id = id diff --git a/src/vorta/scheduler.py b/src/vorta/scheduler.py index e7fdbdd28..4cace732c 100644 --- a/src/vorta/scheduler.py +++ b/src/vorta/scheduler.py @@ -32,6 +32,7 @@ class ScheduleStatus(NamedTuple): class VortaScheduler(QtCore.QObject): + #: The schedule for the profile with the given id changed. schedule_changed = QtCore.pyqtSignal(int) @@ -195,6 +196,7 @@ def set_timer_for_profile(self, profile_id: int): return with self.lock: # Acquire lock + self.remove_job(profile_id) # reset schedule pause = self.pauses.get(profile_id) @@ -288,6 +290,7 @@ def set_timer_for_profile(self, profile_id: int): # handle missing of a scheduled time if next_time <= dt.now(): + if profile.schedule_make_up_missed: self.lock.release() try: