Răsfoiți Sursa

Railway image: keep the bundled ffmpeg for the installer's permission check

install/cmd.php runs BxDolStudioTools::checkPermissions() before any
header exists, so it requires plugins/ffmpeg/ffmpeg.exe to be
executable; removing it made every fresh install fail ("Folders and/or
files permissions aren't correct") and the container crash-loop.
UNA_FFMPEG_PATH still points runtime work at Debian's ffmpeg.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Andrey Yasko 2 săptămâni în urmă
părinte
comite
cce0017de0
2 a modificat fișierele cu 8 adăugiri și 3 ștergeri
  1. 5 3
      scripts/railway/Dockerfile
  2. 3 0
      scripts/railway/entrypoint.sh

+ 5 - 3
scripts/railway/Dockerfile

@@ -21,18 +21,19 @@ RUN printf '%s\n' \
         > /usr/local/etc/php/conf.d/una.ini
 
 # The bundled static plugins/ffmpeg/ffmpeg.exe segfaults on URL inputs (it resolves
-# hostnames with static glibc), which broke every video poster. Use Debian's ffmpeg.
+# hostnames with static glibc), which broke every video poster. Run Debian's ffmpeg instead.
 # Error reports by email are for ci.una.io; a preview would mail on every request.
 ENV UNA_FFMPEG_PATH=/usr/bin/ffmpeg \
     UNA_DEBUG_EMAIL_REPORT=0
 
 COPY --chown=www-data:www-data . /var/www/html
 
+# plugins/ffmpeg/ffmpeg.exe stays: the installer's permission check requires it to be
+# executable, although UNA_FFMPEG_PATH means it never runs.
 RUN mv /var/www/html/entrypoint.sh /usr/local/bin/entrypoint.sh \
     && chmod +x /usr/local/bin/entrypoint.sh \
     && mkdir -p /usr/local/lib/una-railway \
     && mv /var/www/html/configure.php /var/www/html/seed.php /usr/local/lib/una-railway/ \
-    && rm -rf /var/www/html/plugins/ffmpeg \
     && rm -f /var/www/html/Dockerfile /var/www/html/railway.toml \
     && mkdir -p /var/www/html/cache /var/www/html/cache_public /var/www/html/logs /var/www/html/tmp /var/www/html/storage \
     && chown -R www-data:www-data \
@@ -41,7 +42,8 @@ RUN mv /var/www/html/entrypoint.sh /usr/local/bin/entrypoint.sh \
         /var/www/html/cache_public \
         /var/www/html/logs \
         /var/www/html/tmp \
-        /var/www/html/storage
+        /var/www/html/storage \
+    && if [ -f /var/www/html/plugins/ffmpeg/ffmpeg.exe ]; then chmod 0755 /var/www/html/plugins/ffmpeg/ffmpeg.exe; fi
 
 WORKDIR /var/www/html
 ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

+ 3 - 0
scripts/railway/entrypoint.sh

@@ -13,6 +13,9 @@ a2enmod mpm_prefork rewrite >/dev/null 2>&1 || true
 
 mkdir -p cache cache_public logs tmp storage
 chmod a+rwX inc cache cache_public logs tmp storage
+if [ -f plugins/ffmpeg/ffmpeg.exe ]; then
+    chmod 0755 plugins/ffmpeg/ffmpeg.exe  # installer check only; UNA_FFMPEG_PATH is what runs
+fi
 
 parse_mysql_url() {
     _url="$1"