summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2021-02-24 11:55:56 -0700
committerMatthew Holt <mholt@users.noreply.github.com>2021-02-24 11:55:56 -0700
commitb54fa4123975195c721ff5a5c0b43c4622009676 (patch)
tree26ab0253aadf11a175af9ac0f800cdf0458649f8
parent427bbe99d076a76766266d1386ce16a38ce56fa6 (diff)
Update docs; commit setcap.sh
-rw-r--r--.gitignore1
-rw-r--r--README.md12
-rw-r--r--caddy.go2
-rwxr-xr-xcmd/caddy/setcap.sh6
4 files changed, 9 insertions, 12 deletions
diff --git a/.gitignore b/.gitignore
index 250a40a..2d63364 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,7 +10,6 @@ Caddyfile
# build artifacts and helpers
cmd/caddy/caddy
cmd/caddy/caddy.exe
-cmd/caddy/setcap*
# mac specific
.DS_Store
diff --git a/README.md b/README.md
index 620573e..b32be89 100644
--- a/README.md
+++ b/README.md
@@ -69,7 +69,7 @@
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.
-For other install options, see https://caddyserver.com/docs/download.
+For other install options, see https://caddyserver.com/docs/install.
## Build from source
@@ -89,15 +89,7 @@ $ go build
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`
-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:
-
-```bash
-#!/bin/sh
-sudo setcap cap_net_bind_service=+ep "$1"
-"$@"
-```
-
-then you can use `go run` like so:
+If you prefer to use `go run` which only creates temporary binaries, you can still do this with the included `setcap.sh` like so:
```bash
$ go run -exec ./setcap.sh main.go
diff --git a/caddy.go b/caddy.go
index a56529c..fccfeef 100644
--- a/caddy.go
+++ b/caddy.go
@@ -289,7 +289,7 @@ func unsyncedDecodeAndRun(cfgJSON []byte, allowPersist bool) error {
} else {
err := ioutil.WriteFile(ConfigAutosavePath, cfgJSON, 0600)
if err == nil {
- Log().Info("autosaved config", zap.String("file", ConfigAutosavePath))
+ Log().Info("autosaved config (load with --resume flag)", zap.String("file", ConfigAutosavePath))
} else {
Log().Error("unable to autosave config",
zap.String("file", ConfigAutosavePath),
diff --git a/cmd/caddy/setcap.sh b/cmd/caddy/setcap.sh
new file mode 100755
index 0000000..d777e5a
--- /dev/null
+++ b/cmd/caddy/setcap.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# USAGE: go run -exec ./setcap.sh <args...>
+
+sudo setcap cap_net_bind_service=+ep "$1"
+"$@"