mirror of
https://github.com/caddyserver/caddy.git
synced 2025-02-24 16:59:00 +01:00
Customize admin endpoint address with -listen flag
This is a temporary holdover for development purposes
This commit is contained in:
parent
3439933235
commit
f064889a4f
2 changed files with 9 additions and 4 deletions
11
cmd/run.go
11
cmd/run.go
|
@ -1,6 +1,7 @@
|
||||||
package caddycmd
|
package caddycmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"flag"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"bitbucket.org/lightcodelabs/caddy2"
|
"bitbucket.org/lightcodelabs/caddy2"
|
||||||
|
@ -8,14 +9,18 @@ import (
|
||||||
|
|
||||||
// Main executes the main function of the caddy command.
|
// Main executes the main function of the caddy command.
|
||||||
func Main() {
|
func Main() {
|
||||||
addr := ":1234" // TODO: for dev only
|
flag.Parse()
|
||||||
err := caddy2.StartAdmin(addr)
|
|
||||||
|
err := caddy2.StartAdmin(*listenAddr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
defer caddy2.StopAdmin()
|
defer caddy2.StopAdmin()
|
||||||
|
|
||||||
log.Println("Caddy 2 admin endpoint listening on", addr)
|
log.Println("Caddy 2 admin endpoint listening on", *listenAddr)
|
||||||
|
|
||||||
select {}
|
select {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: for dev only
|
||||||
|
var listenAddr = flag.String("listen", ":1234", "The admin endpoint listener address")
|
||||||
|
|
|
@ -23,7 +23,7 @@ type standardSTEKProvider struct {
|
||||||
|
|
||||||
// Initialize sets the configuration for s and returns the starting keys.
|
// Initialize sets the configuration for s and returns the starting keys.
|
||||||
func (s *standardSTEKProvider) Initialize(config *caddytls.SessionTicketService) ([][32]byte, error) {
|
func (s *standardSTEKProvider) Initialize(config *caddytls.SessionTicketService) ([][32]byte, error) {
|
||||||
// keep a reference to the config, we'll need when rotating keys
|
// keep a reference to the config; we'll need it when rotating keys
|
||||||
s.stekConfig = config
|
s.stekConfig = config
|
||||||
|
|
||||||
itvl := time.Duration(s.stekConfig.RotationInterval)
|
itvl := time.Duration(s.stekConfig.RotationInterval)
|
||||||
|
|
Loading…
Reference in a new issue