2022-07-19 22:31:15 +00:00
|
|
|
import { start as startRpc } from "./rpc.js";
|
|
|
|
import { start as startRelay } from "./relay.js";
|
2022-09-21 12:55:35 +00:00
|
|
|
import { start as startApp } from "./app";
|
2022-07-24 00:24:19 +00:00
|
|
|
import log from "loglevel";
|
2022-08-03 06:02:40 +00:00
|
|
|
import config from "./config.js";
|
2022-08-27 01:52:19 +00:00
|
|
|
import { loadPlugins } from "./plugin.js";
|
2022-09-21 12:55:35 +00:00
|
|
|
import { start as startDns } from "./dns.js";
|
|
|
|
import { start as startSSl } from "./ssl.js";
|
2022-07-24 00:24:19 +00:00
|
|
|
|
|
|
|
log.setDefaultLevel(config.str("log-level"));
|
2022-06-27 17:53:00 +00:00
|
|
|
|
2022-07-24 03:16:34 +00:00
|
|
|
async function boot() {
|
2022-08-27 01:52:19 +00:00
|
|
|
await loadPlugins();
|
2022-09-21 12:55:35 +00:00
|
|
|
await startApp();
|
2022-09-09 10:18:14 +00:00
|
|
|
await startRpc();
|
2022-09-21 12:55:35 +00:00
|
|
|
await startDns();
|
|
|
|
await startSSl();
|
2022-07-24 03:16:34 +00:00
|
|
|
await startRelay();
|
|
|
|
}
|
2022-06-27 17:53:00 +00:00
|
|
|
|
2022-07-25 06:50:27 +00:00
|
|
|
boot();
|
|
|
|
|
2022-06-27 17:53:00 +00:00
|
|
|
process.on("uncaughtException", function (err) {
|
2022-08-03 06:02:40 +00:00
|
|
|
console.log(`Caught exception: ${err.message} ${err.stack}`);
|
2022-06-27 17:53:00 +00:00
|
|
|
});
|
2022-08-05 04:06:31 +00:00
|
|
|
process.on("SIGINT", function () {
|
|
|
|
process.exit();
|
|
|
|
});
|
|
|
|
process.on("SIGTERM", function () {
|
|
|
|
process.exit();
|
|
|
|
});
|