Compare commits

...

3 commits

Author SHA1 Message Date
Bozhidar 32ae04766f update 2024-05-16 23:12:30 +03:00
Bozhidar a54424e03d update 2024-05-16 23:08:22 +03:00
Bozhidar a487d80cbd update 2024-05-16 23:05:51 +03:00
12 changed files with 11 additions and 103 deletions

View file

@ -28,7 +28,7 @@ jobs:
sudo chmod +x /phyre-panel/install_base.sh
sudo /phyre-panel/install_base.sh
sudo cp installers/${{ matrix.os }}/install-partial/install_web.sh /phyre-panel/install_web.sh
sudo cp installers/ubuntu-20.04/install-partial/install_web.sh /phyre-panel/install_web.sh
sudo chmod +x /phyre-panel/install_web.sh
- name: Run Unit Test

View file

@ -1,6 +1,6 @@
#!/bin/bash
CURRENT_IP=$(curl -s ipinfo.io/ip)
CURRENT_IP=$(hostname -I | awk '{print $1}')
echo " \
____ _ ___ ______ _____ ____ _ _ _ _____ _

View file

@ -64,7 +64,7 @@ phyre-php artisan phyre:set-ini-settings APP_ENV "production"
chmod -R o+w /usr/local/phyre/web/storage/
chmod -R o+w /usr/local/phyre/web/bootstrap/cache/
CURRENT_IP=$(curl -s ipinfo.io/ip)
CURRENT_IP=$(hostname -I | awk '{print $1}')
echo "PhyrePanel downloaded successfully."
echo "Please visit http://$CURRENT_IP:8443 to continue installation of the panel."

View file

@ -18,9 +18,9 @@ echo "$INSTALL_WEB" >> ubuntu-20.04/install.sh
# get content from file
INSTALL_BASE=$(cat ubuntu-22.04/install-partial/install_base.sh)
INSTALL_LOG=$(cat ubuntu-22.04/install-partial/install_log.sh)
DOWNLOAD_WEB=$(cat ubuntu-22.04/install-partial/download_web.sh)
INSTALL_WEB=$(cat ubuntu-22.04/install-partial/install_web.sh)
INSTALL_LOG=$(cat ubuntu-20.04/install-partial/install_log.sh)
DOWNLOAD_WEB=$(cat ubuntu-20.04/install-partial/download_web.sh)
INSTALL_WEB=$(cat ubuntu-20.04/install-partial/install_web.sh)
# create installer
rm -rf ubuntu-22.04/install.sh

View file

@ -1,6 +1,6 @@
#!/bin/bash
CURRENT_IP=$(curl -s ipinfo.io/ip)
CURRENT_IP=$(hostname -I | awk '{print $1}')
echo " \
____ _ ___ ______ _____ ____ _ _ _ _____ _

View file

@ -64,7 +64,7 @@ phyre-php artisan phyre:set-ini-settings APP_ENV "production"
chmod -R o+w /usr/local/phyre/web/storage/
chmod -R o+w /usr/local/phyre/web/bootstrap/cache/
CURRENT_IP=$(curl -s ipinfo.io/ip)
CURRENT_IP=$(hostname -I | awk '{print $1}')
echo "PhyrePanel downloaded successfully."
echo "Please visit http://$CURRENT_IP:8443 to continue installation of the panel."

View file

@ -145,7 +145,7 @@ phyre-php artisan phyre:set-ini-settings APP_ENV "production"
chmod -R o+w /usr/local/phyre/web/storage/
chmod -R o+w /usr/local/phyre/web/bootstrap/cache/
CURRENT_IP=$(curl -s ipinfo.io/ip)
CURRENT_IP=$(hostname -I | awk '{print $1}')
echo "PhyrePanel downloaded successfully."
echo "Please visit http://$CURRENT_IP:8443 to continue installation of the panel."

View file

@ -1,6 +1,6 @@
#!/bin/bash
CURRENT_IP=$(curl -s ipinfo.io/ip)
CURRENT_IP=$(hostname -I | awk '{print $1}')
echo " \
____ _ ___ ______ _____ ____ _ _ _ _____ _

View file

@ -1,8 +0,0 @@
#!/bin/bash
wget https://github.com/PhyreApps/PhyrePanelWebCompiledVersions/raw/main/phyre-web-panel.zip
unzip -qq -o phyre-web-panel.zip -d /usr/local/phyre/web
rm -rf phyre-web-panel.zip
chmod 711 /home
chmod -R 750 /usr/local/phyre

View file

