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
Customize admin endpoint address with -listen flag
This is a temporary holdover for development purposes
Matthew Holt committed
Jun 3, 2019 at 15:35 UTC
f064889a4f6230fec37da021087b6e2bfb29cc58
2 files changed
+9
-4
cmd/run.go
+8
-3
@@ -1,6 +1,7 @@
1
package caddycmd
2
3
import (
4
+ "flag"
5
"log"
6
7
"bitbucket.org/lightcodelabs/caddy2"
@@ -8,14 +9,18 @@ import (
9
10
// Main executes the main function of the caddy command.
11
func Main() {
11
- addr := ":1234" // TODO: for dev only
12
- err := caddy2.StartAdmin(addr)
12
+ flag.Parse()
13
+
14
+ err := caddy2.StartAdmin(*listenAddr)
15
if err != nil {
16
log.Fatal(err)
17
}
18
defer caddy2.StopAdmin()
19
18
- log.Println("Caddy 2 admin endpoint listening on", addr)
20
+ log.Println("Caddy 2 admin endpoint listening on", *listenAddr)
21
22
select {}
23
}
24
+
25
+// TODO: for dev only
26
+var listenAddr = flag.String("listen", ":1234", "The admin endpoint listener address")
modules/caddytls/standardstek/stek.go
+1
-1
@@ -23,7 +23,7 @@ type standardSTEKProvider struct {
23
24
// Initialize sets the configuration for s and returns the starting keys.
25
func (s *standardSTEKProvider) Initialize(config *caddytls.SessionTicketService) ([][32]byte, error) {
26
- // keep a reference to the config, we'll need when rotating keys
26
+ // keep a reference to the config; we'll need it when rotating keys
27
s.stekConfig = config
28
29
itvl := time.Duration(s.stekConfig.RotationInterval)