parent
fc2f72b2ac
commit
0f1db8cc8e
@ -40,10 +40,7 @@ function update_script() {
|
|||||||
msg_ok "Backup Created"
|
msg_ok "Backup Created"
|
||||||
|
|
||||||
if ! dpkg -l | grep -q 'php8.3'; then
|
if ! dpkg -l | grep -q 'php8.3'; then
|
||||||
$STD apt-get install -y \
|
PHP_VERSION="8.3" PHP_MODULE="common,ctype,fileinfo,mysql,cli,tokenizer,dom,redis,session,openssl" PHP_FPM="YES" setup_php
|
||||||
lsb-release \
|
|
||||||
gnupg2
|
|
||||||
PHP_VERSION="8.3" PHP_MODULE="common,ctype,fileinfo,mysql,cli" PHP_FPM="YES" setup_php
|
|
||||||
sed -i 's/php8.2/php8.3/g' /etc/nginx/conf.d/2fauth.conf
|
sed -i 's/php8.2/php8.3/g' /etc/nginx/conf.d/2fauth.conf
|
||||||
fi
|
fi
|
||||||
fetch_and_deploy_gh_release "2fauth" "Bubka/2FAuth"
|
fetch_and_deploy_gh_release "2fauth" "Bubka/2FAuth"
|
||||||
|
|||||||
@ -14,43 +14,26 @@ network_check
|
|||||||
update_os
|
update_os
|
||||||
|
|
||||||
msg_info "Installing Dependencies"
|
msg_info "Installing Dependencies"
|
||||||
$STD apt install -y \
|
$STD apt install -y nginx
|
||||||
lsb-release \
|
|
||||||
nginx
|
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
PHP_VERSION="8.3" PHP_MODULE="common,ctype,fileinfo,mysql,cli" PHP_FPM="YES" setup_php
|
PHP_VERSION="8.3" PHP_MODULE="common,ctype,fileinfo,mysql,cli,tokenizer,dom,redis,session,openssl" PHP_FPM="YES" setup_php
|
||||||
setup_composer
|
setup_composer
|
||||||
setup_mariadb
|
setup_mariadb
|
||||||
|
MARIADB_DB_NAME="2fauth_db" MARIADB_DB_USER="2fauth" setup_mariadb_db
|
||||||
msg_info "Setting up Database"
|
import_local_ip
|
||||||
DB_NAME=2fauth_db
|
|
||||||
DB_USER=2fauth
|
|
||||||
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
|
|
||||||
$STD mariadb -u root -e "CREATE DATABASE $DB_NAME;"
|
|
||||||
$STD mariadb -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED BY '$DB_PASS';"
|
|
||||||
$STD mariadb -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
|
|
||||||
{
|
|
||||||
echo "2FAuth Credentials"
|
|
||||||
echo "Database User: $DB_USER"
|
|
||||||
echo "Database Password: $DB_PASS"
|
|
||||||
echo "Database Name: $DB_NAME"
|
|
||||||
} >>~/2FAuth.creds
|
|
||||||
msg_ok "Set up Database"
|
|
||||||
|
|
||||||
fetch_and_deploy_gh_release "2fauth" "Bubka/2FAuth"
|
fetch_and_deploy_gh_release "2fauth" "Bubka/2FAuth"
|
||||||
|
|
||||||
msg_info "Setup 2FAuth"
|
msg_info "Setup 2FAuth"
|
||||||
cd /opt/2fauth || exit
|
cd /opt/2fauth
|
||||||
cp .env.example .env
|
cp .env.example .env
|
||||||
IPADDRESS=$(hostname -I | awk '{print $1}')
|
sed -i -e "s|^APP_URL=.*|APP_URL=http://$LOCAL_IP|" \
|
||||||
sed -i -e "s|^APP_URL=.*|APP_URL=http://$IPADDRESS|" \
|
|
||||||
-e "s|^DB_CONNECTION=$|DB_CONNECTION=mysql|" \
|
-e "s|^DB_CONNECTION=$|DB_CONNECTION=mysql|" \
|
||||||
-e "s|^DB_DATABASE=$|DB_DATABASE=$DB_NAME|" \
|
-e "s|^DB_DATABASE=$|DB_DATABASE=$MARIADB_DB_NAME|" \
|
||||||
-e "s|^DB_HOST=$|DB_HOST=127.0.0.1|" \
|
-e "s|^DB_HOST=$|DB_HOST=127.0.0.1|" \
|
||||||
-e "s|^DB_PORT=$|DB_PORT=3306|" \
|
-e "s|^DB_PORT=$|DB_PORT=3306|" \
|
||||||
-e "s|^DB_USERNAME=$|DB_USERNAME=$DB_USER|" \
|
-e "s|^DB_USERNAME=$|DB_USERNAME=$MARIADB_DB_USER|" \
|
||||||
-e "s|^DB_PASSWORD=$|DB_PASSWORD=$DB_PASS|" .env
|
-e "s|^DB_PASSWORD=$|DB_PASSWORD=$MARIADB_DB_PASS|" .env
|
||||||
export COMPOSER_ALLOW_SUPERUSER=1
|
export COMPOSER_ALLOW_SUPERUSER=1
|
||||||
$STD composer update --no-plugins --no-scripts
|
$STD composer update --no-plugins --no-scripts
|
||||||
$STD composer install --no-dev --prefer-dist --no-plugins --no-scripts
|
$STD composer install --no-dev --prefer-dist --no-plugins --no-scripts
|
||||||
@ -68,7 +51,7 @@ cat <<EOF >/etc/nginx/conf.d/2fauth.conf
|
|||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
root /opt/2fauth/public;
|
root /opt/2fauth/public;
|
||||||
server_name $IPADDRESS;
|
server_name $LOCAL_IP;
|
||||||
index index.php;
|
index index.php;
|
||||||
charset utf-8;
|
charset utf-8;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user