Skip to content

Release v2.0.0

Latest

Choose a tag to compare

@github-actions github-actions released this 20 Nov 14:18
· 7 commits to main since this release

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. :latest moves to v2 with this release. Pin :v1.0.0 to stay on v1, :v2.0.0 for this exact release, or :v2 to follow the v2 series.
  • Check your config mount. The supplied Compose file now mounts knocker.yaml at /app/knocker.yaml. If you use a custom mount, set KNOCKER_CONFIG_PATH to match. Keep your existing /data mount 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 /knock bodies must use application/json, and ttl must be a JSON integer. Clients should handle 429 rate limits. Use /ready to check whitelist storage and FirewallD protection. /health is 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_host to 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 /status reports whether the caller's IP is dynamically whitelisted and when its access expires. It leaves the grant untouched. Route it alongside /knock so clients can check their status before they're whitelisted.
  • Faster whitelist checks and clearer failures. /verify reads from an in-memory index backed by the existing JSON file. A knock that needs a new entry now returns 503 when 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.

Full changes since v1.0.0