nandi/frqpublic Fork 0
4aa71e7f6e1d802baf3c1f6098e5ed1c2d998a7b
Commits
Clone
git clone https://git.rickub.com/nandi/frq.git
git clone ssh://git@rickub.com/nandi/frq.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

README.md · 111 lines · 4.8 KBmarkdown Blame HistoryRaw
A freeq client in jolt, as glimmer components on Vidya 4719d6f nandi 20d ago1# frq
2
3A **[freeq](https://github.com/codegod100/freeq)** client written in
4**[jolt](https://github.com/jolt-lang/jolt)**, as
5[glimmer](https://github.com/jolt-lang/glimmer) components painted by
6**[Vidya](https://tangled.org/nandi.uk/vidya)**/egui.
7
8It is a proof of concept port of [sleek](../sleek), which is the same client in
9Rust against egui directly. The screens are sleek's — connect, chats, chat,
10discover, settings, under a tab bar — but each is hiccup over glimmer's widget
11tags rather than immediate-mode drawing code, and state lives in ratoms instead
12of an `AppState` struct.
13
14```
Sign in with Bluesky OAuth, through freeq's broker 2d4a377 nandi 20d ago15src/frq/atproto.jolt handle → DID → PDS → session, and the SASL payloads
16src/frq/oauth.jolt the broker flow: login URL, loopback capture, /session
Remember an OAuth sign-in across restarts 4aa71e7 nandi 20d ago17src/frq/store.jolt the saved sign-in, mode 600 in the config directory
Sign in with a Bluesky identity 5192124 nandi 20d ago18src/frq/irc.jolt IRC over TLS or TCP: parser, reader thread, SASL, PRIVMSG
A freeq client in jolt, as glimmer components on Vidya 4719d6f nandi 20d ago19src/frq/state.jolt the ratoms every screen reads, and `apply-msg!`
20src/frq/app.jolt the screens
21```
22
23## Running
24
25`libvidya` from Vidya's Rust/egui backend, then the app:
26
27```bash
28just lib
29just run
30```
31
32`just run` is `jolt -M:frq` with `LD_LIBRARY_PATH` pointed at the built
33library. It connects to `irc.freeq.at:6697` over TLS and joins `#test`. Untick
34TLS on the connect screen (or point it at `127.0.0.1`) for a local server's
35plain listener:
36
37```bash
38cargo run --release --bin freeq-server # in the freeq checkout
39```
40
Sign in with a Bluesky identity 5192124 nandi 20d ago41## Signing in
42
Sign in with Bluesky OAuth, through freeq's broker 2d4a377 nandi 20d ago43Three modes on the connect screen.
Sign in with a Bluesky identity 5192124 nandi 20d ago44
Sign in with Bluesky OAuth, through freeq's broker 2d4a377 nandi 20d ago45**Bluesky** (OAuth, the default way in) follows sleek's flow: frq binds a
46loopback port, puts it in `return_to`, and opens
47`auth.freeq.at/auth/login?handle=…`. The broker runs the OAuth dance with the
48PDS and redirects back to that port with the handoff in the URL *fragment*, so
49it never reaches a server as a query string. The page frq serves there has one
50job: POST the fragment back to itself. What comes back is a single-use SASL
51`web-token` and a durable `broker_token`; later connections mint a fresh token
52from the durable one at `/session` and skip the browser.
Sign in with a Bluesky identity 5192124 nandi 20d ago53
Remember an OAuth sign-in across restarts 4aa71e7 nandi 20d ago54The durable token is saved to `$XDG_CONFIG_HOME/frq/session.edn` (mode 600) so
55a restart resumes without one, along with the handle and nick it belongs to.
56The web-token beside it is single-use and deliberately not saved. A token the
57broker no longer honours is dropped — from disk and memory — and the browser
58flow runs once more, rather than failing the same way on every Connect.
59
Sign in with Bluesky OAuth, through freeq's broker 2d4a377 nandi 20d ago60**App password** signs in without a browser, straight to the user's own PDS:
61`resolveHandle` → DID → PDS from the DID document → `createSession`. The
62password goes to that PDS and nowhere else, is never written to disk, and is
63dropped once the session exists.
Sign in with a Bluesky identity 5192124 nandi 20d ago64
Sign in with Bluesky OAuth, through freeq's broker 2d4a377 nandi 20d ago65Either way freeq sees only a token. The SASL mechanism is
66`ATPROTO-CHALLENGE` in both cases — `method: "web-token"`, which the server
67resolves through its own token store, or `method: "pds-session"` with the
68server's nonce echoed back so the token cannot be replayed elsewhere.
69
70A refused sign-in is reported and the connection carries on as a guest.
Sign in with a Bluesky identity 5192124 nandi 20d ago71
A freeq client in jolt, as glimmer components on Vidya 4719d6f nandi 20d ago72## Android
73
74An APK with two shared libraries and no Java: `libvidya.so` (vidya's Rust/egui
75C ABI, which owns the event loop as the NativeActivity's own library) and
76`libjoltapp.so` (frq compiled to a Chez boot image). Both native halves come
77from the vidya checkout; only the boot image is frq's.
78
79```bash
80./android/build-apk.sh run # build, install, launch on a connected device
81./android/build-apk.sh log # logcat, filtered
82```
83
84Needs what vidya's Android build needs — SDK, NDK r29, and a cross-built Chez
85in `~/.cache/vidya-chez-android`.
86
87TLS does not work there: jolt reaches OpenSSL through the dynamic loader, and
88Android has no public `libssl` to load. The connect screen falls back to the
89plain `:6667` listener on its own, which is why the plain transport is the raw
90`socket`/`connect`/`send`/`recv` calls rather than jolt's `java.net.Socket`
91surface — that surface does not work on Android either, while the syscalls do.
92
93## What the PoC covers
94
95* TLS (`:6697`, via jolt.mvn-http's OpenSSL bindings) or plain TCP (`:6667`)
96* Guest connect (`NICK`/`USER`), `001` welcome, `PING`/`PONG` keepalive
97* Auto-joins `#test` on `irc.freeq.at`
98* Join channels, channel buffers with unread counts, send and receive `PRIVMSG`
99* Join/part notices, DMs bucketed under the sender's nick
100* Discover list, search over buffers, disconnect
101
102## Limits
103
104* **TLS and plain TCP only** — no WebSocket, no iroh. On Android, plain only.
Sign in with Bluesky OAuth, through freeq's broker 2d4a377 nandi 20d ago105* **No `did:key` signing, no credential gates, no E2EE.** Sign-in of either
106 kind needs TLS, so it is desktop-only — the Android build connects as a
107 guest.
Remember an OAuth sign-in across restarts 4aa71e7 nandi 20d ago108* **Only the broker token is persisted**, and only for OAuth. An app-password
109 sign-in is not remembered.
A freeq client in jolt, as glimmer components on Vidya 4719d6f nandi 20d ago110* **No scrollback trimming, avatars, reactions, threads, or calls.**
111* Message lists are keyed vboxes; glimmer-vidya has no `:listbox` yet.