fix: resolve WebSocket failure and crypto.randomUUID crash on HTTP/LXC

- Replace crypto.randomUUID() with a polyfill (generateUUID) that falls
  back to crypto.getRandomValues or Math.random — fixes crash on HTTP
  non-secure contexts where randomUUID is unavailable
- Fix WebSocket URL hardcoding port 8000 — use window.location.host so
  connections go through Nginx proxy in Docker/LXC instead of bypassing it
- Add /api/v1/status/ws/ location block in nginx.conf with WebSocket
  upgrade headers (must precede /api/ to avoid missing Upgrade header)
This commit is contained in:
Pouzor
2026-03-18 00:16:42 +01:00
parent df3b7a8cb0
commit e5d7260696
6 changed files with 69 additions and 6 deletions
+2 -1
View File
@@ -10,6 +10,7 @@ import {
addEdge,
} from '@xyflow/react'
import type { NodeData, EdgeData } from '@/types'
import { generateUUID } from '@/utils/uuid'
type HistoryEntry = { nodes: Node<NodeData>[]; edges: Edge<EdgeData>[] }
@@ -108,7 +109,7 @@ export const useCanvasStore = create<CanvasState>((set) => ({
if (state.clipboard.length === 0) return state
const newNodes = state.clipboard.map((n) => ({
...n,
id: crypto.randomUUID(),
id: generateUUID(),
position: { x: n.position.x + 50, y: n.position.y + 50 },
selected: false,
parentId: undefined,