54 lines
1.3 KiB
Go
54 lines
1.3 KiB
Go
package checker
|
|
|
|
import (
|
|
"time"
|
|
|
|
sdk "git.happydns.org/checker-sdk-go/checker"
|
|
)
|
|
|
|
// Version is overridden at link time by the standalone or plugin entrypoints.
|
|
var Version = "built-in"
|
|
|
|
// Definition assembles the checker definition by aggregating each
|
|
// registered Source's options into the SDK's audience-grouped layout.
|
|
// Adding a source automatically adds its option fields here: no edit
|
|
// to this file needed.
|
|
func Definition() *sdk.CheckerDefinition {
|
|
opts := sdk.CheckerOptionsDocumentation{
|
|
DomainOpts: []sdk.CheckerOptionDocumentation{
|
|
{
|
|
Id: "domain_name",
|
|
Label: "Domain name",
|
|
AutoFill: sdk.AutoFillDomainName,
|
|
},
|
|
},
|
|
}
|
|
for _, s := range Sources() {
|
|
o := s.Options()
|
|
opts.AdminOpts = append(opts.AdminOpts, o.Admin...)
|
|
opts.UserOpts = append(opts.UserOpts, o.User...)
|
|
}
|
|
|
|
return &sdk.CheckerDefinition{
|
|
ID: "blacklist",
|
|
Name: "Blacklist & reputation",
|
|
Version: Version,
|
|
|
|
Availability: sdk.CheckerAvailability{
|
|
ApplyToDomain: true,
|
|
},
|
|
ObservationKeys: []sdk.ObservationKey{ObservationKeyBlacklist},
|
|
|
|
Options: opts,
|
|
Rules: Rules(),
|
|
|
|
Interval: &sdk.CheckIntervalSpec{
|
|
Min: 30 * time.Minute,
|
|
Max: 24 * time.Hour,
|
|
Default: 6 * time.Hour,
|
|
},
|
|
|
|
HasHTMLReport: true,
|
|
HasMetrics: true,
|
|
}
|
|
}
|