From e58bca0cdd11c79c2f231146a65bfd3ddee8c219 Mon Sep 17 00:00:00 2001 From: wukko Date: Sat, 3 Aug 2024 22:05:50 +0600 Subject: [PATCH] api: remove alias mapping for deprecated env variables --- api/src/cobalt.js | 1 - api/src/misc/alias-envs.js | 23 ----------------------- api/src/util/test.js | 1 - 3 files changed, 25 deletions(-) delete mode 100644 api/src/misc/alias-envs.js diff --git a/api/src/cobalt.js b/api/src/cobalt.js index eec452cc..c548e792 100644 --- a/api/src/cobalt.js +++ b/api/src/cobalt.js @@ -1,5 +1,4 @@ import "dotenv/config"; -import "./misc/alias-envs.js"; import express from "express"; diff --git a/api/src/misc/alias-envs.js b/api/src/misc/alias-envs.js deleted file mode 100644 index 5facb14b..00000000 --- a/api/src/misc/alias-envs.js +++ /dev/null @@ -1,23 +0,0 @@ -import { Red } from "./console-text.js"; - -const mapping = { - apiPort: 'API_PORT', - apiURL: 'API_URL', - apiName: 'API_NAME', - cors: 'CORS_WILDCARD', - cookiePath: 'COOKIE_PATH', - webPort: 'WEB_PORT', - webURL: 'WEB_URL', - showSponsors: 'SHOW_SPONSORS', - isBeta: 'IS_BETA' -} - -for (const [ oldEnv, newEnv ] of Object.entries(mapping)) { - if (process.env[oldEnv] && !process.env[newEnv]) { - process.env[newEnv] = process.env[oldEnv]; - console.error(`${Red('[!]')} ${oldEnv} is deprecated and will be removed in a future version.`); - console.error(` You should use ${newEnv} instead.`); - console.error(); - delete process.env[oldEnv]; - } -} diff --git a/api/src/util/test.js b/api/src/util/test.js index c0097964..704473f4 100644 --- a/api/src/util/test.js +++ b/api/src/util/test.js @@ -1,5 +1,4 @@ import "dotenv/config"; -import "../misc/alias-envs.js"; import { services } from "../processing/service-config.js"; import { extract } from "../processing/url.js";