Giter Club home page Giter Club logo

dehydrated-djbdns's Introduction

Hi there ๐Ÿ‘‹

I'm a freelance PHP developer and Linux system administrator based in Manchester, UK.

The majority of my repositories are small projects which I work on to solve problems that I've experienced, but you are welcome to use them, subject to the relevant LICENSE.

If you'd like to hire me to write code or manage systems, I can be found at: phpdev.uk

dehydrated-djbdns's People

Contributors

ehuggett avatar pwaring avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

ehuggett

dehydrated-djbdns's Issues

Move dnsutil module into separate repository

Although the dnsutil code is now in a separate file, it is still coupled to the hook script. It needs to be made fully generic, which includes:

  1. Removing any calls to print.
  2. Change verify_challenge so that it will verify an arbitrary TXT record (provided via a parameter).

The module should also include whatever configuration is necessary so that it can be installed using pip.

Move nameserver code into separate module

The code for checking whether a given TXT record (or indeed any record) exists on all the authoritative nameservers for a host is generic and not specific to djbdns. Splitting it off into a separate module would allow this functionality to be used in other hook scripts in the future, e.g. to support other DNS servers or providers.

Process all challenges in one go

At present the process is to fetch and verify each challenge sequentially. This works, but does result in delays whilst the script waits for DNS changes to make their way to all the nameservers for a domain (one delay per domain). A better solution for multiple domain requests would be to obtain all the challenges, upload them all to the nameservers and then verify them all. This would result in only one 'upload delay', regardless of the number of domains.

letsencrypt.sh can support this functionality, as outlined here:

dehydrated-io/dehydrated#168

So it is a matter of changing the logic in the hook script to process all the challenges to support this behaviour. It can safely be made the default too, as it will speed things up for all cases other than a single domain certificate (which will be unchanged).

Write DNS records to a file with separate hook script

Instead of printing records to the screen, offer the option to write them to a file and run a command via a hook script. This would allow the certificate request process to be fully automated. For example:

  1. Write record to zone file.
  2. rsync record to DNS provider.
  3. Check for authoritative nameserver responses (as currently).

Although this would not speed up the process, as the script would still have to wait for responses, it would allow users to start the script running and then move on to working on something else, instead of needing to keep going back to check for output.

Writing the DNS records to a file would also avoid copy & paste errors which can occur in the current process.

Ideally the script would also remove the DNS entries afterwards, as they are not required after the certificate has been issued.

Argparse and challenges prefixed with "-"

Hi,

Thanks for sharing this. During testing I got an unexpected failure when letsencrypt.sh passed a challenge that contained a hyphen ("-") as the first character and argparse interpreted it as a named argument instead of a positional argument

usage: hook.py [-h] [action] [domain] [token] [challenge] [extra [extra ...]]
hook.py: error: unrecognized arguments: -{redacted by ehuggett}

The solution I stumbled across is to change the default prefix in argparse for options from "-" to anything else not used in the base64url (?) encoded challenge, I chose "@". Inelegant but does work so far

argparse.ArgumentParser(prefix_chars='@')

Move configuration options to separate file

At the moment, several configuration options are hardcoded into the hook script. These need to be moved to a configuration file, using the configparser module.

Configuration options required:

  • TunnelHost: Host to tunnel an rsync connection through (required for Bytemark's content DNS as uploads must originate from a Bytemark IP).
  • TunnelUsername: Username for the SSH tunnel.
  • RsyncUsername: Equivalent of RSYNC_USERNAME in the upload script.
  • RsyncPassword: Equivalent of RSYNC_PASSWORD in the upload script.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.