docs: update README with file sharing and browser mode clarifications

Document the folder sharing, peer file browsing, and direct push (📎)
workflows added in the previous commit. Clarify that browser mode also
activates locally when config.js sets signalURL.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Fredrik Johansson
2026-06-25 20:31:54 +02:00
parent 91b7406d01
commit 068e7e6566

View File

@@ -53,7 +53,7 @@ npm run build
# Produces web/dist/
# Copy to VPS
rsync -az web/dist/ user@your-vps:/var/www/waste-web/
rsync -az web/dist/ user@your-vps:~/waste-www/
```
Create a `/var/www/waste-web/config.js` on the VPS (not in git — this is host-specific):
@@ -94,7 +94,7 @@ There are two ways to use the web UI.
### Browser mode (for anyone with just a URL)
When the web UI is served from a non-localhost origin it runs entirely in the browser — no daemon, no install. Crypto (Ed25519/X25519) runs via libsodium compiled to WebAssembly. The identity seed is stored in `localStorage` and persists across sessions.
When the web UI is served from a non-localhost origin — or locally with `config.js` setting `signalURL` it runs entirely in the browser. No daemon, no install. Crypto (Ed25519/X25519) runs via libsodium compiled to WebAssembly. The identity seed is stored in `localStorage` and persists across sessions.
A user visits your domain, enters their name and a network name, and joins. Invite links (`waste:…` or `?n=name&a=wss://…`) pre-fill the join form.
@@ -104,7 +104,27 @@ A user visits your domain, enters their name and a network name, and joins. Invi
`launch-web.sh` starts the Go daemon and the Vite dev server. The web UI connects to the local daemon over WebSocket IPC (`ws://127.0.0.1:17338`). The daemon handles all crypto and connects to the anchor.
When the web UI is loaded from `localhost`, it defaults to daemon mode. A "Switch to browser mode" button is available in the join screen if the daemon is not running.
When the web UI is loaded from `localhost` without a `config.js`, it defaults to daemon mode. A "Switch to browser mode" button is available in the join screen if the daemon is not running.
---
## File sharing (browser mode)
File transfer runs peer-to-peer over WebRTC DataChannels — files never touch the anchor or any server.
### Sharing a folder
In the sidebar under **Sharing**, click **+ Share folder** to pick a local directory. The selected files become available for peers to browse and download. You can re-click to change the folder at any time; the new set is immediately reflected for any peer that browses again.
### Browsing a peer's files
Hover over a peer in the sidebar to reveal action buttons. Click **⊞** to request their file list. A panel opens on the right showing their shared files with names and sizes. Click **↓** next to any file to download it directly from that peer.
### Sending a file directly
Hover over a peer and click **📎** to open a file picker. The selected file is pushed immediately to that peer — they don't need to be sharing anything. The recipient's browser auto-downloads the file on arrival.
> File transfer is currently browser mode only. In daemon mode, use `set_share_dir` via IPC and `get_file_list`/`send_file` commands (see IPC protocol below).
---