diff options
author | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-10-10 11:02:25 +0200 |
---|---|---|
committer | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-10-10 11:02:25 +0200 |
commit | dd51a3662b9bacd7c19f4be889c410003b3cdaf4 (patch) | |
tree | 1e487f7c8fb0f55c4c6ae7a57ad15b3da3cd1675 /bundle/src | |
parent | :sparkles: random guest username generation added (diff) | |
download | server-dd51a3662b9bacd7c19f4be889c410003b3cdaf4.tar.xz |
:sparkles: changed and fixed compiler
Diffstat (limited to 'bundle/src')
-rw-r--r-- | bundle/src/Server.ts | 2 | ||||
-rw-r--r-- | bundle/src/start.ts | 16 | ||||
-rw-r--r-- | bundle/src/stats.ts | 10 |
3 files changed, 10 insertions, 18 deletions
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..49705424 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() === 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); } |