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
Update docs; commit setcap.sh
Matthew Holt committed
Feb 24, 2021 at 11:55 UTC
b54fa4123975195c721ff5a5c0b43c4622009676
4 files changed
+9
-12
.gitignore
-1
@@ -10,7 +10,6 @@ Caddyfile
10
# build artifacts and helpers
11
cmd/caddy/caddy
12
cmd/caddy/caddy.exe
13
-cmd/caddy/setcap*
13
14
# mac specific
15
.DS_Store
README.md
+2
-10
@@ -69,7 +69,7 @@
69
70
The simplest, cross-platform way is to download from [GitHub Releases](https://github.com/caddyserver/caddy/releases) and place the executable file in your PATH.
71
72
-For other install options, see https://caddyserver.com/docs/download.
72
+For other install options, see https://caddyserver.com/docs/install.
73
74
## Build from source
75
@@ -89,15 +89,7 @@ $ go build
89
90
When you run Caddy, it may try to bind to low ports unless otherwise specified in your config. If your OS requires elevated privileges for this, you will need to give your new binary permission to do so. On Linux, this can be done easily with: `sudo setcap cap_net_bind_service=+ep ./caddy`
91
92
-If you prefer to use `go run` which creates temporary binaries, you can still do this. Make an executable file called `setcap.sh` (or whatever you want) with these contents:
93
-
94
-```bash
95
-#!/bin/sh
96
-sudo setcap cap_net_bind_service=+ep "$1"
97
-"$@"
98
-```
99
-
100
-then you can use `go run` like so:
92
+If you prefer to use `go run` which only creates temporary binaries, you can still do this with the included `setcap.sh` like so:
93
94
```bash
95
$ go run -exec ./setcap.sh main.go
caddy.go
+1
-1
@@ -289,7 +289,7 @@ func unsyncedDecodeAndRun(cfgJSON []byte, allowPersist bool) error {
289
} else {
290
err := ioutil.WriteFile(ConfigAutosavePath, cfgJSON, 0600)
291
if err == nil {
292
- Log().Info("autosaved config", zap.String("file", ConfigAutosavePath))
292
+ Log().Info("autosaved config (load with --resume flag)", zap.String("file", ConfigAutosavePath))
293
} else {
294
Log().Error("unable to autosave config",
295
zap.String("file", ConfigAutosavePath),
cmd/caddy/setcap.sh
new
+6
@@ -0,0 +1,6 @@
1
+#!/bin/sh
2
+
3
+# USAGE: go run -exec ./setcap.sh <args...>
4
+
5
+sudo setcap cap_net_bind_service=+ep "$1"
6
+"$@"