[PATCH 0/4] gnu: Add browserpass-native.

  • Done
  • quality assurance status badge
Details
One participant
  • Alex Griffin
Owner
unassigned
Submitted by
Alex Griffin
Severity
normal
A
A
Alex Griffin wrote on 10 Jan 2020 23:29
(address . guix-patches@gnu.org)
130dbe95-6f71-4b93-a675-c2e4f2d6e396@www.fastmail.com
This patch series adds browserpass-native. Browserpass is a browser extension that integrates the `pass` password manager with the browser. This does not add the extension itself, only the native messaging component which runs outside of the browser process and communicates with the extension. Packaging the extension itself requires better Node.js infrastructure in Guix, so it is left to the user to install on their own.

I think this is the first native messaging host to be packaged for Guix, so it probably makes sense to get input from the maintainers of IceCat and ungoogled-chromium. The native messaging host is not automatically detected by either browser - the user needs to run something like `make -C $(guix build browserpass-native)/lib/browserpass hosts-chromium-user` to install it into their home directory.

Nix builds a wrapper around Firefox to detect the native messaging hosts that are installed, and I think Guix should consider doing something similar.

--
Alex Griffin
A
A
Alex Griffin wrote on 10 Jan 2020 23:32
[PATCH 1/4] gnu: go-github-com-sirupsen-logrus: Propagate inputs.
(address . 39077@debbugs.gnu.org)
e2cbefcd-37cb-4f4c-85e9-dc311155aa20@www.fastmail.com
attached

--
Alex Griffin
From 8b3c5415e581309abf9bff0ec73f910e859c60f1 Mon Sep 17 00:00:00 2001
From: Alex Griffin <a@ajgrf.com>
Date: Fri, 10 Jan 2020 13:25:19 -0600
Subject: [PATCH 1/4] gnu: go-github-com-sirupsen-logrus: Propagate inputs.

