mirror of https://github.com/breard-r/acmed.git
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.
155 lines
4.0 KiB
155 lines
4.0 KiB
# Copyright (c) 2019-2020 Rodolphe Bréard <rodolphe@breard.tf>
|
|
#
|
|
# Copying and distribution of this file, with or without modification,
|
|
# are permitted in any medium without royalty provided the copyright
|
|
# notice and this notice are preserved. This file is offered as-is,
|
|
# without any warranty.
|
|
|
|
# ------------------------------------------------------------------------
|
|
# Default hooks for ACMEd
|
|
# You should not edit this file since it may be overridden by a newer one.
|
|
# ------------------------------------------------------------------------
|
|
|
|
|
|
#
|
|
# http-01 challenge in "/var/www/{{identifier}}/"
|
|
#
|
|
|
|
[[hook]]
|
|
name = "http-01-echo-mkdir"
|
|
type = ["challenge-http-01"]
|
|
cmd = "mkdir"
|
|
args = [
|
|
"-m", "0755",
|
|
"-p", "{{#if env.HTTP_ROOT}}{{env.HTTP_ROOT}}{{else}}/var/www{{/if}}/{{identifier}}/.well-known/acme-challenge"
|
|
]
|
|
allow_failure = true
|
|
|
|
[[hook]]
|
|
name = "http-01-echo-echo"
|
|
type = ["challenge-http-01"]
|
|
cmd = "echo"
|
|
args = ["{{proof}}"]
|
|
stdout = "{{#if env.HTTP_ROOT}}{{env.HTTP_ROOT}}{{else}}/var/www{{/if}}/{{identifier}}/.well-known/acme-challenge/{{file_name}}"
|
|
|
|
[[hook]]
|
|
name = "http-01-echo-chmod"
|
|
type = ["challenge-http-01"]
|
|
cmd = "chmod"
|
|
args = [
|
|
"a+r",
|
|
"{{#if env.HTTP_ROOT}}{{env.HTTP_ROOT}}{{else}}/var/www{{/if}}/{{identifier}}/.well-known/acme-challenge/{{file_name}}"
|
|
]
|
|
allow_failure = true
|
|
|
|
[[hook]]
|
|
name = "http-01-echo-clean"
|
|
type = ["challenge-http-01-clean"]
|
|
cmd = "rm"
|
|
args = [
|
|
"-f",
|
|
"{{#if env.HTTP_ROOT}}{{env.HTTP_ROOT}}{{else}}/var/www{{/if}}/{{identifier}}/.well-known/acme-challenge/{{file_name}}"
|
|
]
|
|
allow_failure = true
|
|
|
|
[[group]]
|
|
name = "http-01-echo"
|
|
hooks = [
|
|
"http-01-echo-mkdir",
|
|
"http-01-echo-echo",
|
|
"http-01-echo-chmod",
|
|
"http-01-echo-clean"
|
|
]
|
|
|
|
|
|
#
|
|
# tls-alpn-01 challenge with tacd
|
|
#
|
|
|
|
[[hook]]
|
|
name = "tls-alpn-01-tacd-start-tcp"
|
|
type = ["challenge-tls-alpn-01"]
|
|
cmd = "tacd"
|
|
args = [
|
|
"--pid-file", "{{#if env.TACD_PID_ROOT}}{{env.TACD_PID_ROOT}}{{else}}/run{{/if}}/tacd_{{identifier}}.pid",
|
|
"--domain", "{{identifier_tls_alpn}}",
|
|
"--acme-ext", "{{proof}}",
|
|
"--listen", "{{#if env.TACD_HOST}}{{env.TACD_HOST}}{{else}}{{identifier}}{{/if}}:{{#if env.TACD_PORT}}{{env.TACD_PORT}}{{else}}5001{{/if}}"
|
|
]
|
|
|
|
[[hook]]
|
|
name = "tls-alpn-01-tacd-start-unix"
|
|
type = ["challenge-tls-alpn-01"]
|
|
cmd = "tacd"
|
|
args = [
|
|
"--pid-file", "{{#if env.TACD_PID_ROOT}}{{env.TACD_PID_ROOT}}{{else}}/run{{/if}}/tacd_{{identifier}}.pid",
|
|
"--domain", "{{identifier_tls_alpn}}",
|
|
"--acme-ext", "{{proof}}",
|
|
"--listen", "unix:{{#if env.TACD_SOCK_ROOT}}{{env.TACD_SOCK_ROOT}}{{else}}/run{{/if}}/tacd_{{identifier}}.sock"
|
|
]
|
|
|
|
[[hook]]
|
|
name = "tls-alpn-01-tacd-kill"
|
|
type = ["challenge-tls-alpn-01-clean"]
|
|
cmd = "pkill"
|
|
args = [
|
|
"-F", "{{#if env.TACD_PID_ROOT}}{{env.TACD_PID_ROOT}}{{else}}/run{{/if}}/tacd_{{identifier}}.pid",
|
|
]
|
|
allow_failure = true
|
|
|
|
[[hook]]
|
|
name = "tls-alpn-01-tacd-rm"
|
|
type = ["challenge-tls-alpn-01-clean"]
|
|
cmd = "rm"
|
|
args = [
|
|
"-f", "{{#if env.TACD_PID_ROOT}}{{env.TACD_PID_ROOT}}{{else}}/run{{/if}}/tacd_{{identifier}}.pid",
|
|
]
|
|
allow_failure = true
|
|
|
|
[[group]]
|
|
name = "tls-alpn-01-tacd-tcp"
|
|
hooks = ["tls-alpn-01-tacd-start-tcp", "tls-alpn-01-tacd-kill", "tls-alpn-01-tacd-rm"]
|
|
|
|
[[group]]
|
|
name = "tls-alpn-01-tacd-unix"
|
|
hooks = ["tls-alpn-01-tacd-start-unix", "tls-alpn-01-tacd-kill", "tls-alpn-01-tacd-rm"]
|
|
|
|
|
|
#
|
|
# Git storage hook
|
|
#
|
|
|
|
[[hook]]
|
|
name = "git-init"
|
|
type = ["file-pre-create", "file-pre-edit"]
|
|
cmd = "git"
|
|
args = [
|
|
"init",
|
|
"{{file_directory}}"
|
|
]
|
|
|
|
[[hook]]
|
|
name = "git-add"
|
|
type = ["file-post-create", "file-post-edit"]
|
|
cmd = "git"
|
|
args = [
|
|
"-C", "{{file_directory}}",
|
|
"add", "{{file_name}}"
|
|
]
|
|
|
|
[[hook]]
|
|
name = "git-commit"
|
|
type = ["file-post-create", "file-post-edit"]
|
|
cmd = "git"
|
|
args = [
|
|
"-C", "{{file_directory}}",
|
|
"-c", "user.name='{{#if env.GIT_USERNAME}}{{env.GIT_USERNAME}}{{else}}ACMEd{{/if}}'",
|
|
"-c", "user.email='{{#if env.GIT_EMAIL}}{{env.GIT_EMAIL}}{{else}}acmed@localhost{{/if}}'",
|
|
"commit",
|
|
"-m", "{{file_name}}",
|
|
"--only", "{{file_name}}"
|
|
]
|
|
|
|
[[group]]
|
|
name = "git"
|
|
hooks = ["git-init", "git-add", "git-commit"]
|