Skip to content

Commit

Permalink
Feat: PUBLICIP_DNS_TIMEOUT variable
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 committed Jun 29, 2021
1 parent d22dc41 commit fe00994
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ ENV \
PUBLICIPV4_HTTP_PROVIDERS=all \
PUBLICIPV6_HTTP_PROVIDERS=all \
PUBLICIP_DNS_PROVIDERS=all \
PUBLICIP_DNS_TIMEOUT=3s \
HTTP_TIMEOUT=10s \
DATADIR=/updater/data \

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ Note that:
| `PUBLICIPV4_HTTP_PROVIDERS` | `all` | Comma separated providers to obtain the public IPv4 address only. See the [Public IP section](#Public-IP) |
| `PUBLICIPV6_HTTP_PROVIDERS` | `all` | Comma separated providers to obtain the public IPv6 address only. See the [Public IP section](#Public-IP) |
| `PUBLICIP_DNS_PROVIDERS` | `all` | Comma separated providers to obtain the public IP address (IPv4 and/or IPv6). See the [Public IP section](#Public-IP) |
| `PUBLICIP_DNS_TIMEOUT` | `3s` | Public IP DNS query timeout |
| `UPDATE_COOLDOWN_PERIOD` | `5m` | Duration to cooldown between updates for each record. This is useful to avoid being rate limited or banned. |
| `HTTP_TIMEOUT` | `10s` | Timeout for all HTTP requests |
| `LISTENING_PORT` | `8000` | Internal TCP listening port for the web UI |
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ services:
- PUBLICIPV4_HTTP_PROVIDERS=all
- PUBLICIPV6_HTTP_PROVIDERS=all
- PUBLICIP_DNS_PROVIDERS=all
- PUBLICIP_DNS_TIMEOUT=3s
- HTTP_TIMEOUT=10s

# Web UI
Expand Down
7 changes: 7 additions & 0 deletions internal/config/pubip.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,14 @@ func (p *PubIP) get(env params.Env) (warnings []string, err error) {
if err != nil {
return warnings, err
}

dnsTimeout, err := env.Duration("PUBLICIP_DNS_TIMEOUT", params.Default("3s"))
if err != nil {
return warnings, err
}

p.DNSSettings.Options = []dns.Option{
dns.SetTimeout(dnsTimeout),
dns.SetProviders(dnsIPProviders[0], dnsIPProviders[1:]...),
}

Expand Down

0 comments on commit fe00994

Please sign in to comment.