Built motion from commit da24aabd.|2.6.20
[motion2.git] / server / app.js
index 220b7bc..30e5491 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7382=['./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sync','then','listen','info','start','Online\x20apps:','map','filter','online','name','join','Offline\x20apps:','seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./config/pm2/config'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x7382,0x111));var _0x2738=function(_0x213992,_0x5dfbdf){_0x213992=_0x213992-0x0;var _0x215c1b=_0x7382[_0x213992];return _0x215c1b;};'use strict';var _=require('lodash');var mysqldb=require(_0x2738('0x0'));var rpc=require('./rpc');var config=require('./config/environment');var logger=require('./config/logger')('app');var pm2=require('./config/pm2');var pm2Config=require(_0x2738('0x1'));var schedule=require(_0x2738('0x2'));var chat=require(_0x2738('0x3'));var whatsapp=require(_0x2738('0x4'));var transcribe=require(_0x2738('0x5'));function main(){return mysqldb['db']['sequelize'][_0x2738('0x6')]()[_0x2738('0x7')](function(){return rpc[_0x2738('0x8')]();})['then'](function(_0x4235e7){logger[_0x2738('0x9')](_0x4235e7);return chat[_0x2738('0xa')]();})['then'](function(){return whatsapp[_0x2738('0xa')]();})[_0x2738('0x7')](function(){return schedule[_0x2738('0xa')]();})['then'](function(){return transcribe[_0x2738('0xa')]();})[_0x2738('0x7')](function(_0x2eb3ab){logger['info'](_0x2eb3ab);return pm2['start'](pm2Config);})[_0x2738('0x7')](function(_0x20615b){logger[_0x2738('0x9')](_0x2738('0xb'),_[_0x2738('0xc')](_[_0x2738('0xd')](_0x20615b,{'status':_0x2738('0xe')}),_0x2738('0xf'))[_0x2738('0x10')]());logger[_0x2738('0x9')](_0x2738('0x11'),_['map'](_[_0x2738('0xd')](_0x20615b,function(_0x2c6cfa){return _0x2c6cfa['status']!==_0x2738('0xe');}),'name')[_0x2738('0x10')]()||'None');config[_0x2738('0x12')]&&require('./config/seedDB')[_0x2738('0x13')]();require(_0x2738('0x14'))[_0x2738('0x13')]();})[_0x2738('0x15')](function(_0x1d0aca){logger[_0x2738('0x16')](_0x2738('0x17'),_0x1d0aca);process[_0x2738('0x18')](0x1);});}main();
\ No newline at end of file
+var _0xbea5=['./config/license','./rpc','./config/environment','./config/logger','app','./config/schedule','./config/schedule/whatsapp','sequelize','seedDB','default','then','info','start','filter','exitCode','length','map','pm2_env','Online\x20apps:','name','join','status','None','log','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb'];(function(_0x8ecc41,_0x449804){var _0x579f8c=function(_0x4cc77d){while(--_0x4cc77d){_0x8ecc41['push'](_0x8ecc41['shift']());}};_0x579f8c(++_0x449804);}(_0xbea5,0x177));var _0x5bea=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xbea5[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x5bea('0x0'));var db=require(_0x5bea('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0x5bea('0x2'));var rpc=require(_0x5bea('0x3'));var config=require(_0x5bea('0x4'));var logger=require(_0x5bea('0x5'))(_0x5bea('0x6'));var pm2=require('./config/pm2');var pm2Config=require('./config/pm2/config');var schedule=require(_0x5bea('0x7'));var chat=require('./config/schedule/chat');var whatsapp=require(_0x5bea('0x8'));var transcribe=require('./config/schedule/transcribe');var provider=require('./config/schedule/cloud-provider');function main(){return db[_0x5bea('0x9')]['sync']()['then'](function(){if(config[_0x5bea('0xa')]){return seedDb[_0x5bea('0xb')]();}})[_0x5bea('0xc')](function(){return checkLicense['default']();})[_0x5bea('0xc')](function(){return rpc['listen']();})['then'](function(_0x2af7af){logger[_0x5bea('0xd')](_0x2af7af);return chat[_0x5bea('0xe')]();})[_0x5bea('0xc')](function(){return whatsapp[_0x5bea('0xe')]();})[_0x5bea('0xc')](function(){return schedule['start']();})[_0x5bea('0xc')](function(){return transcribe[_0x5bea('0xe')]();})['then'](function(){return provider[_0x5bea('0xe')]();})[_0x5bea('0xc')](function(_0x4fdefd){logger[_0x5bea('0xd')](_0x4fdefd);return pm2[_0x5bea('0xe')](pm2Config);})[_0x5bea('0xc')](function(_0xda336a){var _0x1e2861=_0xda336a[_0x5bea('0xf')](function(_0x14d46c){return typeof _0x14d46c['exitCode']==='number'&&_0x14d46c[_0x5bea('0x10')]>=0x0;});if(_0x1e2861[_0x5bea('0x11')]>0x0){throw new Error(_0x1e2861[_0x5bea('0x11')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0x5bea('0x12')](_0x1e2861,function(_0x18d13f){return'\x22'+_0x18d13f[_0x5bea('0x13')]['name']+'\x22';}));}logger[_0x5bea('0xd')](_0x5bea('0x14'),_['map'](_[_0x5bea('0xf')](_0xda336a,{'status':'online'}),_0x5bea('0x15'))[_0x5bea('0x16')]());logger[_0x5bea('0xd')]('Offline\x20apps:',_['map'](_[_0x5bea('0xf')](_0xda336a,function(_0x2bf974){return _0x2bf974[_0x5bea('0x17')]!=='online';}),_0x5bea('0x15'))[_0x5bea('0x16')]()||_0x5bea('0x18'));console[_0x5bea('0x19')]('App\x20Ready!');})[_0x5bea('0x1a')](function(_0xad55b1){console[_0x5bea('0x19')](_0x5bea('0x1b'),_0xad55b1);logger['error'](_0x5bea('0x1c'),_0xad55b1);process['exit'](0x1);});}main();
\ No newline at end of file