Commit beb5e0ee450121587585aba6b43032e6879a48e0

Authored by root
1 parent b72fc4bb

init test

.gitignore 0 → 100644
  1 +*~
  2 +config.cfg
  3 +src/
  4 +certbot.log
0 5 \ No newline at end of file
... ...
README.md
1 1 # certbot-hook
2 2 certbot validation bash script hooks for updating a DNS server via http://docs.routing.net/api
  3 +
... ...
auth.sh 0 → 100755
  1 +#!/bin/bash
  2 +source config.cfg
  3 +
  4 +
  5 +GET=$(cat <<EOF
  6 +{
  7 + "authToken": "$token",
  8 + "limit": 1,
  9 + "page": 1,
  10 +
  11 +
  12 + "filter": {
  13 + "field": "RecordName",
  14 + "value": "$acme"
  15 + },
  16 +
  17 + "sort": {
  18 + "field": "zoneName",
  19 + "order": "asc"
  20 + }
  21 +}
  22 +EOF
  23 +)
  24 +
  25 +OLD=$(curl -d "$GET" -s 'https://partner.routing.net/api/dns/v1/json/zonesFind' | tac | sed -nE '/"'$acme'"/, /addDate/p ' | sed -n -e 's/"content":\(.*\),/\1/p')
  26 +
  27 +#echo $OLD
  28 +
  29 +DATA=$(cat <<EOF
  30 +{
  31 + "authToken": "$token",
  32 + "zoneConfig": {
  33 + "name": "$zone"
  34 + },
  35 + "recordsToAdd": [
  36 + {
  37 + "name": "$acme",
  38 + "type": "TXT",
  39 + "content": "\"hello22\"",
  40 + "ttl": 86000
  41 + }
  42 + ],
  43 + "recordsToDelete": [
  44 + {
  45 + "name": "$acme",
  46 + "type": "TXT",
  47 + "content": $OLD
  48 + }
  49 + ]
  50 +}
  51 +EOF
  52 +)
  53 +
  54 +
  55 +#curl -X POST https://partner.routing.net/api/dns/v1/json/zoneUpdate -d "$DATA"
  56 +
  57 +
... ...
default-config.cfg 0 → 100644
  1 +#rename this file to config.cfg
  2 +
  3 +token='write here your API Key from the DNS Webpage'
  4 +
  5 +zone='foo.bar.com'
  6 +acme='_acme-challenge.foo.bar.com'
... ...
renew.sh 0 → 100755
  1 +#!/bin/bash
  2 +certbot certonly --manual --manual-auth-hook ./auth.sh --preferred-challenges=dns --register-unsafely-without-email --agree-tos --manual-public-ip-logging-ok -d api.salamander-jewelry.net
  3 +
... ...