Bitwarden : Remove.

This commit is contained in:
Dmitry Voronin 2024-10-04 14:18:55 +03:00
parent e59d82784e
commit 515a5bcde5
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
2 changed files with 0 additions and 59 deletions

View file

@ -1,58 +0,0 @@
{ ... }: {
text = ''
# Setup the pw manager.
function pwsetup() {
bw config server 'https://pass.voronind.com'
bw login
}
# Unlock the vault for current shell.
function pwunlock() {
if [ -z ''${BW_SESSION} ]; then
export BW_SESSION=$(bw unlock --raw)
fi
}
# Lock the vault for current shell.
function pwlock() {
bw lock
unset BW_SESSION
}
# List all password entries.
function pwlist() {
bw list items | jq -r '.[] | .name'
}
# Get entry data.
# Usage: pwget <NAME>
function pwget() {
local IFS=$'\n'
local entry="''${*}"
if [[ "''${entry}" = "" ]]; then
help pwget
return 2
fi
local ids=($(_pwids "''${entry}"))
for id in "''${ids[@]}"; do
local result=($(bw get item "''${id}" | jq -r '(.name), (.login | .username, .password, .uris[].uri)'))
local name="''${result[0]}"
local login="''${result[1]}"
local password="''${result[2]}"
local urls=(''${result[@]:3})
printf "\nName: %s\n" "''${name}"
printf "Login: %s\n" "''${login}"
printf "Password: %s\n" "''${password}"
printf "Url: %s\n" "''${urls[@]}"
done
}
function _pwids() {
bw list items | jq -r '.[] | select(.name | match(".*'$*'.*")) | .id'
}
'';
}

View file

@ -2,7 +2,6 @@
core = with pkgs; [
android-tools # Android adb tool. Can be used to connect to itself via wireless debugging. binwalk # Can analyze files for other files inside them.
bat # Pretty cat.
bitwarden-cli # Password manager.
bridge-utils # Network bridges.
btop htop # System monitors.
coreutils # UNIX Core utilities.