Use SSH configuration if available

This commit is contained in:
Emanuele 2020-12-20 00:09:16 +01:00
parent e863dc25f7
commit f20c2c1f80
2 changed files with 2 additions and 6 deletions

View file

@ -52,7 +52,7 @@ class rMConnect(QRunnable):
else: else:
pkey = None pkey = None
if password is None: if password is None:
raise Exception("Must provide either password or SSH key") log.warning("No key nor password given. System-wide SSH connection parameters are going to be used.")
self.options = { self.options = {
'username': username, 'username': username,

View file

@ -143,12 +143,8 @@ class rMViewApp(QApplication):
def ensureConnConfig(self): def ensureConnConfig(self):
if self.config['ssh'].get('address') is None: if self.config['ssh'].get('address') is None:
address, ok = QInputDialog.getText(self.viewer, "Configuration","IP Address of your reMarkable:", QLineEdit.Normal, "10.11.99.1") address, ok = QInputDialog.getText(self.viewer, "Configuration","IP Address of your reMarkable:", QLineEdit.Normal, "10.11.99.1")
if ok and address:
self.config['ssh']['address'] = address
else:
self.quit()
if self.config['ssh'].get('password') is None and self.config['ssh'].get('key') is None: if self.config['ssh'].get('ask_password'):
password, ok = QInputDialog.getText(self.viewer, "Configuration","reMarkable password:", QLineEdit.Password) password, ok = QInputDialog.getText(self.viewer, "Configuration","reMarkable password:", QLineEdit.Password)
if ok: if ok:
self.config['ssh']['password'] = password or "" self.config['ssh']['password'] = password or ""