3 # This file contains global custom functions for your dehydrated hook scripts.
4 # Feel free to edit it, but do not delete predefined custom functions for
5 # handling dehydrated actions. They are referenced in hooks.sh.
7 custom_deploy_challenge() {
8 # This hook is called once for every domain that needs to be
9 # validated, including any alternative names you may have listed.
13 # The domain name (CN or subject alternative name) being
16 # The name of the file containing the token to be served for HTTP
17 # validation. Should be served by your web server as
18 # /.well-known/acme-challenge/${TOKEN_FILENAME}.
20 # The token value that needs to be served for validation. For DNS
21 # validation, this is what you want to put in the _acme-challenge
22 # TXT record. For HTTP validation it is the value that is expected
23 # be found in the $TOKEN_FILENAME file.
24 local DOMAIN="${1}" TOKEN_FILENAME="${2}" TOKEN_VALUE="${3}"
27 custom_clean_challenge() {
28 # This hook is called after attempting to validate each domain,
29 # whether or not validation was successful. Here you can delete
30 # files or DNS records that are no longer needed.
32 # The parameters are the same as for deploy_challenge.
33 local DOMAIN="${1}" TOKEN_FILENAME="${2}" TOKEN_VALUE="${3}"
36 custom_deploy_cert() {
37 local DOMAIN="${1}" KEYFILE="${2}" CERTFILE="${3}" FULLCHAINFILE="${4}" CHAINFILE="${5}" TIMESTAMP="${6}"
38 # This hook is called once for each certificate that has been
39 # produced. Here you might, for instance, copy your new certificates
40 # to service-specific locations and reload the service.
44 # The primary domain name, i.e. the certificate common
47 # The path of the file containing the private key.
49 # The path of the file containing the signed certificate.
51 # The path of the file containing the full certificate chain.
53 # The path of the file containing the intermediate certificate(s).
55 # Timestamp when the specified certificate was created.
56 local DOMAIN="${1}" KEYFILE="${2}" CERTFILE="${3}" FULLCHAINFILE="${4}" CHAINFILE="${5}" TIMESTAMP="${6}"
59 custom_unchanged_cert() {
60 # This hook is called once for each certificate that is still
61 # valid and therefore wasn't reissued.
65 # The primary domain name, i.e. the certificate common
68 # The path of the file containing the private key.
70 # The path of the file containing the signed certificate.
72 # The path of the file containing the full certificate chain.
74 # The path of the file containing the intermediate certificate(s).
75 local DOMAIN="${1}" KEYFILE="${2}" CERTFILE="${3}" FULLCHAINFILE="${4}" CHAINFILE="${5}"
78 custom_invalid_challenge() {
79 # This hook is called if the challenge response has failed, so domain
80 # owners can be aware and act accordingly.
84 # The primary domain name, i.e. the certificate common
87 # The response that the verification server returned
88 local DOMAIN="${1}" RESPONSE="${2}"
91 custom_request_failure() {
92 # This hook is called when an HTTP request fails (e.g., when the ACME
93 # server is busy, returns an error, etc). It will be called upon any
94 # response code that does not start with '2'. Useful to alert admins
95 # about problems with requests.
99 # The HTML status code that originated the error.
101 # The specified reason for the error.
103 # The kind of request that was made (GET, POST...)
104 local STATUSCODE="${1}" REASON="${2}" REQTYPE="${3}"
107 custom_startup_hook() {
108 # This hook is called before the cron command to do some initial tasks
109 # (e.g. starting a webserver).
114 # This hook is called at the end of the cron command and can be used to
115 # do some final (cleanup or other) tasks.