Browse Source

Initialise cert map

master
Chris Smith 5 years ago
parent
commit
15a2b4090c
1 changed files with 1 additions and 2 deletions
  1. 1
    2
      certs/monitor.go

+ 1
- 2
certs/monitor.go View File

@@ -21,6 +21,7 @@ func NewCertificateManager(logger *zap.SugaredLogger, channel chan<- model.Found
21 21
 	return &CertificateMonitor{
22 22
 		logger:  logger,
23 23
 		channel: channel,
24
+		certs:   make(map[string]*model.FoundCertificate),
24 25
 	}
25 26
 }
26 27
 
@@ -59,11 +60,9 @@ func (c *CertificateMonitor) scanForCerts(vhost string, dir string) {
59 60
 		ext := path.Ext(f.Name())
60 61
 		base := path.Base(f.Name())
61 62
 		base = base[:len(base)-len(ext)]
62
-		c.logger.Debugf("File %s has extension %s, base name %s", f.Name(), ext, base)
63 63
 		if ext == ".pem" {
64 64
 			prefix := strings.Split(base, "-")[0]
65 65
 			added := maybeAddPart(&cert, prefix, path.Join(dir, f.Name()))
66
-			c.logger.Debugf("\tFile prefix is %s, added status %s", prefix, added)
67 66
 			if added && f.ModTime().After(cert.ModTime) {
68 67
 				cert.ModTime = f.ModTime()
69 68
 			}

Loading…
Cancel
Save