Merge pull request #264 from cubedro/develop

fixed WS_SECRET bug
pull/5/head
Marian OANCΞA 9 years ago
commit fa3e8d8912
  1. 1
      .gitignore
  2. 15
      app.js

1
.gitignore vendored

@ -10,3 +10,4 @@ config/nodes.js
*.swp
*.pem
.node-xmlhttprequest-*
ws_secret.js

@ -3,13 +3,10 @@ var logger = require('./lib/utils/logger');
var chalk = require('chalk');
var http = require('http');
// Init WS SECRET
var WS_SECRET;
if( !_.isUndefined(process.env.WS_SECRET) && !_.isNull(process.env.WS_SECRET) )
{
WS_SECRET = ["eth-net-stats-has-a-secret"];
}
else
{
if( process.env.WS_SECRET.indexOf('|') > 0 )
{
@ -20,6 +17,16 @@ else
WS_SECRET = process.env.WS_SECRET.split('');
}
}
else
{
try {
WS_SECRET = require('./ws_secret.js');
}
catch (e)
{
console.error("WS_SECRET NOT SET");
}
}
var banned = require('./lib/utils/config').banned;

Loading…
Cancel
Save