2026-02-20 08:16:43 -05:00
|
|
|
# Local Development
|
|
|
|
|
|
|
|
|
|
## Start Server
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
cd /home/jjm/code/chgrid/server
|
2026-03-08 20:51:50 -04:00
|
|
|
export CHGRID_AUTH_SECRET=dev-secret
|
|
|
|
|
export CHGRID_HOST_ORIGIN=http://localhost:5173
|
2026-02-28 03:52:05 -05:00
|
|
|
.venv/bin/python main.py --allow-insecure-ws
|
2026-02-20 08:16:43 -05:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Start Client
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
cd /home/jjm/code/chgrid/client
|
2026-02-24 22:14:23 -05:00
|
|
|
npm run dev
|
2026-02-20 08:16:43 -05:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Open: `http://localhost:5173`
|
|
|
|
|
|
2026-02-24 22:14:23 -05:00
|
|
|
Defaults:
|
|
|
|
|
- Server reads `config.toml` automatically when present.
|
|
|
|
|
- Server default bind/port is `127.0.0.1:8765`.
|
2026-02-28 03:52:05 -05:00
|
|
|
- Server defaults to TLS-required unless you set `network.allow_insecure_ws=true` or pass `--allow-insecure-ws` for local/dev.
|
2026-02-24 22:14:23 -05:00
|
|
|
- Client dev default is `localhost:5173`.
|
|
|
|
|
- Auth requires `CHGRID_AUTH_SECRET` in environment.
|
2026-03-08 20:51:50 -04:00
|
|
|
- Browser-origin enforcement requires `CHGRID_HOST_ORIGIN` in environment.
|
2026-02-28 04:29:57 -05:00
|
|
|
- Saved login uses server-managed `HttpOnly` cookie (`chgrid_session_token`) via `GET /auth/session/set` and `GET /auth/session/clear` (both require `X-Chgrid-Auth-Client: 1`).
|
2026-02-24 22:14:23 -05:00
|
|
|
|
2026-02-20 08:16:43 -05:00
|
|
|
## Quick Restarts
|
|
|
|
|
|
|
|
|
|
Server:
|
|
|
|
|
```bash
|
|
|
|
|
lsof -tiTCP:8765 -sTCP:LISTEN | xargs -r kill
|
|
|
|
|
cd /home/jjm/code/chgrid/server
|
2026-03-08 20:51:50 -04:00
|
|
|
CHGRID_AUTH_SECRET=dev-secret CHGRID_HOST_ORIGIN=http://localhost:5173 nohup .venv/bin/python main.py --allow-insecure-ws > /tmp/chgrid-server.log 2>&1 &
|
2026-02-20 08:16:43 -05:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Client:
|
|
|
|
|
```bash
|
|
|
|
|
lsof -tiTCP:5173 -sTCP:LISTEN | xargs -r kill
|
|
|
|
|
cd /home/jjm/code/chgrid/client
|
2026-02-24 22:14:23 -05:00
|
|
|
nohup npm run dev > /tmp/chgrid-client.log 2>&1 &
|
2026-02-20 08:16:43 -05:00
|
|
|
```
|