mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-15 12:58:45 +00:00
feat(iplist2rule): add comment describing how rule was generated
Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/TecharoHQ/anubis/lib/config"
|
"github.com/TecharoHQ/anubis/lib/config"
|
||||||
"github.com/facebookgo/flagenv"
|
"github.com/facebookgo/flagenv"
|
||||||
@@ -85,9 +86,10 @@ func main() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("can't create output file %q: %v", foutName, err)
|
log.Fatalf("can't create output file %q: %v", foutName, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
defer fout.Close()
|
defer fout.Close()
|
||||||
|
|
||||||
|
fmt.Fprintf(fout, "# Generated by %s on %s from %s\n\n", filepath.Base(os.Args[0]), time.Now().Format(time.RFC3339), blocklistURL)
|
||||||
|
|
||||||
data, err := yaml.Marshal([]*Rule{result})
|
data, err := yaml.Marshal([]*Rule{result})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("can't marshal yaml")
|
log.Fatalf("can't marshal yaml")
|
||||||
|
|||||||
Reference in New Issue
Block a user