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:
14
chasquid.go
14
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,19 +82,18 @@ 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.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.
|
||||
// This can prevent potential trouble if we were to accidentally treat it
|
||||
|
||||
Reference in New Issue
Block a user