docs(readme): document local outbox, delivery UI, wallet no-spend, Android stack
README still claimed "peer down → send fails / no outbox" after the local chat outbox, TUI/Android delivery markers, SDK SendState/outbox rows, view-only wallet switch, zeroize, Keystore-wrapped passphrase, and foreground keep-alive all landed on main. Align the operator-facing summary with PROTOCOL.md / THREAT_MODEL.md / TUI.md / WALLET.md: - intro + first-run: local outbox for chat, fail-closed for fil/rcp - replace Fail closed section with Local outbox (chat) and fail closed - Monero: prefer view-only + ONIONWIRE_WALLET_NO_SPEND - seized laptop: zeroize + pending outbox rows in the same store - Android: SendState/outbox rows, delivery UI, FGS keep-alive, Keystore; android-release is dispatch-only - Not in v1: ban is server-side outbox only
This commit is contained in:
parent
a8aa3098c7
commit
e979203c20
1 changed files with 47 additions and 14 deletions
61
README.md
61
README.md
|
|
@ -3,7 +3,7 @@
|
|||
Lean Tor messenger: one Rust process (ratatui + Noise IK + sqlite + in-process Arti).
|
||||
No hosted server. Identity is a public key; the onion is only a locator.
|
||||
|
||||
**v0.2** — Linux TUI. Two people add each other with an `onionwire:v1:…` invite string (`F2` share / `F3` paste). There is no QR graphic. Chat is Noise IK over your own v3 onion. Optional Monero invoices if you point at a local `monero-wallet-rpc`. Fail closed: peer down → send fails. Arti onion services are still experimental. The whole store is encrypted at rest with SQLCipher; message bodies add a row-bound AEAD layer on top.
|
||||
**v0.2** — Linux TUI + Android SDK/APK. Two people add each other with an `onionwire:v1:…` invite string (`F2` share / `F3` paste). There is no QR graphic. Chat is Noise IK over your own v3 onion. Unreachable chat peers go to a **local outbox** (device-only retry queue — no relay); file transfer and payment frames still fail closed. Optional Monero invoices if you point at a local `monero-wallet-rpc` (prefer a view-only wallet). Arti onion services are still experimental. The whole store is encrypted at rest with SQLCipher; message bodies add a row-bound AEAD layer on top.
|
||||
|
||||
You do **not** install a `tor` daemon, `torrc`, Prosody, or XMPP. OnionWire embeds Arti and publishes its own v3 onion.
|
||||
|
||||
|
|
@ -112,7 +112,7 @@ or `cargo run --release`.
|
|||
|
||||
On start you are prompted for a store passphrase (echo off, like other CLI passwords) or set `ONIONWIRE_STORE_PASSPHRASE`. Empty passphrase is rejected; a wrong passphrase does not open chat. Then you should see `onionwire: bootstrapping Arti…` on stderr. Directory bootstrap is usually under a minute; the onion is ready once a probe connect works (combined Arti status may still say Bootstrapping). Fail closed at 360s. Data lives in `ONIONWIRE_HOME` if set, otherwise `~/.local/share/onionwire/` (`onionwire.db` + Arti state, mode 0700). First open creates an ed25519 identity key. That key **is** you.
|
||||
|
||||
Then `F2` to share your invite, `F3` to paste a friend’s. Mouse-select the `onionwire:v1:…` line to copy. Highlight them in the roster, type in the composer, Enter to send. Footer shows `sending`, then `sent` or `send failed` — the TUI stays usable while Tor retries (up to 180s). Fail closed: if their onion is down, send fails — no outbox.
|
||||
Then `F2` to share your invite, `F3` to paste a friend’s. Mouse-select the `onionwire:v1:…` line to copy. Highlight them in the roster, type in the composer, Enter to send. Chat rows show delivery state from the local outbox (`✓` delivered, `◷ queued (try n/8, retry …)`, `» sending`, `✗ failed: …`); the footer shows `{n} queued` while anything is outstanding. If their onion is down the message stays on this device and the retry worker re-dials with backoff — nothing is handed to a third party. File transfer and payments are still one-shot (both sides online).
|
||||
|
||||
## Friends are keys
|
||||
|
||||
|
|
@ -154,9 +154,23 @@ Give that string to a friend. They `F3` paste it (`(o) paste invite`). Unknown `
|
|||
- Online friends get a signed `loc` frame.
|
||||
- Offline friends cannot find you until they F3-paste the new invite. There is no directory.
|
||||
|
||||
## Fail closed
|
||||
## Local outbox (chat) and fail closed
|
||||
|
||||
If a peer’s onion is down, send fails. v1 has no outbox, no retry queue, no DHT, no name server. There is still no hosted chat server.
|
||||
**Chat** to an unreachable onion is written to a local `outbox` row next to its
|
||||
`messages` row and retried in-process while the app runs (exponential backoff,
|
||||
cap 30 min between attempts, stop after 8 attempts or a terminal failure). There
|
||||
is **no** server-side queue and **no** store-and-forward relay — a queued message
|
||||
never leaves the device, and it dies with the device. Delivery markers in the
|
||||
TUI and the Android chat UI are the store's own statuses (`Queued` / `Sending` /
|
||||
`Sent` / `Failed`); see [docs/TUI.md](docs/TUI.md) and the threat-model notes on
|
||||
seizure and retry traffic analysis in [docs/THREAT_MODEL.md](docs/THREAT_MODEL.md).
|
||||
|
||||
Still **fail closed** (no queue, no retry):
|
||||
|
||||
- file transfer (`/file`) and payment frames (`rcp` / spend paths)
|
||||
- fingerprint mismatch vs the pinned key
|
||||
- Arti cannot publish the onion (no C-tor fallback)
|
||||
- no DHT, no name server, no hosted chat server
|
||||
|
||||
## File transfer
|
||||
|
||||
|
|
@ -164,7 +178,8 @@ If a peer’s onion is down, send fails. v1 has no outbox, no retry queue, no DH
|
|||
Cap 1 MiB on send and receive. Fail closed: a bad chunk or hash mismatch
|
||||
deletes the partial (never overwrite). Files land in
|
||||
`$ONIONWIRE_HOME/inbox/<fingerprint>/`. Chat shows `[file] name (N bytes)`,
|
||||
never raw frames. No outbox, no resume, no images in the TUI.
|
||||
never raw frames. File transfer is **not** covered by the chat outbox — no
|
||||
resume, no images in the TUI.
|
||||
|
||||
## Profile
|
||||
|
||||
|
|
@ -184,8 +199,14 @@ export ONIONWIRE_WALLET_RPC_LOGIN=onionwire:secret
|
|||
|
||||
Loopback only, HTTP Digest (RFC 2617, matching `--rpc-login`), 5s timeout, 1 MiB response cap. `.onion` RPC URLs are rejected (no Arti dial; do not point this at a remote wallet). Unset → chat still works; `/pay` and `/tip` say so. Do not log the RPC password.
|
||||
|
||||
**Prefer a view-only wallet.** OnionWire only needs invoices and receipt checks
|
||||
(`create_address` / `get_transfers`); it does not need spend authority. Set
|
||||
`ONIONWIRE_WALLET_NO_SPEND=1` (or `true` / `yes` / `on`) to refuse `/tip`
|
||||
locally before any RPC dial — `/pay` and receipt verification keep working.
|
||||
Details: [docs/WALLET.md](docs/WALLET.md).
|
||||
|
||||
- `/pay <xmr> [memo]` — invoice (we want to receive). Uses a wallet subaddress if RPC is up, else the profile `xmr_addr`.
|
||||
- `/tip <xmr> [memo]` — pay the selected friend’s profile address, then send a signed `rcp`. Incoming receipts stay unverified until RPC `get_transfers` matches.
|
||||
- `/tip <xmr> [memo]` — pay the selected friend’s profile address, then send a signed `rcp` (disabled under `ONIONWIRE_WALLET_NO_SPEND`). Incoming receipts stay unverified until RPC `get_transfers` matches.
|
||||
|
||||
## Backup / restore
|
||||
|
||||
|
|
@ -226,7 +247,7 @@ The whole sqlite file is SQLCipher (`rusqlite` feature `bundled-sqlcipher-vendor
|
|||
|
||||
Chat bodies carry a second, row-bound layer: ChaCha20-Poly1305 (`nonce || ciphertext` in `messages.plaintext`) with AAD `owmsg1 || friend_id_le64 || dir || 0x00 || row_id_le64`, plus a random 32-byte data key in `store_meta` wrapped with Argon2id from the same passphrase. Whole-file encryption does not stop someone who can write the file from moving one row's ciphertext into another row; the row-bound AAD does, and it stays. Empty-AAD v0.2 blobs are rewrapped once on unlock.
|
||||
|
||||
At-rest encryption is not a defense against a live compromise: while OnionWire runs, the passphrase, the db key and decrypted rows are in process memory, and SQLCipher's page cache holds decrypted pages. It also does not stop an attacker who has your passphrase. `/wipe` deletes chat and payments history; it is not a forensic erase — SSD wear-levelling can keep copies. Roster and identity stay. `/wipe-all` deletes the data dir (new identity). Ctrl-Q can clear history on the way out (`CLEAR`) without becoming a new person.
|
||||
At-rest encryption is not a defense against a live compromise: while OnionWire runs, the passphrase, the db key and decrypted rows are in process memory, and SQLCipher's page cache holds decrypted pages. Secret material (Noise/Ed25519/X25519 ephemerals, store key copies, TUI passphrase buffer) is zeroized with the `zeroize` crate when dropped; that shrinks the window, it does not close it. It also does not stop an attacker who has your passphrase. Pending outbox rows live in the same encrypted store as delivered chat — seizure *with* the passphrase can reveal messages that never left the device. `/wipe` deletes chat, payments and outbox history; it is not a forensic erase — SSD wear-levelling can keep copies. Roster and identity stay. `/wipe-all` deletes the data dir (new identity). Ctrl-Q can clear history on the way out (`CLEAR`) without becoming a new person.
|
||||
|
||||
Threat model: [`docs/THREAT_MODEL.md`](docs/THREAT_MODEL.md).
|
||||
|
||||
|
|
@ -237,19 +258,31 @@ peer and a Linux peer that exchange invites interoperate — one protocol, not t
|
|||
|
||||
- **SDK** — `onionwire-sdk-<version>.aar`. UniFFI Kotlin bindings over the same
|
||||
Rust crate the TUI runs on, plus `libonionwire_sdk.so` for `arm64-v8a`.
|
||||
Another Android app depends on it directly. See
|
||||
`Wire.send()` returns `SendState.Sent` | `SendState.Queued`; chat rows carry
|
||||
`delivery` and `id`; `Wire.outbox(pubkey)` exposes attempt count and next
|
||||
attempt time so the UI can render `queued (try n/8, retry 45s)` without
|
||||
inventing a countdown. Explicit Tor lifecycle bindings stop, flush, and report
|
||||
observable Tor state. Another Android app depends on the AAR directly. See
|
||||
[`crates/onionwire-sdk/README.md`](crates/onionwire-sdk/README.md).
|
||||
- **APK** — `onionwire-<version>-android-arm64-v8a.apk`. Kotlin + Jetpack
|
||||
Compose + Material 3 messenger that depends on the SDK and nothing else.
|
||||
Per-row delivery markers and a chat-level outbox footer match the TUI
|
||||
vocabulary. A foreground keep-alive service (ongoing notification) keeps the
|
||||
in-process Arti onion published and the outbox retry worker alive through
|
||||
Doze while the user wants the node reachable. The store passphrase can be
|
||||
remembered as an AES-256-GCM blob wrapped by the **Android Keystore**
|
||||
(StrongBox first, TEE/software fallback, labelled honestly).
|
||||
|
||||
It is not a WebView, and `src/tui.rs` is untouched. The APK build itself is
|
||||
amd64-only — the Pi runner is aarch64 Linux and cannot produce an APK.
|
||||
[`.forgejo/workflows/android-release.yml`](.forgejo/workflows/android-release.yml)
|
||||
builds on `docker-amd64`, then a second job on the Pi (`docker`) attaches the
|
||||
APK + AAR (+ `.sha256`) to the same Forgejo tag as the Linux binaries. If that
|
||||
tag's release already exists and is missing the APK, the workflow **joins** it
|
||||
instead of minting patch+1. Publish does not run from amd64 dind: `POST /releases`
|
||||
from that egress returns 422 with an empty body.
|
||||
is **dispatch-only** on this Forgejo (a CI-created tag does not wake it): after
|
||||
the Linux `release` workflow finishes, dispatch `android-release` with that tag
|
||||
so the amd64 job builds the APK/AAR and the Pi job attaches them (+ `.sha256`)
|
||||
to the same Forgejo release. If that tag's release already exists and is missing
|
||||
the APK, the workflow **joins** it instead of minting patch+1. Publish does not
|
||||
run from amd64 dind: `POST /releases` from that egress returns 422 with an empty
|
||||
body.
|
||||
|
||||
```bash
|
||||
# one-time: sdkmanager platform 36 / build-tools 36.0.0 / ndk 28.2.13676358,
|
||||
|
|
@ -331,7 +364,7 @@ Do not run `cargo publish`; `publish = false`. CI needs the repo secret
|
|||
|
||||
## Not in v1
|
||||
|
||||
Prosody, XMPP, s2s, MAM, carbons, outbox, multi-device, DHT / name server, QR codes, A/V. Protocol lock: [docs/PROTOCOL.md](docs/PROTOCOL.md).
|
||||
Prosody, XMPP, s2s, MAM, carbons, a **server-side** outbox / store-and-forward relay, multi-device, DHT / name server, QR codes, A/V. The **local** chat retry queue is in; it never leaves the device. Protocol lock: [docs/PROTOCOL.md](docs/PROTOCOL.md).
|
||||
|
||||
## License
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue