Repository navigation
Knocker v2.0.0
Knocker v2 hardens reverse-proxy authentication, improves FirewallD recovery, and adds an authenticated endpoint that tells clients whether they need to knock. The Docker image also ships with an updated Python runtime and locked dependencies.
Upgrading from v1
- Choose your image tag.
:latestmoves to v2 with this release. Pin:v1.0.0to stay on v1,:v2.0.0for this exact release, or:v2to follow the v2 series. - Check your config mount. The supplied Compose file now mounts
knocker.yamlat/app/knocker.yaml. If you use a custom mount, setKNOCKER_CONFIG_PATHto match. Keep your existing/datamount and run one Knocker process per whitelist file. - Review proxy trust and API keys. If you trusted an entire Docker subnet, switch to the reverse proxy's exact addresses and verify that it forwards the real client IP. Replace any placeholder, duplicate, or non-ASCII API keys before upgrading.
- Check custom clients and monitoring. Nonempty
/knockbodies must useapplication/json, andttlmust be a JSON integer. Clients should handle429rate limits. Use/readyto check whitelist storage and FirewallD protection./healthis the lightweight liveness probe.
Security fixes
- Tightened validation of forwarded client addresses. Ambiguous hosts and paths no longer match authorization exceptions. Use
security.excluded_paths_by_hostto scope public paths to specific domains. - Knocker now authenticates knocks before reading the body, caps request bodies at 4 KiB, and rate-limits attempts per client IP.
- Startup validates API key configuration more strictly and restricts whitelist JSON files to the working directory,
/data, or/tmp.
New features and reliability fixes
- Current IP status. Authenticated
GET /statusreports whether the caller's IP is dynamically whitelisted and when its access expires. It leaves the grant untouched. Route it alongside/knockso clients can check their status before they're whitelisted. - Faster whitelist checks and clearer failures.
/verifyreads from an in-memory index backed by the existing JSON file. A knock that needs a new entry now returns503when the whitelist is full. - More reliable FirewallD recovery. Knocker recognizes existing allowance rules even when FirewallD lists fields in a different order, restores missing timed rules using their saved expiration times, and rechecks readiness when the zone changes.
Runtime and dependencies
- Updated the Docker runtime to Python 3.15 and refreshed FastAPI, Uvicorn, Pydantic, and other dependencies. Builds use a uv lockfile and support AMD64, ARM64, and ARMv7.
- Expanded CI coverage for real Caddy authorization and IPv4/IPv6 FirewallD traffic, including rule expiry and recovery.