summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-08-25 19:40:40 +0300
committerThomas Voss <mail@thomasvoss.com> 2023-08-25 19:40:40 +0300
commite3d59bae4051a36f3c95523ca82b980ab8e464b4 (patch)
treef012e71d9ba89ea7f396982f6e72780c3a2e55bc
parentb9b163bbda84b58edd8e28ecdfa411adfa6888a2 (diff)
vlt: Add the ‘raw’ subcommand
-rw-r--r--.config/isync/mbsyncrc6
-rw-r--r--.config/msmtp/config6
-rwxr-xr-x.local/bin/vlt10
3 files changed, 16 insertions, 6 deletions
diff --git a/.config/isync/mbsyncrc b/.config/isync/mbsyncrc
index a5ee4d2..0d137ae 100644
--- a/.config/isync/mbsyncrc
+++ b/.config/isync/mbsyncrc
@@ -7,7 +7,7 @@ SyncState *
IMAPStore default-remote
Host imap.migadu.com
User mail@thomasvoss.com
-PassCmd "enchive extract < /home/thomas/.local/share/vault/mail/mail@thomasvoss.com"
+PassCmd "vlt raw Email mail@thomasvoss.com"
SSLType IMAPS
CertificateFile /etc/ssl/certs/ca-certificates.crt
@@ -26,7 +26,7 @@ Patterns *
IMAPStore legacy-remote
Host outlook.office365.com
User thomasvoss@live.com
-PassCmd "enchive extract < /home/thomas/.local/share/vault/mail/thomasvoss@live.com"
+PassCmd "vlt raw Email thomasvoss@live.com"
Port 993
SSLType IMAPS
CertificateFile /etc/ssl/certs/ca-certificates.crt
@@ -46,7 +46,7 @@ Patterns *
IMAPStore humanwave-remote
Host imap.gmail.com
User thomas.voss@humanwave.nl
-PassCmd "enchive extract < /home/thomas/.local/share/vault/mail/thomas.voss@humanwave.nl"
+PassCmd "vlt raw Email thomas.voss@humanwave.nl"
SSLType IMAPS
CertificateFile /etc/ssl/certs/ca-certificates.crt
diff --git a/.config/msmtp/config b/.config/msmtp/config
index acc9ad4..7d25938 100644
--- a/.config/msmtp/config
+++ b/.config/msmtp/config
@@ -9,14 +9,14 @@ host smtp.migadu.com
port 465
from mail@thomasvoss.com
user mail@thomasvoss.com
-passwordeval enchive extract < ~/.local/share/vault/mail/mail@thomasvoss.com
+passwordeval vlt raw Email mail@thomasvoss.com
account legacy
host smtp.office365.com
port 587
from thomasvoss@live.com
user thomasvoss@live.com
-passwordeval enchive extract < ~/.local/share/vault/mail/thomasvoss@live.com
+passwordeval vlt raw Email thomasvoss@live.com
tls_starttls on
account humanwave
@@ -24,5 +24,5 @@ host smtp.gmail.com
port 587
from thomas.voss@humanwave.nl
user thomas.voss@humanwave.nl
-passwordeval enchive extract < ~/.local/share/vault/mail/thomas.voss@humanwave.nl
+passwordeval vlt raw Email thomas.voss@humanwave.nl
tls_starttls on
diff --git a/.local/bin/vlt b/.local/bin/vlt
index 32aea4d..92c2fda 100755
--- a/.local/bin/vlt
+++ b/.local/bin/vlt
@@ -291,6 +291,13 @@ edit_c()
[ ! -t 2 ] && notify 'Category Edit' "The category ‘$c’ was renamed"
}
+raw()
+{
+ shift
+ enchive extract <"$VAULT" \
+ | jq --arg c "$1" --arg n "$2" -r '.[$c] | .[$n]'
+}
+
: ${VAULT_2FA:="2fa"}
: ${VAULT_HOME:=${XDG_DATA_HOME:-$HOME/.local/share}/vault}
readonly VAULT="${VAULT_HOME}/vault.sec"
@@ -308,6 +315,9 @@ edit)
get)
get
;;
+raw)
+ raw "$@"
+ ;;
rm)
rm_ "$@"
;;