Skip to content

Commit

Permalink
Fix healthcheck to ignore cert check
Browse files Browse the repository at this point in the history
to close #164
  • Loading branch information
Dave Conway-Jones committed Feb 9, 2020
1 parent b7d40d1 commit c51bab1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .docker/healthcheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ var https = require('https');
var settings = require('/data/settings.js');
var request;

process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0;

var options = {
host : "localhost",
port : settings.uiPort || 1880,
Expand All @@ -12,14 +14,14 @@ var options = {
if (settings.hasOwnProperty("https")) {
request = https.request(options, (res) => {
//console.log(`STATUS: ${res.statusCode}`);
if (res.statusCode == 200) { process.exit(0); }
if ((res.statusCode >= 200) && (res.statusCode < 500)) { process.exit(0); }
else { process.exit(1); }
});
}
else {
request = http.request(options, (res) => {
//console.log(`STATUS: ${res.statusCode}`);
if (res.statusCode == 200) { process.exit(0); }
if ((res.statusCode >= 200) && (res.statusCode < 500)) { process.exit(0); }
else { process.exit(1); }
});
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-docker",
"version": "1.0.3-1",
"version": "1.0.3",
"description": "Low-code programming for event-driven applications",
"homepage": "http://nodered.org",
"license": "Apache-2.0",
Expand Down

0 comments on commit c51bab1

Please sign in to comment.