Browse Source

Update hook for new version of dehydrated

Document wildcard domains in the README

Issue #5
Issue #6
master
Chris Smith 4 years ago
parent
commit
a874513204
Signed by: Chris Smith <chris@chameth.com> GPG Key ID: 3A2D4BBDC4A3C9A9
2 changed files with 15 additions and 76 deletions
  1. 11
    1
      README.md
  2. 4
    75
      hook.sh

+ 11
- 1
README.md View File

@@ -1,7 +1,7 @@
1 1
 # Let's Encrypt Lexicon Service
2 2
 
3 3
 This container uses the awesome [Lexicon](https://github.com/AnalogJ/lexicon)
4
-library with [letsencrypt.sh](https://github.com/lukas2511/letsencrypt.sh) to
4
+library with [dehydrated](https://github.com/dehydrated-io/dehydrated/) to
5 5
 automatically obtain SSL certs from [Let's Encrypt](https://letsencrypt.org/).
6 6
 
7 7
 Multiple domains, as well as SANs, are supported. Certificates will be
@@ -38,6 +38,16 @@ admin.example.com
38 38
 This will request two certificates: one for example.com with a SAN of
39 39
 www.example.com, and a separate one for admin.example.com.
40 40
 
41
+To obtain a wildcard certificate you must alias the domain:
42
+
43
+```
44
+*.example.com > star_example_com
45
+```
46
+
47
+This will request the wildcard certificate and store it under
48
+`star_example_com`. For more information see
49
+[Dehydrated's docs](https://github.com/dehydrated-io/dehydrated/blob/master/docs/examples/domains.txt).
50
+
41 51
 The container uses inotify to monitor the domains.txt file for changes,
42 52
 so you can update it while the container is running and changes will be
43 53
 automatically applied.

+ 4
- 75
hook.sh View File

@@ -49,79 +49,8 @@ function clean_challenge {
49 49
     # The parameters are the same as for deploy_challenge.
50 50
 }
51 51
 
52
-function invalid_challenge() {
53
-    local DOMAIN="${1}" RESPONSE="${2}"
52
+HANDLER="$1"; shift
53
+if [[ "${HANDLER}" =~ ^(deploy_challenge|clean_challenge)$ ]]; then
54
+  "$HANDLER" "$@"
55
+fi
54 56
 
55
-    echo "invalid_challenge called: ${DOMAIN}, ${RESPONSE}"
56
-
57
-    # This hook is called if the challenge response has failed, so domain
58
-    # owners can be aware and act accordingly.
59
-    #
60
-    # Parameters:
61
-    # - DOMAIN
62
-    #   The primary domain name, i.e. the certificate common
63
-    #   name (CN).
64
-    # - RESPONSE
65
-    #   The response that the verification server returned
66
-}
67
-
68
-function deploy_cert {
69
-    local DOMAIN="${1}" KEYFILE="${2}" CERTFILE="${3}" FULLCHAINFILE="${4}" CHAINFILE="${5}"
70
-
71
-    echo "deploy_cert called: ${DOMAIN}, ${KEYFILE}, ${CERTFILE}, ${FULLCHAINFILE}, ${CHAINFILE}"
72
-
73
-    # This hook is called once for each certificate that has been
74
-    # produced. Here you might, for instance, copy your new certificates
75
-    # to service-specific locations and reload the service.
76
-    #
77
-    # Parameters:
78
-    # - DOMAIN
79
-    #   The primary domain name, i.e. the certificate common
80
-    #   name (CN).
81
-    # - KEYFILE
82
-    #   The path of the file containing the private key.
83
-    # - CERTFILE
84
-    #   The path of the file containing the signed certificate.
85
-    # - FULLCHAINFILE
86
-    #   The path of the file containing the full certificate chain.
87
-    # - CHAINFILE
88
-    #   The path of the file containing the intermediate certificate(s).
89
-}
90
-
91
-function unchanged_cert {
92
-    local DOMAIN="${1}" KEYFILE="${2}" CERTFILE="${3}" FULLCHAINFILE="${4}" CHAINFILE="${5}"
93
-
94
-    echo "unchanged_cert called: ${DOMAIN}, ${KEYFILE}, ${CERTFILE}, ${FULLCHAINFILE}, ${CHAINFILE}"
95
-
96
-    # This hook is called once for each certificate that is still
97
-    # valid and therefore wasn't reissued.
98
-    #
99
-    # Parameters:
100
-    # - DOMAIN
101
-    #   The primary domain name, i.e. the certificate common
102
-    #   name (CN).
103
-    # - KEYFILE
104
-    #   The path of the file containing the private key.
105
-    # - CERTFILE
106
-    #   The path of the file containing the signed certificate.
107
-    # - FULLCHAINFILE
108
-    #   The path of the file containing the full certificate chain.
109
-    # - CHAINFILE
110
-    #   The path of the file containing the intermediate certificate(s).
111
-}
112
-
113
-exit_hook() {
114
-  # This hook is called at the end of a dehydrated command and can be used
115
-  # to do some final (cleanup or other) tasks.
116
-
117
-  :
118
-}
119
-
120
-startup_hook() {
121
-  # This hook is called before the dehydrated command to do some initial tasks
122
-  # (e.g. starting a webserver).
123
-
124
-  :
125
-}
126
-
127
-HANDLER=$1; shift; $HANDLER "$@"

Loading…
Cancel
Save