deployment/cloud/: a bootstrap Dockerfile (Bun, git, oauth2-proxy v7.15.3) that clones the repo and runs deployment/cloud/entry.sh from it, so the recipe updates with git; the Vite overlay (host, allowed hosts, HMR over wss); and the pull loop that follows the branch. With no OIDC env it serves Vite directly (laptop default unchanged). With OIDC_ISSUER set, oauth2-proxy owns the port and Vite listens on localhost behind it: Studio, maps and the HMR websocket all sit behind one sign-in, with PKCE S256, a confidential client and a REQUIRED group allow-list (it refuses to start without one). Secrets reach oauth2-proxy through its environment only. README gets a short 'Run it in the cloud' section linking the recipe.
22 lines
766 B
JavaScript
22 lines
766 B
JavaScript
// Overlay for the cloud dev server: the repo's own vite.config.js plus what a shared, public
|
|
// host needs. Every value comes from the environment (see deployment/cloud/README.md).
|
|
import base from '/app/repo/vite.config.js'
|
|
import { mergeConfig } from 'vite'
|
|
|
|
const env = process.env
|
|
export default async (e) => {
|
|
const b = typeof base === 'function' ? await base(e) : base
|
|
const hmr = env.HMR_CLIENT_PORT
|
|
? { clientPort: Number(env.HMR_CLIENT_PORT), protocol: env.HMR_PROTOCOL || 'wss' }
|
|
: undefined
|
|
return mergeConfig(b, {
|
|
cacheDir: '/tmp/vite-cache',
|
|
server: {
|
|
host: env.VITE_HOST || '0.0.0.0',
|
|
port: Number(env.VITE_PORT || 5173),
|
|
strictPort: true,
|
|
allowedHosts: true,
|
|
...(hmr ? { hmr } : {}),
|
|
},
|
|
})
|
|
}
|