diff --git a/bundle/src/Server.ts b/bundle/src/Server.ts
index 5dda2d02..d541735f 100644
--- a/bundle/src/Server.ts
+++ b/bundle/src/Server.ts
@@ -4,7 +4,7 @@ process.on("uncaughtException", console.error);
import http from "http";
import * as Api from "@fosscord/api";
import * as Gateway from "@fosscord/gateway";
-import { CDNServer } from "@fosscord/cdn/";
+import { CDNServer } from "@fosscord/cdn";
import express from "express";
import { green, bold } from "nanocolors";
import { Config, initDatabase } from "@fosscord/util";
diff --git a/bundle/src/start.ts b/bundle/src/start.ts
index fbe5fa4c..8e7c3129 100644
--- a/bundle/src/start.ts
+++ b/bundle/src/start.ts
@@ -1,20 +1,4 @@
// process.env.MONGOMS_DEBUG = "true";
-const tsConfigPaths = require("tsconfig-paths");
-const path = require("path");
-const baseUrl = path.join(__dirname, "..");
-const cleanup = tsConfigPaths.register({
- baseUrl,
- paths: {
- "@fosscord/api": ["../api/dist/index.js"],
- "@fosscord/api/*": ["../api/dist/*"],
- "@fosscord/gateway": ["../gateway/dist/index.js"],
- "@fosscord/gateway/*": ["../gateway/dist/*"],
- "@fosscord/cdn": ["../cdn/dist/index.js"],
- "@fosscord/cdn/*": ["../cdn/dist/*"],
- },
-});
-console.log(require("@fosscord/gateway"));
-
import "reflect-metadata";
import cluster from "cluster";
import os from "os";
diff --git a/bundle/src/stats.ts b/bundle/src/stats.ts
index d5ceeff7..18bb85ca 100644
--- a/bundle/src/stats.ts
+++ b/bundle/src/stats.ts
@@ -1,11 +1,19 @@
import os from "os";
import osu from "node-os-utils";
+import { red } from "nanocolors";
export function initStats() {
console.log(`[Path] running in ${__dirname}`);
console.log(`[CPU] ${osu.cpu.model()} Cores x${osu.cpu.count()}`);
console.log(`[System] ${os.platform()} ${os.arch()}`);
console.log(`[Process] running with pid: ${process.pid}`);
+ if (process.getuid && process.getuid() === 0) {
+ console.warn(
+ red(
+ `[Process] Warning fosscord is running as root, this highly discouraged and might expose your system vulnerable to attackers. Please run fosscord as a user without root privileges.`
+ )
+ );
+ }
setInterval(async () => {
const [cpuUsed, memory, network] = await Promise.all([
@@ -23,5 +31,5 @@ export function initStats() {
process.memoryUsage().rss / 1024 / 1024
)}mb/${memory.totalMemMb.toFixed(0)}mb ${networkUsage}`
);
- }, 1000 * 5);
+ }, 1000 * 10);
}
|