implement private masqr exemptions
This commit is contained in:
parent
8ac7847122
commit
18540bf5c9
2 changed files with 10 additions and 1 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -4,4 +4,5 @@ dist/
|
||||||
node_modules/
|
node_modules/
|
||||||
npm-debug.log*
|
npm-debug.log*
|
||||||
.env
|
.env
|
||||||
public/games/**
|
public/games/**
|
||||||
|
exempt_masqr.txt
|
||||||
8
index.js
8
index.js
|
|
@ -14,10 +14,18 @@ import { server as wisp, logging } from "@mercuryworkshop/wisp-js/server";
|
||||||
import router from "./middleware/ProxyExt/index.js";
|
import router from "./middleware/ProxyExt/index.js";
|
||||||
import { handler as astroSSR } from "./dist/server/entry.mjs";
|
import { handler as astroSSR } from "./dist/server/entry.mjs";
|
||||||
import cookies from "cookie-parser";
|
import cookies from "cookie-parser";
|
||||||
|
import { existsSync, readFileSync } from "fs";
|
||||||
|
|
||||||
dotenv.config();
|
dotenv.config();
|
||||||
|
|
||||||
const whiteListedDomains = ["aluu.xyz", "localhost"];
|
const whiteListedDomains = ["aluu.xyz", "localhost"];
|
||||||
|
|
||||||
|
if (existsSync("exempt_masqr.txt")) {
|
||||||
|
const file = readFileSync("exempt_masqr.txt", "utf-8");
|
||||||
|
const exemptDomains = file.split("\n");
|
||||||
|
whiteListedDomains.push(...exemptDomains);
|
||||||
|
}
|
||||||
|
|
||||||
const LICENSE_SERVER_URL = "https://license.mercurywork.shop/validate?license=";
|
const LICENSE_SERVER_URL = "https://license.mercurywork.shop/validate?license=";
|
||||||
const MASQR_ENABLED = process.env.MASQR_ENABLED;
|
const MASQR_ENABLED = process.env.MASQR_ENABLED;
|
||||||
logging.set_level(logging.WARN);
|
logging.set_level(logging.WARN);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue