summary refs log tree commit diff
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-04-25 23:58:49 +0200
committerRory& <root@rory.gay>2026-04-25 23:58:49 +0200
commitd4ca87a8cee2fd2caaaf8463a8b52ae46f9a607c (patch)
tree313b08195b2b3952dc7a5c9991af0bc2eaefb187
parentConstrain role name lengths (diff)
downloadserver-ts-d4ca87a8cee2fd2caaaf8463a8b52ae46f9a607c.tar.xz
Add deprecation warning for database config
-rw-r--r--src/util/util/Config.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/util/util/Config.ts b/src/util/util/Config.ts

index bc34879c..3c1c45f1 100644 --- a/src/util/util/Config.ts +++ b/src/util/util/Config.ts
@@ -22,6 +22,7 @@ import { OrmUtils } from ".."; import { ConfigValue } from "../config"; import { ConfigEntity } from "../entities"; import { JsonValue } from "@protobuf-ts/runtime"; +import { bold, red, redBright } from "picocolors"; // TODO: yaml instead of json const overridePath = process.env.CONFIG_PATH ?? ""; @@ -37,6 +38,14 @@ export class Config { if (config && !force) return config; console.log("[Config] Loading configuration..."); if (!process.env.CONFIG_PATH) { + if (process.env.CONFIG_SOURCE !== "database") { + console.log("[Config]:", redBright("Warning:"), bold("Database driven configuration has been deprecated")); + console.log("[Config]:", redBright("Warning:"), "Please migrate to JSON configuration by setting CONFIG_PATH=/path/to/config.json"); + console.log("[Config]:", redBright("Warning:"), " or set CONFIG_SOURCE=database to ignore this warning for now."); + console.log("[Config]:", redBright("Warning:"), ""); + console.log("[Config]:", redBright("Warning:"), "Note that this option will be removed soon, and lack hereof will stop the server from starting!"); + } + pairs = await validateConfig(); config = pairsToConfig(pairs); } else {