* gnu/packages/golang.scm (go-github-com-sirupsen-logrus): Propagate inputs.
---
gnu/packages/golang.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index f94251abaf..1b7f0f3487 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -14,7 +14,7 @@
;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
;;; Copyright @ 2018, 2019 Katherine Cox-Buday <cox.katherine.e@gmail.com>
;;; Copyright @ 2019 Giovanni Biscuolo <g@xelera.eu>
-;;; Copyright @ 2019 Alex Griffin <a@ajgrf.com>
+;;; Copyright @ 2019, 2020 Alex Griffin <a@ajgrf.com>
;;; Copyright © 2019 Arun Isaac <arunisaac@systemreboot.net>
;;;
;;; This file is part of GNU Guix.
@@ -1169,7 +1169,7 @@ GNU extensions} to the POSIX recommendations for command-line options.")
(base32
"0g5z7al7kky11ai2dhac6gkp3b5pxsvx72yj3xg4wg3265gbn7yz"))))
(build-system go-build-system)
- (native-inputs
+ (propagated-inputs
`(("go-golang-org-x-crypto"
,go-golang-org-x-crypto)
("go-github-com-stretchr-testify"
--
2.24.1
A
A
Alex Griffin wrote on 10 Jan 2020 23:33
[PATCH 2/4] gnu: Add go-github-com-rifflock-lfshook.
(address . 39077@debbugs.gnu.org)
751e0df2-54e0-493d-92c0-18081aa56613@www.fastmail.com
attached

--
Alex Griffin
From 31bce6a641343d809a84678fff67259936a9b56c Mon Sep 17 00:00:00 2001
From: Alex Griffin <a@ajgrf.com>
Date: Fri, 10 Jan 2020 13:32:32 -0600
Subject: [PATCH 2/4] gnu: Add go-github-com-rifflock-lfshook.

* gnu/packages/golang.scm (go-github-com-rifflock-lfshook): New variable.
---
gnu/packages/golang.scm | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)

Toggle diff (38 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 1b7f0f3487..9dd9b37cf0 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -1184,6 +1184,31 @@ GNU extensions} to the POSIX recommendations for command-line options.")
compatible with the standard library logger.")
(license license:expat)))
+(define-public go-github-com-rifflock-lfshook
+ (package
+ (name "go-github-com-rifflock-lfshook")
+ (version "2.4")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/rifflock/lfshook.git")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0wxqjcjfg8c0klmdgmbw3ckagby3wg9rkga9ihd4fsf05x5scxrc"))))
+ (build-system go-build-system)
+ (arguments
+ `(#:import-path "github.com/rifflock/lfshook"))
+ (propagated-inputs
+ `(("go-github-com-sirupsen-logrus" ,go-github-com-sirupsen-logrus)))
+ (home-page "https://github.com/rifflock/lfshook")
+ (synopsis "Local File System hook for Logrus logger")
+ (description "This package provides a hook for Logrus to write directly to
+a file on the filesystem. The log levels are dynamic at instantiation of the
+hook, so it is capable of logging at some or all levels.")
+ (license license:expat)))
+
(define-public go-github-com-kardianos-osext
(let ((commit "ae77be60afb1dcacde03767a8c37337fad28ac14")
(revision "1"))
--
2.24.1
A
A
Alex Griffin wrote on 10 Jan 2020 23:34
[PATCH 3/4] gnu: Add go-github-com-mattn-go-zglob.
(address . 39077@debbugs.gnu.org)
26154f24-ab7f-4a6c-b021-b97f9cb559bd@www.fastmail.com
attached

--
Alex Griffin
From 9ff783804d62248eb0efcfb69588b4e3cf49e2e1 Mon Sep 17 00:00:00 2001
From: Alex Griffin <a@ajgrf.com>
Date: Fri, 10 Jan 2020 13:36:57 -0600
Subject: [PATCH 3/4] gnu: Add go-github-com-mattn-go-zglob.

* gnu/packages/golang.scm (go-github-com-mattn-go-zglob): New variable.
---
gnu/packages/golang.scm | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)

Toggle diff (32 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 9dd9b37cf0..8665a5f26e 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -3105,3 +3105,25 @@ alternative to @code{reflect.DeepEqual} for comparing whether two values
are semantically equal in Go (for writing tests).")
(home-page "https://godoc.org/github.com/google/go-cmp/cmp")
(license license:asl2.0)))
+
+(define-public go-github-com-mattn-go-zglob
+ (package
+ (name "go-github-com-mattn-go-zglob")
+ (version "0.0.1")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mattn/go-zglob.git")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1sncdyq5fbd42al4amyy91h7vlzm3wm6c9vl8za2pjgfgsd581fz"))))
+ (build-system go-build-system)
+ (arguments
+ `(#:import-path "github.com/mattn/go-zglob"))
+ (home-page "https://github.com/mattn/go-zglob")
+ (synopsis "Glob library that descends into other directories")
+ (description " A glob library that implements descending into other
+directories. It is optimized for filewalking. ")
+ (license license:expat)))
--
2.24.1
A
A
Alex Griffin wrote on 10 Jan 2020 23:34
[PATCH 4/4] gnu: Add browserpass-native.
(address . 39077@debbugs.gnu.org)
fbe76f8f-eca1-4d8f-969c-0f80788312f0@www.fastmail.com
attached

--
Alex Griffin
From 357fce41e0575a04711395d0bd79ee6099ee9938 Mon Sep 17 00:00:00 2001
From: Alex Griffin <a@ajgrf.com>
Date: Fri, 10 Jan 2020 13:37:30 -0600
Subject: [PATCH 4/4] gnu: Add browserpass-native.

* gnu/packages/password-utils.scm (browserpass-native): New variable.
---
gnu/packages/password-utils.scm | 80 ++++++++++++++++++++++++++++++++-
1 file changed, 79 insertions(+), 1 deletion(-)

Toggle diff (114 lines)
diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm
index db5f54e1d9..2043e368bd 100644
--- a/gnu/packages/password-utils.scm
+++ b/gnu/packages/password-utils.scm
@@ -6,7 +6,7 @@
;;; Copyright © 2016 Jessica Tallon <tsyesika@tsyesika.se>
;;; Copyright © 2016 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
-;;; Copyright © 2016, 2019 Alex Griffin <a@ajgrf.com>
+;;; Copyright © 2016, 2019, 2020 Alex Griffin <a@ajgrf.com>
;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
;;; Copyright © 2017, 2018 Clément Lassieur <clement@lassieur.org>
;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
@@ -44,6 +44,7 @@
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix build-system cmake)
#:use-module (guix build-system gnu)
+ #:use-module (guix build-system go)
#:use-module (guix build-system trivial)
#:use-module (guix download)
#:use-module (guix git-download)
@@ -62,6 +63,7 @@
#:use-module (gnu packages gettext)
#:use-module (gnu packages glib)
#:use-module (gnu packages gnupg)
+ #:use-module (gnu packages golang)
#:use-module (gnu packages gtk)
#:use-module (gnu packages guile)
#:use-module (gnu packages kerberos)
@@ -701,6 +703,82 @@ using password-store through rofi interface:
@end enumerate")
(license license:gpl3)))
+(define-public browserpass-native
+ (package
+ (name "browserpass-native")
+ (version "3.0.6")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/browserpass/browserpass-native.git")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0q3bsla07zjl6i69nj1axbkg2ia89pvh0jg6nlqgbm2kpzzbn0pz"))))
+ (build-system go-build-system)
+ (arguments
+ `(#:import-path "github.com/browserpass/browserpass-native"
+ #:install-source? #f
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'build 'patch-makefile
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ ;; This doesn't go in #:make-flags because the Makefile itself
+ ;; gets installed.
+ (substitute*
+ "src/github.com/browserpass/browserpass-native/Makefile"
+ (("PREFIX \\?= /usr")
+ (string-append "PREFIX ?= " out)))
+ #t)))
+ (add-before 'build 'configure
+ (lambda _
+ (with-directory-excursion
+ "src/github.com/browserpass/browserpass-native"
+ (invoke "make" "configure"))
+ #t))
+ (replace 'build
+ (lambda _
+ (with-directory-excursion
+ "src/github.com/browserpass/browserpass-native"
+ (invoke "make"))
+ #t))
+ (replace 'install
+ (lambda _
+ (with-directory-excursion
+ "src/github.com/browserpass/browserpass-native"
+ (invoke "make" "install"))
+ #t))
+ (add-after 'install 'wrap-executable
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out"))
+ (gnupg (assoc-ref inputs "gnupg")))
+ (wrap-program (string-append out "/bin/browserpass")
+ `("PATH" ":" prefix
+ (,(string-append gnupg "/bin"))))
+ #t))))))
+ (native-inputs
+ `(("which" ,which)))
+ (inputs
+ `(("gnupg" ,gnupg)
+ ("go-github-com-mattn-go-zglob" ,go-github-com-mattn-go-zglob)
+ ("go-github-com-rifflock-lfshook" ,go-github-com-rifflock-lfshook)
+ ("go-github-com-sirupsen-logrus" ,go-github-com-sirupsen-logrus)
+ ("go-golang-org-x-sys" ,go-golang-org-x-sys)))
+ (home-page "https://github.com/browserpass/browserpass-native")
+ (synopsis "Browserpass native messaging host")
+ (description "Browserpass is a browser extension for pass, a
+UNIX-based password store manager. It allows you to auto-fill or copy to
+clipboard credentials for the current domain, protecting you from phishing
+attacks.
+
+This package only contains the Browserpass native messaging host. You must
+also install the browser extension for GNU IceCat or ungoogled-chromium
+separately.")
+ (license license:isc)))
+
(define-public argon2
(package
(name "argon2")
--
2.24.1
A
A
Alex Griffin wrote on 22 Feb 2020 15:20
Re: [PATCH 0/4] gnu: Add browserpass-native.
(address . 39077@debbugs.gnu.org)
6f94f3ed-ff54-4876-869d-e8e7525aa284@www.fastmail.com
I plan on pushing this next weekend unless I hear objections. We can figure out how to make native messaging hosts easier to use later.

--
Alex Griffin
A
A
Alex Griffin wrote on 13 Mar 2020 03:19
(address . 39077-done@debbugs.gnu.org)
863f3b48-d083-44d6-a796-728f44fd112e@www.fastmail.com
Pushed in 63299f2840edcd5d942b3433ffb205fcc1fb6eb4.
--
Alex Griffin
Closed
?