feat: add hook on the run command. (#1157)

This commit is contained in:
Ludovic Fernandez 2020-05-14 23:44:08 +02:00 committed by GitHub
parent 2f1b384411
commit e07bf641ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 78 additions and 48 deletions

View file

@ -18,6 +18,21 @@ lego --email="foo@bar.com" --domains="example.com" --http run
(Find your certificate in the `.lego` folder of current working directory.)
### Obtain a certificate (and hook)
The hook is executed only when the certificates are effectively created.
```bash
lego --email="foo@bar.com" --domains="example.com" --http run --run-hook="./myscript.sh"
```
Some information are added to the environment variables when the hook is used:
- `LEGO_ACCOUNT_EMAIL`: the email of the account.
- `LEGO_CERT_DOMAIN`: the main domain of the certificate.
- `LEGO_CERT_PATH`: the path of the certificate.
- `LEGO_CERT_KEY_PATH`: the path of the certificate key.
### To renew the certificate
```bash