Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
upgrade beautify and hint, drop grunt dependency
  • Loading branch information
naugtur committed Feb 24, 2017
1 parent c3025a6 commit 3ae6102
Show file tree
Hide file tree
Showing 19 changed files with 130 additions and 169 deletions.
2 changes: 1 addition & 1 deletion .jsbeautifyrc
Expand Up @@ -14,4 +14,4 @@
"eval_code": false,
"unescape_strings": false,
"wrap_line_length": 0
}
}
1 change: 0 additions & 1 deletion .jshintrc
Expand Up @@ -2,7 +2,6 @@
"globals": {
"module": true,
"define": true,
"requirejs": true,
"require": true
},
"node": true,
Expand Down
38 changes: 0 additions & 38 deletions Gruntfile.js

This file was deleted.

2 changes: 1 addition & 1 deletion conf/env.json.dist
Expand Up @@ -18,4 +18,4 @@
"port": 2600,
"domainWhitelist": ["localhost:10179", "localhost:2600"],
"sourceBlacklist": ["chrome-extension://gighmmpiobklfepjocnamgkkbiglidom"]
}
}
194 changes: 97 additions & 97 deletions conf/env.schema.json
@@ -1,107 +1,107 @@
{
"type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
"id": "cspLoggerEnv",
"required": true,
"properties": {
"store": {
"type": "string",
"id": "store",
"required": true
"type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
"id": "cspLoggerEnv",
"required": true,
"properties": {
"store": {
"type": "string",
"id": "store",
"required": true
},
"logger": {
"type": "object",
"id": "logger",
"required": false,
"properties": {
"configuration": {
"type": "string",
"id": "configuration",
"required": true
}
}
},
"sql": {
"id": "sqlDBDefinition",
"type": "object",
"required": false,
"properties": {
"dbDialect": {
"type": "string",
"id": "dbDialect",
"required": true
},
"logger": {
"type": "object",
"id": "logger",
"required": false,
"properties": {
"configuration": {
"type": "string",
"id": "configuration",
"required": true
}
}
"dbHost": {
"type": "string",
"id": "dbHost",
"required": true
},
"sql": {
"id": "sqlDBDefinition",
"type": "object",
"required": false,
"properties": {
"dbDialect": {
"type": "string",
"id": "dbDialect",
"required": true
},
"dbHost": {
"type": "string",
"id": "dbHost",
"required": true
},
"dbName": {
"type": "string",
"id": "dbName",
"required": true
},
"dbPassword": {
"type": "string",
"id": "dbPassword",
"required": true
},
"dbPort": {
"type": "number",
"minimum": 1,
"maximum": 65535,
"id": "dbPort",
"required": true
},
"dbUsername": {
"type": "string",
"id": "dbUsername",
"required": true
}
}
"dbName": {
"type": "string",
"id": "dbName",
"required": true
},
"health": {
"type": "object",
"id": "health",
"required": false,
"properties": {
"enabled": {
"type": "boolean",
"id": "enabled",
"required": false
},
"endpoint": {
"type": "string",
"id": "endpoint",
"required": false
}
}
"dbPassword": {
"type": "string",
"id": "dbPassword",
"required": true
},
"domainWhitelist": {
"type": "array",
"id": "domainWhitelist",
"required": true,
"items": {
"type": "string",
"id": "domainWhitelist/0",
"required": true
}
"dbPort": {
"type": "number",
"minimum": 1,
"maximum": 65535,
"id": "dbPort",
"required": true
},
"port": {
"type": "number",
"id": "port",
"required": false
"dbUsername": {
"type": "string",
"id": "dbUsername",
"required": true
}
}
},
"health": {
"type": "object",
"id": "health",
"required": false,
"properties": {
"enabled": {
"type": "boolean",
"id": "enabled",
"required": false
},
"sourceBlacklist": {
"type": "array",
"id": "sourceBlacklist",
"required": false,
"items": {
"type": "string",
"id": "sourceBlacklist/0",
"required": false
}
"endpoint": {
"type": "string",
"id": "endpoint",
"required": false
}

}
},
"domainWhitelist": {
"type": "array",
"id": "domainWhitelist",
"required": true,
"items": {
"type": "string",
"id": "domainWhitelist/0",
"required": true
}
},
"port": {
"type": "number",
"id": "port",
"required": false
},
"sourceBlacklist": {
"type": "array",
"id": "sourceBlacklist",
"required": false,
"items": {
"type": "string",
"id": "sourceBlacklist/0",
"required": false
}
}

}
}
24 changes: 11 additions & 13 deletions conf/logger.json.dist
@@ -1,15 +1,13 @@
{
"appenders": [
{
"category": "csp",
"type": "file",
"filename": "/tmp/csp.log",
"absolute": true,
"maxLogSize": 10485760,
"backups": 3
}
],
"levels": {
"csp": "INFO"
}
"appenders": [{
"category": "csp",
"type": "file",
"filename": "/tmp/csp.log",
"absolute": true,
"maxLogSize": 10485760,
"backups": 3
}],
"levels": {
"csp": "INFO"
}
}
2 changes: 1 addition & 1 deletion csp-logger.js
Expand Up @@ -29,4 +29,4 @@ if (argv.example) {
server.listen(config.port || 2600, function (reportObject, req) {
store.save(reportObject);
});
}
}
2 changes: 1 addition & 1 deletion lib/config.js
Expand Up @@ -34,4 +34,4 @@ module.exports = {
dropExample: function (confPath) {
fs.createReadStream(demoConf).pipe(fs.createWriteStream(confPath));
}
};
};
2 changes: 1 addition & 1 deletion lib/healthz.js
Expand Up @@ -10,4 +10,4 @@ module.exports = function (server, config, healthCheck) {
});
});
}
};
};
2 changes: 1 addition & 1 deletion lib/index.js
Expand Up @@ -49,4 +49,4 @@ module.exports = function (conf, existingServerToUse, testing) {
}
};

};
};
2 changes: 1 addition & 1 deletion lib/report.js
Expand Up @@ -71,4 +71,4 @@ Report.prototype.getLog = function () {
return logString;
};

