diff --git a/src/cobalt.js b/src/cobalt.js index 2d90e07e..40bca04b 100644 --- a/src/cobalt.js +++ b/src/cobalt.js @@ -21,8 +21,8 @@ app.disable('x-powered-by'); await loadLoc(); -const apiMode = process.env.apiURL && !process.env.webURL; -const webMode = process.env.webURL && process.env.apiURL; +const apiMode = process.env.API_URL && !process.env.WEB_URL; +const webMode = process.env.WEB_URL && process.env.API_URL; if (apiMode) { const { runAPI } = await import('./core/api.js'); diff --git a/src/core/api.js b/src/core/api.js index 5f910315..8e26dbd0 100644 --- a/src/core/api.js +++ b/src/core/api.js @@ -14,7 +14,7 @@ import { sha256 } from "../modules/sub/crypto.js"; import { verifyStream } from "../modules/stream/manage.js"; export function runAPI(express, app, gitCommit, gitBranch, __dirname) { - const corsConfig = process.env.cors === '0' ? { + const corsConfig = process.env.ENABLE_CORS === '0' ? { origin: process.env.CORS_URL, optionsSuccessStatus: 200 } : {}; @@ -141,9 +141,9 @@ export function runAPI(express, app, gitCommit, gitBranch, __dirname) { version: version, commit: gitCommit, branch: gitBranch, - name: process.env.apiName || "unknown", - url: process.env.apiURL, - cors: process.env?.cors === "0" ? 0 : 1, + name: process.env.API_NAME || "unknown", + url: process.env.API_URL, + cors: process.env?.ENABLE_CORS === "0" ? 0 : 1, startTime: `${startTimestamp}` }); default: @@ -169,12 +169,12 @@ export function runAPI(express, app, gitCommit, gitBranch, __dirname) { res.redirect('/api/json') }); - app.listen(process.env.apiPort || 9000, () => { + app.listen(process.env.API_PORT || 9000, () => { console.log(`\n` + `${Cyan("cobalt")} API ${Bright(`v.${version}-${gitCommit} (${gitBranch})`)}\n` + `Start time: ${Bright(`${startTime.toUTCString()} (${startTimestamp})`)}\n\n` + - `URL: ${Cyan(`${process.env.apiURL}`)}\n` + - `Port: ${process.env.apiPort || 9000}\n` + `URL: ${Cyan(`${process.env.API_URL}`)}\n` + + `Port: ${process.env.API_PORT || 9000}\n` ) }); } diff --git a/src/core/web.js b/src/core/web.js index 08a6ffed..7c0cbf33 100644 --- a/src/core/web.js +++ b/src/core/web.js @@ -76,12 +76,12 @@ export async function runWeb(express, app, gitCommit, gitBranch, __dirname) { return res.redirect('/') }); - app.listen(process.env.webPort || 9001, () => { + app.listen(process.env.WEB_PORT || 9001, () => { console.log(`\n` + `${Cyan("cobalt")} WEB ${Bright(`v.${version}-${gitCommit} (${gitBranch})`)}\n` + `Start time: ${Bright(`${startTime.toUTCString()} (${startTimestamp})`)}\n\n` + - `URL: ${Cyan(`${process.env.webURL}`)}\n` + - `Port: ${process.env.webPort || 9001}\n` + `URL: ${Cyan(`${process.env.WEB_URL}`)}\n` + + `Port: ${process.env.WEB_PORT || 9001}\n` ) }) } diff --git a/src/modules/pageRender/elements.js b/src/modules/pageRender/elements.js index a677d2bc..53ad3c42 100644 --- a/src/modules/pageRender/elements.js +++ b/src/modules/pageRender/elements.js @@ -264,5 +264,5 @@ export function sponsoredList() { } export function betaTag() { - return process.env.isBeta ? 'β' : '' + return process.env.IS_BETA ? 'β' : '' } diff --git a/src/modules/pageRender/page.js b/src/modules/pageRender/page.js index 81e6d514..77b87f29 100644 --- a/src/modules/pageRender/page.js +++ b/src/modules/pageRender/page.js @@ -48,10 +48,10 @@ export default function(obj) {