Skip to content

Commit

Permalink
Merge pull request #8 from polonel/develop
Browse files Browse the repository at this point in the history
Develop Update
  • Loading branch information
polonel committed Jul 29, 2016
2 parents 84efb5d + b8068ea commit af09c6c
Show file tree
Hide file tree
Showing 97 changed files with 3,582 additions and 1,398 deletions.
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ language: node_js
env:
- CXX=g++-4.8
node_js:
- 0.10
- 4
- 5
- 6
services:
- mongodb
addons:
apt:
sources:
- mongodb-3.0-precise
- mongodb-3.2-precise
- ubuntu-toolchain-r-test
packages:
- mongodb-org-server
Expand All @@ -21,7 +20,6 @@ addons:
before_install:
- npm install -g grunt
- npm install -g grunt-cli
- gem install sass

script:
- npm test
Expand Down
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Change Log

## [Unreleased](https://github.com/polonel/trudesk/tree/HEAD)

[Full Changelog](https://github.com/polonel/trudesk/compare/0.1.6...HEAD)

**Fixed bugs:**

- Users still receive email after account disabled [\#6](https://github.com/polonel/trudesk/issues/6)
- Delete / Disable account fires twice [\#5](https://github.com/polonel/trudesk/issues/5)
- Set Assignee Permissions are incorrect [\#2](https://github.com/polonel/trudesk/issues/2)
- Crash when fails to connect to mail server [\#1](https://github.com/polonel/trudesk/issues/1)

**Merged pull requests:**

- Develop to Master [\#4](https://github.com/polonel/trudesk/pull/4) ([polonel](https://github.com/polonel))

## [0.1.6](https://github.com/polonel/trudesk/tree/0.1.6) (2016-01-25)
[Full Changelog](https://github.com/polonel/trudesk/compare/0.1.5...0.1.6)

## [0.1.5](https://github.com/polonel/trudesk/tree/0.1.5) (2015-12-28)
[Full Changelog](https://github.com/polonel/trudesk/compare/0.1.4...0.1.5)

## [0.1.4](https://github.com/polonel/trudesk/tree/0.1.4) (2015-11-07)
[Full Changelog](https://github.com/polonel/trudesk/compare/0.1.3...0.1.4)

## [0.1.3](https://github.com/polonel/trudesk/tree/0.1.3) (2015-10-28)
[Full Changelog](https://github.com/polonel/trudesk/compare/0.1.2...0.1.3)

## [0.1.2](https://github.com/polonel/trudesk/tree/0.1.2) (2015-08-24)
3 changes: 0 additions & 3 deletions Gemfile

This file was deleted.

10 changes: 0 additions & 10 deletions Gemfile.lock

This file was deleted.

13 changes: 13 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright 2014-2016 Chris Brame

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
45 changes: 22 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Trudesk](http://trudesk.io/TD_Black.png)](http://trudesk.io/)
<a href="http://trudesk.io"><img src="http://trudesk.io/TD_Black.png" width="375" /></a>

<br/><br/>

Expand All @@ -7,31 +7,29 @@

[http://trudesk.io](http://trudesk.io/)

TruDesk is an open source help desk solution stil in active development.
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 v4.2.2 or later
+ MongoDB 2.6 or later
+ Ruby 2.0.0 or later
+ __Sass__ Gem Installed
### Requirements
+ Node.JS v6.3.0 or later
+ MongoDB 3.2 or later

###Install & Run
### Install & Run
1. Clone the repo using: ```git clone http://www.github.com/polonel/trudesk```
2. Install dependencies: ```npm install```
3. Run the install script: ```./trudesk setup```
4. Start the server: ```npm start```
5. Navigate to: ```http://localhost:8118```

###Documentation
### Documentation
To build the documentation run ```grunt builddocs```.

The documentation after build is located in:
- ```{repo folder}/docs```
- ```{repo folder}/apidocs```

###Help
### Help
if you like what you see here, and want to help support the work being done, you could:

+ Contribute code, issues and pull requests
Expand All @@ -40,17 +38,18 @@ if you like what you see here, and want to help support the work being done, you



###License
Copyright 2015 Chris Brame
### License

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Copyright 2014-2016 Chris Brame

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
97 changes: 58 additions & 39 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ var async = require('async'),
path = require('path'),
fs = require('fs'),
winston = require('winston'),
wConfig = require('winston/lib/winston/config'),
nconf = require('nconf'),
NodeCache = require('node-cache'),
pkg = require('./package.json');
pkg = require('./package.json'),
ws = require('./src/webserver');


global.forks = [];

Expand Down Expand Up @@ -45,6 +45,16 @@ winston.err = function (err) {
winston.error(err.stack);
};

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

if (ws.server)
ws.server.close();
process.exit(0);
}
});

if (!process.env.FORK) {
winston.info(' . .o8 oooo');
winston.info(' .o8 "888 `888');
Expand All @@ -60,29 +70,6 @@ if (!process.env.FORK) {
winston.info('Time: ' + new Date());
}

//CLUSTER STUFF
//var cluster = require('cluster');
//if (cluster.isMaster) {
// var numWorkers = require('os').cpus().length;
// winston.info('Master cluster setting up ' + numWorkers + ' workers...');
//
// for (var i = 0; i < numWorkers; i++) {
// cluster.fork({FORK: 1});
// }
//
// cluster.on('online', function(worker) {
// winston.debug('Worker ' + worker.process.pid + ' is online');
// });
//
// cluster.on('exit', function(worker, code, signal) {
// winston.warn('Worker ' + worker.process.pid + ' crashed with code: ' + code);
// winston.info('Starting a new worker');
// cluster.fork({FORK: 1});
// });
//} else {
//
//}

var configFile = path.join(__dirname, '/config.json'),
configExists;

Expand Down Expand Up @@ -116,6 +103,15 @@ if (process.env.HEROKU) {
start();
}

if (nconf.get('install') || !configExists && !process.env.HEROKU) {
var ws = require('./src/webserver');
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) {
start();
} else if (nconf.get('setup') || nconf.get('install') || !configExists && !process.env.HEROKU) {
Expand Down Expand Up @@ -181,7 +177,6 @@ function dbCallback(err, db) {
if (err) {
return start();
}
var ws = require('./src/webserver');

ws.init(db, function(err) {
if (err) {
Expand Down Expand Up @@ -212,12 +207,46 @@ function dbCallback(err, db) {
},
function(next) {
//Start Task Runners
var taskrunner = require('./src/taskrunner');
require('./src/taskrunner');
next();
},
function(next) {
//var pm2 = require('pm2');
//pm2.connect(true, function(err) {
// if (err) throw err;
// pm2.start({
// script: path.join(__dirname, '/src/cache/index.js'),
// name: 'trudesk:cache',
// output: path.join(__dirname, '/logs/cache.log'),
// error: path.join(__dirname, '/logs/cache.log'),
// env: {
// FORK: 1,
// NODE_ENV: global.env
// }
// }, function(err) {
// pm2.disconnect();
// if (err) throw err;
//
// process.on('message', function(message) {
// if (message.data.cache) {
// var nodeCache = require('./src/cache/node-cache');
// global.cache = new nodeCache({
// data: message.data.cache.data,
// checkperiod: 0
// });
// }
// });
//
// next();
// });
//});

var fork = require('child_process').fork;
var n = fork(path.join(__dirname, '/src/cache/index.js'), { env: { FORK: 1, NODE_ENV: global.env } } );
var n;
if (process.env.MONGOHQ_URL)
n = fork(path.join(__dirname, '/src/cache/index.js'), { env: { FORK: 1, NODE_ENV: global.env, MONGOHQ_URL: process.env.MONGOHQ_URL } } );
else
n = fork(path.join(__dirname, '/src/cache/index.js'), { env: { FORK: 1, NODE_ENV: global.env } } );

global.forks.push({name: 'cache', fork: n});

Expand All @@ -231,17 +260,7 @@ function dbCallback(err, db) {
}
});

//
//n.on('exit', function (code, signal) {
// console.log('Child exited:', code, signal);
//});

next();
//winston.debug('Initializing Cache...');
//var cache = require('./src/cache');
//cache.init(function() {
// next();
//});
}
], function() {
winston.info("TruDesk Ready");
Expand Down
Loading

0 comments on commit af09c6c

Please sign in to comment.