Compare commits

..

No commits in common. "ab2cd43c159e79145b699e3c0bdda48c45ff776c" and "c152e24ef8d393efb788dff14ddc35ac50fc5b3d" have entirely different histories.

2 changed files with 8 additions and 10 deletions

View File

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

View File

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