From 3ae93e619d67627814ddd52f480b501737009e2e Mon Sep 17 00:00:00 2001 From: LordRippon Date: Tue, 17 Dec 2024 20:51:34 +0000 Subject: [PATCH 1/2] Fix for PDF creation in docker container --- helpers/exporter.js | 8 +++++++- routes/api/webgrabber.js | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/helpers/exporter.js b/helpers/exporter.js index 8f923f4a..c8b3710b 100644 --- a/helpers/exporter.js +++ b/helpers/exporter.js @@ -28,7 +28,13 @@ module.exports = { browser = await puppeteer.launch( { headless: true, - args: ['--disable-dev-shm-usage', '--no-sandbox'] + args: [ + '--no-sandbox', // Disable the sandbox (useful in Docker) + '--disable-setuid-sandbox', // Additional security measure + '--disable-dev-shm-usage', // Workaround for shared memory issues in Docker + '--disable-gpu' // To ensure headless operation + ], + timeout: 60000 // Set a higher timeout (optional, increases wait time) } ); page = await browser.newPage(); diff --git a/routes/api/webgrabber.js b/routes/api/webgrabber.js index f7ff9c38..f0d6a4b2 100644 --- a/routes/api/webgrabber.js +++ b/routes/api/webgrabber.js @@ -32,7 +32,13 @@ function website_to_png(url,on_success,on_error) { browser = await puppeteer.launch( { headless: true, - args: ['--disable-dev-shm-usage', '--no-sandbox'] + args: [ + '--no-sandbox', // Disable the sandbox (useful in Docker) + '--disable-setuid-sandbox', // Additional security measure + '--disable-dev-shm-usage', // Workaround for shared memory issues in Docker + '--disable-gpu' // To ensure headless operation + ], + timeout: 60000 // Set a higher timeout (optional, increases wait time) } ); page = await browser.newPage(); From fbcd8f2bdbd6179a1f86f5e18e590aa5f2457a11 Mon Sep 17 00:00:00 2001 From: LordRippon Date: Tue, 17 Dec 2024 21:03:49 +0000 Subject: [PATCH 2/2] updated readme to reflect PDF fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0b60f062..8145cbe1 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ We appreciate filed issues, pull requests and general discussion. - Turn your Space into a zooming presentation - Collaborate in realtime with teammates, students or friends - Share Spaces on the web or via email -- Export your work as printable PDF or ZIP (currently being fixed, stay tuned) +- Export your work as printable PDF # Use Cases