Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
polonel committed Sep 27, 2018
2 parents 4eaaf8f + 6eeb2ac commit dcfdbcb
Show file tree
Hide file tree
Showing 215 changed files with 37,139 additions and 7,152 deletions.
9 changes: 7 additions & 2 deletions .codacy.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
exclude_paths:
- apidocs/**
- mobile/**
- logs/**
- apidoc_template/**
- docs/**
- src/public/css/**
- src/public/css/**/*
- src/public/js/plugins/**
- src/public/js/plugins/**/*
- src/public/js/vendor/**
- test/**
- src/public/js/vendor/**/*
- test/**/*
- src/cache/node-cache.js
17 changes: 15 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,25 @@
"plugins": ["node"],
"extends": ["eslint:recommended", "plugin:node/recommended"],
"root": true,
"parserOptions": {
"ecmaVersion": 5
},
"env": {
"browser": true,
"node": true
},
"rules": {
"node/exports-style": ["error", "module.exports"],
"no-console": "off"
"no-console": "off",
// "new-cap": "error",
"quotes": ["error", "single"],
"curly": ["error", "multi-or-nest"],
"complexity": ["error", 20],
"wrap-iife": ["error", "outside"],
"semi": ["error", "always"],
"no-extra-semi": "error",
"no-func-assign": "error",
"no-redeclare": "error"
},
"globals": {
"angular": 1,
Expand All @@ -17,6 +29,7 @@
"MG": 1,
"Snackbar": 1,
"ROLES": 1,
"io": 1
"io": 1,
"d3": 1
}
}
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,7 @@ private/
config.local.json
public/css/app.min.css
public/css/app.css
config.json.aws
config.json.local
*.aws
*.local
sonar-project.properties
.scannerwork/
5 changes: 5 additions & 0 deletions .istanbul.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
instrumentation:
root: .
extensions:
- .js
excludes: ['**/src/controllers/*.js']
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
sudo: false
language: node_js
node_js:
- 7
- node
services:
- mongodb
Expand All @@ -17,5 +16,4 @@ script:
- npm test

