Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var defaults = Object.freeze({
logLevel: 'warn',
publishableApiKey: getPublishableApiKeyFromUrl(),
secretApiKey: null,
servicesUrl: 'https://spaces.archilogic.com/api/v2',
storageDomain: 'storage.3d.io',
storageDomainNoCdn: 'storage-nocdn.3d.io'
})
// constants
var LOG_STRING_TO_ENUM = {
error: log.ERROR,
warn: log.WARN,
info: log.INFO,
debug: log.DEBUG
}
// main
var configs = function configs (args) {
if (!args) {
// no arguments: return copy of configs object
return JSON.parse(JSON.stringify(this))
}
// apply log level if among arguments
if (args.logLevel) {
setLogLevel(args.logLevel)
delete args.logLevel
init = function() {
Logger = require('js-logger');
Logger.useDefaults();
Logger.setLevel(Logger.INFO);
Logger.get('broker').setLevel(Logger.INFO);
Logger.get('exchange').setLevel(Logger.INFO);
Logger.get('bus').setLevel(Logger.INFO);
Logger.get('cache').setLevel(Logger.INFO);
Logger.get('connection').setLevel(Logger.INFO);
Logger.get('register').setLevel(Logger.INFO);
Logger.get('request').setLevel(Logger.INFO);
Logger.get('transport').setLevel(Logger.INFO);
Logger.get('server').setLevel(Logger.INFO);
Logger.get('server-web').setLevel(Logger.INFO);
Logger.get('server-socket').setLevel(Logger.INFO);
godsend.Logger = Class.extend({
initialize : function(properties) {
Object.assign(this, properties);
}
});
};
initializeLogger: function() {
Logger.useDefaults();
Logger.setLevel(Logger.INFO);
this.initializeInternalLevels(Logger.INFO);
this.initializeInternalLevels(Logger.OFF);
Logger.get('exchange-secure').setLevel(Logger.OFF);
Logger.get('exchange-learning').setLevel(Logger.OFF);
},
init = function() {
Logger = require('js-logger');
Logger.useDefaults();
Logger.setLevel(Logger.INFO);
Logger.get('broker').setLevel(Logger.INFO);
Logger.get('exchange').setLevel(Logger.INFO);
Logger.get('bus').setLevel(Logger.INFO);
Logger.get('cache').setLevel(Logger.INFO);
Logger.get('connection').setLevel(Logger.INFO);
Logger.get('register').setLevel(Logger.INFO);
Logger.get('request').setLevel(Logger.INFO);
Logger.get('transport').setLevel(Logger.INFO);
Logger.get('server').setLevel(Logger.INFO);
Logger.get('server-web').setLevel(Logger.INFO);
Logger.get('server-socket').setLevel(Logger.INFO);
godsend.Logger = Class.extend({
initialize : function(properties) {
const hawtio = require('@hawtio/node-backend');
const tslint = require('gulp-tslint');
const tslintRules = require('./tslint.json');
const exec = require('child_process').exec;
const usemin = require('gulp-usemin');
const uglify = require('gulp-uglify');
const cleanCss = require('gulp-clean-css');
const rev = require('gulp-rev');
const preprocess = require("gulp-preprocess");
const plugins = gulpLoadPlugins({});
const config = {
proxyPort: argv.port || 8181,
targetPath: argv.path || '/hawtio/jolokia',
logLevel: argv.debug ? logger.DEBUG : logger.INFO,
keycloak: argv.keycloak ? 'true' : 'false',
app: 'app/',
src: 'app/src/',
srcLess: 'app/src/**/*.less',
srcTemplates: 'app/src/**/!(index|login).html',
docTemplates: '../@(CHANGES|FAQ).md',
templateModule: 'hawtio-console-assembly-templates',
temp: 'temp/',
dist: 'dist/',
distFonts: 'dist/fonts',
distImg: 'dist/img',
js: 'hawtio-console-assembly.js',
css: 'hawtio-console-assembly.css',
tsProject: plugins.typescript.createProject('tsconfig.json'),
tsLintOptions: {
rulesDirectory: './tslint-rules/'
initializeLogger: function() {
Logger.useDefaults();
Logger.setLevel(Logger.INFO);
this.initializeInternalLevels(Logger.INFO);
this.initializeInternalLevels(Logger.OFF);
Logger.get('exchange-secure').setLevel(Logger.OFF);
Logger.get('exchange-learning').setLevel(Logger.OFF);
},
initialize: function(properties) {
Logger.setLevel(Logger.INFO);
if (false) Logger.setLevel(Logger.OFF);
Object.assign(this, properties);
if (this.secure) {
this.options = {
key: fs.readFileSync('/home/ubuntu/workspace/trust/server.key.private.pem'),
cert: fs.readFileSync('/home/ubuntu/workspace/trust/server.cert.pem'),
requestCert: false
};
}
},