Esempio n. 1
0
File: main.js Progetto: moon2l/Nova
function UpdateBaseConfig(configValues)
{
  for(var i in configValues)
  {
    if(i != 'id' && i != 'type')
    {
      config.WriteSetting(i, configValues[i]);
    }
  }
}
Esempio n. 2
0
File: main.js Progetto: moon2l/Nova
app.get('/config', passport.authenticate('basic', {session: false}), function(req, res) 
{
	res.render('config.jade', {locals:{
		CLIENTS: getClients()
		, GROUPS: getGroups()
		, EVENTS: getEventList()
		, TCP_TIMEOUT: config.ReadSetting('TCP_TIMEOUT')
		, TCP_CHECK_FREQ: config.ReadSetting('TCP_CHECK_FREQ')
		, CLASSIFICATION_TIMEOUT: config.ReadSetting('CLASSIFICATION_TIMEOUT')
		, K: config.ReadSetting('K')
		, EPS: config.ReadSetting('EPS')
		, CLASSIFICATION_THRESHOLD: config.ReadSetting('CLASSIFICATION_THRESHOLD')
		, DM_ENABLED: config.ReadSetting('DM_ENABLED')
		, ENABLED_FEATURES: config.ReadSetting('ENABLED_FEATURES')
		, FEATURE_NAMES: nova.GetFeatureNames()
		, SAVE_FREQUENCY: config.ReadSetting('SAVE_FREQUENCY')
		, DATA_TTL: config.ReadSetting('DATA_TTL')
		, SERVICE_PREFERENCES: config.ReadSetting('SERVICE_PREFERENCES')
		, CAPTURE_BUFFER_SIZE: config.ReadSetting('CAPTURE_BUFFER_SIZE')
		, MIN_PACKET_THRESHOLD: config.ReadSetting('MIN_PACKET_THRESHOLD')
		, CUSTOM_PCAP_FILTER: config.ReadSetting('CUSTOM_PCAP_FILTER')
		, CUSTOM_PCAP_MODE: config.ReadSetting('CUSTOM_PCAP_MODE')
		, CLEAR_AFTER_HOSTILE_EVENT: config.ReadSetting('CLEAR_AFTER_HOSTILE_EVENT')
	}});
});
Esempio n. 3
0
File: main.js Progetto: moon2l/Nova
var novaconfig = require('novaconfig.node');

// TODO: Need to make fallback code, in case a connection
// doesn't/can't accept websocket connections (for whatever reason)
// Problem not a problem now, but definitely will be later
var express = require('express');
var nowjs = require('now');
var fs = require('fs');
var crypto = require('crypto');
var sql = require('sqlite3');
var schedule = require('node-schedule');
var nova = new novaconfig.Instance();
var config = new novaconfig.NovaConfigBinding();

var passport = require('passport');
var BasicStrategy = require('passport-http').BasicStrategy;

var NovaHomePath = config.GetPathHome();
var NovaSharedPath = config.GetPathShared();

// Setup TLS
var app;
if(config.ReadSetting("PULSAR_WEBUI_TLS_ENABLED") == "1") 
{
	var keyPath = config.ReadSetting("PULSAR_WEBUI_TLS_KEY");
	var certPath = config.ReadSetting("PULSAR_WEBUI_TLS_CERT");
	var passPhrase = config.ReadSetting("PULSAR_WEBUI_TLS_PASSPHRASE");
	express_options = {
		key: fs.readFileSync(NovaHomePath + keyPath),
		cert: fs.readFileSync(NovaHomePath + certPath),
		passphrase: passPhrase