Skip to content

Commit

Permalink
add deduplication
Browse files Browse the repository at this point in the history
  • Loading branch information
Issif committed May 29, 2020
1 parent f14f72d commit 1dbd541
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 0 additions & 2 deletions README.md
Expand Up @@ -28,7 +28,6 @@ SlackIconURL: "" #Slack Icon (Avatar) URL
SlackUsername: "" #Slack Username
Regexp: ".*\\.fr$" #Regexp to match. Can't be empty. It uses Golang regexp format
Workers: 20 #Number of workers for consuming feed from CertStream
DisplayErrors: false #Enable/Disable display of errors in logs
```

### With env vars
Expand All @@ -38,7 +37,6 @@ DisplayErrors: false #Enable/Disable display of errors in logs
- **SLACKUSERNAME**: Slack Username
- **REGEXP**: Regexp to match, if empty, '.*' is used. Use Golang regexp format
- **WORKERS**: Number of workers for consuming feed from CertStream
- **DISPLAYERRORS**: Enable/Disable display of errors in logs

## Run

Expand Down
3 changes: 1 addition & 2 deletions example.yaml
Expand Up @@ -3,5 +3,4 @@ SlackWebhookURL: "" #Slack Webhook URL
SlackIconURL: "" #Slack Icon (Avatar) URL
SlackUsername: "" #Slack Username
Regexp: ".*\\.fr" #Regexp to match. Can't be empty. It uses Golang regexp format
Workers: 20 #Number of workers for consuming stream from CertStream
DisplayErrors: true #Enable/Disable display of errors in logs
Workers: 20 #Number of workers for consuming stream from CertStream
1 change: 1 addition & 0 deletions lib/config.go
Expand Up @@ -19,6 +19,7 @@ type Configuration struct {
DomainName string
RegIP string
Regexp string
Deduplication string
Homoglyph map[string]string
}

Expand Down
4 changes: 4 additions & 0 deletions lib/lib.go
Expand Up @@ -75,6 +75,10 @@ func CertCheckWorker(config *Configuration) {
if !isMatchingCert(config, detailedCert, reg) {
continue
}
if detailedCert.Domain == config.Deduplication {
continue
}
config.Deduplication = detailedCert.Domain
j, _ := json.Marshal(detailedCert)
log.Infof("A certificate for '%v' has been issued : %v\n", detailedCert.Domain, string(j))
if config.SlackWebHookURL != "" {
Expand Down

0 comments on commit 1dbd541

Please sign in to comment.