mirror of
https://git.waldn.net/git/knotteye/satyr.git
synced 2025-11-02 00:02:44 +00:00
Changed init functions to be more consistent.
Added setup script and templates for config and database setup. Fixed typo in tsconfig.
This commit is contained in:
@@ -2,7 +2,7 @@ import * as db from "./database"
|
||||
import * as flags from "flags";
|
||||
import * as config from "config"
|
||||
|
||||
db.run(config.database, config.bcrypt);
|
||||
db.init(config.database, config.bcrypt);
|
||||
|
||||
flags.defineString('add', '', 'User to add');
|
||||
flags.defineString('remove', '', 'User to remove');
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import * as mediaserver from "./server";
|
||||
import * as ircd from "./ircd";
|
||||
import * as db from "./database";
|
||||
const config = require('config');
|
||||
import * as config from "config";
|
||||
|
||||
function run(): void{
|
||||
const dbcfg = config.database;
|
||||
const bcryptcfg = config.bcrypt;
|
||||
const dbcfg: object = config.database;
|
||||
const bcryptcfg: object = config.bcrypt;
|
||||
const satyr: object = {
|
||||
privateEndpoint: config.media.privateEndpoint,
|
||||
record: config.media.record,
|
||||
@@ -47,9 +47,9 @@ function run(): void{
|
||||
}
|
||||
|
||||
};
|
||||
db.run(dbcfg, bcryptcfg);
|
||||
mediaserver.boot(nms, satyr);
|
||||
ircd.boot();
|
||||
db.init(dbcfg, bcryptcfg);
|
||||
mediaserver.init(nms, satyr);
|
||||
ircd.init();
|
||||
}
|
||||
run();
|
||||
export { run };
|
||||
@@ -5,7 +5,7 @@ import { resolve } from "url";
|
||||
var raw: any;
|
||||
var cryptoconfig: any;
|
||||
|
||||
function run (db: object, bcrypt: object){
|
||||
function init (db: object, bcrypt: object){
|
||||
raw = mysql.createPool(db);
|
||||
cryptoconfig = bcrypt;
|
||||
}
|
||||
@@ -63,4 +63,4 @@ async function validatePassword(username: string, password: string){
|
||||
;
|
||||
}
|
||||
|
||||
export { query, raw, run, addUser, rmUser, addStreamKey, rmStreamKey };
|
||||
export { query, raw, init, addUser, rmUser, addStreamKey, rmStreamKey };
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as child from "child_process";
|
||||
var ircd: child.ChildProcess;
|
||||
function boot():void{
|
||||
function init():void{
|
||||
ircd = child.execFile("./lib/inspircd-3.3.0/run/inspircd", ["restart"], (error, stdout, stderr) => {
|
||||
if (error){
|
||||
console.log("[IRCD] Failed to start Inspircd");
|
||||
@@ -17,4 +17,4 @@ function reloadSSL():void{
|
||||
ircd.kill("SIGUSR1");
|
||||
}
|
||||
|
||||
export { boot, reloadSSL };
|
||||
export { init, reloadSSL };
|
||||
@@ -3,7 +3,7 @@ import { mkdir } from "fs";
|
||||
import * as db from "./database";
|
||||
const { exec } = require('child_process');
|
||||
|
||||
function boot (mediaconfig: any, satyrconfig: any) {
|
||||
function init (mediaconfig: any, satyrconfig: any) {
|
||||
const nms = new NodeMediaServer(mediaconfig);
|
||||
nms.run();
|
||||
|
||||
@@ -95,4 +95,4 @@ function boot (mediaconfig: any, satyrconfig: any) {
|
||||
}
|
||||
});
|
||||
}
|
||||
export { boot };
|
||||
export { init };
|
||||
Reference in New Issue
Block a user