2018-06-09 23:34:06 +00:00
|
|
|
//
|
|
|
|
// Shinobi
|
|
|
|
// Copyright (C) 2016 Moe Alam, moeiscool
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// # Donate
|
|
|
|
//
|
|
|
|
// If you like what I am doing here and want me to continue please consider donating :)
|
|
|
|
// PayPal : paypal@m03.ca
|
|
|
|
//
|
2018-09-29 01:57:26 +00:00
|
|
|
var io = new (require('socket.io'))()
|
2018-09-29 04:04:50 +00:00
|
|
|
//library loader
|
2018-09-28 05:37:08 +00:00
|
|
|
var loadLib = function(lib){
|
|
|
|
return require(__dirname+'/libs/'+lib+'.js')
|
|
|
|
}
|
2018-09-29 04:04:50 +00:00
|
|
|
//process handlers
|
2018-10-24 00:37:51 +00:00
|
|
|
var s = loadLib('process')(process,__dirname)
|
2018-09-29 04:04:50 +00:00
|
|
|
//configuration loader
|
2018-09-28 20:26:24 +00:00
|
|
|
var config = loadLib('config')(s)
|
2018-09-29 04:04:50 +00:00
|
|
|
//language loader
|
2018-09-28 20:26:24 +00:00
|
|
|
var lang = loadLib('language')(s,config)
|
2018-09-29 04:04:50 +00:00
|
|
|
//basic functions
|
2018-09-29 01:57:26 +00:00
|
|
|
loadLib('basic')(s,config)
|
2018-10-02 00:21:48 +00:00
|
|
|
//load extender functions
|
|
|
|
loadLib('extenders')(s,config)
|
2018-09-29 04:04:50 +00:00
|
|
|
//video processing engine
|
2018-09-29 20:09:24 +00:00
|
|
|
loadLib('ffmpeg')(s,config,function(){
|
|
|
|
//database connection : mysql, sqlite3..
|
|
|
|
loadLib('sql')(s,config)
|
|
|
|
//working directories : videos, streams, fileBin..
|
|
|
|
loadLib('folders')(s,config)
|
|
|
|
//authenticator functions : API, dashboard login..
|
|
|
|
loadLib('auth')(s,config,lang)
|
|
|
|
//express web server with ejs
|
|
|
|
var app = loadLib('webServer')(s,config,lang,io)
|
2018-10-08 06:01:27 +00:00
|
|
|
//web server routes : page handling..
|
2018-11-11 03:59:02 +00:00
|
|
|
loadLib('webServerPaths')(s,config,lang,app,io)
|
2018-10-08 06:01:27 +00:00
|
|
|
//web server routes for streams : streams..
|
2018-11-11 03:59:02 +00:00
|
|
|
loadLib('webServerStreamPaths')(s,config,lang,app,io)
|
2018-10-05 21:19:29 +00:00
|
|
|
//web server admin routes : create sub accounts, share monitors, share videos
|
2018-11-11 03:59:02 +00:00
|
|
|
loadLib('webServerAdminPaths')(s,config,lang,app,io)
|
2018-10-05 21:19:29 +00:00
|
|
|
//web server superuser routes : create admin accounts and manage system functions
|
2018-11-11 03:59:02 +00:00
|
|
|
loadLib('webServerSuperPaths')(s,config,lang,app,io)
|
2018-09-29 20:09:24 +00:00
|
|
|
//websocket connection handlers : login and streams..
|
2018-09-29 20:40:07 +00:00
|
|
|
loadLib('socketio')(s,config,lang,io)
|
2018-09-29 20:09:24 +00:00
|
|
|
//user and group functions
|
|
|
|
loadLib('user')(s,config)
|
|
|
|
//monitor/camera handlers
|
|
|
|
loadLib('monitor')(s,config,lang)
|
2018-10-01 05:44:35 +00:00
|
|
|
//event functions : motion, object matrix handler
|
|
|
|
loadLib('events')(s,config,lang)
|
2018-09-29 20:09:24 +00:00
|
|
|
//built-in detector functions : pam-diff..
|
|
|
|
loadLib('detector')(s,config)
|
|
|
|
//recording functions
|
2018-09-29 20:40:07 +00:00
|
|
|
loadLib('videos')(s,config,lang)
|
2018-09-29 20:09:24 +00:00
|
|
|
//plugins : websocket connected services..
|
|
|
|
loadLib('plugins')(s,config,lang)
|
|
|
|
//health : cpu and ram trackers..
|
|
|
|
loadLib('health')(s,config,lang,io)
|
|
|
|
//cluster module
|
2018-10-16 02:40:12 +00:00
|
|
|
loadLib('childNode')(s,config,lang,app,io)
|
2018-10-01 05:44:35 +00:00
|
|
|
//cloud uploaders : amazon s3, webdav, backblaze b2..
|
2018-09-30 22:44:04 +00:00
|
|
|
loadLib('cloudUploaders')(s,config,lang)
|
2018-10-02 00:21:48 +00:00
|
|
|
//notifiers : discord..
|
|
|
|
loadLib('notification')(s,config,lang)
|
2018-12-12 23:02:24 +00:00
|
|
|
//custom module loader
|
|
|
|
loadLib('customAutoLoad')(s,config,lang,app,io)
|
2018-10-23 18:36:02 +00:00
|
|
|
//on-start actions, daemon(s) starter
|
2018-09-29 20:09:24 +00:00
|
|
|
loadLib('startup')(s,config,lang)
|
|
|
|
})
|