Development¶
For working on rettui: where things are in the code, and how builds and releases are made. To build it yourself, see Installing.
Code layout¶
The protocol modules each sit on one of the submodules. The UI modules are split
by tab, and app/ and ui/ mirror each other. The web UI drives the same App
state as the TUI.
| Module | What it does | Built on |
|---|---|---|
net/ |
Network actor, on its own threads so heavy traffic can't hold up either UI: runtime, announces, paths and keys, commands and events | rsReticulum |
lxmf/ |
Sending, receiving and propagation node sync | rsLXMF |
nomad/ |
Page and file fetching, Micron parsing and layout, page cache, hosting a node and its pages | rsNomad |
rrc/ |
RRC wire format, hub replies, hub sessions | rsReticulum |
reticulum/ |
Reticulum config file: the options it has, editing it in place, and checking it | rsReticulum |
app/ |
Application state per tab (messages, channels, network, browser, node, reticulum), the page editor's formatting (format), notifications (notify) and input routing |
|
ui/ |
Drawing per tab, plus the sidebar, footer and prompt (chrome), the keys of each mode for the footer and the ? list (keys), and the text editors |
ratatui |
term/ |
Text input, the editors' text area, selection, clipboard, images (Kitty, Sixel, iTerm2 or half blocks), desktop notifications (desktop) |
ratatui-image, notify-rust |
web/ |
Web UI: HTTP API, login, live updates and notifications, and the page's HTML/CSS/JS, service worker, font and logo (web/assets) |
axum |
cli.rs has the shell commands (send, listen, sync, fetch), and
store.rs and config.rs hold what is saved to disk, and app/saver.rs
writes the store and chat history in the background.
Releases and CI¶
The workflows are in .github/workflows:
- CI (ci.yml) runs on every pull request:
- a formatting check: run
cargo fmtbefore committing (rustfmt.tomlhas rettui's style;cargo fmt --checksays what it would change); - Clippy, with warnings as errors;
- the tests on Linux, Windows and macOS.
- Build (build.yml) builds the binaries for every platform in the Installing table without making a release:
- Run it from Actions > Build > Run workflow (tick Linux only for just the Linux binaries).
- Download the archives from the run's Artifacts.
- They're named after the version and commit, for example
rettui-v1.2.0-a4e545b-x86_64-unknown-linux-gnu.tar.gz. - Release (release.yml) runs when a
tag starting with
vis pushed. Before tagging, add the release to CHANGELOG.md under a## v1.7.0heading (a prerelease,v1.7.0-rc.1, may have its own, or uses the release's). It: - checks the tag matches the version in
Cargo.toml, and thatCHANGELOG.mdhas its section; - builds every platform with the Build workflow;
- pushes the Docker image to
ghcr.io, using those Linux binaries (the Dockerfile'sprebuiltstage); - makes Debian packages of the Linux binaries
(
.github/scripts/package-deb.sh):rettui_1.7.0_amd64.debandrettui_1.7.0_arm64.deb; - for a release (not a prerelease), writes a Homebrew formula
(
rettui.rb, by.github/scripts/homebrew-formula.sh) and the AUR'srettui-binpackage (PKGBUILDand.SRCINFO, by.github/scripts/aur-pkgbuild.sh) from the checksums; - creates a GitHub release with the archives, the packages,
SHA256SUMS,rettui.rbandPKGBUILD, and the tag's section ofCHANGELOG.md(printed by.github/scripts/release-notes.sh v1.7.0) as its notes, with the Docker image's name; - for a release, publishes the formula to the Homebrew tap and the package to the AUR (see Homebrew and the AUR below).
A tag containing a hyphen (v1.3.0-rc.1) makes a prerelease. Its image
gets only the version tag, not latest.
- Branch image (docker-branch.yml)
runs on every push to a branch other than main. It builds the Linux
binaries and pushes an image tagged with the branch name: pushing to
dev gives ghcr.io/zevaryx/rettui:dev, and feature/x gives
:feature-x. A newer push to the same branch cancels an unfinished run.
- Wiki (wiki.yml)
copies wiki/ to this wiki when it changes on main or dev, or when
run from Actions > Wiki > Run workflow. Edit the pages in wiki/, not here: the
next publish replaces the wiki with them.
- Docs (docs.yml)
builds the documentation site from
wiki/ with Zensical, and publishes it to GitHub Pages from main. Pull
requests that change wiki/ only build it: a link to a page or heading
that doesn't exist, or a page left out of _Sidebar.md, fails the build.
python3 docs/build.py serve shows it locally (see
docs/README.md).
Both image workflows push through docker.yml.
To release, bump version in Cargo.toml, commit, then:
Homebrew and the AUR¶
The Release workflow's last job, Homebrew and AUR, publishes a release
(not a prerelease) to both, from the release's SHA256SUMS. Each half
runs once its secrets are set (Settings → Secrets and variables →
Actions), and is skipped with a notice until then. Running it again
(Re-run jobs) pushes nothing new, so it's safe to re-run after fixing a
secret.
- Homebrew: the tap is a GitHub repository named
homebrew-rettui(zevaryx/homebrew-rettui; another, asowner/name, in the repository variableHOMEBREW_TAP). The secretHOMEBREW_TAP_DEPLOY_KEYis the private half of an SSH key whose public half is the tap's deploy key, with write access (tap's Settings → Deploy keys). The job writes the formula toFormula/rettui.rb(.github/scripts/publish-homebrew.sh). Thenbrew install zevaryx/rettui/rettuiinstalls rettui, andbrew upgradethe next release. - AUR: the secret
AUR_SSH_PRIVATE_KEYis the private half of an SSH key whose public half is on the AUR account (My Account → SSH Public Key);AUR_USERNAMEandAUR_EMAILare the PKGBUILD's maintainer line and its commits' author, both public on the AUR. The job checks the AUR's host key against the fingerprint aur.archlinux.org publishes, writes.SRCINFOwithmakepkg(in an Arch Linux container), and pushes torettui-bin(.github/scripts/publish-aur.sh); the first push makes the package. Thenyay -S rettui-bin(or any AUR helper) installs it.
By hand, from any release's SHA256SUMS: homebrew-formula.sh and
aur-pkgbuild.sh write the formula and the package, and
publish-homebrew.sh and publish-aur.sh push them, as the job does.