From d50a30c8403bbfa31d6f650c167ddb5b5d1bddc5 Mon Sep 17 00:00:00 2001 From: Patryk Nowak Date: Thu, 7 Dec 2023 21:15:43 +0100 Subject: Add a plugin to print out saved passwords to make migrating to new systems easier --- plugins/password_export/password_export.py | 36 ++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 plugins/password_export/password_export.py diff --git a/plugins/password_export/password_export.py b/plugins/password_export/password_export.py new file mode 100644 index 0000000..1b1d83d --- /dev/null +++ b/plugins/password_export/password_export.py @@ -0,0 +1,36 @@ +import gi +import remmina +import time +import os +gi.require_version('Secret', '1') +from gi.repository import Secret + +#Schema in which passwords are stored +SCHEMA = Secret.Schema.new("org.remmina.Password", + Secret.SchemaFlags.NONE, + { + "filename": Secret.SchemaAttributeType.STRING, + "key": Secret.SchemaAttributeType.STRING, + } +) + +class PluginTool: + def __init__(self): + self.button = None + self.name = "Password Export Tool" + self.type = "tool" + self.description = "Export all passwords" + self.version = "1.0" + + def exec_func(self): + data_dir = remmina.get_datadir() + for file in os.listdir(data_dir): + if file.endswith(".remmina"): + full_path = data_dir + "/" + file + password = Secret.password_lookup_sync(SCHEMA, { "filename": full_path, "key": "password" }, + None) + if (password): + print(file + ":\t\t" + password) + +passwordExportPlugin = PluginTool() +remmina.register_plugin(passwordExportPlugin) -- cgit v1.2.3 From c9129367c9a194633e712a4041b8c73da8783bfc Mon Sep 17 00:00:00 2001 From: Patryk Nowak Date: Wed, 3 Jan 2024 14:00:31 +0100 Subject: Make password export plugin require password if enabled --- plugins/password_export/password_export.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/password_export/password_export.py b/plugins/password_export/password_export.py index 1b1d83d..8c6f93a 100644 --- a/plugins/password_export/password_export.py +++ b/plugins/password_export/password_export.py @@ -1,6 +1,5 @@ import gi import remmina -import time import os gi.require_version('Secret', '1') from gi.repository import Secret @@ -19,10 +18,14 @@ class PluginTool: self.button = None self.name = "Password Export Tool" self.type = "tool" - self.description = "Export all passwords" + self.description = "Export all passwords to logs" self.version = "1.0" + print("Loaded password export plugin") def exec_func(self): + if (remmina.pref_get_value(key="use_primary_password") == "true" and (remmina.unlock_new() == 0)): + print("Unlock failed") + return data_dir = remmina.get_datadir() for file in os.listdir(data_dir): if file.endswith(".remmina"): -- cgit v1.2.3