add standalone and webroot methods
This commit is contained in:
67
README.md
67
README.md
@ -2,7 +2,7 @@
|
||||
|
||||
 
|
||||
|
||||
Dockerised Certbot that utilises cron to schedule creating and renewing SSL certificates. Uses Cloudflare for DNS-01 verification. Automatic renewal attempt happens every 6 hours by default.
|
||||
Dockerised Certbot that utilises cron to schedule creating and renewing SSL certificates. Supports standalone, webroot or Cloudflare methods. Automatic renewal attempt happens every 6 hours by default.
|
||||
|
||||
## Tags
|
||||
|
||||
@ -18,8 +18,9 @@ Dockerised Certbot that utilises cron to schedule creating and renewing SSL cert
|
||||
docker run -d --name certbot \
|
||||
-e EMAIL=admin@domain.com \
|
||||
-e DOMAINS=domain.com \
|
||||
-e PLUGIN=cloudflare \
|
||||
-e CLOUDFLARE_TOKEN=123abc
|
||||
-v /docker/certbot-cron:/config \
|
||||
-v ./certbot-cron:/config \
|
||||
git.mrmeeb.stream/mrmeeb/certbot-cron:latest
|
||||
```
|
||||
|
||||
@ -36,30 +37,78 @@ services:
|
||||
environment:
|
||||
- EMAIL=admin@domain.com
|
||||
- DOMAINS=domain.com,*.domain.com
|
||||
- PLUGIN=cloudflare
|
||||
- CLOUDFLARE_TOKEN=123abc
|
||||
```
|
||||
|
||||
## Environment Variables:
|
||||
|
||||
| Variable | Default Value | Description |
|
||||
### Core Options:
|
||||
|
||||
Core options to the container
|
||||
|
||||
| Variable | Default | Description |
|
||||
| --- | --- | --- |
|
||||
|PUID |int |1000 |Sets the UID of the user certbot runs under |
|
||||
|PGID |int |1000 |Sets the GID of the user certbot runs under |
|
||||
|TZ |[List of valid TZs](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List) |UTC |Sets the timezone of the container |
|
||||
| GENERATE_DHPARAM | true (case-sensitive) | Generate Diffie-Hellman keys in /config/letsencrypt/keys |
|
||||
| INTERVAL | 0 */6 * * * | How often certbot attempts to renew the certificate. Cron syntax |
|
||||
| CERT_COUNT | 1 | How many certificates certbot will try to issue (more than 1 not yet implemented) |
|
||||
|
||||
### Certificate Options
|
||||
|
||||
These options apply when `CERT_COUNT` is `1`
|
||||
|
||||
| Variable | Default | Description |
|
||||
| --- | --- | --- |
|
||||
| EMAIL | None | Email address for renewal information & other communications |
|
||||
| DOMAINS | None | Domains to be included in the certificate. Comma separated list, no spaces. Wildcards supported |
|
||||
| INTERVAL | 0 */6 * * * | How often certbot attempts to renew the certificate. Cron syntax |
|
||||
| STAGING | false (case-sensitive) | Uses the LetsEncrypt staging endpoint for testing - avoids the aggressive rate-limiting of the production endpoint |
|
||||
| STAGING | false (case-sensitive) | Uses the LetsEncrypt staging endpoint for testing - avoids the aggressive rate-limiting of the production endpoint. **Not supported when using a custom Certificate Authority.** |
|
||||
|
||||
### Plugins
|
||||
|
||||
Plugins that can used for issuing a certificate
|
||||
|
||||
| Variable | Default | Description |
|
||||
| --- | --- | --- |
|
||||
| PLUGIN | standalone | Options are `webroot`, `standalone`, or `cloudflare` |
|
||||
|
||||
- `webroot` - relies on a webserver running on the FQDN for which you're trying to issue a certificate to serve validation files
|
||||
- Requires the webserver's root directory to be mounted to the container as `/config/webroot`
|
||||
- `standalone` - certbot spawns a webserver on port 80 for validation
|
||||
- Requires this container to be bound to port 80 on the host
|
||||
- `cloudflare` - Creates a TXT record with Cloudflare pointing to the domain you're requesting a certificate for
|
||||
- Requires the domain you're requesting a certificate for to be entered in Cloudflare
|
||||
|
||||
#### Cloudflare Plugin
|
||||
|
||||
Options that affect the behaviour of certbot running with the Cloudflare plugin
|
||||
|
||||
| Variable | Default | Description |
|
||||
| --- | --- | --- |
|
||||
| PROPOGATION_TIME | 10 | The amount of time (seconds) that certbot waits for the TXT records to propogate to Cloudflare before verifying - the more domains in the certificate, the longer you might need |
|
||||
| GENERATE_DHPARAM | true (case-sensitive) | Generate Diffie-Hellman keys in /config/letsencrypt/keys |
|
||||
| CLOUDFLARE_TOKEN | N/A | Cloudflare token for verification |
|
||||
| CLOUDFLARE_TOKEN | null | Cloudflare token for verification |
|
||||
|
||||
### Custom Certificate Authority
|
||||
|
||||
Options to use a custom Certificate Authority, for example when issuing internal certificates
|
||||
|
||||
| Variable | Default | Description |
|
||||
| --- | --- | --- |
|
||||
| CUSTOM_CA | null | Name of the root certificate Certbot/ACME will trust requesting the certificate, e.g `root.pem`. **Must be placed in `/config/custom_ca`** |
|
||||
| CUSTOM_CA_SERVER | null | Custom server URL used by Certbot/ACME when requesting a certificate, e.g `https://ca.internal/acme/acme/directory` |
|
||||
|
||||
## Volumes
|
||||
|
||||
| Docker path | Purpose |
|
||||
| --- | --- |
|
||||
| /config | Stores configs and LetsEncrypt output for mounting in other containers
|
||||
| /config/custom_ca | Mountpoint for a custom Certificate Authority root certificate. **Required if `CUSTOM_CA` is set**
|
||||
| /config/webroot | Mountpoint for the webroot of a separate webserver. **Required if `PLUGIN=webroot` is set**
|
||||
|
||||
## Other
|
||||
## Ports
|
||||
|
||||
Thanks to [this guy](https://stackoverflow.com/questions/63447441/docker-stop-for-crond-times-out) for explaining how to make cron actually shutdown when stopping the container.
|
||||
| Port | Purpose |
|
||||
| --- | --- |
|
||||
| 80 | Used by ACME to verify domain ownership. **Required if `PLUGIN=standalone` is set**
|
Reference in New Issue
Block a user