Skip to content

feat(country): support static and dynamic country exit routing - #28

Merged
hapheus merged 1 commit into
mainfrom
feat/country-exit-nodes
Oct 18, 2026
Merged

hapheus merged 1 commit into
mainfrom
feat/country-exit-nodes

Conversation

@hapheus

@hapheus hapheus commented Oct 18, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #27

This PR introduces country-specific Tor exit node configuration, automated Docker Hub README synchronization, and complete documentation unification:

Features & Enhancements

  1. Static Startup Routing:
    • Supported via TORPROXY_COUNTRY (e.g. DE, AT, DE,AT) and TORPROXY_STRICT_NODES (0 / 1).
    • Integrated Debian tor-geoipdb package with GeoIPFile / GeoIPv6File paths in torrc.
    • Dynamic torrc rendering appends ExitNodes {cc1},{cc2} and StrictNodes 1|0 at startup.
  2. Dynamic Runtime Routing:
    • Change exit country on the fly via /reconnect or /connect without restarting the container:
      • Query parameters: POST /reconnect?country=DE (or legacy GET).
      • JSON payload: POST /reconnect with {"country": "DE,AT", "strict_nodes": true}.
      • Reset/clear country restriction: POST /reconnect?country=any or {"country": ""}.
    • Dynamically configures Tor Control Protocol (SETCONF ExitNodes=..., SETCONF StrictNodes=...).
  3. Observability & Diagnostics:
    • Dynamic country and strict_nodes state surfaced in /health, /diagnostics, and /metrics (torproxy_exit_country_info and torproxy_strict_nodes).
  4. Automated Docker Hub README Sync:
    • Updated .github/workflows/publish-dockerhub.yml to trigger peter-evans/dockerhub-description@v4 on both main pushes and `v* release tags.
  5. Documentation & Badges:
    • Added Docker pulls badge ([![Docker Pulls]...) to README.md.
    • Unified documentation across README.md, DOCKERHUB.md, docs/configuration.md, docs/compatibility.md, docs/api.md, and docs/releases.md.

Verification

  • 184 hermetic unit tests passing (100% pass rate).
  • 99% coverage on docker/api.py and 100% on docker/tor_control.py.
  • ruff check . and shellcheck passing with 0 errors.
  • Zero breaking changes guaranteed.

- Add TORPROXY_COUNTRY and TORPROXY_STRICT_NODES for static startup routing
- Bundle tor-geoipdb in container and configure GeoIP database paths
- Add dynamic country switching and strict_nodes support to /reconnect and /connect
- Expose exit_country and strict_nodes in /health, /diagnostics, and /metrics
- Automate Docker Hub DOCKERHUB.md sync on release tags in publish workflow
- Add Docker pulls badge to README.md and unify documentation
@hapheus
hapheus merged commit 8521385 into main Oct 18, 2026
3 checks passed
@hapheus
hapheus deleted the feat/country-exit-nodes branch October 18, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add country-specific exit node configuration and unify documentation

1 participant