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!' " 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);