@ -1,14 +0,0 @@
#!/bin/bash
HOSTNAME=$(hostname)
IP_ADDRESS=$(hostname -I | cut -d " " -f 1)
DISTRO_VERSION=$(cat /etc/os-release | grep -w "VERSION_ID" | cut -d "=" -f 2)
DISTRO_VERSION=${DISTRO_VERSION//\"/} # Remove quotes from version string
DISTRO_NAME=$(cat /etc/os-release | grep -w "NAME" | cut -d "=" -f 2)
DISTRO_NAME=${DISTRO_NAME//\"/} # Remove quotes from name string
LOG_JSON='{"os": "'$DISTRO_NAME-$DISTRO_VERSION'", "host_name": "'$HOSTNAME'", "ip": "'$IP_ADDRESS'"}'
curl -s https://phyrepanel.com/api/phyre-installation-log -X POST -H "Content-Type: application/json" -d "$LOG_JSON"

View file

@ -1,70 +0,0 @@
#!/bin/bash
# Check dir exists
if [ ! -d "/usr/local/phyre/web" ]; then
echo "PhyrePanel directory not found."
return 1
fi
# Go to web directory
cd /usr/local/phyre/web
# Create MySQL user
MYSQL_PHYRE_ROOT_USERNAME="phyre"
MYSQL_PHYRE_ROOT_PASSWORD="$(tr -dc a-za-z0-9 </dev/urandom | head -c 32; echo)"
mysql -uroot -proot <<MYSQL_SCRIPT
CREATE USER '$MYSQL_PHYRE_ROOT_USERNAME'@'%' IDENTIFIED BY '$MYSQL_PHYRE_ROOT_PASSWORD';
GRANT ALL PRIVILEGES ON *.* TO '$MYSQL_PHYRE_ROOT_USERNAME'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
MYSQL_SCRIPT
# Create database
PHYRE_PANEL_DB_PASSWORD="$(tr -dc a-za-z0-9 </dev/urandom | head -c 32; echo)"
PHYRE_PANEL_DB_NAME="phyre$(tr -dc a-za-z0-9 </dev/urandom | head -c 13; echo)"
PHYRE_PANEL_DB_USER="phyre$(tr -dc a-za-z0-9 </dev/urandom | head -c 13; echo)"
mysql -uroot -proot <<MYSQL_SCRIPT
CREATE DATABASE $PHYRE_PANEL_DB_NAME;
CREATE USER '$PHYRE_PANEL_DB_USER'@'localhost' IDENTIFIED BY '$PHYRE_PANEL_DB_PASSWORD';
GRANT ALL PRIVILEGES ON $PHYRE_PANEL_DB_NAME.* TO '$PHYRE_PANEL_DB_USER'@'localhost';
FLUSH PRIVILEGES;
MYSQL_SCRIPT
mysql_secure_installation --use-default
# Change mysql root password
MYSQL_ROOT_PASSWORD="$(tr -dc a-za-z0-9 </dev/urandom | head -c 32; echo)"
mysql -uroot -proot <<MYSQL_SCRIPT
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by '$MYSQL_ROOT_PASSWORD';
FLUSH PRIVILEGES;
MYSQL_SCRIPT
# Save mysql root password
echo "$MYSQL_ROOT_PASSWORD" > /root/.mysql_root_password
# Configure the application
phyre-php artisan phyre:set-ini-settings APP_ENV "local"
phyre-php artisan phyre:set-ini-settings APP_URL "127.0.0.1:8443"
phyre-php artisan phyre:set-ini-settings APP_NAME "PHYRE_PANEL"
phyre-php artisan phyre:set-ini-settings DB_DATABASE "$PHYRE_PANEL_DB_NAME"
phyre-php artisan phyre:set-ini-settings DB_USERNAME "$PHYRE_PANEL_DB_USER"
phyre-php artisan phyre:set-ini-settings DB_PASSWORD "$PHYRE_PANEL_DB_PASSWORD"
phyre-php artisan phyre:set-ini-settings DB_CONNECTION "mysql"
phyre-php artisan phyre:set-ini-settings MYSQL_ROOT_USERNAME "$MYSQL_PHYRE_ROOT_USERNAME"
phyre-php artisan phyre:set-ini-settings MYSQL_ROOT_PASSWORD "$MYSQL_PHYRE_ROOT_PASSWORD"
phyre-php artisan phyre:key-generate
phyre-php artisan migrate
phyre-php artisan db:seed
phyre-php artisan phyre:set-ini-settings APP_ENV "production"
chmod -R o+w /usr/local/phyre/web/storage/
chmod -R o+w /usr/local/phyre/web/bootstrap/cache/
CURRENT_IP=$(curl -s ipinfo.io/ip)
echo "PhyrePanel downloaded successfully."
echo "Please visit http://$CURRENT_IP:8443 to continue installation of the panel."

View file

@ -147,7 +147,7 @@ phyre-php artisan phyre:set-ini-settings APP_ENV "production"
chmod -R o+w /usr/local/phyre/web/storage/
chmod -R o+w /usr/local/phyre/web/bootstrap/cache/
CURRENT_IP=$(curl -s ipinfo.io/ip)
CURRENT_IP=$(hostname -I | awk '{print $1}')
echo "PhyrePanel downloaded successfully."
echo "Please visit http://$CURRENT_IP:8443 to continue installation of the panel."