From d4ca87a8cee2fd2caaaf8463a8b52ae46f9a607c Mon Sep 17 00:00:00 2001 From: Rory& Date: Sat, 25 Apr 2026 23:58:49 +0200 Subject: [PATCH] Add deprecation warning for database config --- src/util/util/Config.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/util/util/Config.ts b/src/util/util/Config.ts index bc34879c3..3c1c45f11 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 {