Skip to content

Make the time spend waiting for things to settle down configurable #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ Optionally, you can specify the DNS servers to be used for propagation checking
$ export CF_DNS_SERVERS='8.8.8.8 8.8.4.4'
```

If you experience problems with DNS propagation, increasing the time (in seconds) this hooks waits for things to settle down after setting the DNS records, may help. The default is 10.

```
$ export CF_SETTLE_TIME='30'
```

If you want more information about what is going on while the hook is running:

```
Expand Down
7 changes: 4 additions & 3 deletions hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,13 @@ def invalid_challenge(args):


def create_all_txt_records(args):
settle_time = int(os.environ.get('CF_SETTLE_TIME', '10'))
X = 3
for i in range(0, len(args), X):
create_txt_record(args[i:i+X])
# give it 10 seconds to settle down and avoid nxdomain caching
logger.info(" + Settling down for 10s...")
time.sleep(10)
# give it some time (default: 10 seconds) to settle down and avoid nxdomain caching
logger.info(" + Settling down for {}s...".format(settle_time))
time.sleep(settle_time)
for i in range(0, len(args), X):
domain, token = args[i], args[i+2]
name = "{0}.{1}".format('_acme-challenge', domain)
Expand Down