diff options
author | Hiroyuki Tanaka <myheroyuki@outlook.com> | 2024-01-04 17:00:33 +0300 |
---|---|---|
committer | Hiroyuki Tanaka <myheroyuki@outlook.com> | 2024-01-04 17:00:33 +0300 |
commit | 69ce4e7d23524172922ec1fdd142334131937d7d (patch) | |
tree | 7e78535caaddfbc36af587e1862308f549b1f18b | |
parent | 2514ef155a52985fbbc5cbd95ff1ce95d4867686 (diff) | |
parent | c9129367c9a194633e712a4041b8c73da8783bfc (diff) |
Add a plugin to print out saved passwords to make migrating to new systems easier
See merge request Remmina/remmina-plugins!2
-rw-r--r-- | plugins/password_export/password_export.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/plugins/password_export/password_export.py b/plugins/password_export/password_export.py new file mode 100644 index 0000000..8c6f93a --- /dev/null +++ b/plugins/password_export/password_export.py @@ -0,0 +1,39 @@ +import gi +import remmina +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 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"): + 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) |