Local-first SSH terminal console. This is the v0 PoC workspace.
node/— Python PhotonNode: local WebSocket server, SSH bridge, encrypted SQLite state.shell/— Vue 3 + Vite PWA.me_PhotonShell/— private documentation and protocol definitions (separate repo).
cd node
uv venv
uv pip install -e .
PHOTON_MASTER_PASSWORD=changeme uv run python -m photon.mainThe terminal prints a 6-digit pairing code and the WebSocket address.
In another shell:
cd shell
npm install
npm run gen:proto
npm run devThen open http://127.0.0.1:8080, enter the pairing code, and add a host.
| Variable | Default | Meaning |
|---|---|---|
PHOTON_MASTER_PASSWORD |
— | Master password used to derive the AES-256-GCM key for SQLite state. |
PHOTON_STATE_PATH |
node/data/state.db |
Encrypted SQLite state file. |
PHOTON_HOST |
127.0.0.1 |
WebSocket listen host. Set 0.0.0.0 only for trusted LAN tests. |
PHOTON_PORT |
17373 |
WebSocket listen port. |
PHOTON_ALLOWED_ORIGIN |
http://127.0.0.1:8080 |
Allowed Origin header. |
After changing contracts/photon.proto:
cd node && uv run python scripts/generate_proto.py
cd shell && npm run gen:protoGenerated files are not committed (see .gitignore).
Run the Node-side end-to-end test that pairs, handshakes, and creates/lists a host:
cd node
.venv/bin/python scripts/smoke_test.pyThe test uses a temporary state file and a temporary Node process.
- Node defaults to
127.0.0.1. UsePHOTON_HOST=0.0.0.0only in trusted LAN tests; a warning is printed. - The PWA dev server defaults to
127.0.0.1:8080to match Node's default allowed origin. - SSH passwords are only used for the live session and are never persisted in SQLite state.
- For slow networks, use a mainland China mirror for
npmanduv(already configured in~/.npmrcand~/.config/uv/uv.toml).