parent
fcff93c533
commit
27eafbd71d
@ -1,4 +1,5 @@ |
|||||||
node_modules |
node_modules |
||||||
site |
site |
||||||
|
config/local.toml |
||||||
build/** |
build/** |
||||||
lib/inspircd-* |
lib/inspircd-* |
||||||
|
@ -0,0 +1,55 @@ |
|||||||
|
[bcrypt] |
||||||
|
saltRounds = 12 |
||||||
|
|
||||||
|
[satyr] |
||||||
|
registration = false |
||||||
|
webFormat = 'hls' |
||||||
|
record = false |
||||||
|
restrictedNames = ['live','stream'] |
||||||
|
|
||||||
|
[ircd] |
||||||
|
enable = false |
||||||
|
port = 7000 |
||||||
|
user = '' |
||||||
|
pass = '' |
||||||
|
|
||||||
|
[database] |
||||||
|
host = 'localhost' |
||||||
|
user = 'satyr' |
||||||
|
password = '' |
||||||
|
database = 'satyr_db' |
||||||
|
connectionLimit = '50' |
||||||
|
connectionTimeout = 'false' |
||||||
|
insecureAuth = false |
||||||
|
debug = false |
||||||
|
|
||||||
|
[server] |
||||||
|
logs = 0 |
||||||
|
api = false |
||||||
|
api_user = false |
||||||
|
api_pass = false |
||||||
|
|
||||||
|
[server.rtmp] |
||||||
|
port = 1935 |
||||||
|
chunk_size = 6000 |
||||||
|
gop_cache = true |
||||||
|
ping = 30 |
||||||
|
ping_timeout = 60 |
||||||
|
|
||||||
|
[server.http] |
||||||
|
port = 8080 |
||||||
|
allow_origin = '*' |
||||||
|
directory = './site' |
||||||
|
|
||||||
|
[media] |
||||||
|
streamKeys = false |
||||||
|
record = false |
||||||
|
publicEndpoint = 'live' |
||||||
|
privateEndpoint = 'stream' |
||||||
|
ffmpeg = '' |
||||||
|
|
||||||
|
[transcode] |
||||||
|
hls = true |
||||||
|
hlsFlags = '[hls_time=2:hls_list_size=3:hls_flags=delete_segments]' |
||||||
|
dash = false |
||||||
|
dashFlags = '[f=dash:window_size=3:extra_window_size=5]' |
@ -1,44 +1,71 @@ |
|||||||
import * as mediaserver from "./server"; |
import * as mediaserver from "./server"; |
||||||
import * as ircd from "./ircd"; |
import * as ircd from "./ircd"; |
||||||
import * as db from "./database"; |
import * as db from "./database"; |
||||||
|
const config = require('config'); |
||||||
|
|
||||||
const mediaconfig: any = { |
/*var dbcfg: object; |
||||||
rtmp: { |
var servercfg: object; |
||||||
port: 1935, |
var bcryptcfg: object; |
||||||
chunk_size: 60000, |
var satyrcfg: object; |
||||||
gop_cache: true, |
var ircdcfg: object; |
||||||
ping: 30, |
|
||||||
ping_timeout: 60 |
|
||||||
}, |
|
||||||
http: { |
|
||||||
port:8000, |
|
||||||
allow_origin: '*', |
|
||||||
mediaroot: './site' |
|
||||||
}, |
|
||||||
trans: { |
|
||||||
ffmpeg: '/usr/bin/ffmpeg', |
|
||||||
tasks: [ |
|
||||||
{ |
|
||||||
app: 'live', |
|
||||||
hls: 'true', |
|
||||||
hlsFlags: '[hls_time=2:hls_list_size=3:hls_flags=delete_segments]' |
|
||||||
} |
|
||||||
] |
|
||||||
} |
|
||||||
}; |
|
||||||
|
|
||||||
const dbconfig: any = { |
|
||||||
connectionLimit: 50, |
|
||||||
host : 'localhost', |
|
||||||
user : 'satyr', |
|
||||||
password : 'password', |
|
||||||
database : 'satyr_db' |
|
||||||
}; |
|
||||||
|
|
||||||
function boot(): void{ |
function init(): void{ |
||||||
db.run(dbconfig); |
dbcfg = config.get('database'); |
||||||
mediaserver.boot(mediaconfig); |
bcryptcfg = config.get('bcrypt'); |
||||||
|
servercfg = config.get('server'); |
||||||
|
satyrcfg = config.get('satyr'); |
||||||
|
ircdcfg = config.get('ircd'); |
||||||
|
}*/ |
||||||
|
|
||||||
|
function run(): void{ |
||||||
|
//init();
|
||||||
|
const dbcfg = config.database; |
||||||
|
const bcryptcfg = config.bcrypt; |
||||||
|
const satyr: object = { |
||||||
|
privateEndpoint: config.media.privateEndpoint, |
||||||
|
record: config.media.record, |
||||||
|
streamKeys: config.media.streamKeys, |
||||||
|
registration: config.satyr.registration, |
||||||
|
webFormat: config.satyr.webFormat, |
||||||
|
restrictedNames: config.satyr.restrictedNames |
||||||
|
}; |
||||||
|
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: { |
||||||
|
port: config.server.http.port, |
||||||
|
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 |
||||||
|
} |
||||||
|
|
||||||
|
}; |
||||||
|
db.run(dbcfg, bcryptcfg); |
||||||
|
mediaserver.boot(nms, satyr); |
||||||
ircd.boot(); |
ircd.boot(); |
||||||
} |
} |
||||||
boot(); |
run(); |
||||||
export { boot }; |
export { run }; |
Reference in new issue