mirror of https://github.com/tteck/Proxmox.git
exit-script fix
This commit is contained in:
parent
f7ab4fda4a
commit
62586bcb41
|
@ -1,9 +1,9 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
source <(curl -s https://raw.githubusercontent.com/nicedevil007/Proxmox/main/misc/build.func)
|
source <(curl -s https://raw.githubusercontent.com/nicedevil007/Proxmox/main/misc/build.func)
|
||||||
# Copyright (c) 2021-2023 tteck
|
# Copyright (c) 2021-2023 nicedevil007
|
||||||
# Author: tteck (tteckster)
|
# Author: nicedevil007 (nicedevil007ster)
|
||||||
# License: MIT
|
# License: MIT
|
||||||
# https://github.com/tteck/Proxmox/raw/main/LICENSE
|
# https://github.com/nicedevil007/Proxmox/raw/main/LICENSE
|
||||||
|
|
||||||
function header_info {
|
function header_info {
|
||||||
clear
|
clear
|
||||||
|
@ -73,13 +73,14 @@ function update_script() {
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
2)
|
2)
|
||||||
NEWTOKEN=$(whiptail --passwordbox "Setup your ADMIN-TOKEN (make it strong)" 10 58 3>&1 1>&2 2>&3)
|
if NEWTOKEN=$(whiptail --passwordbox "Setup your ADMIN-TOKEN (make it strong)" 10 58 3>&1 1>&2 2>&3); then
|
||||||
if [[ -z "$NEWTOKEN" ]]; then exit-script; fi
|
if [[ -z "$NEWTOKEN" ]]; then exit-script; fi
|
||||||
ADMINTOKEN=$(echo -n ${NEWTOKEN} | argon2 "$(openssl rand -base64 32)" -e -id -k 19456 -t 2 -p 1)
|
ADMINTOKEN=$(echo -n ${NEWTOKEN} | argon2 "$(openssl rand -base64 32)" -e -id -k 19456 -t 2 -p 1)
|
||||||
if [[ -f /var/lib/vaultwarden/config.json ]]; then
|
if [[ -f /var/lib/vaultwarden/config.json ]]; then
|
||||||
sed -i '/admin_token/d' /var/lib/vaultwarden/config.json
|
sed -i '/admin_token/d' /var/lib/vaultwarden/config.json
|
||||||
sed -i "2i\\ \"admin_token\": \"$ADMINTOKEN\"" /var/lib/vaultwarden/config.json
|
sed -i "2i\\ \"admin_token\": \"$ADMINTOKEN\"" /var/lib/vaultwarden/config.json
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
cat <<EOF >/etc/conf.d/vaultwarden
|
cat <<EOF >/etc/conf.d/vaultwarden
|
||||||
export DATA_FOLDER=/var/lib/vaultwarden
|
export DATA_FOLDER=/var/lib/vaultwarden
|
||||||
export WEB_VAULT_FOLDER=/var/lib/vaultwarden/web-vault
|
export WEB_VAULT_FOLDER=/var/lib/vaultwarden/web-vault
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Copyright (c) 2021-2023 tteck
|
# Copyright (c) 2021-2023 nicedevil007
|
||||||
# Author: tteck (tteckster)
|
# Author: nicedevil007 (nicedevil007ster)
|
||||||
# License: MIT
|
# License: MIT
|
||||||
# https://github.com/tteck/Proxmox/raw/main/LICENSE
|
# https://github.com/nicedevil007/Proxmox/raw/main/LICENSE
|
||||||
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
|
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
|
||||||
|
|
||||||
color
|
color
|
||||||
|
@ -19,9 +19,8 @@ $STD apk add openssl
|
||||||
$STD apk add argon2
|
$STD apk add argon2
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
NEWTOKEN=$(whiptail --passwordbox "Setup your ADMIN-TOKEN (make it strong)" 10 58 3>&1 1>&2 2>&3)
|
if NEWTOKEN=$(whiptail --passwordbox "Setup your ADMIN-TOKEN (make it strong)" 10 58 3>&1 1>&2 2>&3); then
|
||||||
if [[ ! -z "$NEWTOKEN" ]]; then
|
if [[ -z "$NEWTOKEN" ]]; then exit-script; fi
|
||||||
ADMINTOKEN=$(echo -n ${NEWTOKEN} | argon2 "$(openssl rand -base64 32)" -e -id -k 19456 -t 2 -p 1)
|
|
||||||
else
|
else
|
||||||
exit-script
|
exit-script
|
||||||
fi
|
fi
|
||||||
|
@ -29,6 +28,7 @@ clear
|
||||||
|
|
||||||
msg_info "Installing Alpine-Vaultwarden"
|
msg_info "Installing Alpine-Vaultwarden"
|
||||||
$STD apk add vaultwarden
|
$STD apk add vaultwarden
|
||||||
|
ADMINTOKEN=$(echo -n ${NEWTOKEN} | argon2 "$(openssl rand -base64 32)" -e -id -k 19456 -t 2 -p 1)
|
||||||
cat <<EOF >/etc/conf.d/vaultwarden
|
cat <<EOF >/etc/conf.d/vaultwarden
|
||||||
export DATA_FOLDER=/var/lib/vaultwarden
|
export DATA_FOLDER=/var/lib/vaultwarden
|
||||||
export WEB_VAULT_FOLDER=/var/lib/vaultwarden/web-vault
|
export WEB_VAULT_FOLDER=/var/lib/vaultwarden/web-vault
|
||||||
|
@ -36,8 +36,6 @@ export WEB_VAULT_ENABLED=true
|
||||||
export ADMIN_TOKEN='$ADMINTOKEN'
|
export ADMIN_TOKEN='$ADMINTOKEN'
|
||||||
export ROCKET_ADDRESS=0.0.0.0
|
export ROCKET_ADDRESS=0.0.0.0
|
||||||
EOF
|
EOF
|
||||||
#sed -i '/admin_token/d' /var/lib/vaultwarden/config.json
|
|
||||||
#sed -i "2i\\ \"admin_token\": \"$ADMINTOKEN\"" /var/lib/vaultwarden/config.json
|
|
||||||
$STD rc-service vaultwarden start
|
$STD rc-service vaultwarden start
|
||||||
$STD rc-update add vaultwarden default
|
$STD rc-update add vaultwarden default
|
||||||
msg_ok "Installed Alpine-Vaultwarden"
|
msg_ok "Installed Alpine-Vaultwarden"
|
||||||
|
|
Loading…
Reference in New Issue