fix(2fauth): 🐛 Fixed unbound variable

This commit is contained in:
Janek 2024-12-20 12:46:21 +00:00
parent b80e1ca7a4
commit a2801949e8

View File

@ -49,9 +49,9 @@ msg_info "Setup ${APPLICATION}"
RELEASE=$(curl -s https://api.github.com/repos/Bubka/2FAuth/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
wget -q "https://github.com/Bubka/2FAuth/archive/refs/tags/${RELEASE}.zip"
unzip -q "${RELEASE}.zip"
mv "${APPLICATION}-${RELEASE}/" "/opt/${NSAPP}"
mv "${APPLICATION}-${RELEASE}/" "/opt/${app}"
cd "/opt/${NSAPP}" || return
cd "/opt/${app}" || return
cp .env.example .env
IPADDRESS=$(hostname -I | awk '{print $1}')
@ -63,8 +63,8 @@ sed -i -e "s|^APP_URL=.*|APP_URL=http://$IPADDRESS|" \
-e "s|^DB_USERNAME=$|DB_USERNAME=$DB_USER|" \
-e "s|^DB_PASSWORD=$|DB_PASSWORD=$DB_PASS|" .env
chown -R www-data: "/opt/${NSAPP}"
chmod -R 755 "/opt/${NSAPP}"
chown -R www-data: "/opt/${app}"
chmod -R 755 "/opt/${app}"
export COMPOSER_ALLOW_SUPERUSER=1
$STD composer update --no-plugins --no-scripts
@ -77,15 +77,15 @@ $STD php artisan passport:install -q -n
$STD php artisan storage:link
$STD php artisan config:cache
echo "${RELEASE}" >"/opt/${NSAPP}_version.txt"
msg_ok "Setup ${NSAPP}"
echo "${RELEASE}" >"/opt/${app}_version.txt"
msg_ok "Setup ${app}"
# Configure Service (NGINX)
msg_info "Configure Service"
cat <<EOF >/etc/nginx/conf.d/2fauth.conf
server {
listen 80;
root /opt/${NSAPP}/public;
root /opt/${app}/public;
server_name $IPADDRESS;
index index.php;
charset utf-8;