From fe600441c9a121e0b6bdf125296f316d2b44d67c Mon Sep 17 00:00:00 2001 From: Georg Lutz Date: Thu, 29 Dec 2016 11:12:26 +0100 Subject: [PATCH 1/2] Add note about permissions of installed files --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 1a7766ef..dde2eeae 100644 --- a/README.md +++ b/README.md @@ -160,6 +160,8 @@ acme.sh --installcert -d example.com \ Only the domain is required, all the other parameters are optional. +The ownership and permission info of existing files are preserved. You may want to precreate the files to have defined ownership and permission. + Install/copy the issued cert/key to the production Apache or Nginx path. The cert will be `renewed every **60** days by default` (which is configurable). Once the cert is renewed, the Apache/Nginx service will be restarted automatically by the command: `service apache2 restart` or `service nginx restart`. From d0f7c309abb9808004f42b7327a6f4b795873cc5 Mon Sep 17 00:00:00 2001 From: neilpang Date: Tue, 3 Jan 2017 19:31:11 +0800 Subject: [PATCH 2/2] run pre-hook first --- acme.sh | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/acme.sh b/acme.sh index 5199a820..06b14ef6 100755 --- a/acme.sh +++ b/acme.sh @@ -2075,6 +2075,17 @@ _clearupwebbroot() { _on_before_issue() { _debug _on_before_issue + #run pre hook + if [ "$Le_PreHook" ]; then + _info "Run pre hook:'$Le_PreHook'" + if ! ( + cd "$DOMAIN_PATH" && eval "$Le_PreHook" + ); then + _err "Error when run pre hook." + return 1 + fi + fi + if _hasfield "$Le_Webroot" "$NO_VALUE"; then if ! _exists "nc"; then _err "Please install netcat(nc) tools first." @@ -2142,16 +2153,6 @@ _on_before_issue() { usingApache="" fi - #run pre hook - if [ "$Le_PreHook" ]; then - _info "Run pre hook:'$Le_PreHook'" - if ! ( - cd "$DOMAIN_PATH" && eval "$Le_PreHook" - ); then - _err "Error when run pre hook." - return 1 - fi - fi } _on_issue_err() {