From 4166e50764dd8bef6187b74cece0073efdc5353d Mon Sep 17 00:00:00 2001 From: Jan Holthuis Date: Sun, 28 Oct 2018 15:27:02 +0100 Subject: [PATCH 1/3] Add support for per-domain secret files in qute-pass This adds support for password stores where the domain is not the directory name, but the filename of a gpg file. This solves problems when using a password store folder structure like this reddit user does: https://www.reddit.com/r/qutebrowser/comments/7owzl2/cant_get_qutepass_working/ --- misc/userscripts/qute-pass | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/misc/userscripts/qute-pass b/misc/userscripts/qute-pass index ca9c4d4ca..bfc2cbeb9 100755 --- a/misc/userscripts/qute-pass +++ b/misc/userscripts/qute-pass @@ -97,13 +97,19 @@ def qute_command(command): def find_pass_candidates(domain, password_store_path): candidates = [] for path, directories, file_names in os.walk(password_store_path, followlinks=True): - if directories or domain not in path.split(os.path.sep): + secrets = fnmatch.filter(file_names, '*.gpg') + if not secrets: continue # Strip password store path prefix to get the relative pass path pass_path = path[len(password_store_path) + 1:] - secrets = fnmatch.filter(file_names, '*.gpg') - candidates.extend(os.path.join(pass_path, os.path.splitext(secret)[0]) for secret in secrets) + split_path = pass_path.split(os.path.sep) + for secret in secrets: + secret_base = os.path.splitext(secret)[0] + if domain not in (split_path + [secret_base]): + continue + + candidates.append(os.path.join(pass_path, secret_base)) return candidates From 61d1cd3f5544989c639f72a429402283a49b2b58 Mon Sep 17 00:00:00 2001 From: Jay Kamat Date: Sun, 27 Jan 2019 12:21:36 -0800 Subject: [PATCH 2/3] Update changelog We may want to consider changing the desktop filename at some point as well to comply with https://www.freedesktop.org/software/appstream/docs/chap-Quickstart.html --- doc/changelog.asciidoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index a116b53e6..338625936 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -55,6 +55,8 @@ Changed - The Wayland check for QtWebEngine is now disabled on Qt >= 5.11.2, as those versions should work without any issues. - The JavaScript `console` object is now available in PAC files. +- The metainfo file `qutebrowser.appdata.xml` is now renamed to + `org.qutebrowser.qutebrowser.appdata.xml`. Fixed ~~~~~ From 8ad7184ca1d67a06b19edef43638581e330badb1 Mon Sep 17 00:00:00 2001 From: Jay Kamat Date: Sun, 27 Jan 2019 12:44:27 -0800 Subject: [PATCH 3/3] Update changelog --- doc/changelog.asciidoc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 338625936..6b2bc1d71 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -57,6 +57,8 @@ Changed - The JavaScript `console` object is now available in PAC files. - The metainfo file `qutebrowser.appdata.xml` is now renamed to `org.qutebrowser.qutebrowser.appdata.xml`. +- The `qute-pass` userscript now understands domains in gpg filenames + in addition to directory names. Fixed ~~~~~ @@ -71,7 +73,7 @@ Fixed `content.cookies.accept = no-3rdparty` from working properly on some pages like GMail. However, the default for `content.cookies.accept` is still `all` to be in line with what other browsers do. -- `:navigate` not incrementing in anchors or queries or anchors. +- `:navigate` not incrementing in anchors or queries. - Crash when trying to use a proxy requiring authentication with QtWebKit. - Slashes in search terms are now percent-escaped. - When `scrolling.bar = True` was set in versions before v1.5.0, this now