Files
urutau/CONTRIBUTING.md
T
Lucas RayanandClaude Opus 5.5 8546d14cef
CI / Format and vet (pull_request) Failing after 53s
CI / Dependency audit (pull_request) Successful in 33s
CI / Tests (Linux, race detector) (pull_request) Successful in 2m1s
CI / Docker images (build and smoke test) (pull_request) Failing after 47s
feat!: Urutau 2.0.0, ultralight probes and a single analysis hub
Each server runs an ultralight probe (scratch image, ~7 MiB RSS) that
tails the logs, ships raw lines to the hub over HTTPS with an on-disk
spool, and applies enforce decisions locally. The hub keeps one node per
probe (primary node = the 1.x data dir, unchanged), does all analysis and
serves the UI. Peer federation is removed. 'urutau import' brings 1.x
data dirs in with hash and count verification. UI: probes page, host
qualified incidents, IPs never wrap, egress heatmap labels, live and
replay globes no longer auto-rotate, replay repeat, live traffic metrics.

BREAKING CHANGE: URUTAU_PEERS, URUTAU_PEER_* and /api/v1/peer/* are gone;
log path variables move from the hub to the probe. See docs/migration-2.0.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 22:14:50 -03:00

39 lines
3.5 KiB
Markdown

# Contributing to Urutau
**English** · [Português](CONTRIBUTING.pt-BR.md)
Thanks for helping. Urutau is a lightweight threat intelligence panel for self-hosted servers: it reads logs, classifies hostile activity and scores IPs. It has two roles in one binary, the hub (`urutau serve`) and the probe (`urutau probe`). The most useful contributions right now are tests, log fixtures, new detection rules and documentation.
1. **Defensive use only.** Urutau reads logs on servers you own or administer. Do not add features that send traffic to the IPs it lists, scan third parties or hide what the tool does.
2. **Log content is hostile, and so is what a probe sends.** Every field that comes from a log (path, User-Agent, user name, host, jail) was written by an attacker. It must be length-limited when parsed, never executed or interpolated into a command, and escaped on output. A new parser comes with tests for malformed and oversized input. The probe stays tiny: it must not import the store, geolocation or intelligence packages (its memory target is under 20 MB), and anything the hub asks it to write must pass `wire.ValidCmdLine`.
3. **A classification change pins its category.** New or changed detection rules need a test that shows the expected category and, for a weight change, the resulting score.
4. **Standard library first.** The binary is static and dependency-free on purpose. Adding a module needs a clear reason, and `go.sum` then enters the image inputs.
5. **100% English codebase.** Source code, comments, scripts, workflows and commit messages are in English. The dashboard is bilingual (English and Portuguese in `internal/server/web/i18n.js`).
## Workflow
```bash
scripts/install-hooks.sh
scripts/check.sh
```
`check.sh` validates `gofmt`, `go vet`, UI translation coverage, shell script syntax, workflow YAML files and `docker compose config` (hub and probe) in seconds, skipping with a warning whatever the machine lacks. `scripts/check.sh --full` also runs `go test -race ./...` and `govulncheck`.
## Interface and translation
Both dictionaries in `internal/server/web/i18n.js` must have exactly the same keys, and visible text in the HTML needs a `data-i18n` attribute. When adding or changing visible text, run `node scripts/check-ui-i18n.mjs` and supply both languages.
## Documentation
Always maintain document pairs: every `*.md` and `docs/*` file has an English version and a Portuguese version (`*.pt-BR.md`, `docs/pt-BR/`). File names are translated only when the word changes (for example `architecture.md` and `arquitetura.md`). Do not use em dashes.
## Commits and releases
Commits follow Conventional Commits 1.0.0 in English (`feat:`, `fix:`, `chore:`, `ci:`, `docs:`, `refactor:`, `test:`, `perf:`, `build:`). Versions follow SemVer 2.0.0. Update the CHANGELOG in the same pull request as a user-visible change: add it under `[Unreleased]`, and at release time rename that section to the version and date and add the comparison link at the end of the file.
Releases are two multi-arch container images, the hub `urutau` and the probe `urutau-probe` (`linux/amd64` and `linux/arm64`, built from the same Dockerfile targets), published to the Gitea registry. Pushing a `v*` tag triggers the release workflow, which reuses the images already built for the same inputs when there are, and creates the Gitea release from the CHANGELOG section.
## License
By contributing, you agree to license your work under [MIT](LICENSE-MIT) **or** [Apache-2.0](LICENSE-APACHE), matching the rest of the project.