Compare commits

...

3 Commits

Author SHA1 Message Date
tteckster ab2cd43c15
Update vaultwarden.sh
tweak
2023-04-09 23:50:49 -04:00
tteckster c46675f250
Update vaultwarden-install.sh
Add Argon2
2023-04-09 23:47:27 -04:00
tteckster 1267ac0131
Update vaultwarden.sh
Use Argon2 to securely hash passwords and protect them against various types of attacks.
2023-04-09 23:45:57 -04:00
2 changed files with 10 additions and 8 deletions

View File

@ -65,7 +65,7 @@ function update_script() {
UPD=$(whiptail --title "SUPPORT" --radiolist --cancel-button Exit-Script "Spacebar = Select" 11 58 3 \
"1" "VaultWarden $VAULT" ON \
"2" "Web-Vault $WVRELEASE" OFF \
"3" "Show Admin Token" OFF \
"3" "Set Admin Token" OFF \
3>&1 1>&2 2>&3)
header_info
@ -121,11 +121,12 @@ function update_script() {
exit
fi
if [ "$UPD" == "3" ]; then
DIR=/usr/bin/vaultwarden
if [ -d "$DIR" ]; then
cat /etc/vaultwarden.env | grep "ADMIN_TOKEN"
else
cat /opt/vaultwarden/.env | grep "ADMIN_TOKEN"
if NEWTOKEN=$(whiptail --passwordbox "Set the ADMIN_TOKEN" 10 58 3>&1 1>&2 2>&3); then
if [[ -z "$NEWTOKEN" ]]; then exit; fi
if ! command -v argon2 >/dev/null 2>&1; then apt-get install -y argon2 &>/dev/null; fi
TOKEN=$(echo -n ${NEWTOKEN} | argon2 "$(openssl rand -base64 32)" -t 2 -m 16 -p 4 -l 64 -e)
sed -i "s|ADMIN_TOKEN='.*'|ADMIN_TOKEN='${TOKEN}'|" /opt/vaultwarden/.env
systemctl restart vaultwarden
fi
exit
fi

View File

@ -5,7 +5,7 @@
# License: MIT
# https://github.com/tteck/Proxmox/raw/main/LICENSE
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
@ -24,6 +24,7 @@ $STD apt-get -qqy install \
libpq-dev \
curl \
sudo \
argon2 \
mc
msg_ok "Installed Dependencies"
@ -61,7 +62,7 @@ $STD tar -xzf bw_web_$WEBVAULT.tar.gz -C /opt/vaultwarden/
msg_ok "Downloaded Web-Vault ${WEBVAULT}"
cat <<EOF >/opt/vaultwarden/.env
ADMIN_TOKEN=$(openssl rand -base64 48)
ADMIN_TOKEN=''
ROCKET_ADDRESS=0.0.0.0
DATA_FOLDER=/opt/vaultwarden/data
DATABASE_MAX_CONNS=10