How weebdatahoarder/go-away works
go-away is a self-hosted abuse-detection and rule-enforcement proxy between a site and its clients/upstream. Requests enter its HTTP handler, are evaluated against configurable conditions and rules, and are passed, challenged, or otherwise actioned; challenge state lets later requests proceed after verification. The README also documents network-based matching, multiple challenge types, custom JavaScript/WASM challenges, and customizable challenge pages. The excerpts establish startup, request-data evaluation, state initialization, and challenge action behavior; some deeper routing and integrations are documented but not shown in source excerpts.
Main entry points: http.go HTTP request handler · main.go Server startup · policy.go Policy and rules · state.go Policy runtime state
Components 18
Proxy runtime
- Server startup
cmd/go-away/main.go - Listener and TLS
lib/settings/bind.go - HTTP request handler
lib/http.go - Runtime settings
lib/settings/settings.go
Policy evaluation
- Policy and rules
lib/policy/policy.go - CEL conditions
lib/conditions.go - Network matching
lib/policy/network.go - Rule actions
lib/action/challenge.go
Challenges
- Request and challenge state
lib/challenge/data.go - Challenge registration
lib/challenge/register.go - Browser challenges
lib/challenge - JavaScript WASM challenges
lib/challenge/wasm/registration.go - SHA-256 proof of work
embed/challenge/js-pow-sha256/runtime/runtime.go
State and presentation
- Challenge templates
lib/template.go - Policy runtime state
lib/state.go - Network prefix sources
lib/policy/network.go
Other components
- Incoming client
- Upstream site
Connections 19
- Incoming client → HTTP request handler: sends requests
- HTTP request handler → Request and challenge state: creates request data
lib/http.go - HTTP request handler → Request and challenge state: evaluates challenges
lib/http.go - Server startup → Policy runtime state: loads policy state
cmd/go-away/main.go - Server startup → Listener and TLS: opens listener
- Listener and TLS → HTTP request handler: serves handler
lib/settings/bind.go - Server startup → Runtime settings: loads settings
cmd/go-away/main.go - Policy and rules → HTTP request handler: selects requests
- Policy and rules → CEL conditions: defines conditions
- Policy and rules → Network matching: defines networks
lib/policy/network.go - Policy runtime state → Network matching: loads prefixes
lib/state.go - Policy runtime state → Challenge registration: creates challenges
lib/state.go - Rule actions → Challenge registration: selects challenges
lib/action/challenge.go - Rule actions → Browser challenges: issues challenges
lib/action/challenge.go - Challenge registration → JavaScript WASM challenges: registers WASM
- JavaScript WASM challenges → SHA-256 proof of work: runs challenge module
- Request and challenge state → Challenge templates: renders challenge page
- HTTP request handler → Upstream site: forwards permitted requests
- Network prefix sources → Network matching: provides prefixes
lib/policy/network.go