module.exports = Report;
module.exports = Report;
2 changes: 1 addition & 1 deletion lib/server.js
Expand Up @@ -85,4 +85,4 @@ function init(config) {

module.exports = {
init: init
};
};
2 changes: 1 addition & 1 deletion lib/store.js
Expand Up @@ -23,4 +23,4 @@ module.exports = {
return store;

}
};
};
2 changes: 1 addition & 1 deletion lib/stores/console.js
Expand Up @@ -7,4 +7,4 @@ module.exports = function (config) {
console.warn(report.getLog());
}
};
};
};
2 changes: 1 addition & 1 deletion lib/stores/logger.js
Expand Up @@ -15,4 +15,4 @@ module.exports = function (config) {
logger.warn(report.getLog());
}
};
};
};
2 changes: 1 addition & 1 deletion lib/stores/nil.js
Expand Up @@ -4,4 +4,4 @@ module.exports = function (config) {
//nothing!
}
};
};
};
6 changes: 3 additions & 3 deletions lib/stores/sql.js
@@ -1,8 +1,8 @@
var sequelize = require('sequelize');
var Sequelize = require('sequelize');
var Report = require('../report');

module.exports = function (config) {
var sequelizeDB = new sequelize(config.sql.dbName, config.sql.dbUsername, config.sql.dbPassword, {
var sequelizeDB = new Sequelize(config.sql.dbName, config.sql.dbUsername, config.sql.dbPassword, {
host: config.sql.dbHost,
dialect: config.sql.dbDialect, // or 'sqlite', 'postgres', 'mariadb'
port: config.sql.dbPort
Expand All @@ -20,7 +20,7 @@ module.exports = function (config) {
});

// Define schema
var cspViolation = sequelizeDB.define('cspViolation', Report.prototype.getSQLDefinition(sequelize));
var cspViolation = sequelizeDB.define('cspViolation', Report.prototype.getSQLDefinition(Sequelize));

// Create table
sequelizeDB.sync({}).complete(function (err) {
Expand Down
2 changes: 1 addition & 1 deletion lib/test.js
Expand Up @@ -8,4 +8,4 @@ module.exports = function (server) {

});

};
};

0 comments on commit 3ae6102

Please sign in to comment.