ruleset_v2 integration test working
This commit is contained in:
56
cmd/main.go
56
cmd/main.go
@@ -9,7 +9,6 @@ import (
|
||||
|
||||
"ladder/handlers"
|
||||
"ladder/internal/cli"
|
||||
"ladder/proxychain/requestmodifiers/bot"
|
||||
|
||||
"github.com/akamensky/argparse"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
@@ -43,15 +42,17 @@ func main() {
|
||||
Help: "Adds verbose logging",
|
||||
})
|
||||
|
||||
randomGoogleBot := parser.Flag("", "random-googlebot", &argparse.Options{
|
||||
Required: false,
|
||||
Help: "Update the list of trusted Googlebot IPs, and use a random one for each masqueraded request",
|
||||
})
|
||||
/*
|
||||
randomGoogleBot := parser.Flag("", "random-googlebot", &argparse.Options{
|
||||
Required: false,
|
||||
Help: "Update the list of trusted Googlebot IPs, and use a random one for each masqueraded request",
|
||||
})
|
||||
|
||||
randomBingBot := parser.Flag("", "random-bingbot", &argparse.Options{
|
||||
Required: false,
|
||||
Help: "Update the list of trusted Bingbot IPs, and use a random one for each masqueraded request",
|
||||
})
|
||||
randomBingBot := parser.Flag("", "random-bingbot", &argparse.Options{
|
||||
Required: false,
|
||||
Help: "Update the list of trusted Bingbot IPs, and use a random one for each masqueraded request",
|
||||
})
|
||||
*/
|
||||
|
||||
// TODO: add version flag that reads from handers/VERSION
|
||||
|
||||
@@ -65,14 +66,9 @@ func main() {
|
||||
Help: "Compiles a directory of yaml files into a single ruleset.yaml. Requires --ruleset arg.",
|
||||
})
|
||||
|
||||
mergeRulesetsGzip := parser.Flag("", "merge-rulesets-gzip", &argparse.Options{
|
||||
Required: false,
|
||||
Help: "Compiles a directory of yaml files into a single ruleset.gz Requires --ruleset arg.",
|
||||
})
|
||||
|
||||
mergeRulesetsOutput := parser.String("", "merge-rulesets-output", &argparse.Options{
|
||||
Required: false,
|
||||
Help: "Specify output file for --merge-rulesets and --merge-rulesets-gzip. Requires --ruleset and --merge-rulesets args.",
|
||||
Help: "Specify output file for --merge-rulesets. Requires --ruleset and --merge-rulesets args.",
|
||||
})
|
||||
|
||||
err := parser.Parse(os.Args)
|
||||
@@ -80,24 +76,26 @@ func main() {
|
||||
fmt.Print(parser.Usage(err))
|
||||
}
|
||||
|
||||
if *randomGoogleBot {
|
||||
err := bot.GoogleBot.UpdatePool("https://developers.google.com/static/search/apis/ipranges/googlebot.json")
|
||||
if err != nil {
|
||||
fmt.Println("error while retrieving list of Googlebot IPs: " + err.Error())
|
||||
fmt.Println("defaulting to known trusted Googlebot identity")
|
||||
/*
|
||||
if *randomGoogleBot {
|
||||
err := bot.GoogleBot.UpdatePool("https://developers.google.com/static/search/apis/ipranges/googlebot.json")
|
||||
if err != nil {
|
||||
fmt.Println("error while retrieving list of Googlebot IPs: " + err.Error())
|
||||
fmt.Println("defaulting to known trusted Googlebot identity")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if *randomBingBot {
|
||||
err := bot.BingBot.UpdatePool("https://www.bing.com/toolbox/bingbot.json")
|
||||
if err != nil {
|
||||
fmt.Println("error while retrieving list of Bingbot IPs: " + err.Error())
|
||||
fmt.Println("defaulting to known trusted Bingbot identity")
|
||||
if *randomBingBot {
|
||||
err := bot.BingBot.UpdatePool("https://www.bing.com/toolbox/bingbot.json")
|
||||
if err != nil {
|
||||
fmt.Println("error while retrieving list of Bingbot IPs: " + err.Error())
|
||||
fmt.Println("defaulting to known trusted Bingbot identity")
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// utility cli flag to compile ruleset directory into single ruleset.yaml
|
||||
if *mergeRulesets || *mergeRulesetsGzip {
|
||||
if *mergeRulesets {
|
||||
output := os.Stdout
|
||||
|
||||
if *mergeRulesetsOutput != "" {
|
||||
@@ -109,7 +107,7 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
err = cli.HandleRulesetMerge(*ruleset, *mergeRulesets, *mergeRulesetsGzip, output)
|
||||
err = cli.HandleRulesetMerge(*ruleset, *mergeRulesets, output)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
|
||||
Reference in New Issue
Block a user