Compare commits
No commits in common. "experiment/chatgpt-sites" and "main" have entirely different histories.
experiment
...
main
@ -1,5 +0,0 @@
|
|||||||
VITE_AIRSHIP_API_BASE=https://game.arrowstack.dev
|
|
||||||
VITE_AIRSHIP_WS_BASE=wss://game.arrowstack.dev
|
|
||||||
VITE_KEYCLOAK_URL=https://auth.arrowstack.dev
|
|
||||||
VITE_KEYCLOAK_REALM=dev
|
|
||||||
VITE_KEYCLOAK_CLIENT_ID=airship-web
|
|
||||||
27
SITES.md
27
SITES.md
@ -1,27 +0,0 @@
|
|||||||
# ChatGPT Sites portability test
|
|
||||||
|
|
||||||
This branch keeps ChatGPT Sites at the presentation boundary only.
|
|
||||||
|
|
||||||
## Ownership boundary
|
|
||||||
|
|
||||||
- Sites: built Phaser/Vite frontend and static assets.
|
|
||||||
- Arrowstack: Keycloak identity, API, authoritative multiplayer simulation, PostgreSQL state, and WebSocket transport.
|
|
||||||
|
|
||||||
The browser defaults still point to:
|
|
||||||
|
|
||||||
- API: https://game.arrowstack.dev
|
|
||||||
- WebSocket: wss://game.arrowstack.dev
|
|
||||||
- Identity: https://auth.arrowstack.dev, realm `dev`, client `airship-web`
|
|
||||||
|
|
||||||
They can be overridden with the Vite variables in `.env.example`.
|
|
||||||
|
|
||||||
## First deployment
|
|
||||||
|
|
||||||
Ask Sites to build this existing Vite project without moving the Go server or game state into Sites.
|
|
||||||
|
|
||||||
Once Sites returns its production origin, add that exact HTTPS origin to:
|
|
||||||
|
|
||||||
1. the Airship Go server `ALLOWED_ORIGINS` value, and
|
|
||||||
2. the Keycloak `airship-web` client's redirect URIs and web origins.
|
|
||||||
|
|
||||||
Until those origin allow-lists are updated, the game should still render and remain usable in solo mode; authenticated multiplayer is expected to fail closed.
|
|
||||||
@ -1,12 +1,11 @@
|
|||||||
import Keycloak from 'keycloak-js';
|
import Keycloak from 'keycloak-js';
|
||||||
|
|
||||||
const env = import.meta.env || {};
|
const API_BASE = 'https://game.arrowstack.dev';
|
||||||
const API_BASE = env.VITE_AIRSHIP_API_BASE || 'https://game.arrowstack.dev';
|
const WS_BASE = 'wss://game.arrowstack.dev';
|
||||||
const WS_BASE = env.VITE_AIRSHIP_WS_BASE || 'wss://game.arrowstack.dev';
|
|
||||||
const KEYCLOAK_CONFIG = {
|
const KEYCLOAK_CONFIG = {
|
||||||
url: env.VITE_KEYCLOAK_URL || 'https://auth.arrowstack.dev',
|
url: 'https://auth.arrowstack.dev',
|
||||||
realm: env.VITE_KEYCLOAK_REALM || 'dev',
|
realm: 'dev',
|
||||||
clientId: env.VITE_KEYCLOAK_CLIENT_ID || 'airship-web',
|
clientId: 'airship-web',
|
||||||
};
|
};
|
||||||
|
|
||||||
const clamp = (value, min, max) => Math.max(min, Math.min(max, value));
|
const clamp = (value, min, max) => Math.max(min, Math.min(max, value));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user