Make config file optional
This commit is contained in:
1 parent
e7821f655b
commit
faa12537e4
9 files changed
+126
-87
No files matched your search
+4
-13
@@ -1,9 +1,4 @@
|
||||
#!/usr/bin/env -S node -r esm -r ts-node/register/transpile-only
|
||||
import * as path from "path";
|
||||
import * as fs from "fs";
|
||||
|
||||
process.chdir(path.resolve(path.dirname(fs.realpathSync(__filename)), ".."));
|
||||
|
||||
import * as config from "../lib/config";
|
||||
import * as logger from "../lib/logger";
|
||||
import * as cluster from "../lib/cluster";
|
||||
@@ -57,14 +52,10 @@ if (!cluster.worker) {
|
||||
cluster.stop();
|
||||
});
|
||||
} else {
|
||||
let ssl;
|
||||
if (config.get("FS_SSL")) {
|
||||
ssl = {
|
||||
key: path.resolve("" + config.get("CONFIG_DIR"), "fs.key"),
|
||||
cert: path.resolve("" + config.get("CONFIG_DIR"), "fs.crt"),
|
||||
ca: path.resolve("" + config.get("CONFIG_DIR"), "fs.ca-bundle")
|
||||
};
|
||||
}
|
||||
const ssl = {
|
||||
key: config.get("FS_SSL_KEY"),
|
||||
cert: config.get("FS_SSL_CERT")
|
||||
};
|
||||
|
||||
process.on("uncaughtException", err => {
|
||||
if ((err as NodeJS.ErrnoException).code === "ERR_IPC_DISCONNECTED") return;
|
||||
|
||||
Reference in new issue
Block a user