Compare commits

..
Author SHA1 Message Date
MickLesk 0c97c1deb6 Pelican Panel: back up public storage only when it exists
Releases ship no storage/app/public; it appears with the first uploaded
avatar, icon or logo. Without one, the update stopped at the backup.
2026-11-28 13:47:47 +01:00
MickLesk 08646a2924 Pelican Panel: leave the PHP version change to setup_php
The update removed php"${CURRENT_PHP//./}"*, which turns 8.6 into php86*: no
such package, apt exits 100 and the update stops (#19130). setup_php removes
other versions itself and keeps what the old one had.
2026-11-28 12:40:10 +01:00
2 changed files with 10 additions and 12 deletions

No files matched your search

+5 -1
View File
@@ -38,7 +38,11 @@ function update_script() {
fi
if ! php -r 'exit((extension_loaded("intl") && extension_loaded("xml")) ? 0 : 1);' 2>/dev/null; then
PHP_VERSION="8.4" PHP_APACHE="YES" PHP_MODULE="xml,intl" setup_php
msg_info "Installing missing PHP extensions"
apt_update_safe
$STD apt install -y php-xml php-intl
systemctl reload apache2
msg_ok "Installed missing PHP extensions"
fi
if check_for_gh_release "freshrss" "FreshRSS/FreshRSS"; then
+5 -11
View File
@@ -31,15 +31,10 @@ function update_script() {
fi
setup_mariadb
CURRENT_PHP=$(php -v 2>/dev/null | awk '/^PHP/{print $2}' | cut -d. -f1,2)
setup_composer
if [[ "$CURRENT_PHP" != "8.4" ]]; then
msg_info "Migrating PHP $CURRENT_PHP to 8.4"
$STD apt remove -y php"${CURRENT_PHP//./}"*
if [[ "$(php -v 2>/dev/null | awk '/^PHP/{print $2}' | cut -d. -f1,2)" != "8.4" ]]; then
PHP_VERSION="8.4" PHP_APACHE="YES" PHP_FPM="YES" setup_php
msg_ok "Migrated PHP $CURRENT_PHP to 8.4"
fi
setup_composer
if check_for_gh_release "pelican-panel" "pelican-dev/panel"; then
msg_info "Stopping Service"
@@ -47,10 +42,9 @@ function update_script() {
$STD php artisan down
msg_ok "Stopped Service"
mkdir -p /opt/backup
mkdir -p /opt/backup/storage/app
cp -a /opt/pelican-panel/.env /opt/backup
mkdir -p /opt/backup/storage/app/
cp -a /opt/pelican-panel/storage/app/public /opt/backup/storage/app/
[[ -d /opt/pelican-panel/storage/app/public ]] && cp -a /opt/pelican-panel/storage/app/public /opt/backup/storage/app/
SQLITE_INSTALL=$(ls /opt/pelican-panel/database/*.sqlite 1>/dev/null 2>&1 && echo "true" || echo "false")
$SQLITE_INSTALL && cp -r /opt/pelican-panel/database/*.sqlite /opt/backup
@@ -63,7 +57,7 @@ function update_script() {
cp -a /opt/backup/.env /opt/pelican-panel/
grep -q "^APP_URL=http://panel.test$" /opt/pelican-panel/.env && sed -i "s|^APP_URL=.*|APP_URL=http://${LOCAL_IP}|" /opt/pelican-panel/.env
$SQLITE_INSTALL && mv /opt/backup/*.sqlite /opt/pelican-panel/database/
cp -a /opt/backup/storage/app/public /opt/pelican-panel/storage/app/
[[ -d /opt/backup/storage/app/public ]] && cp -a /opt/backup/storage/app/public /opt/pelican-panel/storage/app/
$STD composer install --no-dev --optimize-autoloader --no-interaction
PANEL_URL="$(sed -n 's/^APP_URL=//p' /opt/pelican-panel/.env | tr -d "\"'")"