Compare commits

..
Author SHA1 Message Date
gorkem-bwl dbccce445b fix(client): allow configurable Vite allowed hosts
Vite >=4.3 rejects requests with a Host header not in the allowlist,
which broke status-page submissions and dev-server access for users
serving Checkmate behind a reverse proxy after upgrading.

Adds VITE_ALLOWED_HOSTS env var (comma-separated list). When unset,
falls back to allowing all hosts so existing self-hosted deployments
keep working without changes.

Closes #3397
Closes #2951
2026-04-23 23:31:05 -04:00
2 changed files with 11 additions and 4 deletions

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "client",
"private": true,
"version": "3.6.1",
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
+10 -3
View File
@@ -3,19 +3,26 @@ import react from "@vitejs/plugin-react";
import svgr from "vite-plugin-svgr";
import path from "path";
import { fileURLToPath } from "url";
import { readFileSync } from "fs";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
export default defineConfig(({}) => {
const pkg = JSON.parse(readFileSync(path.resolve(__dirname, "package.json"), "utf-8"));
const version = pkg.version;
let version = "3.6.1";
const allowedHosts = process.env.VITE_ALLOWED_HOSTS
? process.env.VITE_ALLOWED_HOSTS.split(",").map((h) => h.trim())
: true;
return {
base: "/",
plugins: [svgr(), react()],
server: {
host: true,
allowedHosts,
},
preview: {
host: true,
allowedHosts,
},
resolve: {
alias: {