Fix puppeteer EACCES: set TMPDIR to project tmp dir
All checks were successful
Deploy / deploy (push) Successful in 8s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
isUnknown 2026-03-05 08:31:48 +01:00
parent 57f4af07e0
commit 6c82523cc8

View file

@ -52,7 +52,8 @@ class PdfGenerator
$pdfFile = tempnam($this->config['tmp_dir'], 'pdf_') . '.pdf'; $pdfFile = tempnam($this->config['tmp_dir'], 'pdf_') . '.pdf';
try { try {
$cmd = escapeshellcmd($this->config['pagedjs_bin']); $cmd = 'TMPDIR=' . escapeshellarg($this->config['tmp_dir']) . ' ';
$cmd .= escapeshellcmd($this->config['pagedjs_bin']);
$cmd .= ' ' . escapeshellarg($url); $cmd .= ' ' . escapeshellarg($url);
$cmd .= ' -o ' . escapeshellarg($pdfFile); $cmd .= ' -o ' . escapeshellarg($pdfFile);
@ -110,7 +111,8 @@ class PdfGenerator
private function buildCommand(string $htmlFile, string $pdfFile, array $options): string private function buildCommand(string $htmlFile, string $pdfFile, array $options): string
{ {
$cmd = escapeshellcmd($this->config['pagedjs_bin']); $cmd = 'TMPDIR=' . escapeshellarg($this->config['tmp_dir']) . ' ';
$cmd .= escapeshellcmd($this->config['pagedjs_bin']);
$cmd .= ' ' . escapeshellarg($htmlFile); $cmd .= ' ' . escapeshellarg($htmlFile);
$cmd .= ' -o ' . escapeshellarg($pdfFile); $cmd .= ' -o ' . escapeshellarg($pdfFile);