diff --git a/config/.gitignore b/config/.gitignore index 0cffcb3..e69de29 100644 --- a/config/.gitignore +++ b/config/.gitignore @@ -1 +0,0 @@ -config.json \ No newline at end of file diff --git a/config/config.json b/config/config.json new file mode 100644 index 0000000..c1cdb90 --- /dev/null +++ b/config/config.json @@ -0,0 +1,6 @@ +{ + "http_port": 8125, + "db_port": 6379, + "crypto_key": "[choose_a_safe_cypto_key(max_256_bit)]", + "session_secret": "[choose_a_safe_session_key]" +} \ No newline at end of file diff --git a/config/users.json b/config/users.json index bcc94ac..f08699a 100644 --- a/config/users.json +++ b/config/users.json @@ -1,6 +1,6 @@ { "dominic": { - "password": "test", + "password": "[change this]", "roles": [ "admin" ] } } diff --git a/js/server.js b/js/server.js index 9ae26ab..a7f6e93 100644 --- a/js/server.js +++ b/js/server.js @@ -96,12 +96,13 @@ function init() { } /** - * + * admin commands handler receives all command arguments and an answerHandler + * object that eases response handling to the HTTP request issuer. */ function handleAdminCommands(args, answHandler) { if(args && args.cmd) { var func = adminCmds[args.cmd]; - if(func) func(args, answHandler); + if(typeof func == 'function') func(args, answHandler); } else log.print('RS', 'No command in request'); setTimeout(function(ah) { answHandler = ah; @@ -139,4 +140,7 @@ process.on('message', function(cmd) { */ procCmds.die = shutDown; +/* + * *Start initialization* + */ init(); diff --git a/mod_actions/probinder/probinder.js b/mod_actions/probinder/probinder.js index bd4f06e..68bd3da 100644 --- a/mod_actions/probinder/probinder.js +++ b/mod_actions/probinder/probinder.js @@ -1,6 +1,5 @@ 'use strict'; -var needle = require('needle'); /** * ProBinder ACTION MODULE */ diff --git a/mod_actions/testing/testing.js b/mod_actions/testing/testing.js index 223c0eb..11c37ba 100644 --- a/mod_actions/testing/testing.js +++ b/mod_actions/testing/testing.js @@ -1,6 +1,8 @@ -var fs = require('fs'), - path = require('path'); - +log.print('action testing.js'); +log.print(module); +log.print(module.exports); +console.log(exports); +console.log(module.exports); /* // Hacking my own system... console.log(module.parent.parent.children[0].exports.getEventModuleAuth('probinder', diff --git a/mod_actions/webapi/webapi.js b/mod_actions/webapi/webapi.js index 927e04c..06a584a 100644 --- a/mod_actions/webapi/webapi.js +++ b/mod_actions/webapi/webapi.js @@ -1,6 +1,4 @@ 'use strict'; - -var needle = require('needle'); /** * Call any arbitrary webAPI. diff --git a/mod_actions/wikipedia/wikipedia.js b/mod_actions/wikipedia/wikipedia.js index 868f859..4631c10 100644 --- a/mod_actions/wikipedia/wikipedia.js +++ b/mod_actions/wikipedia/wikipedia.js @@ -1,7 +1,5 @@ 'use strict'; -var needle = require('needle'); - var urlService = 'http://en.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&exintro&exchars=200&explaintext&titles=Computer%20science'; //http://www.mediawiki.org/wiki/API:Search /* diff --git a/mod_events/emailyak/emailyak.js b/mod_events/emailyak/emailyak.js index 7518e99..ed7fb01 100644 --- a/mod_events/emailyak/emailyak.js +++ b/mod_events/emailyak/emailyak.js @@ -1,7 +1,5 @@ 'use strict'; -var needle = require('request'); - /* * EmailYak EVENT MODULE */ diff --git a/mod_events/testing/testing.js b/mod_events/testing/testing.js index aaeaaf6..e5f26e4 100644 --- a/mod_events/testing/testing.js +++ b/mod_events/testing/testing.js @@ -1,5 +1,3 @@ -var fs = require('fs'), - path = require('path'); /* // Hacking my own system... diff --git a/mod_events/weather/weather.js b/mod_events/weather/weather.js index da57fcd..e6f9881 100644 --- a/mod_events/weather/weather.js +++ b/mod_events/weather/weather.js @@ -1,6 +1,4 @@ -var needle = require('needle'); - var urlService = 'http://api.openweathermap.org/data/2.5/weather', credentials, old_temp;