Skip to content

Development

Hora is a small Cargo workspace in Rust (edition 2024), MIT-licensed, at github.com/uplg/hora.

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.

Terminal window
git clone https://github.com/uplg/hora && cd hora
cp config.example.toml config.toml # then edit
cargo run -p hora

Building needs Rust 1.99.1 or later, a C toolchain and cmake, for aws-lc-rs (the rustls crypto provider).

just gate runs exactly what CI runs:

Terminal window
cargo fmt --all -- --check
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo deny check # licences, advisories, banned crates
cargo audit
cargo test --workspace --locked
python3 brand/src/tokens.py --check # design tokens in step with their source

just 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.

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.

The site is Starlight, in docs/, built with Bun and deployed to GitHub Pages by the Docs workflow:

Terminal window
cd docs
bun install --frozen-lockfile
bun run dev # http://localhost:4321/hora/
bun run build

The changelog page renders the repository’s CHANGELOG.md directly, so there is one file to edit.

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/.