Renaming Letsencrypt to Certbot, since it will be more generic allowing other issuers.
This commit is contained in:
parent
55888752c9
commit
5dbe0a6d28
40 changed files with 188 additions and 184 deletions
|
|
@ -2,19 +2,19 @@
|
|||
|
||||
## Container (Docker or Swarm) labels
|
||||
|
||||
| Tag | Description | Default | Example |
|
||||
|---------------------------------------|-------------------------------------------------------------------------------------------------------|----------------|--------------|
|
||||
| easyhaproxy.[definition].host | Host(s) HAProxy is listening. More than one host use comma as delimiter | **required** | somehost.com OR host1.com,host2.com |
|
||||
| easyhaproxy.[definition].mode | (Optional) Is this `http` or `tcp` mode in HAProxy. | http | http or tcp |
|
||||
| easyhaproxy.[definition].port | (Optional) Port HAProxy will listen for the host. | 80 | 3000 |
|
||||
| easyhaproxy.[definition].localport | (Optional) Port container is listening. | 80 | 8080 |
|
||||
| easyhaproxy.[definition].redirect | (Optional) JSON containing key/value pair from host/to URL redirect. | *empty* | {"foo.com":"https://bla.com", "bar.com":"https://bar.org"} |
|
||||
| easyhaproxy.[definition].sslcert | (Optional) Cert PEM Base64 encoded. Do not use this if `letsencrypt` is enabled. | *empty* | base64 cert + key |
|
||||
| easyhaproxy.[definition].ssl | (Optional) If `true` you need to provide certificate as a file. See below. Do not use with `sslcert`. | false | true or false |
|
||||
| easyhaproxy.[definition].health-check | (Optional) `ssl`, enable health check via SSL in `mode tcp` | *empty* | ssl |
|
||||
| easyhaproxy.[definition].letsencrypt | (Optional) Generate certificate with letsencrypt. Do not use with `sslcert` parameter. | false | true OR false |
|
||||
| easyhaproxy.[definition].redirect_ssl | (Optional) Redirect all requests to https | false | true OR false |
|
||||
| easyhaproxy.[definition].clone_to_ssl | (Optional) It copies the configuration to HTTPS(443) and disable SSL from the current config. **Do not use* this with `ssl` or `letsencrypt` parameters | false | true OR false |
|
||||
| Tag | Description | Default | Example |
|
||||
|---------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|--------------|------------------------------------------------------------|
|
||||
| easyhaproxy.[definition].host | Host(s) HAProxy is listening. More than one host use comma as delimiter | **required** | somehost.com OR host1.com,host2.com |
|
||||
| easyhaproxy.[definition].mode | (Optional) Is this `http` or `tcp` mode in HAProxy. | http | http or tcp |
|
||||
| easyhaproxy.[definition].port | (Optional) Port HAProxy will listen for the host. | 80 | 3000 |
|
||||
| easyhaproxy.[definition].localport | (Optional) Port container is listening. | 80 | 8080 |
|
||||
| easyhaproxy.[definition].redirect | (Optional) JSON containing key/value pair from host/to URL redirect. | *empty* | {"foo.com":"https://bla.com", "bar.com":"https://bar.org"} |
|
||||
| easyhaproxy.[definition].sslcert | (Optional) Cert PEM Base64 encoded. Do not use this if `certbot` is enabled. | *empty* | base64 cert + key |
|
||||
| easyhaproxy.[definition].ssl | (Optional) If `true` you need to provide certificate as a file. See below. Do not use with `sslcert`. | false | true or false |
|
||||
| easyhaproxy.[definition].health-check | (Optional) `ssl`, enable health check via SSL in `mode tcp` | *empty* | ssl |
|
||||
| easyhaproxy.[definition].certbot | (Optional) Generate certificate with certbot. Do not use with `sslcert` parameter. | false | true OR false |
|
||||
| easyhaproxy.[definition].redirect_ssl | (Optional) Redirect all requests to https | false | true OR false |
|
||||
| easyhaproxy.[definition].clone_to_ssl | (Optional) It copies the configuration to HTTPS(443) and disable SSL from the current config. **Do not use* this with `ssl` or `certbot` parameters | false | true OR false |
|
||||
|
||||
The `definition` is a string that will group all configurations togethers. Different `definition` will create different configurations.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,20 +1,20 @@
|
|||
# Docker environment variables
|
||||
|
||||
| Environment Variable | Description | Default |
|
||||
|---------------------------------|-------------------------------------------------------------------------------------------------|------------------|
|
||||
| EASYHAPROXY_DISCOVER | How the services will be discovered to create `haproxy.cfg`: `static`, `docker`, `swarm` or `kubernetes` | **required** |
|
||||
| EASYHAPROXY_LABEL_PREFIX | (Optional) The key will search for matching resources. | `easyhaproxy` |
|
||||
| EASYHAPROXY_LETSENCRYPT_EMAIL | (Optional) The email will be used to request the certificate to Letsencrypt | *empty* |
|
||||
| EASYHAPROXY_LETSENCRYPT_SERVER | (Optional) Can be `staging` or 'schema://domain.tld'. If set, will try to connect to the Letsencrypt test server | *empty* |
|
||||
| EASYHAPROXY_SSL_MODE | (Optional) `strict` supports only the most recent TLS version; `default` good SSL integration with recent browsers; `loose` supports all old SSL protocols for old browsers (not recommended). | `default`|
|
||||
| EASYHAPROXY_REFRESH_CONF | (Optional) Check configuration every N seconds. | 10 |
|
||||
| EASYHAPROXY_LOG_LEVEL | (Optional) The log level for EasyHAproxy messages. Available: TRACE,DEBUG,INFO,WARN,ERROR,FATAL | DEBUG |
|
||||
| CERTBOT_LOG_LEVEL | (Optional) The log level for Certbot messages. Available: TRACE,DEBUG,INFO,WARN,ERROR,FATAL | DEBUG |
|
||||
| HAPROXY_LOG_LEVEL | (Optional) The log level for HAProxy messages. Available: TRACE,DEBUG,INFO,WARN,ERROR,FATAL | DEBUG |
|
||||
| HAPROXY_USERNAME | (Optional) The HAProxy username to the statistics. | `admin` |
|
||||
| HAPROXY_PASSWORD | (Optional) The HAProxy password to the statistics. If not set, statistics will be available with no password | *empty* |
|
||||
| HAPROXY_STATS_PORT | (Optional) The HAProxy port to the statistics. If set to `false`, disable statistics | `1936` |
|
||||
| HAPROXY_CUSTOMERRORS | (Optional) If HAProxy will use custom HTML errors. true/false. | `false` |
|
||||
| Environment Variable | Description | Default |
|
||||
|------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|
|
||||
| EASYHAPROXY_DISCOVER | How the services will be discovered to create `haproxy.cfg`: `static`, `docker`, `swarm` or `kubernetes` | **required** |
|
||||
| EASYHAPROXY_LABEL_PREFIX | (Optional) The key will search for matching resources. | `easyhaproxy` |
|
||||
| EASYHAPROXY_CERTBOT_EMAIL | (Optional) The email will be used to request the certificate to Certbox | *empty* |
|
||||
| EASYHAPROXY_CERTBOT_SERVER | (Optional) Can be `staging` or 'schema://domain.tld'. If set, will try to connect to the Certbot test server | *empty* |
|
||||
| EASYHAPROXY_SSL_MODE | (Optional) `strict` supports only the most recent TLS version; `default` good SSL integration with recent browsers; `loose` supports all old SSL protocols for old browsers (not recommended). | `default` |
|
||||
| EASYHAPROXY_REFRESH_CONF | (Optional) Check configuration every N seconds. | 10 |
|
||||
| EASYHAPROXY_LOG_LEVEL | (Optional) The log level for EasyHAproxy messages. Available: TRACE,DEBUG,INFO,WARN,ERROR,FATAL | DEBUG |
|
||||
| CERTBOT_LOG_LEVEL | (Optional) The log level for Certbot messages. Available: TRACE,DEBUG,INFO,WARN,ERROR,FATAL | DEBUG |
|
||||
| HAPROXY_LOG_LEVEL | (Optional) The log level for HAProxy messages. Available: TRACE,DEBUG,INFO,WARN,ERROR,FATAL | DEBUG |
|
||||
| HAPROXY_USERNAME | (Optional) The HAProxy username to the statistics. | `admin` |
|
||||
| HAPROXY_PASSWORD | (Optional) The HAProxy password to the statistics. If not set, statistics will be available with no password | *empty* |
|
||||
| HAPROXY_STATS_PORT | (Optional) The HAProxy port to the statistics. If set to `false`, disable statistics | `1936` |
|
||||
| HAPROXY_CUSTOMERRORS | (Optional) If HAProxy will use custom HTML errors. true/false. | `false` |
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -58,6 +58,10 @@ You can configure the behavior of the EasyHAProxy by setup specific environment
|
|||
|
||||
Follow [this link](letsencrypt.md)
|
||||
|
||||
## Setup certificates with ZeroSSL
|
||||
|
||||
Follow [this link](zerossl.md)
|
||||
|
||||
## Setup your own certificates
|
||||
|
||||
Follow [this link](ssl.md)
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ easyhaproxy:
|
|||
certbot: DEBUG
|
||||
easyhaproxy: DEBUG
|
||||
haproxy: DEBUG
|
||||
letsencrypt:
|
||||
certbot:
|
||||
email: ""
|
||||
|
||||
service:
|
||||
|
|
|
|||
|
|
@ -79,27 +79,27 @@ Caveats:
|
|||
|
||||
## Kubernetes annotations
|
||||
|
||||
| annotation | Description | Default | Example |
|
||||
|-----------------------------|-----------------------------------------------------------------------------------------|--------------|--------------|
|
||||
| kubernetes.io/ingress.class | (required) Activate EasyHAProxy. | **required** | easyhaproxy-ingress
|
||||
| easyhaproxy.redirect_ssl | (optional) Boolean. Force redirect all endpoints to HTTPS. | false | true or false
|
||||
| easyhaproxy.letsencrypt | (optional) Boolean. It will request letsencrypt certificates for the ingresses domains. | false | true or false
|
||||
| easyhaproxy.redirect | (optional) JSON. Key pair with a domain and its destination. | *empty* | {"domain":"redirect_url"}
|
||||
| easyhaproxy.mode | (optional) Set the HTTP mode for that connection. | http | http or tcp
|
||||
| easyhaproxy.listen_port | (optional) Set the an additional port for that ingress | http | http or tcp
|
||||
| annotation | Description | Default | Example |
|
||||
|-----------------------------|-------------------------------------------------------------------------------------|--------------|---------------------------|
|
||||
| kubernetes.io/ingress.class | (required) Activate EasyHAProxy. | **required** | easyhaproxy-ingress |
|
||||
| easyhaproxy.redirect_ssl | (optional) Boolean. Force redirect all endpoints to HTTPS. | false | true or false |
|
||||
| easyhaproxy.certbot | (optional) Boolean. It will request certbot certificates for the ingresses domains. | false | true or false |
|
||||
| easyhaproxy.redirect | (optional) JSON. Key pair with a domain and its destination. | *empty* | {"domain":"redirect_url"} |
|
||||
| easyhaproxy.mode | (optional) Set the HTTP mode for that connection. | http | http or tcp |
|
||||
| easyhaproxy.listen_port | (optional) Set the an additional port for that ingress | http | http or tcp |
|
||||
|
||||
**Important**: The annotations are per ingress and applied to all hosts in that ingress configuration.
|
||||
|
||||
## Letsencrypt
|
||||
|
||||
It is necessary add the annotation `easyhaproxy.letsencrypt` to the ingress configuration:
|
||||
It is necessary add the annotation `easyhaproxy.certbot` to the ingress configuration:
|
||||
|
||||
```yaml
|
||||
kind: Ingress
|
||||
metadata:
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: easyhaproxy-ingress
|
||||
easyhaproxy.letsencrypt: 'true'
|
||||
easyhaproxy.certbot: 'true'
|
||||
name: example-ingress
|
||||
namespace: example
|
||||
spec:
|
||||
|
|
|
|||
|
|
@ -9,17 +9,17 @@ Run the EasyHAProxy container:
|
|||
```bash
|
||||
docker run \
|
||||
... \
|
||||
-e EASYHAPROXY_LETSENCRYPT_EMAIL=john@doe.com \
|
||||
-e EASYHAPROXY_CERTBOT_EMAIL=john@doe.com \
|
||||
-p 80:80 \
|
||||
-p 443:443 \
|
||||
-v /path/to/guest/lestencrypt/certs:/certs/letsencrypt \
|
||||
-v /path/to/guest/certbot/certs:/certs/certbot \
|
||||
... \
|
||||
byjg/easy-haproxy
|
||||
```
|
||||
|
||||
Notes:
|
||||
|
||||
- If you don't setup `EASYHAPROXY_LETSENCRYPT_EMAIL` environment variable, EasyHAProxy will fail silently and **will not request** a certificate.
|
||||
- If you don't setup `EASYHAPROXY_CERTBOT_EMAIL` environment variable, EasyHAProxy will fail silently and **will not request** a certificate.
|
||||
- The ports 80 and 443 needs to accessible through the internet as [Let's Encrypt requirement](https://letsencrypt.org/docs/allow-port-80/)
|
||||
|
||||
Be aware of Letsencrypt issue rate limits:
|
||||
|
|
@ -28,7 +28,7 @@ Be aware of Letsencrypt issue rate limits:
|
|||
- https://letsencrypt.org/docs/rate-limits/
|
||||
|
||||
In order to avoid several certificate issuing,
|
||||
**It is required you to persist the container folder `/certs/letsencrypt` outside the container.**
|
||||
**It is required you to persist the container folder `/certs/certbot` outside the container.**
|
||||
You cannot delete or change it contents.
|
||||
If you do not persist, or change/delete the contents, Let's encrypt will not work properly.
|
||||
|
||||
|
|
@ -41,7 +41,7 @@ docker run \
|
|||
--label easyhaproxy.express.port=80 \
|
||||
--label easyhaproxy.express.localport=3000 \
|
||||
--label easyhaproxy.express.host=example.org \
|
||||
--label easyhaproxy.express.letsencrypt=true \
|
||||
--label easyhaproxy.express.certbot=true \
|
||||
... \
|
||||
some/myimage
|
||||
```
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ customerrors: true # Optional (default false)
|
|||
|
||||
ssl_mode: default
|
||||
|
||||
letsencrypt: {
|
||||
certbot: {
|
||||
"email": "acme@example.org"
|
||||
}
|
||||
|
||||
|
|
@ -30,7 +30,7 @@ easymapping:
|
|||
host1.com.br:
|
||||
containers:
|
||||
- container:5000
|
||||
letsencrypt: true
|
||||
certbot: true
|
||||
redirect_ssl: true
|
||||
host2.com.br:
|
||||
containers:
|
||||
|
|
@ -83,7 +83,7 @@ customerrors: true # Optional (default false)
|
|||
|
||||
ssl_mode: default # Optional
|
||||
|
||||
letsencrypt: { # Optional. If you enable `letsencrypt` will need to setu0p this,
|
||||
certbot: { # Optional. If you enable `certbot` will need to setu0p this,
|
||||
# otherwise the certificate will be issued
|
||||
"email": "acme@example.org"
|
||||
}
|
||||
|
|
@ -95,7 +95,7 @@ easymapping:
|
|||
host1.com.br: # Hostname
|
||||
containers:
|
||||
- container:5000 # Endpoints of the hostname above (ip, dns, container, etc)
|
||||
letsencrypt: true # Optional. it will request a letsencrypt certiticate
|
||||
certbot: true # Optional. it will request a certbot certiticate
|
||||
redirect_ssl: true # Optional. It will redirect this site to it SSL.
|
||||
ssl: true # Optional. Inform this port will listen to SSL, instead of HTTP
|
||||
clone_to_ssl: true # Optional. Default False. You clone these hosts to its equivalent SSL.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue