Implement IP range restrictions
This commit is contained in:
parent
88cba6d48a
commit
ed83e014cd
6
app.js
6
app.js
|
@ -21,6 +21,12 @@ app.use(bodyParser.urlencoded({ extended: false }));
|
|||
app.use(cookieParser());
|
||||
app.use(express.static(path.join(__dirname, 'public')));
|
||||
|
||||
if(glass_config.ip_ranges_to_allow) {
|
||||
var ip_filter = require('express-ipfilter').IpFilter;
|
||||
var ips = glass_config.ip_ranges_to_allow;
|
||||
app.use(ip_filter(ips, {mode: 'allow'}));
|
||||
}
|
||||
|
||||
/* Normal Web Routes */
|
||||
app.use('/', require('./routes/index'));
|
||||
app.use('/users', require('./routes/users'));
|
||||
|
|
|
@ -8,5 +8,6 @@
|
|||
"shared_network_warning_threshold": "80",
|
||||
"slack_webhook_url": "https://hooks.slack.com/services/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",
|
||||
"slack_alert_channel": "#alerting",
|
||||
"leases_per_minute_threshold": "1000"
|
||||
"leases_per_minute_threshold": "1000",
|
||||
"ip_ranges_to_allow": [""]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue