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 \
"1" "VaultWarden $VAULT" ON \
"2" "Web-Vault $WVRELEASE" OFF \
"3" "Set Admin Token" OFF \
"3" "Show Admin Token" OFF \
3>&1 1>&2 2>&3)
header_info
@ -121,12 +121,11 @@ function update_script() {
exit
fi
if [ "$UPD" == "3" ]; then
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
DIR=/usr/bin/vaultwarden
if [ -d "$DIR" ]; then
cat /etc/vaultwarden.env | grep "ADMIN_TOKEN"
else
cat /opt/vaultwarden/.env | grep "ADMIN_TOKEN"
fi
exit
fi

View File

@ -24,7 +24,6 @@ $STD apt-get -qqy install \
libpq-dev \
curl \
sudo \
argon2 \
mc
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}"
cat <<EOF >/opt/vaultwarden/.env
ADMIN_TOKEN=''
ADMIN_TOKEN=$(openssl rand -base64 48)
ROCKET_ADDRESS=0.0.0.0
DATA_FOLDER=/opt/vaultwarden/data
DATABASE_MAX_CONNS=10