env: rename ENABLE_CORS to CORS_WILDCARD for better clarity

This commit is contained in:
wukko 2024-03-05 19:20:56 +06:00
parent 765615390a
commit 011a0127b4
3 changed files with 4 additions and 4 deletions

View file

@ -55,7 +55,7 @@ sudo service nscd start
| `API_PORT` | `9000` | `9000` | changes port from which api server is accessible. |
| `API_URL` | | `https://co.wuk.sh/` | changes url from which api server is accessible. <br> ***REQUIRED TO RUN API***. |
| `API_NAME` | `unknown` | `ams-1` | api server name that is shown in `/api/serverInfo`. |
| `ENABLE_CORS` | `1` | `0` | toggles cross-origin resource sharing. <br> `0`: disabled. `1`: enabled. |
| `CORS_WILDCARD` | `1` | `0` | toggles cross-origin resource sharing. <br> `0`: disabled. `1`: enabled. |
| `CORS_URL` | not used | `https://cobalt.tools/` | cross-origin resource sharing url. api will be available only from this url. |
| `COOKIE_PATH` | not used | `/cookies.json` | path for cookie file relative to main folder. |
| `PROCESSING_PRIORITY` | not used | `10` | changes `nice` value* for ffmpeg subprocess. available only on unix systems. |

View file

@ -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.ENABLE_CORS === '0' ? {
const corsConfig = process.env.CORS_WILDCARD === '0' ? {
origin: process.env.CORS_URL,
optionsSuccessStatus: 200
} : {};
@ -143,7 +143,7 @@ export function runAPI(express, app, gitCommit, gitBranch, __dirname) {
branch: gitBranch,
name: process.env.API_NAME || "unknown",
url: process.env.API_URL,
cors: process.env?.ENABLE_CORS === "0" ? 0 : 1,
cors_wildcard: process.env?.CORS_WILDCARD === "0" ? 0 : 1,
startTime: `${startTimestamp}`
});
default:

View file

@ -59,7 +59,7 @@ function setup() {
rl.question(q, apiCors => {
let answCors = apiCors.toLowerCase().trim();
if (answCors !== "y" && answCors !== "yes") ob['ENABLE_CORS'] = '0'
if (answCors !== "y" && answCors !== "yes") ob['CORS_WILDCARD'] = '0'
final()
})
})