Remote: copy from the phone to this device's clipboard
CI / test (pull_request) Successful in 1m22s

- Web UI: Ctrl+C, Ctrl+X, Ctrl+Shift+C (Cmd+C on Mac) also put what they copied, text or PNG, on this device's clipboard; Copy, Copy Selection and Copy Clipboard buttons
- chandra-remote: GET /api/clipboard/data, with the same authorization as the upload
- Compositor: clipboard-get-fd has the clipboard's owner write into a pipe, refused while locked; input-copy presses Ctrl+Shift+C in terminals, Ctrl+C elsewhere
- Pending clipboard transfers keep the main loop awake

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
nandiandClaude Opus 5.5 committed 2026-11-30 18:26:53 -08:00
1 parent c5dbe028e6
commit 589d167f79
11 files changed
+552 -19

No files matched your search

+1
View File
@@ -75,6 +75,7 @@ Chandra includes KMS/libinput/compositor adaptations tailored for mainline Linux
- **VNC (RFB 3.8, port `5900`)** with Tight-JPEG (`libturbojpeg`), Zlib, Raw, dynamic rotation resize (`ExtendedDesktopSize`), clipboard sync, and 1:1 pointer/touch/keyboard input (tested for Android **AVNC**).
- **Mobile Web UI / PWA (HTTP + WebSocket, port `6080`)** with 1:1 touch gestures (tap, drag, long-press right-click, two-finger scroll/right-click), mouse right-click, optional trackpad mode, Android keyboard bridge, live rotation/brightness/OLED-off toggles, and adaptive JPEG streaming.
- **Paste (web UI):** `Ctrl+V`, `Ctrl+Shift+V`, `Shift+Insert` (`Cmd+V` on a Mac) put this device's clipboard, text or an image (up to 16 MB, sent as PNG), on the phone's and then press the same keys there. This works over plain HTTP. If something was copied on the phone since the page was last focused, that is pasted instead. The **Paste** button (`KB` bar) and **Paste Image…** (menu) do the same, with `Ctrl+Shift+V` for text in terminals. In the launcher and the password dialog the text is typed in. The browser uploads to `POST /api/clipboard`; the compositor gets the data as a memfd over the control socket (`clipboard-set-fd`, `input-paste`). VNC clients can send text only.
- **Copy (web UI):** `Ctrl+C`, `Ctrl+X`, `Ctrl+Shift+C` (`Cmd+C` on a Mac) go to the phone as ever, and what they copied there, text or a PNG image (up to 16 MB), is put on this device's clipboard too. The **Copy** button (`KB` bar; **Copy Selection** in the menu) presses them, with `Ctrl+Shift+C` in terminals, where `Ctrl+C` interrupts. **Copy Clipboard** (menu) takes what is already on the phone's clipboard. Text works over plain HTTP; images need the HTTPS address. When the browser wants a fresh tap first, the page asks for one. The browser reads `GET /api/clipboard/data`; the compositor has the clipboard's owner write it into a pipe sent over the control socket (`clipboard-get-fd`, `input-copy`), and refuses while the session is locked. Nothing is sent to VNC clients.
- `https://chandra-6t.tail.site.latha.org/` serves the web UI over HTTPS, tailnet only, from the `chandra-remote` chart in `nandi/cluster` (Caddy on the phone node, proxying to loopback `6080`).
- By default (`~/.config/chandra/remote.conf`), `bind=tailscale`, `bind_loopback=1`, and `auth=none`, binding strictly to the Tailscale `100.64.0.0/10` interface + `127.0.0.1` so any device on the same Tailscale tailnet can connect directly with zero password prompt (`http://<tailscale-dns>:6080/` or `<tailscale-dns>:5900`), even while the handset's physical OLED screen is turned off (`chandra-ctl screen off`). Run `chandra-remote status` to inspect endpoints or `chandra-remote passwd [PASS|--none]` to configure optional password auth.