~abcdw/rde-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
14 2

[PATCH rde 0/6] rde: mail: Update and allow use of multiline password files

Details
Message ID
<20240630183657.31636-1-ngraves@ngraves.fr>
DKIM signature
missing
Download raw message
Motivation :
goimapnotify doesn't seem to allow the use of pipes for its
passwordCmd parameter. I use multiline password files to optionally
store additional data, which is quite standard as it's featured on the
main documentation page of password-store
(https://www.passwordstore.org/#organization). I couldn't use
goimapnotify properly as a result.

This patch series does the following :
* the mail-account-get-pass-cmd is replaced by mail-account-pass-args,
  which is used between the binary provided by feature-password-store
  and the mail-account-fqda.
* wrap the password-store binary like if piped into "| head -1" when
  used for password-querying commands.
* adapt isync configuration to both previous changes.

Nicolas Graves (6):
  rde: mail: Split mail-account-get-pass-cmd
  rde: mail: Allow gexp mail-account-get-pass-cmd in serialization
  rde: mail: Use pass-binary from feature-password-store
  rde: password-store: Add pass-binary value
  rde: password-store: Wrap pass-binary to handle multiline files
  rde: isync: Use char serialization to quote PassCmd

 src/gnu/home-services/mail.scm      |  3 ++-
 src/rde/features/mail.scm           | 39 ++++++++++++++++-------------
 src/rde/features/password-utils.scm | 25 +++++++++++++++++-
 3 files changed, 47 insertions(+), 20 deletions(-)

-- 
2.45.2

[PATCH rde 1/6] rde: mail: Split mail-account-get-pass-cmd

Details
Message ID
<20240630183657.31636-2-ngraves@ngraves.fr>
In-Reply-To
<20240630183657.31636-1-ngraves@ngraves.fr> (view parent)
DKIM signature
missing
Download raw message
Patch: +16 -10
Splits mail-account-get-pass-cmd into string
mail-account-pass-binary and list of strings mail-account-pass-args.
---
 src/rde/features/mail.scm | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/src/rde/features/mail.scm b/src/rde/features/mail.scm
index 329144d9..3d06d5c2 100644
--- a/src/rde/features/mail.scm
+++ b/src/rde/features/mail.scm
@@ -64,7 +64,8 @@
            mail-account-user
            mail-account-get-user
            mail-account-synchronizer
            mail-account-get-pass-cmd
            mail-account-pass-binary
            mail-account-pass-args

            mailing-list
            mailing-list-id
@@ -109,15 +110,20 @@ scenarios, during generation of @file{mbsyncrc} for example.")
   "User name.  Will default to @code{fqda}.")
  ;; TODO: Add sign? field. or maybe just annoy users, which doesn't
  ;; have a gpg key for all emails they use?
  (pass-cmd
  (pass-binary
   (maybe-string #f)
   "Command returning a password.  If value not provided @code{pass
show mail/$fqda} will be used, where @code{$fqda} is a value of fqda
field."))
   "Binary to use to get password. This field is composed with
@code{pass-args} to produce the command returning a password.")
  (pass-args
   (list-of-strings '())
   "List of strings passed to @code{pass-binary} to produce the command
returning a password."))

(define (mail-account-get-pass-cmd mail-account)
  (if (mail-account-pass-cmd mail-account)
      (mail-account-pass-cmd mail-account)
  (if (mail-account-pass-binary mail-account)
      (string-join (cons* (mail-account-pass-binary mail-account)
                          (mail-account-pass-args mail-account))
                   " ")
      (string-append "pass show mail/" (mail-account-fqda mail-account))))

(define (mail-account-get-user account)
@@ -1047,11 +1053,11 @@ control whether to NOTIFY? when new emails arrive."
          (pipeline-depth #f))
  (ensure-pred symbol? subfolders)

  (define (isync-settings mail-directory mail-account)
  (define (isync-settings mail-directory mail-account config)
    (let* ((id       (mail-account-id mail-account))
           (account  (symbol->string id))
           (user     (mail-account-get-user mail-account))
           (pass-cmd (mail-account-get-pass-cmd mail-account)))
           (pass-cmd (mail-account-get-pass-cmd mail-account config)))
      `(,#~(string-append "# Account '" #$(symbol->string id)
                          " starts here")
        (IMAPAccount ,id)
@@ -1252,7 +1258,7 @@ mail accounts.  ISYNC-VERBOSE controls output verboseness of

      (define (serialize-mail-acc mail-acc)
        ((assoc-ref isync-serializers (mail-account-type mail-acc))
         mail-directory mail-acc))
         mail-directory mail-acc config))

      (list
       (simple-service
-- 
2.45.2

[PATCH rde 2/6] rde: mail: Allow gexp mail-account-get-pass-cmd in serialization

Details
Message ID
<20240630183657.31636-3-ngraves@ngraves.fr>
In-Reply-To
<20240630183657.31636-1-ngraves@ngraves.fr> (view parent)
DKIM signature
missing
Download raw message
Patch: +2 -2
---
 src/rde/features/mail.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/rde/features/mail.scm b/src/rde/features/mail.scm
index 3d06d5c2..d5457028 100644
--- a/src/rde/features/mail.scm
+++ b/src/rde/features/mail.scm
@@ -427,9 +427,9 @@ Example:
                  (string-length "$HOME")))
          (append-map
           (lambda (acc)
             (map
             (append-map
              (lambda (address)
                (string-append
                (list
                 "\n"
                 "account " (symbol->string (mail-account-id acc))
                 "-" address "\n"
-- 
2.45.2

[PATCH rde 3/6] rde: mail: Use pass-binary from feature-password-store

Details
Message ID
<20240630183657.31636-4-ngraves@ngraves.fr>
In-Reply-To
<20240630183657.31636-1-ngraves@ngraves.fr> (view parent)
DKIM signature
missing
Download raw message
Patch: +13 -16
---
 src/rde/features/mail.scm | 29 +++++++++++++----------------
 1 file changed, 13 insertions(+), 16 deletions(-)

diff --git a/src/rde/features/mail.scm b/src/rde/features/mail.scm
index d5457028..8663507c 100644
--- a/src/rde/features/mail.scm
+++ b/src/rde/features/mail.scm
@@ -64,7 +64,6 @@
            mail-account-user
            mail-account-get-user
            mail-account-synchronizer
            mail-account-pass-binary
            mail-account-pass-args

            mailing-list
@@ -110,21 +109,19 @@ scenarios, during generation of @file{mbsyncrc} for example.")
   "User name.  Will default to @code{fqda}.")
  ;; TODO: Add sign? field. or maybe just annoy users, which doesn't
  ;; have a gpg key for all emails they use?
  (pass-binary
   (maybe-string #f)
   "Binary to use to get password. This field is composed with
@code{pass-args} to produce the command returning a password.")
  (pass-args
   (list-of-strings '())
   "List of strings passed to @code{pass-binary} to produce the command
returning a password."))
   (list-of-strings
    (list "show"))
   "List of strings prefixed with @code{pass-binary} and suffixed with
@code{fqda} to produce the command returning the password."))

(define (mail-account-get-pass-cmd mail-account)
  (if (mail-account-pass-binary mail-account)
      (string-join (cons* (mail-account-pass-binary mail-account)
                          (mail-account-pass-args mail-account))
                   " ")
      (string-append "pass show mail/" (mail-account-fqda mail-account))))
(define (mail-account-get-pass-cmd mail-account config)
  (file-append
   (get-value 'pass-binary config)
   (string-join
    `("" ,@(mail-account-pass-args mail-account)
      ,(mail-account-fqda mail-account))
    " ")))

(define (mail-account-get-user account)
  "Return the value of user field or fqda if a value for user filed is not
@@ -435,7 +432,7 @@ Example:
                 "-" address "\n"
                 "from " address "\n"
                 "user " (mail-account-get-user acc) "\n"
                 "passwordeval " (mail-account-get-pass-cmd acc) "\n"
                 "passwordeval " (mail-account-get-pass-cmd acc config) "\n"
                 (msmtp-serializer msmtp-provider-settings acc)))
              (mail-account-get-addresses acc)))
           mail-accs)))))
