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:
pkey = 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 = {
'username': username,

View file

@ -143,12 +143,8 @@ class rMViewApp(QApplication):
def ensureConnConfig(self):
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")
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)
if ok:
self.config['ssh']['password'] = password or ""