Skip to content

remote: headless server, RedShell Remote and the desktop client - #3

Merged
ForeverInLaw merged 128 commits into
feat/ssh-hostsfrom
feat/remote
Dec 4, 2026
Merged

ForeverInLaw merged 128 commits into
feat/ssh-hostsfrom
feat/remote

Conversation

@ForeverInLaw

@ForeverInLaw ForeverInLaw commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Agents running in a desktop tab die with the desktop and can't be driven from a phone.

  • redshell-server: a headless server, light enough for a Raspberry Pi, that owns terminal and agent sessions. Claude Code permission requests are held through HTTP hooks and can be answered from any client. Sign-in is by password or passkey, with a passkey-only mode, desktop pairing by a typed code, re-authentication for sensitive changes, Web Push, an SSH hosts API, and the hardening from an independent security review.
  • RedShell Remote: the PWA the server serves. It has an inbox of sessions by what needs you, a mobile terminal with a key bar and composer, approval sheets with the command or diff, passkeys and notifications. It was reviewed against its visual contract, and its e2e test runs against a real server.
  • Desktop: servers under Settings → Servers, with their sessions in the sidebar and as tabs that detach on close, approval banners, and Send to Server for SSH hosts.
  • Packaging: the server is built with the PWA for Linux x86_64/aarch64 (as a .deb with a per-user systemd unit) and for macOS.

Design: docs/design/remote-server.md, docs/design/remote-pwa-visual.md. Usage: docs/REMOTE.md.

@codeant-ai

codeant-ai Bot commented Dec 4, 2026

Copy link
Copy Markdown

Skipping CodeAnt AI review — this PR changes more than 100 files, which usually means a migration, codemod, or vendored drop. Line-level review on diffs this large produces duplicate findings on the same rewrite pattern and drowns out anything that actually matters.

If you still want a review, comment @codeant-ai : review. For better signal, consider splitting the PR into smaller chunks.

@socket-security

socket-security Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

The PWA lives in web/: Vite 8, React 19, strict TypeScript, Tailwind v4
driven by the theme's CSS variables, and an ESLint flat config.
`npm run build` writes web/dist for the server to embed.

styles/tokens.css adds the PWA tokens of the visual contract on top of
crates/redshell-theme/themes/redshell.css: field borders, the solid
red, state, attention and diff colours, scrims, elevation and motion,
light and dark. JetBrains Mono is self-hosted (Latin, box drawing,
blocks and arrows, about 46 KB per weight) with its OFL licence, and an
external theme-init.js keeps the dark-first page from flashing light.
src/api/client.ts is the one place that lists what the PWA asks of
redshell-server, typed with the protocol generated into src/protocol/.
The calls of the next server phase (passkeys, passkey-only sign-in,
pairing, Web Push, SSH hosts) are kept apart in src/api/pending/.

Connection owns the single /api/ws socket: it subscribes to sessions
and events, multiplexes attached sessions over 2-byte binary channels,
reconnects with jittered exponential backoff (0.5 s up to 10 s), and
after every reconnect subscribes again and re-attaches each session for
a fresh snapshot. A close with 4001 stops the retries.

The mock backend (`?mock[=scenario]` or VITE_MOCK=1) speaks the same
REST and WebSocket protocol in the browser, so the real client runs
against it: live agents, approvals, shells that echo, and scenarios for
every state the screens have. It is a separate chunk, never precached.
Built from docs/design/remote-pwa-visual.md:

- the inbox, grouped into Needs you, Working and Recent, live over the
  WebSocket, with FLIP reordering, a reconnecting and an offline strip,
  long-press menus and attention banners from other sessions;
- the session view: xterm.js (WebGL, fit, web links, Unicode 11) in its
  own chunk, the composer and the key bar pinned to the visual viewport,
  a grid that the on-screen keyboard only clips (following the cursor),
  pinch to zoom, text selection, and Ended, Failed and gone states;
- the approval sheet for commands, diffs and other tools, with the
  "1 of N" queue, Always allow from Claude's suggestions, the 500 ms
  guard, answers from other devices, timeouts and send failures;
- sign-in (passkey first, autofill, rate limits), first-run setup,
  /pair, new session, SSH hosts and settings (passkeys, devices,
  notifications, password, passkey-only, appearance);
- the 900 px layout with the session list as a sidebar.

Session lists and approvals live in the TanStack Query cache, patched
from the WebSocket; UI state is in small Zustand stores. PTY bytes go
from the socket straight into xterm.js, never through React.
Two new hand-drawn sources next to the app icon: redshell-maskable.svg,
the tile's gradient full-bleed with the chevron and cursor at their
exact geometry (inside the maskable safe zone), and redshell-badge.svg,
the chevron and cursor alone in white with a 1.5x chevron stroke for
24dp notification badges.

`npm run icons` renders them with @vite-pwa/assets-generator into
public/: the any-purpose 64/192/512 icons, the maskable 512, the
apple-touch icon, the badge, the favicon, and light and dark portrait
splash screens for current iPhones, whose <link> tags it writes into
index.html.
Merge the duplicated SSH hosts paragraphs and the pre- and post-hardening
notes into one guide ordered from install to resource use. Add the .deb,
tarball and source installs, the per-user systemd unit, and RedShell
Remote on the phone. The proxy samples drop trusted_proxies, which the
server assumes for a TLS proxy on loopback, and the guide now says that a
restart or package upgrade ends every session.
Turn Unreleased into 0.0.3 with a lead paragraph and an upgrading note
(ssh.askpass on by default, hosts named after a ~/.ssh/config alias,
the new key order in config.toml). Fixes of features new in this release
fold into their Added entries, the server's hardening reads as what
ships, and the stray duplicated askpass line is gone.
Split the long SSH paragraph, rewrite the RedShell Remote paragraph as
connected prose, list Answer in terminal with the desktop's approval
buttons, move the update check back beside the desktop installers, and
refresh the project layout. The Russian summary mentions the SSH tools
and the server.
The [server] table now says what public_url does (pairing links, passkeys,
HSTS) and when loopback proxies are trusted, as REMOTE.md does.
Document ssh.ssh_config_path and tidy two merged paragraphs.
The server section predated passkeys, pairing, re-authentication, push,
the hosts API and the request guards. Pane ratios are saved with a tab's
layout now, and the terminal crate depends on the theme crate.
The askpass default, alias connections and key order move into Changed as
well as the upgrading note, which now says aliases need import_ssh_config.
The [server] section, the hosts API, trusted loopback proxies and the
pairing address check get their entries back.
Adding or removing a passkey, passkey-only on or off, approving a pairing
and signing out another browser or device answer reauth_required unless
the user re-authenticated in the last five minutes. The HTTP layer now
asks for that in one place: it opens "Confirm it's you" (a passkey, or
the password unless the account is passkey-only), and sends the change
once more when the user confirmed. Closing it counts as a cancel, which
the screens don't report as a failure. Adding a passkey asks first when
the last re-authentication has lapsed, before the ceremony starts.
@ForeverInLaw ForeverInLaw changed the title remote: headless server and the RedShell Remote PWA remote: headless server, RedShell Remote and the desktop client Dec 4, 2026
@ForeverInLaw
ForeverInLaw merged commit 3dd89d4 into feat/ssh-hosts Dec 4, 2026
17 checks passed
@ForeverInLaw
ForeverInLaw deleted the feat/remote branch December 4, 2026 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant