fix(user/secrets/hcv): include vssh script

Signed-off-by: Matej Focko <me@mfocko.xyz>
This commit is contained in:
Matej Focko 2023-09-06 11:42:26 +02:00
parent 6f29e49597
commit a1235a25b4
Signed by: mfocko
GPG key ID: 7C47D46246790496
3 changed files with 45 additions and 3 deletions
roles/user/shell/zsh/files

View file

@ -78,7 +78,7 @@ alias bwvps='ln -sf $HOME/.config/Bitwarden\ CLI/{vault.mfocko.xyz,data}.json'
function gen_pass() {
LENGTH=12
if [[ -n $1 ]]; then
LENGTH=$1
LENGTH=$1
fi
bw generate -uln --length $LENGTH
@ -87,19 +87,23 @@ function gen_pass() {
function gen_passphrase() {
LENGTH=2
if [[ -n $1 ]]; then
LENGTH=$1
LENGTH=$1
fi
bw generate -p --words $LENGTH
}
# HashiCorp Vault
### HashiCorp Vault ###
export VAULT_ADDR="https://hvault.mfocko.xyz"
function hcvu() {
local PASS=$(yad --text "Password for HashiCorp Vault @ mfocko.xyz:" --center --button "yad-ok" --entry --hide-text)
vault login -method=userpass -no-print username=$(whoami) password=$PASS
}
# SSH variables for HashiCorp Vault
export VSSH_ROLE=$(whoami)
export VSSH_PRINCIPALS="$(whoami),me@mfocko.xyz"
### public_html ###
function from_phrase() {
bw list items --search $2 | jq --raw-output ".[] | select(.folderId == \"$1\") | .fields[] | select(.value == \"$3\") | .name"