implement private masqr exemptions

This commit is contained in:
wearrrrr 2024-11-19 13:21:42 -06:00
parent 8ac7847122
commit 18540bf5c9
2 changed files with 10 additions and 1 deletions

3
.gitignore vendored
View file

@ -4,4 +4,5 @@ dist/
node_modules/
npm-debug.log*
.env
public/games/**
public/games/**
exempt_masqr.txt

View file

@ -14,10 +14,18 @@ import { server as wisp, logging } from "@mercuryworkshop/wisp-js/server";
import router from "./middleware/ProxyExt/index.js";
import { handler as astroSSR } from "./dist/server/entry.mjs";
import cookies from "cookie-parser";
import { existsSync, readFileSync } from "fs";
dotenv.config();
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 MASQR_ENABLED = process.env.MASQR_ENABLED;
logging.set_level(logging.WARN);