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.

157 lines
3.8 KiB

5 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. # ------------------------------------------------------------------------
  8. # Default hooks for ACMEd
  9. # You should not edit this file since it may be overridden by a newer one.
  10. # ------------------------------------------------------------------------
  11. #
  12. # http-01 challenge in "/var/www/{{ identifier }}/"
  13. #
  14. [[hook]]
  15. name = "http-01-echo-mkdir"
  16. type = ["challenge-http-01"]
  17. cmd = "mkdir"
  18. args = [
  19. "-m", "0755",
  20. "-p", "{{ env.HTTP_ROOT | default('/var/www') }}/{{ identifier }}/.well-known/acme-challenge"
  21. ]
  22. allow_failure = true
  23. [[hook]]
  24. name = "http-01-echo-echo"
  25. type = ["challenge-http-01"]
  26. cmd = "echo"
  27. args = ["{{ proof }}"]
  28. stdout = "{{ env.HTTP_ROOT | default('/var/www') }}/{{ identifier }}/.well-known/acme-challenge/{{ file_name }}"
  29. [[hook]]
  30. name = "http-01-echo-chmod"
  31. type = ["challenge-http-01"]
  32. cmd = "chmod"
  33. args = [
  34. "a+r",
  35. "{{ env.HTTP_ROOT | default('/var/www') }}/{{ identifier }}/.well-known/acme-challenge/{{ file_name }}"
  36. ]
  37. allow_failure = true
  38. [[hook]]
  39. name = "http-01-echo-clean"
  40. type = ["challenge-http-01-clean"]
  41. cmd = "rm"
  42. args = [
  43. "-f",
  44. "{{ env.HTTP_ROOT | default('/var/www') }}/{{ identifier }}/.well-known/acme-challenge/{{ file_name }}"
  45. ]
  46. allow_failure = true
  47. [[group]]
  48. name = "http-01-echo"
  49. hooks = [
  50. "http-01-echo-mkdir",
  51. "http-01-echo-echo",
  52. "http-01-echo-chmod",
  53. "http-01-echo-clean"
  54. ]
  55. #
  56. # tls-alpn-01 challenge with tacd
  57. #
  58. [[hook]]
  59. name = "tls-alpn-01-tacd-start-tcp"
  60. type = ["challenge-tls-alpn-01"]
  61. cmd = "tacd"
  62. args = [
  63. "--pid-file", "{{ env.TACD_PID_ROOT | default('/run') }}/tacd_{{ identifier }}.pid",
  64. "--domain", "{{ identifier_tls_alpn }}",
  65. "--acme-ext", "{{ proof }}",
  66. "--listen", "{{ env.TACD_PORT | default('5001') }}"
  67. ]
  68. [[hook]]
  69. name = "tls-alpn-01-tacd-start-unix"
  70. type = ["challenge-tls-alpn-01"]
  71. cmd = "tacd"
  72. args = [
  73. "--pid-file", "{{ env.TACD_PID_ROOT | default('/run') }}/tacd_{{ identifier }}.pid",
  74. "--domain", "{{ identifier_tls_alpn }}",
  75. "--acme-ext", "{{ proof }}",
  76. "--listen", "unix:{{ env.TACD_SOCK_ROOT | default('/run') }}/tacd_{{ identifier }}.sock"
  77. ]
  78. [[hook]]
  79. name = "tls-alpn-01-tacd-kill"
  80. type = ["challenge-tls-alpn-01-clean"]
  81. cmd = "pkill"
  82. args = [
  83. "-F", "{{ env.TACD_PID_ROOT | default('/run') }}/tacd_{{ identifier }}.pid",
  84. ]
  85. allow_failure = true
  86. [[hook]]
  87. name = "tls-alpn-01-tacd-rm"
  88. type = ["challenge-tls-alpn-01-clean"]
  89. cmd = "rm"
  90. args = [
  91. "-f", "{{ env.TACD_PID_ROOT | default('/run') }}/tacd_{{ identifier }}.pid",
  92. ]
  93. allow_failure = true
  94. [[group]]
  95. name = "tls-alpn-01-tacd-tcp"
  96. hooks = ["tls-alpn-01-tacd-start-tcp", "tls-alpn-01-tacd-kill", "tls-alpn-01-tacd-rm"]
  97. [[group]]
  98. name = "tls-alpn-01-tacd-unix"
  99. hooks = ["tls-alpn-01-tacd-start-unix", "tls-alpn-01-tacd-kill", "tls-alpn-01-tacd-rm"]
  100. #
  101. # Git storage hook
  102. #
  103. [[hook]]
  104. name = "git-init"
  105. type = ["file-pre-create", "file-pre-edit"]
  106. cmd = "git"
  107. args = [
  108. "init",
  109. "{{ file_directory }}"
  110. ]
  111. [[hook]]
  112. name = "git-add"
  113. type = ["file-post-create", "file-post-edit"]
  114. cmd = "git"
  115. args = [
  116. "-C", "{{ file_directory }}",
  117. "add", "{{ file_name }}"
  118. ]
  119. allow_failure = true
  120. [[hook]]
  121. name = "git-commit"
  122. type = ["file-post-create", "file-post-edit"]
  123. cmd = "git"
  124. args = [
  125. "-C", "{{ file_directory }}",
  126. "-c", "user.name='{{ env.GIT_USERNAME | default('ACMEd') }}'",
  127. "-c", "user.email='{{ env.GIT_EMAIL | default('acmed@localhost') }}'",
  128. "commit",
  129. "-m", "{{ file_name }}",
  130. "--only", "{{ file_name }}"
  131. ]
  132. allow_failure = true
  133. [[group]]
  134. name = "git"
  135. hooks = ["git-init", "git-add", "git-commit"]