Browse Source

Improve the http-01-echo example

If someone used the example the way it was defined, file-access issues
may arise. This new example add two new hooks to fix it. The example
should now work in most environment although the path may need to be
adapted.
pull/5/head
Rodolphe Breard 6 years ago
parent
commit
c6037861f4
  1. 39
      man/en/acmed.toml.5

39
man/en/acmed.toml.5

@ -363,16 +363,38 @@ to solve the
challenge and challenge and
.Xr rm 1 .Xr rm 1
to clean it. to clean it.
.Xr mkdir 1
and
.Xr chmod 1
are used to prevent issues related to file access.
.Bd -literal -offset indent .Bd -literal -offset indent
[[hook]] [[hook]]
name = "echo"
name = "http-01-echo-mkdir"
type = ["challenge-http-01"]
cmd = "mkdir"
args = [
"-m", "0755",
"-p", "/var/www/{{domain}}/.well-known/acme-challenge"
]
[[hook]]
name = "http-01-echo-echo"
type = ["challenge-http-01"] type = ["challenge-http-01"]
cmd = "echo" cmd = "echo"
args = ["{{proof}}"] args = ["{{proof}}"]
stdout = "/var/www/{{domain}}/.well-known/acme-challenge/{{file_name}}" stdout = "/var/www/{{domain}}/.well-known/acme-challenge/{{file_name}}"
[[hook]] [[hook]]
name = "echo-clean"
name = "http-01-echo-chmod"
type = ["challenge-http-01-clean"]
cmd = "chmod"
args = [
"a+r",
"/var/www/{{domain}}/.well-known/acme-challenge/{{file_name}}"
]
[[hook]]
name = "http-01-echo-clean"
type = ["challenge-http-01-clean"] type = ["challenge-http-01-clean"]
cmd = "rm" cmd = "rm"
args = [ args = [
@ -381,15 +403,20 @@ args = [
] ]
.Ed .Ed
.Pp .Pp
The two above hooks can be grouped in order to reduce the number of hooks to define in the certificate.
The hooks from the previous example can be grouped in order to reduce the number of hooks to define in the certificate.
.Bd -literal -offset indent .Bd -literal -offset indent
[[group]] [[group]]
name = "http-echo"
hooks = ["echo", "echo-clean"]
name = "http-01-echo-var-www"
hooks = [
"http-01-echo-mkdir",
"http-01-echo-echo",
"http-01-echo-chmod",
"http-01-echo-clean"
]
[[certificate]] [[certificate]]
# Some fields omitted # Some fields omitted
hooks = ["http-echo"]
hooks = ["http-01-echo-var-www"]
.Ed .Ed
.Pp .Pp

Loading…
Cancel
Save