1
0
mirror of https://github.com/community-scripts/ProxmoxVE.git synced 2025-04-19 01:38:07 +00:00

Pterodactyl: Pump Php to 8.4 (#3655)

This commit is contained in:
CanbiZ 2025-04-04 17:40:02 +02:00 committed by GitHub
parent 481156275b
commit 51692da70f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 28 additions and 11 deletions

View File

@ -27,10 +27,27 @@ function update_script() {
msg_error "No ${APP} Installation Found!" msg_error "No ${APP} Installation Found!"
exit exit
fi fi
CURRENT_PHP=$(php -v 2>/dev/null | awk '/^PHP/{print $2}' | cut -d. -f1,2)
if [[ "$CURRENT_PHP" != "8.4" ]]; then
msg_info "Migrating PHP $CURRENT_PHP to 8.4"
$STD curl -fsSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb
$STD dpkg -i /tmp/debsuryorg-archive-keyring.deb
$STD sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
$STD apt-get update
$STD apt-get remove -y php"${CURRENT_PHP//./}"*
$STD apt-get install -y \
php8.4 \
php8.4-{gd,mysql,mbstring,bcmath,xml,curl,zip,intl,fpm} \
libapache2-mod-php8.4
msg_ok "Migrated PHP $CURRENT_PHP to 8.4"
fi
RELEASE=$(curl -fsSL https://api.github.com/repos/pterodactyl/panel/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') RELEASE=$(curl -fsSL https://api.github.com/repos/pterodactyl/panel/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
msg_info "Stopping Service" msg_info "Stopping Service"
cd /opt/pterodactyl-panel cd /opt/pterodactyl-panel || exit
$STD php artisan down $STD php artisan down
msg_ok "Stopped Service" msg_ok "Stopped Service"

View File

@ -23,19 +23,19 @@ $STD apt-get install -y \
composer composer
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
msg_info "Adding PHP8.3 Repository" msg_info "Adding PHP8.4 Repository"
$STD curl -fsSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb $STD curl -sSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb
$STD dpkg -i /tmp/debsuryorg-archive-keyring.deb $STD dpkg -i /tmp/debsuryorg-archive-keyring.deb
$STD sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list' $STD sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
$STD apt-get update $STD apt-get update
msg_ok "Added PHP8.3 Repository" msg_ok "Added PHP8.4 Repository"
msg_info "Installing PHP" msg_info "Installing PHP"
$STD apt-get remove -y php8.2* $STD apt-get remove -y php8.2*
$STD apt-get install -y \ $STD apt-get install -y \
php8.3 \ php8.4 \
php8.3-{gd,mysql,mbstring,bcmath,xml,curl,zip,intl,fpm} \ php8.4-{gd,mysql,mbstring,bcmath,xml,curl,zip,intl,fpm} \
libapache2-mod-php8.3 libapache2-mod-php8.4
msg_ok "Installed PHP" msg_ok "Installed PHP"
msg_info "Setting up MariaDB" msg_info "Setting up MariaDB"
@ -60,7 +60,7 @@ read -p "Enter your Last Name: " NAME_LAST
msg_info "Installing pterodactyl Panel" msg_info "Installing pterodactyl Panel"
RELEASE=$(curl -fsSL https://api.github.com/repos/pterodactyl/panel/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') RELEASE=$(curl -fsSL https://api.github.com/repos/pterodactyl/panel/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
mkdir /opt/pterodactyl-panel mkdir /opt/pterodactyl-panel
cd /opt/pterodactyl-panel cd /opt/pterodactyl-panel || exit
curl -fsSL "https://github.com/pterodactyl/panel/releases/download/v${RELEASE}/panel.tar.gz" -o $(basename "https://github.com/pterodactyl/panel/releases/download/v${RELEASE}/panel.tar.gz") curl -fsSL "https://github.com/pterodactyl/panel/releases/download/v${RELEASE}/panel.tar.gz" -o $(basename "https://github.com/pterodactyl/panel/releases/download/v${RELEASE}/panel.tar.gz")
tar -xzf "panel.tar.gz" tar -xzf "panel.tar.gz"
cp .env.example .env cp .env.example .env
@ -68,8 +68,8 @@ IP=$(hostname -I | awk '{print $1}')
ADMIN_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13) ADMIN_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
$STD composer install --no-dev --optimize-autoloader --no-interaction $STD composer install --no-dev --optimize-autoloader --no-interaction
$STD php artisan key:generate --force $STD php artisan key:generate --force
$STD php artisan p:environment:setup --no-interaction --author $ADMIN_EMAIL --url "http://$IP" $STD php artisan p:environment:setup --no-interaction --author "$ADMIN_EMAIL" --url "http://$IP"
$STD php artisan p:environment:database --no-interaction --database $DB_NAME --username $DB_USER --password $DB_PASS $STD php artisan p:environment:database --no-interaction --database $DB_NAME --username $DB_USER --password "$DB_PASS"
$STD php artisan migrate --seed --force --no-interaction $STD php artisan migrate --seed --force --no-interaction
$STD php artisan p:user:make --no-interaction --admin=1 --email "$ADMIN_EMAIL" --password "$ADMIN_PASS" --name-first "$NAME_FIRST" --name-last "$NAME_LAST" --username "admin" $STD php artisan p:user:make --no-interaction --admin=1 --email "$ADMIN_EMAIL" --password "$ADMIN_PASS" --name-first "$NAME_FIRST" --name-last "$NAME_LAST" --username "admin"
echo "* * * * * php /opt/pterodactyl-panel/artisan schedule:run >> /dev/null 2>&1" | crontab -u www-data - echo "* * * * * php /opt/pterodactyl-panel/artisan schedule:run >> /dev/null 2>&1" | crontab -u www-data -
@ -82,7 +82,7 @@ chmod -R 755 /opt/pterodactyl-panel/storage/* /opt/pterodactyl-panel/bootstrap/c
echo "pterodactyl Admin Password: $ADMIN_PASS" echo "pterodactyl Admin Password: $ADMIN_PASS"
} >>~/pterodactyl-panel.creds } >>~/pterodactyl-panel.creds
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt echo "${RELEASE}" >/opt/"${APPLICATION}"_version.txt
msg_ok "Installed pterodactyl Panel" msg_ok "Installed pterodactyl Panel"
msg_info "Creating Service" msg_info "Creating Service"