jitsilg/cmd/jitsilg/main.go

46 lines
1.2 KiB
Go

/*
Copyright (C) 2021 j.r <j.r@jugendhacker.de>
jitsilg is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package main
import (
"log"
"os"
"regexp"
jitsilg "git.sr.ht/~j-r/jitsilg/internal"
)
func main() {
var badStunStrings = []string{
`stun[0-9]*\..*\.google.com`,
}
var badStuns []*regexp.Regexp
for _, stun := range badStunStrings {
regex, err := regexp.Compile(stun)
if err != nil {
log.Fatalf("Error compiling regex %s: %e", stun, err)
}
badStuns = append(badStuns, regex)
}
domains := jitsilg.ParseFile(os.Args[1])
output := jitsilg.ProcessDomains(domains, badStuns)
jitsilg.OutputMarkdown(output)
}