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
cmd: Add build-info command; update CertMagic
Matthew Holt committed
Jan 10, 2020 at 11:53 UTC
ba514f9660519c0ddee3eefdbe9c9ed4a3ba5c7f
4 files changed
+30
-1
cmd/commandfuncs.go
+20
@@ -321,6 +321,26 @@ func cmdVersion(_ Flags) (int, error) {
321
return caddy.ExitCodeSuccess, nil
322
}
323
324
+func cmdBuildInfo(fl Flags) (int, error) {
325
+ bi, ok := debug.ReadBuildInfo()
326
+ if !ok {
327
+ return caddy.ExitCodeFailedStartup, fmt.Errorf("no build information")
328
+ }
329
+
330
+ fmt.Printf("path: %s\n", bi.Path)
331
+ fmt.Printf("main: %s %s %s\n", bi.Main.Path, bi.Main.Version, bi.Main.Sum)
332
+ fmt.Println("dependencies:")
333
+
334
+ for _, goMod := range bi.Deps {
335
+ fmt.Printf("%s %s %s", goMod.Path, goMod.Version, goMod.Sum)
336
+ if goMod.Replace != nil {
337
+ fmt.Printf(" => %s %s %s", goMod.Replace.Path, goMod.Replace.Version, goMod.Replace.Sum)
338
+ }
339
+ fmt.Println()
340
+ }
341
+ return caddy.ExitCodeSuccess, nil
342
+}
343
+
344
func cmdListModules(fl Flags) (int, error) {
345
versions := fl.Bool("versions")
346
cmd/commands.go
+6
@@ -188,6 +188,12 @@ config file; otherwise the default is assumed.`,
188
}(),
189
})
190
191
+ RegisterCommand(Command{
192
+ Name: "build-info",
193
+ Func: cmdBuildInfo,
194
+ Short: "Prints information about this build",
195
+ })
196
+
197
RegisterCommand(Command{
198
Name: "environ",
199
Func: cmdEnviron,
go.mod
+2
-1
@@ -7,6 +7,7 @@ require (
7
github.com/alecthomas/chroma v0.7.0
8
github.com/andybalholm/brotli v0.0.0-20190821151343-b60f0d972eeb
9
github.com/cenkalti/backoff/v3 v3.1.1 // indirect
10
+ github.com/decker502/dnspod-go v0.2.0 // indirect
11
github.com/dustin/go-humanize v1.0.0
12
github.com/go-acme/lego/v3 v3.3.0
13
github.com/golang/groupcache v0.0.0-20191002201903-404acd9df4cc
@@ -17,7 +18,7 @@ require (
18
github.com/klauspost/cpuid v1.2.2
19
github.com/kylelemons/godebug v1.1.0 // indirect
20
github.com/lucas-clemente/quic-go v0.14.1
20
- github.com/mholt/certmagic v0.9.0
21
+ github.com/mholt/certmagic v0.9.1
22
github.com/miekg/dns v1.1.25 // indirect
23
github.com/muhammadmuzzammil1998/jsonc v0.0.0-20190906142622-1265e9b150c6
24
github.com/naoina/go-stringutil v0.1.0 // indirect
go.sum
+2
@@ -230,6 +230,8 @@ github.com/mattn/go-tty v0.0.0-20180219170247-931426f7535a/go.mod h1:XPvLUNfbS4f
230
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
231
github.com/mholt/certmagic v0.9.0 h1:dYh9sZPDBTcIiPhYM/Qtv3V623/zFH34FmpbrQTpMAc=
232
github.com/mholt/certmagic v0.9.0/go.mod h1:91uJzK5K8IWtYQqTi5R2tsxV1pCde+wdGfaRaOZi6aQ=
233
+github.com/mholt/certmagic v0.9.1 h1:wPzyouOyE+30NIQETJuhTB5ZQWz+0Hy038vaR5WWQDE=
234
+github.com/mholt/certmagic v0.9.1/go.mod h1:nu8jbsbtwK4205EDH/ZUMTKsfYpJA1Q7MKXHfgTihNw=
235
github.com/miekg/dns v1.1.15 h1:CSSIDtllwGLMoA6zjdKnaE6Tx6eVUxQ29LUgGetiDCI=
236
github.com/miekg/dns v1.1.15/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
237
github.com/miekg/dns v1.1.25 h1:dFwPR6SfLtrSwgDcIq2bcU/gVutB4sNApq2HBdqcakg=