@@ -970,7 +967,7 @@ control whether to NOTIFY? when new emails arrive."
                  (tls . #f)
                  (tlsOptions . ((rejectUnauthorized . #t)))
                  (username . ,(mail-account-fqda acc))
                  (passwordCmd . ,(mail-account-get-pass-cmd acc))
                  (passwordCmd . ,(mail-account-get-pass-cmd acc config))
                  (xoauth2 . #f)
                  (alias . ,(mail-account-id acc))
                  (trigger . 20)
-- 
2.45.2

[PATCH rde 4/6] rde: password-store: Add pass-binary value

Details
Message ID
<20240630183657.31636-5-ngraves@ngraves.fr>
In-Reply-To
<20240630183657.31636-1-ngraves@ngraves.fr> (view parent)
DKIM signature
missing
Download raw message
Patch: +9 -1
---
 src/rde/features/password-utils.scm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/rde/features/password-utils.scm b/src/rde/features/password-utils.scm
index 19d4d0e1..315e55b1 100644
--- a/src/rde/features/password-utils.scm
+++ b/src/rde/features/password-utils.scm
@@ -31,6 +31,8 @@
  #:use-module (gnu services)

  #:use-module (guix gexp)
  #:use-module (guix packages)
  #:use-module (ice-9 match)

  #:export (feature-password-store))

@@ -42,7 +44,11 @@
          (consult-pass-key "M-g P")
          (remote-password-store-url #f)
          (password-store-directory "$HOME/.local/var/lib/password-store")
          (default-pass-prompt? #t))
          (default-pass-prompt? #t)
          (pass-binary (match (package-name password-store)
                         ("password-store" "pass")
                         ("pass-age" "passage")
                         (name name))))
  "Setup and configure password manager."
  ;; (ensure-pred maybe-url? remote-password-store-url)
  (ensure-pred file-like? password-store)
@@ -169,6 +175,8 @@ Keybinding for `rde-consult-pass' and embark actions for it."
  (feature
   (name 'password-store)
   (values `((pass . #t)
             (pass-binary . ,(file-append password-store
                                          (string-append "/bin/" pass-binary)))
             (password-store . ,password-store)
             ,@(if default-pass-prompt?
                   `((default-pass-prompt-fn . ,emacs-pass-prompt))
-- 
2.45.2

[PATCH rde 5/6] rde: password-store: Wrap pass-binary to handle multiline files

Details
Message ID
<20240630183657.31636-6-ngraves@ngraves.fr>
In-Reply-To
<20240630183657.31636-1-ngraves@ngraves.fr> (view parent)
DKIM signature
missing
Download raw message
Patch: +17 -2
---
 src/rde/features/password-utils.scm | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/src/rde/features/password-utils.scm b/src/rde/features/password-utils.scm
index 315e55b1..16450c02 100644
--- a/src/rde/features/password-utils.scm
+++ b/src/rde/features/password-utils.scm
@@ -175,8 +175,23 @@ Keybinding for `rde-consult-pass' and embark actions for it."
  (feature
   (name 'password-store)
   (values `((pass . #t)
             (pass-binary . ,(file-append password-store
                                          (string-append "/bin/" pass-binary)))
             (pass-binary
              . ,(program-file
                  pass-binary
                  #~(begin
                      (use-modules (ice-9 textual-ports)
                                   (ice-9 popen))
                      (let* ((cmd
                              (string-join
                               (cons* #$(file-append
                                         password-store
                                         (string-append "/bin/" pass-binary))
                                      (cdr (command-line)))
                               " "))
                             (port (open-input-pipe cmd))
                             (result (get-line port)))
                        (close-pipe port)
                        (format #t "~a~%" result)))))
             (password-store . ,password-store)
             ,@(if default-pass-prompt?
                   `((default-pass-prompt-fn . ,emacs-pass-prompt))
-- 
2.45.2

[PATCH rde 6/6] rde: isync: Use char serialization to quote PassCmd

Details
Message ID
<20240630183657.31636-7-ngraves@ngraves.fr>
In-Reply-To
<20240630183657.31636-1-ngraves@ngraves.fr> (view parent)
DKIM signature
missing
Download raw message
Patch: +3 -2
---
 src/gnu/home-services/mail.scm | 3 ++-
 src/rde/features/mail.scm      | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/gnu/home-services/mail.scm b/src/gnu/home-services/mail.scm
index ae7db039..047ef31d 100644
--- a/src/gnu/home-services/mail.scm
+++ b/src/gnu/home-services/mail.scm
@@ -48,10 +48,11 @@
      ((? symbol? e) (symbol->string e))
      ((? number? e) (format #f "~a" e))
      ((? string? e) (format #f "~s" e))
      ((? char? e) (format #f "~a" e))
      (e e)))
  (define (serialize-item entry)
    (match entry
      ((? gexp? e) e)
      ((or (? file-like? e) (? gexp? e)) e)
      ((? list lst)
       #~(string-join '#$(map serialize-term lst)))))

diff --git a/src/rde/features/mail.scm b/src/rde/features/mail.scm
index 8663507c..d0a8622c 100644
--- a/src/rde/features/mail.scm
+++ b/src/rde/features/mail.scm
@@ -1061,7 +1061,7 @@ control whether to NOTIFY? when new emails arrive."
        (Host ,host)
        ,@(if (integer? port) `((Port ,port)) '())
        (User ,user)
        (PassCmd ,pass-cmd)
        (PassCmd #\" ,pass-cmd #\")
        ,@(if (symbol? auth-mechs) `((AuthMechs ,auth-mechs)) '())
        (SSLType IMAPS)
        (CertificateFile /etc/ssl/certs/ca-certificates.crt)
-- 
2.45.2

[rde/patches/.build.yml] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<D2DKLJ1XXKT8.EMCFMVK7ESB7@fra01>
In-Reply-To
<20240630183657.31636-7-ngraves@ngraves.fr> (view parent)
DKIM signature
missing
Download raw message
rde/patches/.build.yml: SUCCESS in 3m40s

[rde: mail: Update and allow use of multiline password files][0] from [Nicolas Graves][1]

[0]: https://lists.sr.ht/~abcdw/rde-devel/patches/53611
[1]: ngraves@ngraves.fr

✓ #1264506 SUCCESS rde/patches/.build.yml https://builds.sr.ht/~abcdw/job/1264506

[PATCH rde v2 0/6] Use of multiline password files

Details
Message ID
<20240910093447.25533-1-ngraves@ngraves.fr>
In-Reply-To
<20240630183657.31636-7-ngraves@ngraves.fr> (view parent)
DKIM signature
pass
Download raw message
This is a light update to the first patch series. It's rebased, and
the last command wraps the PassCmd explicitely instead of the previous
char serialization method.

Nicolas Graves (6):
  rde: mail: Split mail-account-get-pass-cmd
  rde: mail: Allow gexp mail-account-get-pass-cmd in serialization
  rde: mail: Use pass-binary from feature-password-store
  rde: password-store: Add pass-binary value
  rde: password-store: Wrap pass-binary to handle multiline files
  rde: isync: Wrap pass-cmd in quotes

 src/rde/features/mail.scm           | 45 +++++++++++++++--------------
 src/rde/features/password-utils.scm | 25 +++++++++++++++-
 2 files changed, 48 insertions(+), 22 deletions(-)

-- 
2.46.0

[PATCH rde v2 1/6] rde: mail: Split mail-account-get-pass-cmd

Details
Message ID
<20240910093447.25533-2-ngraves@ngraves.fr>
In-Reply-To
<20240910093447.25533-1-ngraves@ngraves.fr> (view parent)
DKIM signature
pass
Download raw message
Patch: +18 -12
Splits mail-account-get-pass-cmd into string
mail-account-pass-binary and list of strings mail-account-pass-args.
---
 src/rde/features/mail.scm | 30 ++++++++++++++++++------------
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/src/rde/features/mail.scm b/src/rde/features/mail.scm
index 18b3f813a..4a4245ebf 100644
--- a/src/rde/features/mail.scm
+++ b/src/rde/features/mail.scm
@@ -66,7 +66,8 @@
            mail-account-user
            mail-account-get-user
            mail-account-synchronizer
            mail-account-get-pass-cmd
            mail-account-pass-binary
            mail-account-pass-args

            mailing-list
            mailing-list-id
@@ -112,15 +113,20 @@ scenarios, during generation of @file{mbsyncrc} for example.")
   "User name.  Will default to @code{fqda}.")
  ;; TODO: Add sign? field. or maybe just annoy users, which doesn't
  ;; have a gpg key for all emails they use?
  (pass-cmd
  (pass-binary
   (maybe-string #f)
   "Command returning a password.  If value not provided @code{pass
show mail/$fqda} will be used, where @code{$fqda} is a value of fqda
field."))
   "Binary to use to get password. This field is composed with
@code{pass-args} to produce the command returning a password.")
  (pass-args
   (list-of-strings '())
   "List of strings passed to @code{pass-binary} to produce the command
returning a password."))

(define (mail-account-get-pass-cmd mail-account)
  (if (mail-account-pass-cmd mail-account)
      (mail-account-pass-cmd mail-account)
  (if (mail-account-pass-binary mail-account)
      (string-join (cons* (mail-account-pass-binary mail-account)
                          (mail-account-pass-args mail-account))
                   " ")
      (string-append "pass show mail/" (mail-account-fqda mail-account))))

(define (mail-account-get-user account)
@@ -1048,11 +1054,11 @@ control whether to NOTIFY? when new emails arrive."
          (pipeline-depth #f))
  (ensure-pred symbol? subfolders)

  (define (isync-settings mail-directory mail-account)
  (define (isync-settings mail-directory mail-account config)
    (let* ((id       (mail-account-id mail-account))
           (account  (symbol->string id))
           (user     (mail-account-get-user mail-account))
           (pass-cmd (mail-account-get-pass-cmd mail-account)))
           (pass-cmd (mail-account-get-pass-cmd mail-account config)))
      `(,#~(string-append "# Account '" #$(symbol->string id)
                          " starts here")
        (IMAPAccount ,id)
@@ -1084,11 +1090,11 @@ control whether to NOTIFY? when new emails arrive."
        (options (assoc-ref imap-settings 'extra-options)))
    (ensure-pred string? host)
    (ensure-pred list? folder-mapping)
    (define (isync-settings mail-directory mail-account)
    (define (isync-settings mail-directory mail-account config)
      (let* ((id       (mail-account-id mail-account))
             (account  (symbol->string id))
             (user     (mail-account-get-user mail-account))
             (pass-cmd (mail-account-get-pass-cmd mail-account))
             (pass-cmd (mail-account-get-pass-cmd mail-account config))
             (subfolders (or (assoc-ref options 'subfolders) 'Verbatim))
             (auth-mechs (assoc-ref options 'auth-mechs))
             (cipher-string (assoc-ref options 'cipher-string))
@@ -1170,7 +1176,7 @@ mail accounts.  ISYNC-VERBOSE controls output verboseness of
          (unless (procedure? serializer)
            (raise-exception
             (config-exception "Serializer for ~a is missing" (list provider))))
          (serializer mail-directory mail-acc)))
          (serializer mail-directory mail-acc config)))

      (list
       (simple-service
-- 
2.46.0

[PATCH rde v2 2/6] rde: mail: Allow gexp mail-account-get-pass-cmd in serialization

Details
Message ID
<20240910093447.25533-3-ngraves@ngraves.fr>
In-Reply-To
<20240910093447.25533-1-ngraves@ngraves.fr> (view parent)
DKIM signature
pass
Download raw message
Patch: +2 -2
---
 src/rde/features/mail.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/rde/features/mail.scm b/src/rde/features/mail.scm
index 4a4245ebf..5b7e56fb5 100644
--- a/src/rde/features/mail.scm
+++ b/src/rde/features/mail.scm
@@ -427,9 +427,9 @@ unlikely you ever need this)."
                  (string-length "$HOME")))
          (append-map
           (lambda (acc)
             (map
             (append-map
              (lambda (address)
                (string-append
                (list
                 "\n"
                 "account " (symbol->string (mail-account-id acc))
                 "-" address "\n"
-- 
2.46.0

[PATCH rde v2 3/6] rde: mail: Use pass-binary from feature-password-store

Details
Message ID
<20240910093447.25533-4-ngraves@ngraves.fr>
In-Reply-To
<20240910093447.25533-1-ngraves@ngraves.fr> (view parent)
DKIM signature
pass
Download raw message
Patch: +13 -16
---
 src/rde/features/mail.scm | 29 +++++++++++++----------------
 1 file changed, 13 insertions(+), 16 deletions(-)

diff --git a/src/rde/features/mail.scm b/src/rde/features/mail.scm
index 5b7e56fb5..e16d9e18d 100644
--- a/src/rde/features/mail.scm
+++ b/src/rde/features/mail.scm
@@ -66,7 +66,6 @@
            mail-account-user
            mail-account-get-user
            mail-account-synchronizer
            mail-account-pass-binary
            mail-account-pass-args

            mailing-list
@@ -113,21 +112,19 @@ scenarios, during generation of @file{mbsyncrc} for example.")
   "User name.  Will default to @code{fqda}.")
  ;; TODO: Add sign? field. or maybe just annoy users, which doesn't
  ;; have a gpg key for all emails they use?
  (pass-binary
   (maybe-string #f)
   "Binary to use to get password. This field is composed with
@code{pass-args} to produce the command returning a password.")
  (pass-args
   (list-of-strings '())
   "List of strings passed to @code{pass-binary} to produce the command
returning a password."))
   (list-of-strings
    (list "show"))
   "List of strings prefixed with @code{pass-binary} and suffixed with
@code{fqda} to produce the command returning the password."))

(define (mail-account-get-pass-cmd mail-account)
  (if (mail-account-pass-binary mail-account)
      (string-join (cons* (mail-account-pass-binary mail-account)
                          (mail-account-pass-args mail-account))
                   " ")
      (string-append "pass show mail/" (mail-account-fqda mail-account))))
(define (mail-account-get-pass-cmd mail-account config)
  (file-append
   (get-value 'pass-binary config)
   (string-join
    `("" ,@(mail-account-pass-args mail-account)
      ,(mail-account-fqda mail-account))
    " ")))

(define (mail-account-get-user account)
  "Return the value of user field or fqda if a value for user filed is not
@@ -435,7 +432,7 @@ unlikely you ever need this)."
                 "-" address "\n"
                 "from " address "\n"
                 "user " (mail-account-get-user acc) "\n"
                 "passwordeval " (mail-account-get-pass-cmd acc) "\n"
                 "passwordeval " (mail-account-get-pass-cmd acc config) "\n"
                 (msmtp-serializer msmtp-provider-settings acc)))
              (mail-account-get-addresses acc)))
           mail-accs)))))
@@ -970,7 +967,7 @@ control whether to NOTIFY? when new emails arrive."
                  (tls . #f)
                  (tlsOptions . ((rejectUnauthorized . #t)))
                  (username . ,(mail-account-fqda acc))
                  (passwordCmd . ,(mail-account-get-pass-cmd acc))
                  (passwordCmd . ,(mail-account-get-pass-cmd acc config))
                  (xoauth2 . #f)
                  (alias . ,(mail-account-id acc))
                  (trigger . 20)
-- 
2.46.0

[PATCH rde v2 4/6] rde: password-store: Add pass-binary value

Details
Message ID
<20240910093447.25533-5-ngraves@ngraves.fr>
In-Reply-To
<20240910093447.25533-1-ngraves@ngraves.fr> (view parent)
DKIM signature
pass
Download raw message
Patch: +9 -1
---
 src/rde/features/password-utils.scm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/rde/features/password-utils.scm b/src/rde/features/password-utils.scm
index 939004f9c..909e55810 100644
--- a/src/rde/features/password-utils.scm
+++ b/src/rde/features/password-utils.scm
@@ -32,6 +32,8 @@
  #:use-module (gnu services)

  #:use-module (guix gexp)
  #:use-module (guix packages)
  #:use-module (ice-9 match)

  #:export (feature-password-store))

@@ -42,7 +44,11 @@
          (consult-pass-key "M-g P")
          (remote-password-store-url #f)
          (password-store-directory "$HOME/.local/var/lib/password-store")
          (default-pass-prompt? #t))
          (default-pass-prompt? #t)
          (pass-binary (match (package-name password-store)
                         ("password-store" "pass")
                         ("pass-age" "passage")
                         (name name))))
  "Setup and configure password manager."
  ;; (ensure-pred maybe-url? remote-password-store-url)
  (ensure-pred file-like? password-store)
@@ -188,6 +194,8 @@ Keybinding for `rde-consult-pass' and embark actions for it."
  (feature
   (name 'password-store)
   (values `((pass . #t)
             (pass-binary . ,(file-append password-store
                                          (string-append "/bin/" pass-binary)))
             (password-store . ,password-store)
             ,@(if default-pass-prompt?
                   `((default-pass-prompt-fn . ,emacs-pass-prompt))
-- 
2.46.0

[PATCH rde v2 5/6] rde: password-store: Wrap pass-binary to handle multiline files

Details
Message ID
<20240910093447.25533-6-ngraves@ngraves.fr>
In-Reply-To
<20240910093447.25533-1-ngraves@ngraves.fr> (view parent)
DKIM signature
pass
Download raw message
Patch: +17 -2
---
 src/rde/features/password-utils.scm | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/src/rde/features/password-utils.scm b/src/rde/features/password-utils.scm
index 909e55810..57777ef3f 100644
--- a/src/rde/features/password-utils.scm
+++ b/src/rde/features/password-utils.scm
@@ -194,8 +194,23 @@ Keybinding for `rde-consult-pass' and embark actions for it."
  (feature
   (name 'password-store)
   (values `((pass . #t)
             (pass-binary . ,(file-append password-store
                                          (string-append "/bin/" pass-binary)))
             (pass-binary
              . ,(program-file
                  pass-binary
                  #~(begin
                      (use-modules (ice-9 textual-ports)
                                   (ice-9 popen))
                      (let* ((cmd
                              (string-join
                               (cons* #$(file-append
                                         password-store
                                         (string-append "/bin/" pass-binary))
                                      (cdr (command-line)))
                               " "))
                             (port (open-input-pipe cmd))
                             (result (get-line port)))
                        (close-pipe port)
                        (format #t "~a~%" result)))))
             (password-store . ,password-store)
             ,@(if default-pass-prompt?
                   `((default-pass-prompt-fn . ,emacs-pass-prompt))
-- 
2.46.0

[PATCH rde v2 6/6] rde: isync: Wrap pass-cmd in quotes

Details
Message ID
<20240910093447.25533-7-ngraves@ngraves.fr>
In-Reply-To
<20240910093447.25533-1-ngraves@ngraves.fr> (view parent)
DKIM signature
pass
Download raw message
Patch: +2 -2
---
 src/rde/features/mail.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/rde/features/mail.scm b/src/rde/features/mail.scm
index e16d9e18d..0a39b8848 100644
--- a/src/rde/features/mail.scm
+++ b/src/rde/features/mail.scm
@@ -1062,7 +1062,7 @@ control whether to NOTIFY? when new emails arrive."
        (Host ,host)
        ,@(if (integer? port) `((Port ,port)) '())
        (User ,user)
        (PassCmd ,pass-cmd)
        ,#~(format #f "PassCmd ~s" #$pass-cmd)
        ,@(if (symbol? auth-mechs) `((AuthMechs ,auth-mechs)) '())
        (TLSType IMAPS)
        (CertificateFile /etc/ssl/certs/ca-certificates.crt)
@@ -1104,7 +1104,7 @@ control whether to NOTIFY? when new emails arrive."
          (Host ,host)
          ,@(if (integer? port) `((Port ,port)) '())
          (User ,user)
          (PassCmd ,pass-cmd)
          ,#~(format #f "PassCmd ~s" #$pass-cmd)
          ,@(if (symbol? auth-mechs) `((AuthMechs ,auth-mechs)) '())
          (TLSType IMAPS)
          (CertificateFile /etc/ssl/certs/ca-certificates.crt)
-- 
2.46.0
Reply to thread Export thread (mbox)