Development
Hora is a small Cargo workspace in Rust (edition 2024), MIT-licensed, at github.com/uplg/hora.
Architecture
Section titled “Architecture”| Crate | What it holds |
|---|---|
hora-notify |
The Notifier trait, the Event type, the dispatcher, and the ten channels (Telegram, Discord, Slack, Matrix, ntfy, Gotify, Pushover, email, Free Mobile, webhook). Add a channel by implementing the trait. |
hora-core |
Configuration and its validation, the probes, SQLite storage and migrations, certificate and domain checks, the per-monitor scheduler, alert grouping, the peer mesh, and the supervisor that owns the live config and reconciles monitor tasks on reload. |
hora-web |
The axum router, the view model, the pages (written with maud: markup as Rust functions, escaped by default), the JSON API and its OpenAPI document. |
hora |
The binary: it wires the rest together and holds the CLI subcommands. |
Migrations and templates are compiled into the binary, so a release is one file. The Docker image is a static musl build on Alpine.
Build and run
Section titled “Build and run”git clone https://github.com/uplg/hora && cd horacp config.example.toml config.toml # then editcargo run -p horaBuilding needs Rust 1.99.1 or later, a C toolchain and cmake, for
aws-lc-rs (the rustls crypto provider).
Quality gate
Section titled “Quality gate”just gate runs exactly what CI runs:
cargo fmt --all -- --checkcargo clippy --workspace --all-targets --locked -- -D warningscargo deny check # licences, advisories, banned cratescargo auditcargo test --workspace --lockedpython3 brand/src/tokens.py --check # design tokens in step with their sourcejust fix applies formatting and the machine-applicable lints. just deps
reports what is behind on every surface (crates, these docs, pinned Actions,
base images) without changing anything.
Changing a design token
Section titled “Changing a design token”Colours, fonts, the type scale, spacing and radii live once, in
brand/tokens.json. Edit that file, then run just tokens
(python3 brand/src/tokens.py, standard library only): it rewrites the marked
tokens:begin / tokens:end region of every copy, which are the stylesheet
(crates/hora-web/assets/hora.css), the brand gallery, this site’s theme
(docs/src/styles/custom.css, docs/src/code-themes.mjs) and the few Rust
constants (the heatmap’s tiers, theme-color). Never edit between the
markers: just tokens-check, part of the gate and of CI, fails with a diff
when a copy and the source disagree. Commit tokens.json and the regenerated
files together.
These docs
Section titled “These docs”The site is Starlight, in docs/, built
with Bun and deployed to GitHub Pages by the Docs workflow:
cd docsbun install --frozen-lockfilebun run dev # http://localhost:4321/hora/bun run buildThe changelog page renders the repository’s
CHANGELOG.md directly, so there is one file to edit.
Licences
Section titled “Licences”Hora is under the MIT licence.
The status page embeds the Cal Sans font,
under the SIL Open Font License (see
crates/hora-web/assets/OFL.txt).
This site also uses Fraunces, Borel Display and Mona Sans Mono, all under
the same licence; the licence files sit next to the fonts in
docs/public/fonts/.