fixed WS_SECRET bug
This commit is contained in:
parent
a5ffebfd6f
commit
3237db0d1a
1
.gitignore
vendored
1
.gitignore
vendored
@ -10,3 +10,4 @@ config/nodes.js
|
||||
*.swp
|
||||
*.pem
|
||||
.node-xmlhttprequest-*
|
||||
ws_secret.js
|
15
app.js
15
app.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…
Reference in New Issue
Block a user