mirror of
https://github.com/therootcompany/golib.git
synced 2026-11-04 06:55:00 +00:00
refactor(cmd/form2mail): use external GeoIP updater
This commit is contained in:
parent
4760eecc38
commit
3d02034c22
@ -60,8 +60,6 @@ type MainConfig struct {
|
||||
blocklistRepo string
|
||||
cacheDir string
|
||||
geoipDir string
|
||||
geoipBaseURL string
|
||||
geoipConfPath string
|
||||
}
|
||||
|
||||
func main() {
|
||||
@ -93,8 +91,6 @@ func main() {
|
||||
fs.StringVar(&cfg.blocklistRepo, "blocklist-repo", cfg.blocklistRepo, "git URL of the bitwire-it-compatible blocklist repo")
|
||||
fs.StringVar(&cfg.cacheDir, "cache-dir", "", "cache parent dir (default: ~/.cache)")
|
||||
fs.StringVar(&cfg.geoipDir, "geoip-dir", "", "dir holding GeoLite2 tarballs (default: <$cache-dir>/maxmind)")
|
||||
fs.StringVar(&cfg.geoipBaseURL, "geoip-base-url", "", "MaxMind download base URL (default: https://download.maxmind.com/geoip/databases)")
|
||||
fs.StringVar(&cfg.geoipConfPath, "geoip-conf", "", "path to GeoIP.conf (default: ./GeoIP.conf or ~/.config/maxmind/GeoIP.conf)")
|
||||
|
||||
fs.Usage = func() {
|
||||
printVersion(os.Stderr)
|
||||
@ -188,8 +184,6 @@ func main() {
|
||||
BlocklistRepo: cfg.blocklistRepo,
|
||||
CacheDir: cfg.cacheDir,
|
||||
GeoIPDir: cfg.geoipDir,
|
||||
GeoIPBaseURL: cfg.geoipBaseURL,
|
||||
GeoIPConfPath: cfg.geoipConfPath,
|
||||
AllowedCountries: []string{"US", "CA", "MX", "CR", "VI"},
|
||||
Fields: fields,
|
||||
RPM: requestsPerMinute,
|
||||
|
||||
@ -4,7 +4,7 @@ go 1.26.5
|
||||
|
||||
require (
|
||||
github.com/joho/godotenv v1.5.1
|
||||
github.com/therootcompany/golib/net/formmailer v0.1.1
|
||||
github.com/therootcompany/golib/net/formmailer v0.2.0
|
||||
golang.org/x/term v0.40.0
|
||||
)
|
||||
|
||||
|
||||
@ -12,8 +12,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT
|
||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/therootcompany/golib/https v0.9.0 h1:D9gh0K6ljkvF805JUbylITn8SHPMo08q5PglQGXsK8c=
|
||||
github.com/therootcompany/golib/https v0.9.0/go.mod h1:ilExqR/Uh7oB36oy9mwuNhANcFh+zdCfD3uJiZ11YAY=
|
||||
github.com/therootcompany/golib/net/formmailer v0.1.1 h1:TF81OYZNqWu6aZqhaEGcKEBaCUSfOvgM+807/Snn+Xo=
|
||||
github.com/therootcompany/golib/net/formmailer v0.1.1/go.mod h1:hFr4I6BalzjJOs5JA7p2iGayN6wTz13/YqEDYOhptDs=
|
||||
github.com/therootcompany/golib/net/formmailer v0.2.0 h1:2sfP9YhLKZ6TUJYw8ynOhrzs0sJri+uukBLttr3WWKo=
|
||||
github.com/therootcompany/golib/net/formmailer v0.2.0/go.mod h1:hFr4I6BalzjJOs5JA7p2iGayN6wTz13/YqEDYOhptDs=
|
||||
github.com/therootcompany/golib/net/geoip v0.5.3 h1:wps0TrRoGYw7XA5mWP0uOkGBF5oZ5rQ+1JPIAkRYrOU=
|
||||
github.com/therootcompany/golib/net/geoip v0.5.3/go.mod h1:3CuuG2igsZySLNrRxoRTHPw3fmw9c4b0jRajSOOKJNU=
|
||||
github.com/therootcompany/golib/net/gitshallow v0.9.3 h1:FKi0IvpqEDnYasjTmkRmXDdi+y3bhQBcjgvggwAwxFs=
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user