3 Commits

Author SHA1 Message Date
0xJacky
4c0802ed1d feat(demo): simulate the terminal in the browser
Demo mode used to downgrade the PTY to a restricted shell that still
executed real commands on the host. Replace that with a terminal that
never leaves the browser: a local command table drives xterm, and the
backend refuses /api/pty outright.

The refusal happens BEFORE the WebSocket upgrade. Once the connection is
hijacked no HTTP status can be written, so the old ordering would have
shown the browser nothing but an opaque close.

Two things fall out of doing this client-side rather than server-side.
Nothing can reach the host at all, and no WebSocket stays open — which
matters on Cloudflare Containers, where an in-flight request keeps the
container from ever going to sleep.

The frontend needs to know it is a demo before it has a session, so
GET /api/icp_settings now carries the flag; the authenticated settings
call only resolves after a view has mounted. The flag is cached in the
global store rather than the settings store, which is persisted to
localStorage and would carry a stale `true` into a real installation.

Input is walked per character so a multi-line paste runs each line, and
Enter is accepted as both \r and \n.

internal/pty/restricted_pipeline.go is now unreferenced but left in
place along with its test, pending a decision on removing both together.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-02 00:33:55 +08:00
0xJacky
2ca2a2c958 feat: add deployment package sources 2026-07-31 10:05:46 +08:00
Jacky
e326f5e930 feat(china): set icp number and public security number #780 2024-12-15 14:56:53 +08:00