Browse Source

Populate vhost correctly for certs

master
Chris Smith 5 years ago
parent
commit
32a3546cec
2 changed files with 6 additions and 2 deletions
  1. 2
    0
      certs/deployer.go
  2. 4
    2
      certs/monitor.go

+ 2
- 0
certs/deployer.go View File

@@ -51,6 +51,8 @@ func (c *CertificateDeployer) deployAll() {
51 51
 			for _, hostname := range c.hostnames {
52 52
 				if cert, ok := c.certs[hostname.Name]; ok {
53 53
 					c.deploySingle(cert, hostname)
54
+				} else {
55
+					c.logger.Warnf("No certificate found for %s", hostname.Name)
54 56
 				}
55 57
 			}
56 58
 		}

+ 4
- 2
certs/monitor.go View File

@@ -48,14 +48,16 @@ func (c *CertificateMonitor) scanForFolders(dir string) {
48 48
 }
49 49
 
50 50
 func (c *CertificateMonitor) scanForCerts(vhost string, dir string) {
51
-	c.logger.Debugf("Scanning folder %s for certificates for %s", dir, vhost)
51
+	c.logger.Debugf("Scanning folder %s for certificates", dir)
52 52
 	files, err := ioutil.ReadDir(dir)
53 53
 	if err != nil {
54 54
 		c.logger.Errorf("Unable to read directory %s - %s", dir, err.Error())
55 55
 		return
56 56
 	}
57 57
 
58
-	cert := model.FoundCertificate{}
58
+	cert := model.FoundCertificate{
59
+		Hostname: vhost,
60
+	}
59 61
 	for _, f := range files {
60 62
 		ext := path.Ext(f.Name())
61 63
 		base := path.Base(f.Name())

Loading…
Cancel
Save