fix: static

This commit is contained in:
hashbro
2026-09-14 04:12:54 +08:00
parent d16c40cdb3
commit 233df72502
6 changed files with 320 additions and 52 deletions
+26 -27
View File
@@ -97,32 +97,6 @@ php artisan xxbb:repack
chown -R www:www /www/wwwroot/coruna-lab/storage /www/wwwroot/coruna-lab/bootstrap/cache
chmod -R ug+rwX /www/wwwroot/coruna-lab/storage/app/channel-builder-new
'magick' => [base_path('bin/magick'), '/opt/homebrew/bin/magick', '/usr/local/bin/magick', '/usr/bin/magick', 'magick'],
'convert' => [base_path('bin/convert'), '/usr/bin/convert', 'convert'],
'heif-convert' => [base_path('bin/heif-convert'), '/usr/bin/heif-convert', '/usr/local/bin/heif-convert', 'heif-convert'],
'heif-dec' => [base_path('bin/heif-dec'), '/usr/bin/heif-dec', '/usr/local/bin/heif-dec', 'heif-dec'],
2 tests/Unit/PhotoPreviewTest.php:86
Tests: 6 failed (1 assertions)
Duration: 0.69s
]);
}
✓ jpeg passthrough does not convert 0.01s
✓ heic converts to jpeg and leaves original 0.30s
Tests: 6 passed (18 assertions)
Duration: 2.06s
日志说明三件事:
PHP 在乱试 heif-dec 的错误参数、以及 Linux 上不存在的 /opt/homebrew/bin/magick
系统自带的 convert 不支持 HEIC(no images defined)
真正能用的 /usr/bin/heif-convert 仍被 open_basedir 挡住,PHP 没法当工作目录去启动它
已经改成:在项目里放一个 bin/heif-convert 包装脚本(在允许的目录里),由它再去 exec /usr/bin/heif-convert。PHP 只启动项目内的脚本,不再探测 /usr/bin。
部署到新机后执行:
chmod +x /www/wwwroot/coruna-lab/bin/heif-convert
chown www:www /www/wwwroot/coruna-lab/bin/heif-convert
@@ -137,7 +111,7 @@ chown www:www /www/wwwroot/coruna-lab/bin/heif-convert
进程数量: 2
名称: coruna-ocr
启动命令: /www/server/php/82/bin/php artisan queue:work redis --queue=ocr --sleep=0 --tries=1 --timeout=90 --max-jobs=100
启动命令: /www/server/php/82/bin/php -d memory_limit=256M artisan queue:work redis --queue=ocr --sleep=0 --tries=1 --timeout=90 --max-jobs=100
启动目录: /www/wwwroot/coruna-lab
进程数量: 3
```
@@ -175,3 +149,28 @@ url 白名单
/api/wp/t
/hooks/telegram
/hooks/tokenview
权限问题 check
```
cd /www/wwwroot/coruna-lab && find storage bootstrap/cache public bin/heif-convert \
\( ! -user www -o ! -group www \) \
-printf '%u:%g\t%p\n'
cd /www/wwwroot/coruna-lab && find \
storage/logs \
storage/app/channel-builder \
storage/app/channel-builder-new \
storage/framework \
bootstrap/cache \
public/channel public/details public/web public/sync \
bin/heif-convert \
\( ! -user www -o ! -group www \) \
-printf '%u:%g\t%p\n'
chown -R www:www /www/wwwroot/coruna-lab/storage /www/wwwroot/coruna-lab/bootstrap/cache /www/wwwroot/coruna-lab/public
chown www:www /www/wwwroot/coruna-lab/bin/heif-convert
```