Skip to content

Commit c51bab1

Browse files
author
Dave Conway-Jones
committed
Fix healthcheck to ignore cert check
to close #164
1 parent b7d40d1 commit c51bab1

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

.docker/healthcheck.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ var https = require('https');
33
var settings = require('/data/settings.js');
44
var request;
55

6+
process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0;
7+
68
var options = {
79
host : "localhost",
810
port : settings.uiPort || 1880,
@@ -12,14 +14,14 @@ var options = {
1214
if (settings.hasOwnProperty("https")) {
1315
request = https.request(options, (res) => {
1416
//console.log(`STATUS: ${res.statusCode}`);
15-
if (res.statusCode == 200) { process.exit(0); }
17+
if ((res.statusCode >= 200) && (res.statusCode < 500)) { process.exit(0); }
1618
else { process.exit(1); }
1719
});
1820
}
1921
else {
2022
request = http.request(options, (res) => {
2123
//console.log(`STATUS: ${res.statusCode}`);
22-
if (res.statusCode == 200) { process.exit(0); }
24+
if ((res.statusCode >= 200) && (res.statusCode < 500)) { process.exit(0); }
2325
else { process.exit(1); }
2426
});
2527
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-red-docker",
3-
"version": "1.0.3-1",
3+
"version": "1.0.3",
44
"description": "Low-code programming for event-driven applications",
55
"homepage": "http://nodered.org",
66
"license": "Apache-2.0",

0 commit comments

Comments
 (0)