Skip to content

Commit

Permalink
Switch to env based key checks for selfhosts
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkView committed Nov 25, 2024
1 parent 58e05c7 commit 7763ca5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 1 addition & 2 deletions src/connector/websocketIncoming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import logging from "../util/Logging";
import { readFileSync } from "fs";
import { createServer } from "https";
import { createServer as createInsecureServer } from "http";
import { ValidKeys } from "../util/ValidKeys";
import { DatabaseConnector, KeyValidity, ValidityReasons } from "./databaseConnector";
import { isCompatibleVersion } from "../util/CompatibleClients";
const Log = logging("WebsocketIncoming");
Expand Down Expand Up @@ -134,7 +133,7 @@ export class WebsocketIncoming {
private async isValidKey(key: string) : Promise<KeyValidity> {
if (process.env.REQUIRE_AUTH_KEY === "false") return { valid: true, reason: ValidityReasons.VALID };

if (ValidKeys.includes(key)) return { valid: true, reason: ValidityReasons.VALID };
if (process.env.AUTH_KEY === key) return { valid: true, reason: ValidityReasons.VALID };

let validity: KeyValidity = { valid: false, reason: ValidityReasons.INVALID };
if (process.env.USE_BACKEND === "true") {
Expand Down
1 change: 0 additions & 1 deletion src/util/ValidKeys.ts

This file was deleted.

0 comments on commit 7763ca5

Please sign in to comment.