Contributing
How to contribute to HostWall: development setup, project layout and pull request rules.
Thanks for helping! Every contribution counts: code, docs, rules, test data, translations, answering questions, reporting bugs.
Please follow the Code of Conduct.
Before you start
- Small fix (typo, docs, a bug with a clear cause)? Open a pull request directly.
- New feature or a change to defaults? Open an issue or a discussion first, so we agree on the design before you spend time on it. Check the roadmap: it may already be planned for a phase.
- Security problem? Don't open an issue. See SECURITY.md.
Good first contributions
| Area | Examples |
|---|---|
| Rule packs | Exceptions for WordPress, Magento, Laravel, Nextcloud and other apps |
| Benchmark data | Clean requests from real apps (anonymised), attack samples |
| Docs | Install guides for your platform, fixing anything unclear |
| Translations | Dashboard languages (once the dashboard lands) |
| Code | Issues labelled good first issue |
Development setup
Requires Go 1.26 or newer. make is optional; every target is a plain go command.
git clone https://github.com/hostwall/hostwall.git
cd hostwall
make check # go vet + go test -race
make build # builds ./bin/hostwall
./bin/hostwall version| Command | What it does |
|---|---|
make build | Build the binary into ./bin |
make test | Run all tests with the race detector |
make vet | go vet |
make lint | golangci-lint (install it first) |
make vuln | govulncheck (install it first) |
make check | vet + tests, as CI does |
Project layout
cmd/hostwall/ the binary and CLI
internal/ packages (see internal/README.md)
internal/dashboard/web/ dashboard UI: plain JavaScript modules, no build step
docs/ roadmap details, architecture, features, launch plan
examples/ example configuration
packaging/ systemd unit
scripts/ install script (served at www.hostwall.io/install)The dashboard UI never uses innerHTML or inline scripts. Build elements with the h() helper in lib.js: it only creates text nodes and sets attributes, so request data from attackers can't run as code. The strict Content-Security-Policy enforces this too.
End-to-end check
The example config binds ports 80 and 443. For local testing, copy it and set http: "127.0.0.1:8080" and https: "off".
make build
./bin/hostwall run --config examples/hostwall.yaml --data ./tmp-data # prints a setup code
# open http://127.0.0.1:9443 (or https:// with the self-signed certificate)Pull request rules
- Never hurt real visitors. A change that adds false positives or noticeable latency is a bug, even if it catches more attacks. Include benchmark numbers for detection or performance changes.
- Secure defaults. New options default to the safe choice.
- Every feature is usable four ways: dashboard, YAML, API and CLI, and is documented.
- Tests. New code comes with tests; parsers and anything that reads request data also get fuzz tests.
- Keep dependencies few. Discuss new dependencies in the issue first.
- Add a line under Unreleased in CHANGELOG.md.
Maintainers aim to review every pull request within 48 hours.
License
By contributing, you agree that your contributions are licensed under the Apache-2.0 license.