Skip to content

Commit 1ad52e1

Browse files
authored
ACCEPT_INSECURE_CERTS env setting and version update (#67)
1 parent 185c7b0 commit 1ad52e1

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ Here we list them all with their purpose.
311311
* `LOGSTASH_HOST = undefined` - host address of the logstash
312312
* `LOGSTASH_PORT = undefined` - port of the logstash server
313313
* `HEADLESS = true` - should the service use the "headless" mode
314+
* `ACCEPT_INSECURE_CERTS = false` - should the service allow navigation on sites with insecure certificate
314315
* `CONNECT_TIMEOUT = 180000` - Maximum time in milliseconds to wait for the browser to start
315316
* `VIEWPORT_WIDTH = 1280` - width of the browser's window
316317
* `VIEWPORT_HEIGHT = 720` - height of the browser's window

app.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ const LOG_FILE = process.env.LOG_FILE;
3737
const LOGSTASH_HOST = process.env.LOGSTASH_HOST;
3838
const LOGSTASH_PORT = process.env.LOGSTASH_PORT;
3939
const HEADLESS = (process.env.HEADLESS || "true").toLowerCase() === "true";
40+
const ACCEPT_INSECURE_CERTS = (process.env.ACCEPT_INSECURE_CERTS || "false").toLowerCase() === "true";
4041
const CONNECT_TIMEOUT = parseInt(process.env.CONNECT_TIMEOUT) || 180000;
4142
const VIEWPORT_WIDTH = parseInt(process.env.VIEWPORT_WIDTH) || 1280;
4243
const VIEWPORT_HEIGHT = parseInt(process.env.VIEWPORT_HEIGHT) || 720;
@@ -75,6 +76,7 @@ async function setupBrowser() {
7576
//TODO add more params for puppeteer launch
7677
const browser = await puppeteer.launch(
7778
{
79+
acceptInsecureCerts: ACCEPT_INSECURE_CERTS,
7880
headless: HEADLESS,
7981
defaultViewport: { width: VIEWPORT_WIDTH, height: VIEWPORT_HEIGHT },
8082
timeout: CONNECT_TIMEOUT,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "scrapy-puppeteer-service",
3-
"version": "0.3.12",
3+
"version": "0.3.13",
44
"private": true,
55
"scripts": {
66
"start": "node ./bin/www"

0 commit comments

Comments
 (0)