From 450d01753db471f002b027eed44c4741694f538e Mon Sep 17 00:00:00 2001 From: wukko Date: Sun, 9 Apr 2023 09:40:13 +0600 Subject: [PATCH] update the way environment variables are checked no longer checking for .env file, just the variables --- README.md | 2 +- package.json | 2 +- src/cobalt.js | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3b1015ce..b1e636af 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ It's also possible to host cobalt via a Docker image, but in that case you'd nee That includes: | Variable | Example | | -------- | :--- | -| `selfUrl` | `https://co.wukko.me/` | +| `selfURL` | `https://co.wukko.me/` | | `port` | `9000` | | `streamSalt` | `randomly generated sha512 hash` | | `cors` | `0` | diff --git a/package.json b/package.json index cd3dad05..5738e29d 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "exports": "./src/cobalt.js", "type": "module", "engines": { - "node": ">=17.5" + "node": ">=18" }, "scripts": { "start": "node src/cobalt", diff --git a/src/cobalt.js b/src/cobalt.js index 17c84ce4..8e65b080 100644 --- a/src/cobalt.js +++ b/src/cobalt.js @@ -2,7 +2,6 @@ import "dotenv/config"; import express from "express"; import cors from "cors"; -import * as fs from "fs"; import rateLimit from "express-rate-limit"; import path from 'path'; @@ -30,7 +29,7 @@ const corsConfig = process.env.cors === '0' ? { origin: process.env.selfURL, opt app.disable('x-powered-by'); -if (fs.existsSync('./.env') && process.env.selfURL && process.env.streamSalt && process.env.port) { +if (process.env.selfURL && process.env.streamSalt && process.env.port) { const apiLimiter = rateLimit({ windowMs: 60000, max: 25,