Skip to content

Commit

Permalink
Merge pull request #10 from umlaeute/master
Browse files Browse the repository at this point in the history
renamed script according to the repository rename
  • Loading branch information
eferdman authored Jun 14, 2017
2 parents 8e57a1d + aa0c21b commit b6364e5
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 20 deletions.
2 changes: 1 addition & 1 deletion COPYING
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# dnspython-hook - dns-01 Challenge Hook Script for dehydrated.sh
# dehydrated-hook-ddns-tsig - dns-01 Challenge Hook Script for dehydrated
#
# This script uses the dnspython API to create and delete TXT records
# in order to prove ownership of a domain.
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# dnspython hook for dehydrated
# ddns-tsig hook for dehydrated

This repository contains a python hook for the `dehydrated.sh` project, a Let's Encrypt/ACME client implemented as a shell script. This hook uses the dnspython API to perform dynamic DNS updates and queries to verify. The DNS challenge is outlined in the [ACME protocol](https://letsencrypt.github.io/acme-spec/#rfc.section.7.4). To successfully complete this challenge, the client creates a temporary TXT record containing a secret token for the given domain name, thereby proving ownership of the domain.
This repository contains a python hook for the [dehydrated](https://github.com/lukas2511/dehydrated) project, a Let's Encrypt/ACME client implemented as a shell script. This hook uses the dnspython API to perform dynamic DNS updates and queries to verify. The DNS challenge is outlined in the [ACME protocol](https://letsencrypt.github.io/acme-spec/#rfc.section.7.4). To successfully complete this challenge, the client creates a temporary TXT record containing a secret token for the given domain name, thereby proving ownership of the domain.

## Required Python libraries
* [dnspython](http://www.dnspython.org/) - a DNS toolkit used for queries, zone transfers, and dynamic updates
Expand All @@ -11,16 +11,16 @@ Download the files for installation

``` sh
$ git clone https://github.com/lukas2511/dehydrated.git
$ mkdir -p dehydrated/hooks/dnspython
$ git clone https://github.com/eferdman/dnspython-hook.git dehydrated/hooks/dnspython
$ mkdir -p dehydrated/hooks/ddns-tsig
$ git clone https://github.com/eferdman/dehydrated-hook-ddns-tsig.git dehydrated/hooks/ddns-tsig
```

## Configuration
The script reads a configuration file as specified via the cmdline (using the `--config` flag),
falling back to these default config files:
- `$(pwd)/dnspython-hook.conf`
- `/etc/dehydrate/dnspython-hook.conf`
- `/usr/local/etc/dehydrate/dnspython-hook.conf`
- `$(pwd)/dehydrated-hook-ddns-tsig.conf`
- `/etc/dehydrate/dehydrated-hook-ddns-tsig.conf`
- `/usr/local/etc/dehydrate/dehydrated-hook-ddns-tsig.conf`

The configuration file uses a simple `INI`-style syntax,
where you can set the parameters for each domain separately (by creating a section named after the domain),
Expand All @@ -35,7 +35,7 @@ The following parameters can be set:
- `key_secret` the base64-encoded key secret (**required**, see [below](#using-an-extra-key-file))
- `key_algorithm` the hashing algorithm of the key (default: *hmac-md5*)

A complete example can be found in the `dnspython-hook.conf` file.
A complete example can be found in the `dehydrated-hook-ddns-tsig.conf` file.

### Using an extra key file
If you do not want to specify key name and key secret in the config file,
Expand All @@ -58,14 +58,14 @@ See the [dehydrated script](https://github.com/lukas2511/dehydrated) for more op

``` bash
$ cd dehydrated
$ ./dehydrated -c --challenge dns-01 --domain myblog.com --hook ./hooks/dnspython/dnspython-hook.py
$ ./dehydrated -c --challenge dns-01 --domain myblog.com --hook ./hooks/ddns-tsig/dehydrated-hook-ddns-tsig.py
```

Or to test the script directly:

``` bash
$ python dnspython-hook.py deploy_challenge yourdomain.com - "Hello World"
$ python dnspython-hook.py clean_challenge yourdomain.com - "Hello World"
$ python dehydrated-hook-ddns-tsig.py deploy_challenge yourdomain.com - "Hello World"
$ python dehydrated-hook-ddns-tsig.py clean_challenge yourdomain.com - "Hello World"
```

## Contribute
Expand Down
13 changes: 9 additions & 4 deletions dnspython-hook.conf → dehydrated-hook-ddns-tsig.conf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## configuration file for dehydrated's dnspython-hook
## configuration file for dehydrated's ddns-tsig hook
# location:
# - $(pwd)/dnspython-hook.conf
# - /etc/dehydrated/dnspython-hook.conf
# - /usr/local/etc/dehydrated/dnspython-hook.conf
# - $(pwd)/dehydrated-hook-ddns-tsig.conf
# - /etc/dehydrated/dehydrated-hook-ddns-tsig.conf
# - /usr/local/etc/dehydrated/dehydrated-hook-ddns-tsig.conf
# OR provided via the '--config' cmdline flag

[DEFAULT]
Expand All @@ -26,6 +26,11 @@ key_secret = "R3HI8P6BKw9ZwXwN3VZKuQ=="
## key-algorithm to use (bind9 only supports hmac-md5)
#key_algorithm = hmac-md5

## you can also call additional hook-scripts after each stage
## the configuration keys are 'post_<stagename>'
# the arguments (and stagenames) are as documented for 'dehydrated' hooks
#post_deploy_cert = /script/to/dehydrated_hooks/deploy_cert.sh

###################################################
# you can override values for a given domain
#[example.com]
Expand Down
8 changes: 4 additions & 4 deletions dnspython-hook.py → dehydrated-hook-ddns-tsig.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# dnspython-hook - dns-01 Challenge Hook Script for dehydrated.sh
# dehydrated-hook-ddns-tsig - dns-01 Challenge Hook Script for dehydrated
#
# This script uses the dnspython API to create and delete TXT records
# in order to prove ownership of a domain.
Expand Down Expand Up @@ -46,9 +46,9 @@
# the default configuration
defaults = {
"configfiles": [
"/etc/dehydrated/dnspython-hook.conf",
"/usr/local/etc/dehydrated/dnspython-hook.conf",
"dnspython-hook.conf", ],
"/etc/dehydrated/dehydrated-hook-ddns-tsig.conf",
"/usr/local/etc/dehydrated/dehydrated-hook-ddns-tsig.conf",
"dehydrated-hook-ddns-tsig.conf", ],
"name_server_ip": '10.0.0.1',
"ttl": 300,
"sleep": 5,
Expand Down

0 comments on commit b6364e5

Please sign in to comment.