Skip to content

pebble-challtestsrv: small binary for mock DNS & ACME challenges. - #181

Merged
cpu merged 7 commits into
masterfrom
cpu-pebble-challtestsrv
Dec 7, 2018
Merged

cpu merged 7 commits into
masterfrom
cpu-pebble-challtestsrv

Conversation

@cpu

@cpu cpu commented Dec 4, 2018 •

Copy link
Copy Markdown
Contributor

Boulder has a nice handy challtestsrv package and command used for integration tests. Its small and useful enough that the library portion has been promoted to a first-class repo: https://github.com/letsencrypt/challtestsrv

The stand-alone binary with an HTTP management interface can come live in the Pebble repo where more folks can use it without pulling in all of Boulder. I've heard from a few ACME client developers that this would be useful to them. It is possible we could achieve the same thing by leaving the binary in the Boulder repo using the updated code that doesn't import other things from Boulder. Moving it out of the repo will help us commit to working on abstractions that make tests cleaner. This also makes it quick and easy to have a full Pebble environment with mock DNS without needing to install tools from other repos.

The dependency on the letsencrypt/challtestsrv package does require pulling in a dep. on github.com/miekg/dns (and vendoring it) but I think its a fair tradeoff.

The provided Dockerfile is now split into two dockerfiles (see docker/ directory): one for pebble and one for pebble-challtestsrv. They are both updated to use Go 1.11, to build with the vendored modules instead of fetching them at build time, and to use the latest Alpine base image.

A new docker-compose.yml example is included that starts up a pebble-challtestsrv container and a pebble container that uses the former as its DNS server. The README is updated to explain the usage briefly.

Daniel added 2 commits December 4, 2018 16:41
Boulder has a nice handy challtestsrv package and command. Its small and
useful enough to live in the Pebble repo where more folks can use it
without pulling in all of Boulder's heavy deps.

The `challtestsrv` package is ported over with some improvements.
Notably:

* The TLS-ALPN-01 and HTTPS HTTP-01 features were split into two
separate binds. This helps us preserve strict TLS-ALPN-01 challenge
responses while also supporting HTTP-01 -> HTTPS HTTP-01 redirects.
* The "FAKE_DNS" env var is removed. Now there is a default IPv4 and
a default IPv6 address that can be set via the management API. These
default addresses are used for A/AAAA query responses when there is not
a more specific mock.
* Hardcoded Boulder specific mock DNS data is removed. In its place are
new management API functions for adding/removing mock A, AAAA, and CAA
records
* Updated documentation for all of the above & TLS-ALPN-01 challenges.
* Less noisy output! The DNS server no longer prints a line per reply.

A new `pebble-challtestsrv` stand alone binary is added to expose the
`challtestsrv` package with a little HTTP API.

This does require pulling in a dep. on `github.com/miekg/dns` but
I think its a fair tradeoff (dns only has 2 small golang/x/ transitive
deps).
@cpu cpu self-assigned this Dec 4, 2018
@cpu

cpu commented Dec 4, 2018

Copy link
Copy Markdown
Contributor Author

I think I might extract the challtestsrv package to its own repo. Pebble can vendor that package to provide pebble-challtestsrv. I think this will be cleaner for both Pebble and Boulder.

@cpu

cpu commented Dec 5, 2018

Copy link
Copy Markdown
Contributor Author

Closing this for now while I pursue a first-class repo for the challtestsrv package (letsencrypt/challtestsrv#1)

I will re-open this when I can vendor that module into Pebble instead of putting the package in this repo.

@cpu cpu closed this Dec 5, 2018
@cpu cpu reopened this Dec 6, 2018
@cpu cpu changed the title pebble-challtestsrv: small binary/package for mock DNS & ACME challenges. pebble-challtestsrv: small binary for mock DNS & ACME challenges. Dec 6, 2018
@cpu

cpu commented Dec 6, 2018

Copy link
Copy Markdown
Contributor Author

I will re-open this when I can vendor that module into Pebble instead of putting the package in this repo.

This was done in 2e8f228

@cpu

cpu commented Dec 7, 2018

Copy link
Copy Markdown
Contributor Author

I updated the Docker support & documentation to make it really easy to stand up a pebble-challtestsrv
instance and a pebble instance that uses it for DNS. The PR description is updated as well.

@cpu
cpu merged commit 80ae435 into master Dec 7, 2018
@cpu
cpu deleted the cpu-pebble-challtestsrv branch December 7, 2018 22:42
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.

2 participants