Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 14, 05:15 UTC
Require Go 1.13; use Go 1.13's default support for TLS 1.3
Matthew Holt committed
Sep 10, 2019 at 13:11 UTC
1ce10b453fbfd01aae7887c4ff8e5730f7908f50
2 files changed
+12
-15
README.md
+12
-7
@@ -22,8 +22,8 @@ Please file issues to propose new features and report bugs, and after the bug or
22
23
Requirements:
24
25
-- [Go 1.12 or newer](https://golang.org/dl/)
26
-- [Go modules](https://github.com/golang/go/wiki/Modules) enabled: `export GO111MODULE=on`
25
+- [Go 1.13 or newer](https://golang.org/dl/)
26
+- Make sure you do not disable [Go modules](https://github.com/golang/go/wiki/Modules) (`export GO111MODULE=auto`)
27
28
Download source code:
29
@@ -40,11 +40,13 @@ $ go build
40
41
That will put a `caddy(.exe)` binary into the current directory. You can move it into your PATH or use `go install` to do that automatically (assuming `$GOPATH/bin` is already in your PATH). You can also use `go run main.go` for quick, temporary builds while developing.
42
43
-The initial build may be slow as dependencies are downloaded. Subsequent builds should be very fast. If you encounter any Go-module-related errors, try clearing your Go module cache (`$GOPATH/pkg/mod`) and read [the Go wiki page about modules for help](https://github.com/golang/go/wiki/Modules).
43
+The initial build may be slow as dependencies are downloaded. Subsequent builds should be very fast. If you encounter any Go-module-related errors, try clearing your Go module cache (`$GOPATH/pkg/mod`) and read [the Go wiki page about modules for help](https://github.com/golang/go/wiki/Modules). If you have issues with Go modules, please consult the Go community for help. But if there is an actual error in Caddy, please report it to us.
44
45
46
## Quick Start
47
48
+(Until the stable 2.0 release, there may be breaking changes in v2, please be aware!)
49
+
50
These instructions assume an executable build of Caddy 2 is named `caddy` in the current folder. If it's in your PATH, you may omit the path to the binary (`./`).
51
52
Start Caddy:
@@ -119,11 +121,11 @@ example.com
121
templates
122
encode gzip zstd
123
try_files {path}.html {path}
122
-proxy /api http://localhost:9005
124
+reverse_proxy /api localhost:9005
125
file_server
126
```
127
126
-Instead of being its core method of configuration, an internal _config adapter_ adapts the Caddyfile to Caddy's native JSON structure. You can see it in action with the [`adapt-config` command](https://github.com/caddyserver/caddy/wiki/v2:-Documentation#adapt-config):
128
+Instead of being its primary mode of configuration, an internal _config adapter_ adapts the Caddyfile to Caddy's native JSON structure. You can see it in action with the [`adapt-config` command](https://github.com/caddyserver/caddy/wiki/v2:-Documentation#adapt-config):
129
130
```bash
131
$ ./caddy adapt-config --input path/to/Caddyfile --adapter caddyfile --pretty
@@ -164,6 +166,8 @@ Caddy 2 is very much in development, so the documentation is an ongoing WIP, but
166
167
**https://github.com/caddyserver/caddy/wiki/v2:-Documentation**
168
169
+Note that breaking changes are expected until the stable 2.0 release.
170
+
171
172
## List of Improvements
173
@@ -219,9 +223,8 @@ The following is a non-comprehensive list of significant improvements over Caddy
223
And a few major features still being worked on:
224
225
- Logging
222
-- More powerful, dynamic reverse proxy
226
- Kubernetes ingress controller (mostly done, just polishing it -- and it's amazing)
224
-- Config adapters. Caddy's native JSON config structure is powerful and complex. Config adapters upsample various formats to Caddy's native config. Planned adapters include Caddyfile, NGINX config, YAML, and TOML. The community might be interested in building Traefik and Apache config adapters!
227
+- More config adapters. Caddy's native JSON config structure is powerful and complex. Config adapters upsample various formats to Caddy's native config. There are already adapters for Caddyfile, JSON 5, and JSON-C. Planned are NGINX config, YAML, and TOML. The community might be interested in building Traefik and Apache config adapters!
228
229
230
@@ -250,6 +253,8 @@ Caddy's default _config adapter_ is the Caddyfile adapter. This takes a Caddyfil
253
The following _config adapters_ are already being built or plan to be built:
254
255
- Caddyfile
256
+- JSON 5
257
+- JSON-C
258
- nginx
259
- YAML
260
- TOML
modules/caddytls/tls.go
-8
@@ -18,9 +18,7 @@ import (
18
"crypto/tls"
19
"encoding/json"
20
"fmt"
21
- "log"
21
"net/http"
23
- "os"
22
"time"
23
24
"github.com/caddyserver/caddy/v2"
@@ -31,12 +29,6 @@ import (
29
30
func init() {
31
caddy.RegisterModule(TLS{})
34
-
35
- // opt-in TLS 1.3 for Go1.12
36
- // TODO: remove this line when Go1.13 is released.
37
- if err := os.Setenv("GODEBUG", os.Getenv("GODEBUG")+",tls13=1"); err != nil {
38
- log.Println("[ERROR] failed to set environment variable: ", err)
39
- }
32
}
33
34
// TLS represents a process-wide TLS configuration.