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:
24
chasquid.go
24
chasquid.go
@@ -38,11 +38,6 @@ import (
|
|||||||
var (
|
var (
|
||||||
configDir = flag.String("config_dir", "/etc/chasquid",
|
configDir = flag.String("config_dir", "/etc/chasquid",
|
||||||
"configuration directory")
|
"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() {
|
func main() {
|
||||||
@@ -87,18 +82,17 @@ func main() {
|
|||||||
// They live inside the config directory, so the relative path works.
|
// They live inside the config directory, so the relative path works.
|
||||||
domainDirs, err := ioutil.ReadDir("domains/")
|
domainDirs, err := ioutil.ReadDir("domains/")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Fatalf("Error in glob: %v", err)
|
glog.Fatalf("Error reading domains/ directory: %v", err)
|
||||||
}
|
}
|
||||||
if len(domainDirs) == 0 {
|
if len(domainDirs) == 0 {
|
||||||
glog.Warningf("No domains found in config, using test certs")
|
glog.Fatalf("No domains found in config")
|
||||||
s.AddCerts(*testCert, *testKey)
|
}
|
||||||
} else {
|
|
||||||
glog.Infof("Domain config paths:")
|
glog.Infof("Domain config paths:")
|
||||||
for _, info := range domainDirs {
|
for _, info := range domainDirs {
|
||||||
name := info.Name()
|
name := info.Name()
|
||||||
dir := filepath.Join("domains", name)
|
dir := filepath.Join("domains", name)
|
||||||
loadDomain(name, dir, s, aliasesR)
|
loadDomain(name, dir, s, aliasesR)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Always include localhost as local domain.
|
// Always include localhost as local domain.
|
||||||
|
|||||||
Reference in New Issue
Block a user