Skip to Content
HostWall

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

AreaExamples
Rule packsExceptions for WordPress, Magento, Laravel, Nextcloud and other apps
Benchmark dataClean requests from real apps (anonymised), attack samples
DocsInstall guides for your platform, fixing anything unclear
TranslationsDashboard languages (once the dashboard lands)
CodeIssues 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
CommandWhat it does
make buildBuild the binary into ./bin
make testRun all tests with the race detector
make vetgo vet
make lintgolangci-lint (install it first)
make vulngovulncheck (install it first)
make checkvet + 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

  1. 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.
  2. Secure defaults. New options default to the safe choice.
  3. Every feature is usable four ways: dashboard, YAML, API and CLI, and is documented.
  4. Tests. New code comes with tests; parsers and anything that reads request data also get fuzz tests.
  5. Keep dependencies few. Discuss new dependencies in the issue first.
  6. 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.

Edit this page on GitHub

On this page