after_success:
# - ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --recursive && ./node_modules/.bin/istanbul-coveralls
- npm run codacy
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Trudesk is an open source help desk solution still in active development.
Built on [Node.JS](http://nodejs.org) and [MongoDB](http://www.mongodb.org).

### Requirements
+ Node.JS v6.0 or later
+ MongoDB 3.2 or later (MMAPv1)
+ Node.JS v9.10.0 or later
+ MongoDB 3.6 or later

### Install & Run
1. Clone the repo using: ```git clone http://www.github.com/polonel/trudesk```
Expand Down
6 changes: 0 additions & 6 deletions apidoc.json

This file was deleted.

58 changes: 29 additions & 29 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env node
/*
. .o8 oooo
.o8 "888 `888
Expand All @@ -9,8 +10,7 @@
========================================================================
**/

var _ = require('lodash'),
async = require('async'),
var async = require('async'),
path = require('path'),
fs = require('fs'),
winston = require('winston'),
Expand Down Expand Up @@ -49,7 +49,7 @@ winston.err = function (err) {

process.on('message', function(msg) {
if (msg === 'shutdown') {
console.log('Closing all connections...');
winston.debug('Closing all connections...');

if (ws.server)
ws.server.close();
Expand All @@ -67,7 +67,7 @@ if (!process.env.FORK) {
winston.info(' 888 . 888 888 888 888 888 888 .o o. )88b 888 `88b.');
winston.info(' "888" d888b `V88V"V8P\' `Y8bod88P" `Y8bod8P\' 8""888P\' o888o o888o');
winston.info('==========================================================================');
winston.info('TruDesk v' + pkg.version + ' Copyright (C) 2014-2018 Chris Brame');
winston.info('trudesk v' + pkg.version + ' Copyright (C) 2014-2018 Chris Brame');
winston.info('');
winston.info('Running in: ' + global.env);
winston.info('Time: ' + new Date());
Expand All @@ -76,16 +76,16 @@ if (!process.env.FORK) {
var configFile = path.join(__dirname, '/config.json'),
configExists;

if (nconf.get('config')) {
if (nconf.get('config'))
configFile = path.resolve(__dirname, nconf.get('config'));
}

configExists = fs.existsSync(configFile);

if (process.env.HEROKU) {
//Build Config for Heroku
var configHeroku = {
"url": "http://localhost:8118",
"port": "8118"
'url': 'http://localhost:8118',
'port': '8118'
};

winston.info('Creating heroku config file...');
Expand All @@ -103,13 +103,11 @@ if (nconf.get('install') || !configExists && !process.env.HEROKU) {
ws.installServer(function() {
return winston.info('Trudesk Install Server Running...');
});

return;
}

if (!nconf.get('setup') && !nconf.get('install') && !nconf.get('upgrade') && !nconf.get('reset') && configExists) {
if (!nconf.get('setup') && !nconf.get('install') && !nconf.get('upgrade') && !nconf.get('reset') && configExists)
start();
}


function loadConfig() {
nconf.file({
Expand All @@ -134,16 +132,16 @@ function start() {
_db.init(dbCallback);
}, 10000);

} else {
} else
dbCallback(err, db);
}

});
}

function dbCallback(err, db) {
if (err) {
if (err)
return start();
}


ws.init(db, function(err) {
if (err) {
Expand All @@ -159,18 +157,20 @@ function dbCallback(err, db) {
function(next) {
//Start Check Mail
var settingSchema = require('./src/models/setting');
settingSchema.getSettings(function(err, settings) {
if (err) {
winston.warn(err);
return next();
}

var mailerCheckEnabled = _.find(settings, function(x) { return x.name === 'mailer:check:enable' });
mailerCheckEnabled = (mailerCheckEnabled === undefined) ? {value: false} : mailerCheckEnabled;
if (mailerCheckEnabled.value) {
var mailCheck = require('./src/mailer/mailCheck');
winston.debug('Starting MailCheck...');
mailCheck.init(settings);
settingSchema.getSetting('mailer:check:enable', function(err, mailCheckEnabled) {
if (err) {
winston.warn(err);
return next();
}

if (mailCheckEnabled && mailCheckEnabled.value) {
settingSchema.getSettings(function(err, settings) {
if (err) return next();

var mailCheck = require('./src/mailer/mailCheck');
winston.debug('Starting MailCheck...');
mailCheck.init(settings);
});
}

return next();
Expand Down Expand Up @@ -237,7 +237,7 @@ function dbCallback(err, db) {
return next();
}
], function() {
winston.info("TruDesk Ready");
winston.info('trudesk Ready');
});
});
}
8 changes: 5 additions & 3 deletions gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,15 @@ module.exports = function(grunt) {
'src/public/js/vendor/uikit/css/uikit_custom.css',
'src/public/js/plugins/snackbar.css',
'src/public/js/vendor/c3/c3.css',
'src/public/js/vendor/multiselect/css/multi-select.css',
'src/public/js/vendor/formvalidator/theme-default.css',
'src/public/js/vendor/shepherd/css/shepherd-theme-default.css',
'src/public/js/vendor/shepherd/css/shepherd-theme-dark.css',
'src/public/js/vendor/shepherd/css/shepherd-theme-arrows.css',
'src/public/js/vendor/shepherd/css/shepherd-theme-arrows-fix.css',
'src/public/js/vendor/shepherd/css/shepherd-theme-square.css',
'src/public/js/vendor/shepherd/css/shepherd-theme-square-dark.css'
'src/public/js/vendor/shepherd/css/shepherd-theme-square-dark.css',
'src/public/js/vendor/easymde/dist/easymde.min.css'
]
}
},
Expand Down Expand Up @@ -130,9 +132,9 @@ module.exports = function(grunt) {
}
});

grunt.registerTask('buildcss', ['cssmin']);
grunt.registerTask('buildcss', ['uglify:uikit', 'cssmin']);
grunt.registerTask('server', 'launch webserver and watch tasks', ['parallel:web']);
grunt.registerTask('build', ['uglify:uikit', 'shell:webpackDist', 'buildcss']);
grunt.registerTask('build', ['buildcss', 'shell:webpackDist']);
grunt.registerTask('devbuild', ['shell:webpackDev']);
grunt.registerTask('default', ['server']);
};
Loading

0 comments on commit dcfdbcb

Please sign in to comment.