update the way environment variables are checked
no longer checking for .env file, just the variables
This commit is contained in:
parent
7e01f0b496
commit
450d01753d
3 changed files with 3 additions and 4 deletions
|
@ -77,7 +77,7 @@ It's also possible to host cobalt via a Docker image, but in that case you'd nee
|
||||||
That includes:
|
That includes:
|
||||||
| Variable | Example |
|
| Variable | Example |
|
||||||
| -------- | :--- |
|
| -------- | :--- |
|
||||||
| `selfUrl` | `https://co.wukko.me/` |
|
| `selfURL` | `https://co.wukko.me/` |
|
||||||
| `port` | `9000` |
|
| `port` | `9000` |
|
||||||
| `streamSalt` | `randomly generated sha512 hash` |
|
| `streamSalt` | `randomly generated sha512 hash` |
|
||||||
| `cors` | `0` |
|
| `cors` | `0` |
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"exports": "./src/cobalt.js",
|
"exports": "./src/cobalt.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=17.5"
|
"node": ">=18"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node src/cobalt",
|
"start": "node src/cobalt",
|
||||||
|
|
|
@ -2,7 +2,6 @@ import "dotenv/config";
|
||||||
|
|
||||||
import express from "express";
|
import express from "express";
|
||||||
import cors from "cors";
|
import cors from "cors";
|
||||||
import * as fs from "fs";
|
|
||||||
import rateLimit from "express-rate-limit";
|
import rateLimit from "express-rate-limit";
|
||||||
|
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
@ -30,7 +29,7 @@ const corsConfig = process.env.cors === '0' ? { origin: process.env.selfURL, opt
|
||||||
|
|
||||||
app.disable('x-powered-by');
|
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({
|
const apiLimiter = rateLimit({
|
||||||
windowMs: 60000,
|
windowMs: 60000,
|
||||||
max: 25,
|
max: 25,
|
||||||
|
|
Loading…
Reference in a new issue