Built motion from commit 20b39a97.|2.6.29
[motion2.git] / server / app.js
index 76c6ae4..6cf33f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2427=['./config/environment','app','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','seedDB','default','then','listen','info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','Online\x20apps:','name','status','online','join','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/license'];(function(_0x1c6f44,_0x49aed4){var _0x334b74=function(_0x17fe5e){while(--_0x17fe5e){_0x1c6f44['push'](_0x1c6f44['shift']());}};_0x334b74(++_0x49aed4);}(_0x2427,0x165));var _0x7242=function(_0x590432,_0x4bf4dd){_0x590432=_0x590432-0x0;var _0x3ffc33=_0x2427[_0x590432];return _0x3ffc33;};'use strict';var _=require(_0x7242('0x0'));var db=require(_0x7242('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0x7242('0x2'));var rpc=require('./rpc');var config=require(_0x7242('0x3'));var logger=require('./config/logger')(_0x7242('0x4'));var pm2=require(_0x7242('0x5'));var pm2Config=require(_0x7242('0x6'));var schedule=require('./config/schedule');var chat=require(_0x7242('0x7'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x7242('0x8'));var provider=require(_0x7242('0x9'));function main(){return db[_0x7242('0xa')][_0x7242('0xb')]()['then'](function(){if(config[_0x7242('0xc')]){return seedDb[_0x7242('0xd')]();}})['then'](function(){return checkLicense[_0x7242('0xd')]();})[_0x7242('0xe')](function(){return rpc[_0x7242('0xf')]();})['then'](function(_0x423018){logger[_0x7242('0x10')](_0x423018);return chat[_0x7242('0x11')]();})[_0x7242('0xe')](function(){return whatsapp['start']();})[_0x7242('0xe')](function(){return schedule[_0x7242('0x11')]();})['then'](function(){return transcribe[_0x7242('0x11')]();})[_0x7242('0xe')](function(){return provider[_0x7242('0x11')]();})['then'](function(_0x4bd60d){logger[_0x7242('0x10')](_0x4bd60d);return pm2['start'](pm2Config);})[_0x7242('0xe')](function(_0x375ca6){var _0x294535=_0x375ca6[_0x7242('0x12')](function(_0x461f20){return typeof _0x461f20[_0x7242('0x13')]===_0x7242('0x14')&&_0x461f20['exitCode']>=0x0;});if(_0x294535[_0x7242('0x15')]>0x0){throw new Error(_0x294535['length']+_0x7242('0x16')+_[_0x7242('0x17')](_0x294535,function(_0x4828a0){return'\x22'+_0x4828a0['pm2_env']['name']+'\x22';}));}logger[_0x7242('0x10')](_0x7242('0x18'),_['map'](_['filter'](_0x375ca6,{'status':'online'}),_0x7242('0x19'))['join']());logger[_0x7242('0x10')]('Offline\x20apps:',_[_0x7242('0x17')](_[_0x7242('0x12')](_0x375ca6,function(_0xb3a27f){return _0xb3a27f[_0x7242('0x1a')]!==_0x7242('0x1b');}),_0x7242('0x19'))[_0x7242('0x1c')]()||'None');console[_0x7242('0x1d')](_0x7242('0x1e'));})[_0x7242('0x1f')](function(_0x546be9){console[_0x7242('0x1d')](_0x7242('0x20'),_0x546be9);logger[_0x7242('0x21')](_0x7242('0x22'),_0x546be9);process[_0x7242('0x23')](0x1);});}main();
\ No newline at end of file
+var _0x2428=['error','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','default','start','info','filter','exitCode','number','length','map','pm2_env','name','Online\x20apps:','join','Offline\x20apps:','online','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!'];(function(_0x3b632f,_0x453380){var _0x10e788=function(_0x2228a4){while(--_0x2228a4){_0x3b632f['push'](_0x3b632f['shift']());}};_0x10e788(++_0x453380);}(_0x2428,0xd3));var _0x8242=function(_0x4c272f,_0x18d107){_0x4c272f=_0x4c272f-0x0;var _0xd08a10=_0x2428[_0x4c272f];return _0xd08a10;};'use strict';var _=require('lodash');var db=require(_0x8242('0x0'))['db'];var seedDb=require(_0x8242('0x1'));var checkLicense=require(_0x8242('0x2'));var rpc=require(_0x8242('0x3'));var config=require(_0x8242('0x4'));var logger=require(_0x8242('0x5'))(_0x8242('0x6'));var pm2=require(_0x8242('0x7'));var pm2Config=require(_0x8242('0x8'));var schedule=require(_0x8242('0x9'));var chat=require(_0x8242('0xa'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x8242('0xb'));var provider=require(_0x8242('0xc'));function main(){return db[_0x8242('0xd')][_0x8242('0xe')]()[_0x8242('0xf')](function(){if(config['seedDB']){return seedDb[_0x8242('0x10')]();}})[_0x8242('0xf')](function(){return checkLicense[_0x8242('0x10')]();})[_0x8242('0xf')](function(){return rpc['listen']();})[_0x8242('0xf')](function(_0x3abaea){logger['info'](_0x3abaea);return chat[_0x8242('0x11')]();})['then'](function(){return whatsapp['start']();})['then'](function(){return schedule['start']();})['then'](function(){return transcribe[_0x8242('0x11')]();})[_0x8242('0xf')](function(){return provider['start']();})['then'](function(_0xfb7cae){logger[_0x8242('0x12')](_0xfb7cae);return pm2['start'](pm2Config);})[_0x8242('0xf')](function(_0x5d649c){var _0x4086e5=_0x5d649c[_0x8242('0x13')](function(_0x27f950){return typeof _0x27f950[_0x8242('0x14')]===_0x8242('0x15')&&_0x27f950[_0x8242('0x14')]>=0x0;});if(_0x4086e5[_0x8242('0x16')]>0x0){throw new Error(_0x4086e5['length']+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0x8242('0x17')](_0x4086e5,function(_0x45a325){return'\x22'+_0x45a325[_0x8242('0x18')][_0x8242('0x19')]+'\x22';}));}logger[_0x8242('0x12')](_0x8242('0x1a'),_[_0x8242('0x17')](_[_0x8242('0x13')](_0x5d649c,{'status':'online'}),_0x8242('0x19'))[_0x8242('0x1b')]());logger[_0x8242('0x12')](_0x8242('0x1c'),_[_0x8242('0x17')](_['filter'](_0x5d649c,function(_0x140fbc){return _0x140fbc['status']!==_0x8242('0x1d');}),_0x8242('0x19'))['join']()||'None');console[_0x8242('0x1e')](_0x8242('0x1f'));})[_0x8242('0x20')](function(_0x30e805){console[_0x8242('0x1e')](_0x8242('0x21'),_0x30e805);logger[_0x8242('0x22')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x30e805);process['exit'](0x1);});}main();
\ No newline at end of file