git » chasquid » commit 711459b

chasquid: Remove support for test keys

author Alberto Bertogli
2016-09-23 23:47:45 UTC
committer Alberto Bertogli
2016-10-09 23:51:04 UTC
parent 3d06fb3a7886974222f8350466ccfdc9f6c4bfd8

chasquid: Remove support for test keys

The test key flags have not been used in a while, so this patch removes
them, which simplifies the initialization code a little bit.

chasquid.go +9 -15

diff --git a/chasquid.go b/chasquid.go
index ee60ef5..e7397b8 100644
--- a/chasquid.go
+++ b/chasquid.go
@@ -38,11 +38,6 @@ import (
 var (
 	configDir = flag.String("config_dir", "/etc/chasquid",
 		"configuration directory")
-
-	testCert = flag.String("test_cert", ".cert.pem",
-		"Certificate file, for testing purposes")
-	testKey = flag.String("test_key", ".key.pem",
-		"Key file, for testing purposes")
 )
 
 func main() {
@@ -87,18 +82,17 @@ func main() {
 	// They live inside the config directory, so the relative path works.
 	domainDirs, err := ioutil.ReadDir("domains/")
 	if err != nil {
-		glog.Fatalf("Error in glob: %v", err)
+		glog.Fatalf("Error reading domains/ directory: %v", err)
 	}
 	if len(domainDirs) == 0 {
-		glog.Warningf("No domains found in config, using test certs")
-		s.AddCerts(*testCert, *testKey)
-	} else {
-		glog.Infof("Domain config paths:")
-		for _, info := range domainDirs {
-			name := info.Name()
-			dir := filepath.Join("domains", name)
-			loadDomain(name, dir, s, aliasesR)
-		}
+		glog.Fatalf("No domains found in config")
+	}
+
+	glog.Infof("Domain config paths:")
+	for _, info := range domainDirs {
+		name := info.Name()
+		dir := filepath.Join("domains", name)
+		loadDomain(name, dir, s, aliasesR)
 	}
 
 	// Always include localhost as local domain.