You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

704 lines
21 KiB

5 years ago
4 years ago
  1. .\" Copyright (c) 2019-2020 Rodolphe Bréard <rodolphe@breard.tf>
  2. .\"
  3. .\" Copying and distribution of this file, with or without modification,
  4. .\" are permitted in any medium without royalty provided the copyright
  5. .\" notice and this notice are preserved. This file is offered as-is,
  6. .\" without any warranty.
  7. .Dd August 27, 2020
  8. .Dt ACMED.TOML 5
  9. .Os
  10. .Sh NAME
  11. .Nm acmed.toml
  12. .Nd ACMEd configuration file
  13. .Sh DESCRIPTION
  14. .Nm
  15. is the configuration file for
  16. .Xr acmed 8 .
  17. It is written in the
  18. .Em TOML
  19. format. The allowed elements are described below.
  20. .Bl -tag
  21. .It Ic include
  22. Array containing the path to configuration file to include. The path can be either relative or absolute. If relative, it is relative to the configuration file which included it.
  23. .Pp
  24. In case or overlapping global option definition, the one of the last included file will be used. For example, if a file
  25. .Em A
  26. includes files
  27. .Em B
  28. and
  29. .Em C
  30. and all three defines the same global option, the final value will be the one defined in file
  31. .Em C .
  32. .Pp
  33. Unix style globing is supported.
  34. .It Ic global
  35. Table containing the global configuration options.
  36. .Bl -tag
  37. .It Cm accounts_directory Ar string
  38. Specify the directory where the accounts private and public keys are stored.
  39. .It Cm certificates_directory Ar string
  40. Specify the directory where the certificates and their associated private keys are stored.
  41. .It Cm cert_file_mode Ar integer
  42. Specify the permissions to use for newly-created certificates files. See
  43. .Xr chmod 2
  44. for more details.
  45. .It Cm cert_file_user Ar username|user_id Ft string
  46. Specify the user who will own newly-created certificates files. See
  47. .Xr chown 2
  48. for more details.
  49. .It Cm cert_file_group Ar group_name|group_id Ft string
  50. Specify the group who will own newly-created certificates files. See
  51. .Xr chown 2
  52. for more details.
  53. .It Ic env Ar table
  54. Table of environment variables that will be accessible from hooks.
  55. .It Cm pk_file_mode Ar integer
  56. Specify the permissions to use for newly-created private-key files. See
  57. .Xr chmod 2
  58. for more details.
  59. .It Cm pk_file_user Ar username|user_id Ft string
  60. Specify the user who will own newly-created private-key files. See
  61. .Xr chown 2
  62. for more details.
  63. .It Cm pk_file_group Ar group_name|group_id Ft string
  64. Specify the group who will own newly-created private-key files. See
  65. .Xr chown 2
  66. for more details.
  67. .It Cm renew_delay Ar string
  68. Period of time between the certificate renewal and its expiration date. The format is described in the
  69. .Sx TIME PERIODS
  70. section. Default is 3w.
  71. .El
  72. .It Ic rate-limit
  73. Array of table where each element defines a HTTPS rate limit.
  74. .Bl -tag
  75. .It Cm name Ar string
  76. The name the rate limit is registered under. Must be unique.
  77. .It Cm number Ar integer
  78. Number of requests authorized withing the time period.
  79. .It Cm period Ar string
  80. Period of time during which a maximal number of requests is authorized. The format is described in the
  81. .Sx TIME PERIODS
  82. section.
  83. .El
  84. .It Ic endpoint
  85. Array of table where each element defines a Certificate Authority
  86. .Pq CA
  87. which may be used to request certificates.
  88. .Bl -tag
  89. .It Cm name Ar string
  90. The name the endpoint is registered under. Must be unique.
  91. .It Cm rate_limits Ar array
  92. Array containing the names of the HTTPS rate limits to apply.
  93. .It Cm tos_agreed Ar boolean
  94. Set whether or not the user agrees to the Terms Of Service
  95. .Pq TOS .
  96. .It Cm url Ar string
  97. The endpoint's directory URL.
  98. .It Cm renew_delay Ar string
  99. Period of time between the certificate renewal and its expiration date. The format is described in the
  100. .Sx TIME PERIODS
  101. section. Default is the value defined in the global section.
  102. .El
  103. .It Ic hook
  104. Array of table where each element defines a command that will be launched at a defined point. See section
  105. .Sx WRITING A HOOK
  106. for more details.
  107. .Bl -tag
  108. .It Cm allow_failure Ar boolean
  109. Defines if an error return value for this hook is allowed or not. If not allowed, a failure in this hook will fail the whole certificate request process. Default is false.
  110. .It Cm name Ar string
  111. The name the hook is registered under. Must be unique.
  112. .It Cm type Ar array
  113. Array of strings. Possible types are:
  114. .Bl -dash -compact
  115. .It
  116. challenge-http-01
  117. .It
  118. challenge-http-01-clean
  119. .It
  120. challenge-dns-01
  121. .It
  122. challenge-dns-01-clean
  123. .It
  124. challenge-tls-alpn-01
  125. .It
  126. challenge-tls-alpn-01-clean
  127. .It
  128. file-pre-create
  129. .It
  130. file-pre-edit
  131. .It
  132. file-post-create
  133. .It
  134. file-post-edit
  135. .It
  136. post-operation
  137. .El
  138. .It Ic cmd Ar string
  139. The name of the command that will be launched.
  140. .It Ic args Ar array
  141. Array of strings representing the command's arguments.
  142. .It Ic stdin Ar string
  143. Path to the file that will be written into the command's standard intput. Mutually exclusive with
  144. .Em stdin_str .
  145. .It Ic stdin_str Ar string
  146. String that will be written into the command's standard input. Mutually exclusive with
  147. .Em stdin .
  148. .It Ic stdout Ar string
  149. Path to the file where the command's standard output if written.
  150. .It Ic stderr Ar string
  151. Path to the file where the command's standard error output if written.
  152. .El
  153. .It Ic group
  154. Array of table allowing to group several hooks as one. A group is considered as new hook.
  155. .Bl -tag
  156. .It Cm name Ar string
  157. The name the group is registered under. This name is considered as a hook name. Must be unique.
  158. .It Cm hooks Ar array
  159. Array containing the names of the hooks that are grouped. The hooks are guaranteed to be called sequentially in the declaration order.
  160. .El
  161. .It Ic account
  162. Array of table representing an account on one or several endpoint.
  163. .Bl -tag
  164. .It Ic name Ar string
  165. The name the account is registered under. Must be unique.
  166. .It Ic email Ar string
  167. The email address used to contact the account's holder.
  168. .It Cm key_type Ar string
  169. Name of the asymmetric cryptography algorithm used to generate the key pair. Possible values are :
  170. .Bl -dash -compact
  171. .It
  172. rsa2048
  173. .It
  174. rsa4096
  175. .It
  176. ecdsa_p256
  177. .Aq default
  178. .It
  179. ecdsa_p384
  180. .El
  181. .It Cm signature_algorithm Ar string
  182. Name of the signature algorithm used to sign the messages sent to the endpoint as defined in
  183. .Em RFC 7518 .
  184. The default value is derived from the key type. Possible values are:
  185. .Bl -dash -compact
  186. .It
  187. RS256
  188. .It
  189. ES256
  190. .It
  191. ES384
  192. .El
  193. .El
  194. .It Ic certificate
  195. Array of table representing a certificate that will be requested to a CA.
  196. .Pp
  197. Note that certificates are identified by the first identifier in the list of identifiers. That means that if you reorder the identifiers so that a different identifier is at the first position, a new certificate with a new name will be issued.
  198. .Bl -tag
  199. .It Ic account Ar string
  200. Name of the account to use.
  201. .It Ic endpoint Ar string
  202. Name of the endpoint to use.
  203. .It Ic env Ar table
  204. Table of environment variables that will be accessible from hooks.
  205. .It Ic identifiers Ar array
  206. Array of tables listing the identifiers that should be included in the certificate along with the challenge to use for each one. The
  207. .Em dns
  208. and
  209. .Em ip
  210. fields are mutually exclusive.
  211. .Bl -tag
  212. .It Ic challenge Ar string
  213. The name of the challenge to use to prove the identifier's ownership. Possible values are:
  214. .Bl -dash -compact
  215. .It
  216. http-01
  217. .It
  218. dns-01
  219. .It
  220. tls-alpn-01
  221. .El
  222. .It Ic dns Ar string
  223. The domain name.
  224. .It Ic ip Ar string
  225. The IP address.
  226. .It Ic env Ar table
  227. Table of environment variables that will be accessible from hooks.
  228. .El
  229. .It Ic key_type Ar string
  230. Name of the asymmetric cryptography algorithm used to generate the certificate's key pair. Possible values are :
  231. .Bl -dash -compact
  232. .It
  233. rsa2048
  234. .Aq default
  235. .It
  236. rsa4096
  237. .It
  238. ecdsa_p256
  239. .It
  240. ecdsa_p384
  241. .El
  242. .It Ic csr_digest Ar string
  243. Name of the certificate's signing request digest algorithm. Possible values are :
  244. .Bl -dash -compact
  245. .It
  246. sha256
  247. .Aq default
  248. .It
  249. sha384
  250. .It
  251. sha512
  252. .El
  253. .It Ic kp_reuse Ar boolean
  254. Set whether or not the private key should be reused when renewing the certificate. Default is false.
  255. .It Ic directory Ar string
  256. Path to the directory where certificates and their associated private keys are stored.
  257. .It Ic hooks Ar array
  258. Names of hooks that will be called when requesting a new certificate. The hooks are guaranteed to be called sequentially in the declaration order.
  259. .It Cm renew_delay Ar string
  260. Period of time between the certificate renewal and its expiration date. The format is described in the
  261. .Sx TIME PERIODS
  262. section. Default is the value defined in the associated endpoint.
  263. .El
  264. .Sh WRITING A HOOK
  265. When requesting a certificate from a CA using ACME, there are three steps that are hard to automatize. The first one is solving challenges in order to prove the ownership of every identifier to be included: it requires to interact with the configuration of other services, hence depends on how the infrastructure works. The second one is restarting all the services that use a given certificate, for the same reason. The last one is archiving: although several default methods can be implemented, sometimes admins wants or are required to do it in a different way.
  266. .Pp
  267. In order to allow full automation of the three above steps without imposing arbitrary restrictions or methods,
  268. .Xr acmed 8
  269. uses hooks. Fundamentally, a hook is a command line template that will be called at a specific time of the process. Such an approach allows admins to use any executable script or program located on the machine to customize the process.
  270. .Pp
  271. For a given certificate, hooks are guaranteed to be called sequentially in the declaration order. It is therefore possible to have a hook that depends on another one. Nevertheless, several certificates may be renewed at the same time. Hence, hooks shall not use globing or any other action that may disrupt hooks called by a different certificate.
  272. .Pp
  273. A hook has a type that will influence both the moment it is called and the available template variables. It is possible to declare several types. In such a case, the hook will be invoked whenever one of its type request it. When called, the hook only have access to template variable for the current type. If a hook uses a template variable that does not exists for the current type it is invoked for, the variable is empty.
  274. .Pp
  275. When writing a hook, the values of
  276. .Em args ,
  277. .Em stdin ,
  278. .Em stdin_str ,
  279. .Em stdout
  280. and
  281. .Em stderr
  282. are considered as template strings whereas
  283. .Em cmd
  284. is not. The template syntax is
  285. .Em Handlebars .
  286. See the
  287. .Sx STANDARDS
  288. section for a link to the
  289. .Em Handlebars
  290. specifications.
  291. .Pp
  292. The available types and the associated template variable are described below.
  293. .Bl -tag
  294. .It Ic challenge-http-01
  295. Invoked when the ownership of an identifier must be proved using the
  296. .Em http-01
  297. challenge. The available template variables are:
  298. .Bl -tag -compact
  299. .It Cm challenge Ar string
  300. The name of the challenge type
  301. .Aq http-01 .
  302. Mostly used in hooks with multiple types.
  303. .It Cm identifier Ar string
  304. The identifier name whom ownership is currently being validated.
  305. .It Cm identifier_tls_alpn Ar string
  306. The identifier name whom ownership is currently being validated, in a form suitable for the TLS ALPN challenge.
  307. .It Cm env Ar array
  308. Array containing all the environment variables.
  309. .It Cm file_name Ar string
  310. Name of the file containing the proof. This is not a full path and does not include the
  311. .Ql .well-known/acme-challenge/
  312. prefix.
  313. .It Cm is_clean_hook Ar bool
  314. False
  315. .It Cm proof Ar string
  316. The content of the proof that must be written to
  317. .Em file_name .
  318. .El
  319. .It Ic challenge-http-01-clean
  320. Invoked once an identifier ownership has been proven using the
  321. .Em http-01
  322. challenge. This hook is intended to remove the proof since it is no longer required. The template variables are strictly identical to those given in the corresponding
  323. .Em challenge-http-01
  324. hook, excepted
  325. .Em is_clean_hook
  326. which is set to
  327. .Em true .
  328. .It Ic challenge-dns-01
  329. Invoked when the ownership of an identifier must be proved using the
  330. .Em dns-01
  331. challenge. The available template variables are:
  332. .Bl -tag -compact
  333. .It Cm challenge Ar string
  334. The name of the challenge type
  335. .Aq dns-01 .
  336. Mostly used in hooks with multiple types.
  337. .It Cm identifier Ar string
  338. The identifier name whom ownership is currently being validated.
  339. .It Cm identifier_tls_alpn Ar string
  340. The identifier name whom ownership is currently being validated, in a form suitable for the TLS ALPN challenge.
  341. .It Cm env Ar array
  342. Array containing all the environment variables.
  343. .It Cm is_clean_hook Ar bool
  344. False
  345. .It Cm proof Ar string
  346. The content of the proof that must be written to a
  347. .Ql TXT
  348. entry of the DNS zone for the
  349. .Ql _acme-challenge
  350. subdomain.
  351. .El
  352. .It Ic challenge-dns-01-clean
  353. Invoked once an identifier ownership has been proven using the
  354. .Em dns-01
  355. challenge. This hook is intended to remove the proof since it is no longer required. The template variables are strictly identical to those given in the corresponding
  356. .Em challenge-dns-01
  357. hook, excepted
  358. .Em is_clean_hook
  359. which is set to
  360. .Em true .
  361. .It Ic challenge-tls-alpn-01
  362. Invoked when the ownership of an identifier must be proved using the
  363. .Em tls-alpn-01
  364. challenge. The available template variables are:
  365. .Bl -tag -compact
  366. .It Cm challenge Ar string
  367. The name of the challenge type
  368. .Aq tls-alpn-01 .
  369. Mostly used in hooks with multiple types.
  370. .It Cm identifier Ar string
  371. The identifier name whom ownership is currently being validated.
  372. .It Cm identifier_tls_alpn Ar string
  373. The identifier name whom ownership is currently being validated, in a form suitable for the TLS ALPN challenge.
  374. .It Cm env Ar array
  375. Array containing all the environment variables.
  376. .It Cm is_clean_hook Ar bool
  377. False
  378. .It Cm proof Ar string
  379. Plain-text representation of the
  380. .Em acmeIdentifier
  381. extension that should be used in the self-signed certificate presented when a TLS connection is initiated with the
  382. .Qd acme-tls/1
  383. ALPN extension value.
  384. .Xr acmed 8
  385. will not generate the certificate itself since it can be done using
  386. .Xr tacd 8 .
  387. .El
  388. .It Ic challenge-tls-alpn-01-clean
  389. Invoked once an identifier ownership has been proven using the
  390. .Em tls-alpn-01
  391. challenge. This hook is intended to remove the proof since it is no longer required. The template variables are strictly identical to those given in the corresponding
  392. .Em challenge-tls-alpn-01
  393. hook, excepted
  394. .Em is_clean_hook
  395. which is set to
  396. .Em true .
  397. .It Ic file-pre-create
  398. Invoked
  399. .Em before
  400. a non-existent file
  401. .Em created .
  402. The available template variables are:
  403. .Bl -tag -compact
  404. .It Cm env Ar array
  405. Array containing all the environment variables.
  406. .It Cm file_directory Ar string
  407. Name of the directory where the impacted file is located.
  408. .It Cm file_name Ar string
  409. Name of the impacted file.
  410. .It Cm file_path Ar string
  411. Full path to the impacted file.
  412. .El
  413. .It Ic file-pre-edit
  414. Invoked
  415. .Em before
  416. an existent file
  417. .Em modified .
  418. The available template variables are the same as those available for the
  419. .Em file-pre-create
  420. type.
  421. .It Ic file-post-create
  422. Invoked
  423. .Em after
  424. a non-existent file
  425. .Em created .
  426. The available template variables are the same as those available for the
  427. .Em file-pre-create
  428. type.
  429. .It Ic file-post-edit
  430. Invoked
  431. .Em after
  432. an existent file
  433. .Em modified .
  434. The available template variables are the same as those available for the
  435. .Em file-pre-create
  436. type.
  437. .It Ic post-operation
  438. Invoked at the end of the certificate request process. The available template variables are:
  439. .Bl -tag -compact
  440. .It Cm key_type Ar string
  441. Name of the asymmetric cryptography algorithm used to generate the certificate's key pair.
  442. .It Cm identifiers Ar string
  443. Array containing the identifiers included in the requested certificate.
  444. .It Cm env Ar array
  445. Array containing all the environment variables.
  446. .It Cm is_success Ar boolean
  447. True if the certificate request is successful.
  448. .It Cm status Ar string
  449. Human-readable status. If the certificate request failed, it contains the error description.
  450. .El
  451. .El
  452. .Sh DEFAULT HOOKS
  453. Because many people have the same needs, ACMEd comes with a set of hooks that should serve most situations. Hook names being unique, the following names and any other name starting by those is reserved and should not be used.
  454. .Bl -tag
  455. .It Pa git
  456. This hook uses
  457. .Xr git 1
  458. to archive private keys, public keys and certificates. It is possible to customize the commit username and email by using respectively the
  459. .Ev GIT_USERNAME
  460. and
  461. .Ev GIT_EMAIL
  462. environment variables.
  463. .It Pa http-01-echo
  464. This hook is designed to solve the http-01 challenge. For this purpose, it will write the proof into
  465. .Pa {{env.HTTP_ROOT}}/{{identifier}}/.well-known/acme-challenge/{{file_name}} .
  466. .Pp
  467. The web server must be configured so the file
  468. .Pa http://{{identifier}}/.well-known/acme-challenge/{{file_name}}
  469. can be accessed from the CA.
  470. .Pp
  471. If
  472. .Ev HTTP_ROOT
  473. is not specified, it will be set to
  474. .Pa /var/www .
  475. .It Pa tls-alpn-01-tacd-tcp
  476. This hook is designed to solve the tls-alpn-01 challenge using
  477. .Xr tacd 8 .
  478. It requires
  479. .Xr pkill 1
  480. to support the
  481. .Em Ar -F
  482. option.
  483. .Pp
  484. .Xr tacd 8
  485. will listen on the host defined by the
  486. .Ev TACD_HOST
  487. environment variable (default is the identifier to be validated) and on the port defined by the
  488. .Ev TACD_PORT
  489. environment variable (default is 5001).
  490. .Pp
  491. .Xr tacd 8
  492. will store its pid into
  493. .Pa {{TACD_PID_ROOT}}/tacd_{{identifier}}.pid .
  494. If
  495. .Ev TACD_PID_ROOT
  496. is not specified, it will be set to
  497. .Pa /run .
  498. .It Pa tls-alpn-01-tacd-unix
  499. This hook is designed to solve the tls-alpn-01 challenge using
  500. .Xr tacd 8 .
  501. It requires
  502. .Xr pkill 1
  503. to support the
  504. .Em Ar -F
  505. option.
  506. .Pp
  507. .Xr tacd 8
  508. will listen on the unix socket
  509. .Pa {{env.TACD_SOCK_ROOT}}/tacd_{{identifier}}.sock .
  510. If
  511. .Ev TACD_SOCK_ROOT
  512. is not specified, it will be set to
  513. .Pa /run .
  514. .Pp
  515. .Xr tacd 8
  516. will store its pid into
  517. .Pa {{TACD_PID_ROOT}}/tacd_{{identifier}}.pid .
  518. If
  519. .Ev TACD_PID_ROOT
  520. is not specified, it will be set to
  521. .Pa /run .
  522. .El
  523. .Sh TIME PERIODS
  524. ACMEd uses its own time period format, which is vaguely inspired by the ISO 8601 one. Periods are formatted as
  525. .Ar PM[PM...]
  526. where
  527. .Ar M
  528. is case sensitive character representing a length and
  529. .Ar P
  530. is an integer representing a multiplayer for the following length. The authorized length are:
  531. .Bl -dash -compact
  532. .It
  533. .Ar s :
  534. second
  535. .It
  536. .Ar m :
  537. minute
  538. .It
  539. .Ar h :
  540. hour
  541. .It
  542. .Ar d :
  543. day
  544. .It
  545. .Ar w :
  546. week
  547. .El
  548. The
  549. .Ar PM
  550. couples can be specified multiple times and in any order.
  551. .Pp
  552. For example,
  553. .Dq 1d42s and
  554. .Dq 40s20h4h2s
  555. both represents a period of one day and forty-two seconds.
  556. .Sh FILES
  557. .Bl -tag
  558. .It Pa /etc/acmed/acmed.toml
  559. Default
  560. .Xr acmed 8
  561. configuration file.
  562. .It Pa /etc/acmed/accounts
  563. Default accounts private and public keys directory.
  564. .It Pa /etc/acmed/certs
  565. Default certificates and associated private keys directory.
  566. .Sh EXAMPLES
  567. The following example defines a typical endpoint, account and certificate for a domain, several subdomains and an IP address.
  568. .Bd -literal -offset indent
  569. [[endpoint]]
  570. name = "example name"
  571. url = "https://acme.example.org/directory"
  572. tos_agreed = true
  573. [[account]]
  574. name = "my test account"
  575. email = "certs@exemple.net"
  576. [[certificate]]
  577. endpoint = "example name"
  578. account = "my test account"
  579. identifiers = [
  580. { dns = "exemple.net", challenge = "http-01"},
  581. { dns = "1.exemple.net", challenge = "dns-01"},
  582. { dns = "2.exemple.net", challenge = "tls-alpn-01", env.TACD_PORT="5010"},
  583. { dns = "3.exemple.net", challenge = "tls-alpn-01", env.TACD_PORT="5011"},
  584. { ip = "203.0.113.1", challenge = "http-01"},
  585. ]
  586. hooks = ["git", "http-01-echo", "tls-alpn-01-tacd-tcp", "some-dns-01-hook"]
  587. env.HTTP_ROOT = "/srv/http"
  588. .Ed
  589. .Pp
  590. It is possible to use
  591. .Xr echo 1
  592. to solve the
  593. .Em http-01
  594. challenge and
  595. .Xr rm 1
  596. to clean it.
  597. .Xr mkdir 1
  598. and
  599. .Xr chmod 1
  600. are used to prevent issues related to file access.
  601. .Bd -literal -offset indent
  602. [[hook]]
  603. name = "http-01-echo-mkdir"
  604. type = ["challenge-http-01"]
  605. cmd = "mkdir"
  606. args = [
  607. "-m", "0755",
  608. "-p", "{{%if env.HTTP_ROOT}}{{env.HTTP_ROOT}}{{else}}/var/www{{/if}}/{{identifier}}/.well-known/acme-challenge"
  609. ]
  610. [[hook]]
  611. name = "http-01-echo-echo"
  612. type = ["challenge-http-01"]
  613. cmd = "echo"
  614. args = ["{{proof}}"]
  615. stdout = "{{%if env.HTTP_ROOT}}{{env.HTTP_ROOT}}{{else}}/var/www{{/if}}/{{identifier}}/.well-known/acme-challenge/{{file_name}}"
  616. [[hook]]
  617. name = "http-01-echo-chmod"
  618. type = ["challenge-http-01-clean"]
  619. cmd = "chmod"
  620. args = [
  621. "a+r",
  622. "{{%if env.HTTP_ROOT}}{{env.HTTP_ROOT}}{{else}}/var/www{{/if}}/{{identifier}}/.well-known/acme-challenge/{{file_name}}"
  623. ]
  624. [[hook]]
  625. name = "http-01-echo-clean"
  626. type = ["challenge-http-01-clean"]
  627. cmd = "rm"
  628. args = [
  629. "-f",
  630. "{{%if env.HTTP_ROOT}}{{env.HTTP_ROOT}}{{else}}/var/www{{/if}}/{{identifier}}/.well-known/acme-challenge/{{file_name}}"
  631. ]
  632. .Ed
  633. .Pp
  634. The hooks from the previous example can be grouped in order to reduce the number of hooks to define in the certificate.
  635. .Bd -literal -offset indent
  636. [[group]]
  637. name = "http-01-echo-var-www"
  638. hooks = [
  639. "http-01-echo-mkdir",
  640. "http-01-echo-echo",
  641. "http-01-echo-chmod",
  642. "http-01-echo-clean"
  643. ]
  644. [[certificate]]
  645. # Some fields omitted
  646. hooks = ["http-01-echo"]
  647. env.HTTP_ROOT = "/srv/http"
  648. .Ed
  649. .Pp
  650. It is also possible to use
  651. .Xr sendmail 8
  652. in a hook in order to notif someone when the certificate request process is done.
  653. .Bd -literal -offset indent
  654. [[hook]]
  655. name = "email-report"
  656. type = ["post-operation"]
  657. cmd = "sendmail"
  658. args = [
  659. "-f", "noreply.certs@example.net",
  660. "contact@example.net"
  661. ]
  662. stdin_str = """Subject: Certificate renewal {{#if is_success}}succeeded{{else}}failed{{/if}} for {{identifiers.[0]}}
  663. The following certificate has {{#unless is_success}}*not* {{/unless}}been renewed.
  664. identifiers: {{#each identifiers}}{{#if @index}}, {{/if}}{{this}}{{/each}}
  665. key type: {{key_type}}
  666. status: {{status}}"""
  667. .Ed
  668. .Sh SEE ALSO
  669. .Xr acmed 8 ,
  670. .Xr tacd 8
  671. .Sh STANDARDS
  672. .Bl
  673. .It
  674. .Rs
  675. .%A Tom Preston-Werner
  676. .%D July 2018
  677. .%T TOML v0.5.0
  678. .%U https://github.com/toml-lang/toml
  679. .Re
  680. .It
  681. .Rs
  682. .%A Yehuda Katz
  683. .%T Handlebars
  684. .%U https://handlebarsjs.com/
  685. .Re
  686. .It
  687. .Rs
  688. .%A M. Jones
  689. .%D May 2015
  690. .%R RFC 7518
  691. .%T JSON Web Algorithms (JWA)
  692. .Re
  693. .El
  694. .Sh AUTHORS
  695. .An Rodolphe Bréard
  696. .Aq rodolphe@breard.tf