[PR #158] Public IP package to work over HTTPs and DNS #633

Closed
opened 2025-11-20 04:25:31 -05:00 by saavagebueno · 0 comments
Owner

Original Pull Request: https://github.com/qdm12/ddns-updater/pull/158

State: closed
Merged: Yes


⚠️ Most added lines come from go.sum which you can ignore since I added the miekg/dns package, required to resolve Chaos records for Cloudflare

  • Base code for HTTP fetching of public IP address for IP4or6, IP4 and IP6
  • Base code for DNS fetching of public IP address for IP4or6, IP4 and IP6 (refers to #136)
  • Thread safety for all fetchers
  • Cycle between selected providers - sequentially in a ring
  • Cycle between selected fetch methods (dns, http) - at random
  • Add some unit tests
    • HTTP: full coverage
    • DNS
      • How to mock resolver???
      • Add unit tests for miekg/dns... or just trust in the integration test
      • Add moare unit tests although that's not really necessary
  • Add integration tests
    • HTTP
    • DNS
      • Google
      • Cloudflare; add support for Chaos records
  • Assign each IP method to the right IP version for http to avoid breaking changes and add comment to remove on next major version bump. Add an exported method to do so in the publicip/http package which returns what ipversions the provider supports No need, there are already separated IP_METHOD environment variables for each IP version
  • CSV IP methods providers for both HTTP and DNS
  • Document CSV providers behavior
  • Document cycling for HTTP fetcher is sequential and not random selection No one cares

Next PR

  • Add publicip protocol environment variable PUBLICIP_METHOD to select http, dns or both (indicate it will cycle between each at random uniformly distributed)
  • Change environment variables naming e.g. IP_METHOD -> PUBLICIP_HTTP_IP_PROVIDER while keeping retrocompatibility
  • Add environment variable PUBLICIP_DNS_IP_PROVIDER (valid for ip4or6, ip4 and ip6)

And in another PR

  • Put ipinfo package from gluetun in there to get country and other information on an IP address, with the option to have more providers. It won't be used for this program but should be part of the package.
**Original Pull Request:** https://github.com/qdm12/ddns-updater/pull/158 **State:** closed **Merged:** Yes --- ⚠️ Most added lines come from `go.sum` which you can ignore since I added the `miekg/dns` package, required to resolve Chaos records for Cloudflare - [x] Base code for HTTP fetching of public IP address for IP4or6, IP4 and IP6 - [x] Base code for DNS fetching of public IP address for IP4or6, IP4 and IP6 (refers to #136) - [x] Thread safety for all fetchers - [x] Cycle between selected providers - sequentially in a ring - [x] Cycle between selected fetch methods (dns, http) - at random - [x] Add some unit tests - [x] HTTP: full coverage - [x] DNS - [x] ~How to mock resolver???~ - [x] Add unit tests for miekg/dns... ~or just trust in the integration test~ - [x] Add moare unit tests although that's not really necessary - [x] Add integration tests - [x] HTTP - [x] DNS - [x] Google - [x] Cloudflare; add support for Chaos records - [x] ~Assign each IP method to the right IP version for http to avoid breaking changes and add comment to remove on next major version bump. **Add an exported method to do so in the publicip/http package which returns what ipversions the provider supports**~ No need, there are already separated `IP_METHOD` environment variables for each IP version - [x] CSV IP methods providers for both HTTP and DNS - [x] Document CSV providers behavior - [x] ~Document cycling for HTTP fetcher is sequential and not random selection~ No one cares ## Next PR - Add publicip protocol environment variable `PUBLICIP_METHOD` to select `http`, `dns` or both (indicate it will cycle between each at random uniformly distributed) - Change environment variables naming e.g. `IP_METHOD` -> `PUBLICIP_HTTP_IP_PROVIDER` while keeping retrocompatibility - Add environment variable `PUBLICIP_DNS_IP_PROVIDER` (valid for ip4or6, ip4 and ip6) ### And in another PR - Put ipinfo package from gluetun in there to get country and other information on an IP address, with the option to have more providers. It won't be used for this program but should be part of the package.
saavagebueno added the pull-request label 2025-11-20 04:25:31 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ddns-updater#633