Skip to content

Commit

Permalink
Added #567, PUPPETEER_DIR made configurable.
Browse files Browse the repository at this point in the history
  • Loading branch information
jszuminski committed Aug 13, 2024
1 parent e740944 commit c6f7462
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ export function get() {
*/
export async function create(puppeteerArgs) {
// Get debug and other options
const { debug, other } = getOptions();
const { puppeteer, debug, other } = getOptions();

// Get the debug options
const { enable: enabledDebug, ...debugOptions } = debug;

const launchOptions = {
headless: other.browserShellMode ? 'shell' : true,
userDataDir: './tmp/',
userDataDir: puppeteer.dir,
args: puppeteerArgs,
handleSIGINT: false,
handleSIGTERM: false,
Expand Down
3 changes: 3 additions & 0 deletions lib/envs.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ export const Config = z.object({
HIGHCHARTS_CACHE_PATH: v.string(),
HIGHCHARTS_ADMIN_TOKEN: v.string(),

// puppeteer
PUPPETEER_DIR: v.string(),

// export
EXPORT_TYPE: v.enum(['jpeg', 'png', 'pdf', 'svg']),
EXPORT_CONSTR: v.enum(['chart', 'stockChart', 'mapChart', 'ganttChart']),
Expand Down
6 changes: 6 additions & 0 deletions lib/schemas/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@ export const defaultConfig = {
],
type: 'string[]',
description: 'Arguments array to send to Puppeteer.'
},
dir: {
value: './tmp/',
type: 'string',
envLink: 'PUPPETEER_DIR',
description: 'The directory for Puppeteer to store temporary files.'
}
},
highcharts: {
Expand Down

0 comments on commit c6f7462

Please sign in to comment.