Skip to content

Commit 1aba810

Browse files
committed
Update README.md
1 parent 4b6affe commit 1aba810

File tree

1 file changed

+10
-23
lines changed

1 file changed

+10
-23
lines changed

README.md

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Caddy Storage Consul K/V
1+
# Caddy Cluster / Certmagic Storage Consul K/V
22

33
[Consul K/V](https://github.com/hashicorp/consul) Storage for [Caddy](https://github.com/mholt/caddy) TLS data.
44

55
By default Caddy uses local filesystem to store TLS data (generated keys, csr, crt) when it auto-generates certificates from a CA like Lets Encrypt.
66
Starting with 0.11.x Caddy can work in cluster environments where TLS storage path is shared across servers.
77
This is a great improvement but you need to take care of mounting a centeralized storage on every server. If you have an already running Consul cluster it can be easier to use it's KV store to save certificates and make them available to all Caddy instances.
88

9-
This plugin enables Caddy to store TLS data like keys and certificates in Consul's K/V store.
9+
This cluster plugin enables Caddy to store TLS data like keys and certificates in Consul's K/V store.
1010
This allows you to use Caddy in a cluster or multi machine environment and use a centralized storage for auto-generated certificates.
1111

1212
With this plugin it is possible to use multiple Caddy instances with the same HTTPS domain for instance with DNS round-robin.
@@ -17,8 +17,12 @@ its new storage interface (> 0.11.1). More at https://github.com/pteich/caddy-tl
1717

1818
For older versions of Caddy (0.10.x - 0.11.1) you can use the `old_storage_interface` branch.
1919

20+
2021
## Installation (subject to change for Caddy >0.11.1)
2122

23+
For new versions of Caddy this cluster plugin will be available as a first-class plugin on Caddy's download page.
24+
25+
[DEPRECATED] ~~
2226
You need to compile Caddy by yourself to use this plugin. Alternativly you can use my Docker image that already includes Consul KV storage, more infos below.
2327

2428
- Set up a working Go installation, see https://golang.org/doc/install
@@ -31,18 +35,12 @@ import (
3135
_ "github.com/pteich/caddy-tlsconsul"
3236
)
3337
```
34-
- [DEPRECATED] ~~Change dir into `caddy/caddymain` and compile Caddy with `build.bash`~~
3538
- Change dir into `caddy/caddy` do a `go get github.com/caddyserver/builds` and compile Caddy with `go run build.go`
39+
~~
3640

3741
## Configuration
3842

39-
In order to use Consul you have to change the storage provider in your Caddyfile like so:
40-
41-
```
42-
tls my@email.com {
43-
storage consul
44-
}
45-
```
43+
You enable Consul storage with Caddy by setting the `CADDY_CLUSTERING` environment variable to `consul`.
4644

4745
Because this plugin uses the official Consul API client you can use all ENV variables like `CONSUL_HTTP_ADDR` or `CONSUL_HTTP_TOKEN`
4846
to define your Consul connection and credentials. For more information see https://github.com/hashicorp/consul/blob/master/api/api.go
@@ -51,16 +49,5 @@ Without any further configuration a running Consul on 127.0.01:8500 is assumed.
5149

5250
There are additional ENV variables for this plugin:
5351

54-
- `CADDY_CONSULTLS_AESKEY` defines your personal AES key to use when encrypting data. It needs to be 32 characters long.
55-
- `CADDY_CONSULTLS_PREFIX` defines the prefix for the keys in KV store. Default is `caddytls`
56-
57-
## Run with Docker
58-
59-
You can use a custom version of Caddy with integrated Consul TLS storage using the Dockerfile provided in this repo. Because this Dockerfile uses multi-stage build you need at least Docker 17.05 CE.
60-
61-
See https://hub.docker.com/r/pteich/caddy-tlsconsul/
62-
63-
Example for a Docker run command:
64-
```bash
65-
docker run -d -p 80:80 -p 443:443 -e "CONSUL_HTTP_ADDR=my.consul.addr:8500" -v /home/test/Caddyfile:/Caddyfile:ro -v /home/test/config:/.caddy:rw -v /home/test/html:/var/www/html pteich/caddy-tlsconsul -agree -conf=/Caddyfile
66-
```
52+
- `CADDY_CLUSTERING_CONSUL_AESKEY` defines your personal AES key to use when encrypting data. It needs to be 32 characters long.
53+
- `CADDY_CLUSTERING_CONSUL_PREFIX` defines the prefix for the keys in KV store. Default is `caddytls`

0 commit comments

Comments
 (0)