From f9332035cbf491bd30d48ec9a606d63b81f80c45 Mon Sep 17 00:00:00 2001 From: Adam Bark Date: Fri, 24 Jul 2020 14:13:59 -0500 Subject: [PATCH] Add default configuration values Address issue #297 --- cmd/pebble/main.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cmd/pebble/main.go b/cmd/pebble/main.go index bb4bea4b..69ed42b1 100644 --- a/cmd/pebble/main.go +++ b/cmd/pebble/main.go @@ -29,6 +29,17 @@ type config struct { } } +func setConfigDefaults() (config) { + var conf config + conf.Pebble.ListenAddress = "0.0.0.0:14000" + conf.Pebble.ManagementListenAddress = "0.0.0.0:15000" + conf.Pebble.Certificate = "test/certs/localhost/cert.pem" + conf.Pebble.PrivateKey = "test/certs/localhost/key.pem" + conf.Pebble.HTTPPort = 5002 + conf.Pebble.TLSPort = 5001 + return conf +} + func main() { configFile := flag.String( "config", @@ -52,7 +63,7 @@ func main() { logger := log.New(os.Stdout, "Pebble ", log.LstdFlags) logger.Printf("Starting Pebble ACME server") - var c config + c := setConfigDefaults() err := cmd.ReadConfigFile(*configFile, &c) cmd.FailOnError(err, "Reading JSON config file into config structure")