some library updates and adds support for adblock lists

This commit is contained in:
2025-05-02 20:57:03 -05:00
parent 03b1cc13ee
commit ce4b4a11ff
19 changed files with 712 additions and 139 deletions

View File

@ -1,8 +1,11 @@
package main
import (
"pihole-blocklist/bind/internal/config"
"os"
"time"
"gitlab.smoothnet.org/nhyatt/bind-response-policy-zone-creator/internal/config"
"gitlab.smoothnet.org/nhyatt/bind-response-policy-zone-creator/internal/log"
)
var cfg config.Config
@ -11,7 +14,12 @@ func main() {
// Blocklist Collection
// https://firebog.net/
cfg = config.Init()
var err error
if cfg, err = config.Init(); err != nil {
log.Error("error initializing program", "error", err)
os.Exit(1)
}
// Set the zone serial number
cfg.ConfigFile.ZoneConfig.Serial = time.Now().In(cfg.TZLocal).Format("0601021504")
@ -24,6 +32,6 @@ func main() {
// write file
if err := buildBindResponsePolicyFile(); err != nil {
cfg.Log.Error("unable to write file", "error", err, "path", cfg.BindOutputFileName)
log.Error("unable to write file", "error", err, "path", cfg.BindOutputFileName)
}
}