2019-09-20 11:09:15 -05:00
|
|
|
import * as mediaserver from "./server";
|
2019-09-22 16:33:18 -05:00
|
|
|
import * as db from "./database";
|
2019-09-28 21:43:25 -05:00
|
|
|
import * as api from "./api";
|
|
|
|
import * as http from "./http";
|
2019-09-26 14:43:24 -05:00
|
|
|
import * as config from "config";
|
2019-09-22 16:33:18 -05:00
|
|
|
|
2019-09-23 14:27:01 -05:00
|
|
|
function run(): void{
|
2019-09-26 14:43:24 -05:00
|
|
|
const dbcfg: object = config.database;
|
|
|
|
const bcryptcfg: object = config.bcrypt;
|
2019-09-23 14:27:01 -05:00
|
|
|
const satyr: object = {
|
|
|
|
privateEndpoint: config.media.privateEndpoint,
|
|
|
|
record: config.media.record,
|
|
|
|
registration: config.satyr.registration,
|
|
|
|
webFormat: config.satyr.webFormat,
|
2019-09-28 21:43:25 -05:00
|
|
|
restrictedNames: config.satyr.restrictedNames,
|
|
|
|
name: config.satyr.name,
|
|
|
|
domain: config.satyr.domain,
|
2019-10-05 14:34:57 -05:00
|
|
|
email: config.satyr.email,
|
|
|
|
rootredirect: config.satyr.rootredirect,
|
|
|
|
version: process.env.npm_package_version
|
2019-09-23 14:27:01 -05:00
|
|
|
};
|
|
|
|
const nms: object = {
|
|
|
|
logType: config.server.logs,
|
|
|
|
rtmp: {
|
|
|
|
port: config.server.rtmp.port,
|
|
|
|
chunk_size: config.server.rtmp.chunk_size,
|
|
|
|
gop_cache: config.server.rtmp.gop_cache,
|
|
|
|
ping: config.server.rtmp.ping,
|
|
|
|
ping_timeout: config.server.rtmp.ping_timeout,
|
|
|
|
},
|
|
|
|
http: {
|
2019-10-17 16:01:35 -05:00
|
|
|
port: config.server.http.port + 1,
|
2019-09-23 14:27:01 -05:00
|
|
|
mediaroot: config.server.http.directory,
|
|
|
|
allow_origin: config.server.http.allow_origin
|
|
|
|
},
|
|
|
|
trans: {
|
|
|
|
ffmpeg: config.media.ffmpeg,
|
|
|
|
tasks: [
|
|
|
|
{
|
|
|
|
app: config.media.publicEndpoint,
|
|
|
|
hls: config.transcode.hls,
|
|
|
|
hlsFlags: config.transcode.hlsFlags,
|
|
|
|
dash: config.transcode.dash,
|
|
|
|
dashFlags: config.transcode.dashFlags
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
auth: {
|
|
|
|
api: config.server.api,
|
|
|
|
api_user: config.server.api_user,
|
|
|
|
api_pass: config.server.api_pass
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
2019-09-28 21:43:25 -05:00
|
|
|
api.init(satyr);
|
2019-10-17 16:01:35 -05:00
|
|
|
http.init(satyr, config.server.http.port);
|
2019-09-26 14:43:24 -05:00
|
|
|
db.init(dbcfg, bcryptcfg);
|
|
|
|
mediaserver.init(nms, satyr);
|
2019-09-20 11:09:15 -05:00
|
|
|
}
|
2019-09-23 14:27:01 -05:00
|
|
|
run();
|
|
|
|
export { run };
|