1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-17 14:37:02 +00:00

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.
This commit is contained in:
Alberto Bertogli
2016-09-24 00:47:45 +01:00
parent 3d06fb3a78
commit 711459b798

View File

@@ -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.