From c60f1893d36b2cc286908ad517ffc57ed98cc8b0 Mon Sep 17 00:00:00 2001 From: MickLesk Date: Tue, 31 Mar 2026 20:48:42 +0200 Subject: [PATCH] fix(koillection): ensure newline before appending to .env.local If .env.local does not end with a newline, the APP_RUNTIME entry gets concatenated with the previous line, causing Symfony to fail with an invalid trusted header error during composer install. Closes #13438 --- ct/koillection.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ct/koillection.sh b/ct/koillection.sh index bba9c6825..3ee42e9a1 100644 --- a/ct/koillection.sh +++ b/ct/koillection.sh @@ -48,7 +48,9 @@ function update_script() { # 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 + # Ensure file ends with newline before appending to avoid concatenation + [[ -s /opt/koillection/.env.local && -n "$(tail -c 1 /opt/koillection/.env.local)" ]] && echo "" >>/opt/koillection/.env.local + echo 'APP_RUNTIME="Symfony\Component\Runtime\SymfonyRuntime"' >>/opt/koillection/.env.local fi export COMPOSER_ALLOW_SUPERUSER=1