From 57f4af07e02a0a64470ca50ab56b0a689c33f771 Mon Sep 17 00:00:00 2001 From: isUnknown Date: Thu, 5 Mar 2026 08:17:57 +0100 Subject: [PATCH 1/2] Fix CI: sudo rm to clean up root-owned tmp deploy directory Co-Authored-By: Claude Sonnet 4.6 --- .forgejo/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml index dbc13fa..98f157d 100644 --- a/.forgejo/workflows/deploy.yml +++ b/.forgejo/workflows/deploy.yml @@ -71,7 +71,7 @@ jobs: sudo chmod 640 \$DEPLOY_PATH/config/config.php echo 'Nettoyage...' - rm -rf /tmp/web2print-deploy + sudo rm -rf /tmp/web2print-deploy echo 'Deploiement termine avec succes!' " From 6c82523cc887c5dadc1c7261c5a39549dc36b4e4 Mon Sep 17 00:00:00 2001 From: isUnknown Date: Thu, 5 Mar 2026 08:31:48 +0100 Subject: [PATCH 2/2] Fix puppeteer EACCES: set TMPDIR to project tmp dir Co-Authored-By: Claude Sonnet 4.6 --- src/Services/PdfGenerator.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Services/PdfGenerator.php b/src/Services/PdfGenerator.php index fce4d32..6e91688 100644 --- a/src/Services/PdfGenerator.php +++ b/src/Services/PdfGenerator.php @@ -52,7 +52,8 @@ class PdfGenerator $pdfFile = tempnam($this->config['tmp_dir'], 'pdf_') . '.pdf'; try { - $cmd = escapeshellcmd($this->config['pagedjs_bin']); + $cmd = 'TMPDIR=' . escapeshellarg($this->config['tmp_dir']) . ' '; + $cmd .= escapeshellcmd($this->config['pagedjs_bin']); $cmd .= ' ' . escapeshellarg($url); $cmd .= ' -o ' . escapeshellarg($pdfFile); @@ -110,7 +111,8 @@ class PdfGenerator 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 .= ' -o ' . escapeshellarg($pdfFile);