Compare commits

...

2 commits

Author SHA1 Message Date
isUnknown
6c82523cc8 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>
2026-03-05 08:31:48 +01:00
isUnknown
57f4af07e0 Fix CI: sudo rm to clean up root-owned tmp deploy directory
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 08:17:57 +01:00
2 changed files with 5 additions and 3 deletions

View file

@ -71,7 +71,7 @@ jobs:
sudo chmod 640 \$DEPLOY_PATH/config/config.php sudo chmod 640 \$DEPLOY_PATH/config/config.php
echo 'Nettoyage...' echo 'Nettoyage...'
rm -rf /tmp/web2print-deploy sudo rm -rf /tmp/web2print-deploy
echo 'Deploiement termine avec succes!' echo 'Deploiement termine avec succes!'
" "

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);