mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-05-24 09:34:44 +00:00
fix(koillection): override FrankenPHP runtime with Symfony runtime
Koillection 1.8.0 configures FrankenPHP runtime in composer.json extra, but we use Apache. Fix by: - Adding APP_RUNTIME to .env.local for CLI commands - Adding SetEnv APP_RUNTIME in Apache VirtualHost for web requests - Creating uploads directory before chown - Update script checks and adds runtime config for upgrades
This commit is contained in:
+11
-1
@@ -44,8 +44,13 @@ function update_script() {
|
|||||||
cd /opt/koillection
|
cd /opt/koillection
|
||||||
cp -r /opt/koillection-backup/.env.local /opt/koillection
|
cp -r /opt/koillection-backup/.env.local /opt/koillection
|
||||||
cp -r /opt/koillection-backup/public/uploads/. /opt/koillection/public/uploads/
|
cp -r /opt/koillection-backup/public/uploads/. /opt/koillection/public/uploads/
|
||||||
|
|
||||||
|
# Ensure APP_RUNTIME is in .env.local for CLI commands (upgrades from older versions)
|
||||||
|
if ! grep -q "APP_RUNTIME" /opt/koillection/.env.local 2>/dev/null; then
|
||||||
|
echo 'APP_RUNTIME="Symfony\Component\Runtime\SymfonyRuntime"' >> /opt/koillection/.env.local
|
||||||
|
fi
|
||||||
|
|
||||||
export COMPOSER_ALLOW_SUPERUSER=1
|
export COMPOSER_ALLOW_SUPERUSER=1
|
||||||
export APP_RUNTIME='Symfony\Component\Runtime\SymfonyRuntime'
|
|
||||||
$STD composer install --no-dev -o --no-interaction --classmap-authoritative
|
$STD composer install --no-dev -o --no-interaction --classmap-authoritative
|
||||||
$STD php bin/console doctrine:migrations:migrate --no-interaction
|
$STD php bin/console doctrine:migrations:migrate --no-interaction
|
||||||
$STD php bin/console app:translations:dump
|
$STD php bin/console app:translations:dump
|
||||||
@@ -55,6 +60,11 @@ function update_script() {
|
|||||||
mkdir -p /opt/koillection/public/uploads
|
mkdir -p /opt/koillection/public/uploads
|
||||||
chown -R www-data:www-data /opt/koillection/public/uploads
|
chown -R www-data:www-data /opt/koillection/public/uploads
|
||||||
rm -r /opt/koillection-backup
|
rm -r /opt/koillection-backup
|
||||||
|
|
||||||
|
# Ensure APP_RUNTIME is set in Apache config (for upgrades from older versions)
|
||||||
|
if ! grep -q "APP_RUNTIME" /etc/apache2/sites-available/koillection.conf 2>/dev/null; then
|
||||||
|
sed -i '/<VirtualHost/a\ SetEnv APP_RUNTIME "Symfony\\Component\\Runtime\\SymfonyRuntime"' /etc/apache2/sites-available/koillection.conf
|
||||||
|
fi
|
||||||
msg_ok "Updated Koillection"
|
msg_ok "Updated Koillection"
|
||||||
|
|
||||||
msg_info "Starting Service"
|
msg_info "Starting Service"
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ sed -i -e "s|^APP_ENV=.*|APP_ENV=prod|" \
|
|||||||
-e "s|^DB_USER=.*|DB_USER=${PG_DB_USER}|" \
|
-e "s|^DB_USER=.*|DB_USER=${PG_DB_USER}|" \
|
||||||
-e "s|^DB_PASSWORD=.*|DB_PASSWORD=${PG_DB_PASS}|" \
|
-e "s|^DB_PASSWORD=.*|DB_PASSWORD=${PG_DB_PASS}|" \
|
||||||
/opt/koillection/.env.local
|
/opt/koillection/.env.local
|
||||||
|
echo 'APP_RUNTIME="Symfony\Component\Runtime\SymfonyRuntime"' >> /opt/koillection/.env.local
|
||||||
export COMPOSER_ALLOW_SUPERUSER=1
|
export COMPOSER_ALLOW_SUPERUSER=1
|
||||||
export APP_RUNTIME='Symfony\Component\Runtime\SymfonyRuntime'
|
|
||||||
$STD composer install --no-dev -o --no-interaction --classmap-authoritative
|
$STD composer install --no-dev -o --no-interaction --classmap-authoritative
|
||||||
$STD php bin/console doctrine:migrations:migrate --no-interaction
|
$STD php bin/console doctrine:migrations:migrate --no-interaction
|
||||||
$STD php bin/console app:translations:dump
|
$STD php bin/console app:translations:dump
|
||||||
@@ -49,6 +49,7 @@ cat <<EOF >/etc/apache2/sites-available/koillection.conf
|
|||||||
<VirtualHost *:80>
|
<VirtualHost *:80>
|
||||||
ServerName koillection
|
ServerName koillection
|
||||||
DocumentRoot /opt/koillection/public
|
DocumentRoot /opt/koillection/public
|
||||||
|
SetEnv APP_RUNTIME "Symfony\\Component\\Runtime\\SymfonyRuntime"
|
||||||
<Directory /opt/koillection/public>
|
<Directory /opt/koillection/public>
|
||||||
Options Indexes FollowSymLinks
|
Options Indexes FollowSymLinks
|
||||||
AllowOverride All
|
AllowOverride All
|
||||||
|
|||||||
Reference in New Issue
Block a user