Allow simulator deployment host

This commit is contained in:
masterdev
2026-06-17 01:13:30 +01:00
parent e3d8f856e3
commit c7c11d5060
3 changed files with 3 additions and 3 deletions

View File

@@ -182,7 +182,7 @@ VITE_API_BASE_URL=https://plasttrack.sable.ynsdev.site
VITE_WS_URL=wss://plasttrack.sable.ynsdev.site/ws/dashboard
VITE_ALLOWED_HOSTS=plasttrack.sable.ynsdev.site,localhost,127.0.0.1
SIMULATOR_API_BASE_URL=https://plasttrack.sable.ynsdev.site
SIMULATOR_ALLOWED_HOSTS=simulator.plasttrack.sable.ynsdev.site,localhost,127.0.0.1
SIMULATOR_ALLOWED_HOSTS=simplasttrack.sable.ynsdev.site,localhost,127.0.0.1
```
The main dashboard reverse proxy must route:

View File

@@ -77,7 +77,7 @@ services:
context: ./simulator-ui
environment:
VITE_API_BASE_URL: ${SIMULATOR_API_BASE_URL:-http://localhost:8000}
VITE_ALLOWED_HOSTS: ${SIMULATOR_ALLOWED_HOSTS:-localhost,127.0.0.1,simulator.plasttrack.sable.ynsdev.site}
VITE_ALLOWED_HOSTS: ${SIMULATOR_ALLOWED_HOSTS:-localhost,127.0.0.1,simplasttrack.sable.ynsdev.site}
depends_on:
- backend
ports:

View File

@@ -3,7 +3,7 @@ import react from "@vitejs/plugin-react-swc";
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), "");
const allowedHosts = (env.VITE_ALLOWED_HOSTS ?? "localhost,127.0.0.1")
const allowedHosts = (env.VITE_ALLOWED_HOSTS ?? "localhost,127.0.0.1,simplasttrack.sable.ynsdev.site")
.split(",")
.map((host) => host.trim())
.filter(Boolean);