Release / Plan (reuse the published image?) (push) Successful in 4s
CI / Docker image (build and smoke test) (push) Skipped
CI / Format and vet (push) Successful in 1m29s
CI / Tests (Linux, race detector) (push) Failing after 1m48s
CI / Dependency audit (push) Successful in 21s
Release / ci (push) Failing after 1m50s
Release / Build image (amd64) (push) Skipped
Release / Build image (arm64) (push) Skipped
Release / Publish tags (push) Skipped
Release / Gitea release (push) Skipped
Always-on Go service (stdlib only) that follows the Traefik JSON access log, the sshd log and the fail2ban log of a host, classifies attacks, scores sources, keeps bounded aggregates with snapshots, and serves an embedded dashboard with live updates, offline geolocation (DB-IP Lite), privacy-friendly traffic analytics, an exportable blocklist and token-authenticated federation between instances. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
39 lines
2.9 KiB
Markdown
39 lines
2.9 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. 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.** 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.
|
|
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` 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.
|
|
|
|
Releases are multi-arch container images (`linux/amd64` and `linux/arm64`) published to the Gitea registry. Pushing a `v*` tag triggers the release workflow, which reuses the image already built for the same inputs when there is one, 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.
|