2019-12-21 08:59:35 -06:00
|
|
|
import {parseAsYaml as parse} from "parse-yaml";
|
|
|
|
import {readFileSync as read} from "fs";
|
2020-07-30 00:03:05 -05:00
|
|
|
try {
|
|
|
|
var localconfig: Object = parse(read('config/config.yml'));
|
2020-10-10 15:55:32 -05:00
|
|
|
console.log('Config file found.');
|
2020-07-30 00:03:05 -05:00
|
|
|
} catch (e) {
|
|
|
|
console.log('No config file found. Exiting.');
|
|
|
|
process.exit();
|
|
|
|
}
|
2019-12-21 08:59:35 -06:00
|
|
|
const config: Object = {
|
|
|
|
crypto: Object.assign({
|
|
|
|
saltRounds: 12
|
|
|
|
}, localconfig['crypto']),
|
|
|
|
satyr: Object.assign({
|
|
|
|
name: '',
|
|
|
|
domain: '',
|
|
|
|
registration: false,
|
2020-07-29 03:24:19 -05:00
|
|
|
email: null,
|
2020-10-13 16:12:07 -05:00
|
|
|
restrictedNames: [ 'live', 'user', 'users', 'register', 'login', 'invite' ],
|
2019-12-21 08:59:35 -06:00
|
|
|
rootredirect: '/users/live',
|
|
|
|
version: process.env.npm_package_version,
|
|
|
|
}, localconfig['satyr']),
|
|
|
|
database: Object.assign({
|
|
|
|
host: 'localhost',
|
|
|
|
user: 'satyr',
|
|
|
|
password: '',
|
|
|
|
database: 'satyr_db',
|
|
|
|
connectionLimit: '50',
|
|
|
|
connectionTimeout: '1000',
|
|
|
|
insecureAuth: false,
|
|
|
|
debug: false }, localconfig['database']),
|
|
|
|
rtmp: Object.assign({
|
2020-10-17 21:20:32 -05:00
|
|
|
cluster: false,
|
2019-12-21 08:59:35 -06:00
|
|
|
port: 1935,
|
|
|
|
chunk_size: 6000,
|
|
|
|
gop_cache: true,
|
|
|
|
ping: 30,
|
|
|
|
ping_timeout: 60 }, localconfig['rtmp']),
|
|
|
|
http: Object.assign({
|
2020-10-16 21:31:23 -05:00
|
|
|
hsts: false,
|
|
|
|
directory: './site',
|
|
|
|
port: 8000,
|
|
|
|
server_side_render: true
|
2019-12-21 08:59:35 -06:00
|
|
|
}, localconfig['http']),
|
|
|
|
media: Object.assign({
|
|
|
|
record: false,
|
|
|
|
publicEndpoint: 'live',
|
|
|
|
privateEndpoint: 'stream',
|
|
|
|
ffmpeg: ''
|
|
|
|
}, localconfig['media']),
|
|
|
|
transcode: Object.assign({
|
|
|
|
adapative: false,
|
|
|
|
variants: 3,
|
2020-08-08 23:08:09 -05:00
|
|
|
format: 'dash',
|
|
|
|
inputflags: null,
|
|
|
|
outputflags: null
|
2020-06-26 04:07:37 -05:00
|
|
|
}, localconfig['transcode']),
|
|
|
|
chat: {
|
|
|
|
irc: Object.assign({
|
|
|
|
enabled: false,
|
|
|
|
server: null,
|
|
|
|
port: 6667,
|
|
|
|
tls: false,
|
|
|
|
nickname: 'SatyrChat',
|
|
|
|
userName: 'SatyrChat',
|
|
|
|
sasl: false,
|
|
|
|
password: null
|
|
|
|
}, localconfig['chat']['irc']),
|
|
|
|
|
|
|
|
discord: Object.assign({
|
|
|
|
enabled: false,
|
|
|
|
token: null
|
|
|
|
}, localconfig['chat']['discord']),
|
|
|
|
|
|
|
|
xmpp: Object.assign({
|
|
|
|
enabled: false,
|
|
|
|
server: null,
|
|
|
|
port: 5222,
|
2020-10-17 16:55:55 -05:00
|
|
|
jid: null,
|
2020-10-17 18:30:38 -05:00
|
|
|
password: null,
|
|
|
|
nickname: 'SatyrChat'
|
2020-06-26 04:07:37 -05:00
|
|
|
}, localconfig['chat']['xmpp']),
|
|
|
|
|
|
|
|
twitch: Object.assign({
|
|
|
|
enabled: false,
|
|
|
|
username: null,
|
|
|
|
token: null
|
|
|
|
}, localconfig['chat']['twitch'])
|
2020-10-12 10:54:55 -05:00
|
|
|
},
|
|
|
|
twitch_mirror: Object.assign({
|
2020-10-12 11:14:59 -05:00
|
|
|
enabled: false,
|
|
|
|
ingest: null
|
2020-10-12 10:54:55 -05:00
|
|
|
}, localconfig['twitch_mirror'])
|
2019-12-21 08:59:35 -06:00
|
|
|
};
|
|
|
|
export { config };
|