projectdiscovery / mapcidr

Utility program to perform multiple operations for a given subnet/CIDR ranges.
https://projectdiscovery.io
MIT License
986 stars 92 forks source link

[Issue] This project has too many dependencies. #171

Closed KOLANICH closed 1 year ago

KOLANICH commented 1 year ago

Describe the bug

golang.org/x/net/html/atom
golang.org/x/net/internal/iana
golang.org/x/exp/maps
github.com/projectdiscovery/gologger/levels
github.com/dsnet/compress/internal
github.com/dsnet/compress/bzip2/internal/sais
github.com/ulikunitz/xz/internal/hash
github.com/tidwall/match
github.com/tidwall/tinyqueue
github.com/projectdiscovery/blackrock
github.com/tidwall/rtred/base
github.com/VividCortex/ewma
github.com/tidwall/rtred
github.com/rivo/uniseg
github.com/tidwall/btree
github.com/cnf/structhash
github.com/pkg/errors
github.com/aymerick/douceur/css
golang.org/x/net/html
github.com/gorilla/css/scanner
github.com/asaskevich/govalidator
github.com/aymerick/douceur/parser
github.com/saintfish/chardet
github.com/microcosm-cc/bluemonday/css
gopkg.in/yaml.v3
golang.org/x/net/bpf
golang.org/x/sys/unix
github.com/microcosm-cc/bluemonday - a fast golang HTML sanitizer (inspired by the OWASP Java HTML Sanitizer) to scrub user generated content of XSS 
github.com/projectdiscovery/utils/slice
github.com/modern-go/concurrent
github.com/modern-go/reflect2
github.com/projectdiscovery/utils/strings
github.com/logrusorgru/aurora
github.com/projectdiscovery/utils/file
golang.org/x/net/internal/socket
github.com/dsnet/compress/internal/errors
github.com/json-iterator/go
github.com/dsnet/compress
github.com/golang/snappy
github.com/dsnet/compress/internal/prefix
github.com/nwaples/rardecode
golang.org/x/net/ipv4
golang.org/x/net/ipv6
github.com/dsnet/compress/bzip2
github.com/pierrec/lz4/internal/xxh32
github.com/miekg/dns
github.com/ulikunitz/xz/internal/xlog
github.com/pierrec/lz4
github.com/ulikunitz/xz/lzma
github.com/xi2/xz
github.com/projectdiscovery/gologger/formatter
gopkg.in/djherbis/times.v1
github.com/projectdiscovery/hmap/store/cache
github.com/akrylysov/pogreb/internal/errors
github.com/akrylysov/pogreb/internal/hash
github.com/akrylysov/pogreb/fs
github.com/ulikunitz/xz
github.com/akrylysov/pogreb - Embedded key-value store for read-heavy workloads written in Go
github.com/syndtr/goleveldb/leveldb/util
github.com/syndtr/goleveldb/leveldb/cache
github.com/syndtr/goleveldb/leveldb/comparer
github.com/mholt/archiver
github.com/syndtr/goleveldb/leveldb/storage
github.com/syndtr/goleveldb/leveldb/filter
github.com/syndtr/goleveldb/leveldb/opt
github.com/tidwall/pretty
github.com/tidwall/gjson
github.com/projectdiscovery/gologger/writer
github.com/syndtr/goleveldb/leveldb/errors
github.com/projectdiscovery/gologger
github.com/syndtr/goleveldb/leveldb/iterator
github.com/syndtr/goleveldb/leveldb/journal
go.etcd.io/bbolt
github.com/syndtr/goleveldb/leveldb/memdb
github.com/syndtr/goleveldb/leveldb/table
github.com/projectdiscovery/utils/maps
github.com/tidwall/grect
github.com/tidwall/buntdb - BuntDB is an embeddable, in-memory key/value database for Go with custom indexing and geospatial support 
github.com/projectdiscovery/goflags
github.com/syndtr/goleveldb/leveldb
github.com/projectdiscovery/mapcidr
github.com/projectdiscovery/stringsutil
go.uber.org/atomic
github.com/yl2chen/cidranger/net
github.com/Mzack9999/go-http-digest-auth-client
github.com/yl2chen/cidranger
go.uber.org/multierr
github.com/projectdiscovery/utils/reader
github.com/projectdiscovery/iputil
github.com/projectdiscovery/utils/errors
github.com/projectdiscovery/utils/ip
github.com/projectdiscovery/networkpolicy
github.com/projectdiscovery/utils/url
golang.org/x/text/transform
golang.org/x/text/unicode/bidi
golang.org/x/net/http2/hpack
golang.org/x/text/unicode/norm
github.com/projectdiscovery/retryabledns/hostsfile
golang.org/x/net/internal/socks
golang.org/x/text/secure/bidirule
github.com/projectdiscovery/hmap/store/disk
github.com/Masterminds/semver/v3
golang.org/x/net/proxy
github.com/mattn/go-runewidth
github.com/dlclark/regexp2/syntax
golang.org/x/net/idna
github.com/muesli/reflow/ansi
github.com/muesli/reflow/indent
github.com/muesli/reflow/padding
github.com/projectdiscovery/hmap/store/hybrid
github.com/muesli/reflow/wordwrap
github.com/aymanbagabas/go-osc52/v2
github.com/lucasb-eyer/go-colorful
golang.org/x/net/http/httpguts
golang.org/x/net/http2
github.com/projectdiscovery/ipranger
github.com/mattn/go-isatty
github.com/muesli/termenv
github.com/dlclark/regexp2
github.com/olekukonko/tablewriter
github.com/yuin/goldmark-emoji/definition
github.com/yuin/goldmark/util
github.com/alecthomas/chroma
github.com/projectdiscovery/retryablehttp-go - Package retryablehttp provides a familiar HTTP client interface with automatic retries and exponential backoff 
github.com/alecthomas/chroma/formatters/html
github.com/projectdiscovery/retryabledns/doh
github.com/alecthomas/chroma/formatters/svg
github.com/projectdiscovery/retryabledns
github.com/alecthomas/chroma/formatters
github.com/projectdiscovery/asnmap/libs
github.com/projectdiscovery/mapcidr/asn
github.com/alecthomas/chroma/styles
github.com/alecthomas/chroma/lexers/internal
github.com/alecthomas/chroma/lexers/b
github.com/alecthomas/chroma/lexers/a
github.com/alecthomas/chroma/lexers/p
github.com/alecthomas/chroma/lexers/j
github.com/alecthomas/chroma/lexers/d
github.com/alecthomas/chroma/lexers/e
github.com/alecthomas/chroma/lexers/c
github.com/alecthomas/chroma/lexers/f
github.com/alecthomas/chroma/lexers/i
github.com/alecthomas/chroma/lexers/k
github.com/alecthomas/chroma/lexers/h
github.com/alecthomas/chroma/lexers/l
github.com/alecthomas/chroma/lexers/n
github.com/alecthomas/chroma/lexers/o
github.com/alecthomas/chroma/lexers/q
github.com/alecthomas/chroma/lexers/r
github.com/alecthomas/chroma/lexers/t
github.com/alecthomas/chroma/lexers/circular
github.com/alecthomas/chroma/lexers/g
github.com/alecthomas/chroma/lexers/m
github.com/alecthomas/chroma/lexers/s
github.com/alecthomas/chroma/lexers/v
github.com/alecthomas/chroma/lexers/w
github.com/alecthomas/chroma/lexers/x
github.com/alecthomas/chroma/lexers/y
github.com/alecthomas/chroma/lexers/z
github.com/cheggaaa/pb/v3/termutil
github.com/mattn/go-colorable
github.com/google/go-querystring/query
github.com/fatih/color
golang.org/x/crypto/openpgp/errors
github.com/cheggaaa/pb/v3
golang.org/x/crypto/openpgp/armor
golang.org/x/crypto/cast5
golang.org/x/crypto/openpgp/elgamal
golang.org/x/crypto/openpgp/s2k
golang.org/x/crypto/openpgp/packet
github.com/alecthomas/chroma/lexers
github.com/alecthomas/chroma/quick
golang.org/x/sys/cpu
golang.org/x/crypto/pbkdf2
golang.org/x/crypto/scrypt
golang.org/x/crypto/blake2b
github.com/minio/selfupdate/internal/binarydist
github.com/minio/selfupdate/internal/osext
aead.dev/minisign
golang.org/x/oauth2/internal
github.com/minio/selfupdate
golang.org/x/oauth2
golang.org/x/crypto/openpgp
github.com/google/go-github/v30/github
github.com/yuin/goldmark/text
github.com/yuin/goldmark/ast
github.com/yuin/goldmark-emoji/ast
github.com/yuin/goldmark/extension/ast
github.com/yuin/goldmark/renderer
github.com/yuin/goldmark/parser
github.com/yuin/goldmark/renderer/html
github.com/charmbracelet/glamour/ansi
github.com/yuin/goldmark - A markdown parser written in Go. Easy to extend, standard(CommonMark) compliant, well structured. 
github.com/yuin/goldmark-emoji - An emoji extension for the goldmark markdown parser
github.com/yuin/goldmark/extension
github.com/charmbracelet/glamour
github.com/projectdiscovery/utils/update

I'm not very familiar to golang, so IDK why we really need all this.

Small utility program

ls -lh mapcidr

26M before strip -s, 20M after

ehsandeep commented 1 year ago

Mod file got cleaned up and has only 10 direct dependencies https://github.com/projectdiscovery/mapcidr/blob/main/go.mod#L5-L15

KOLANICH commented 1 year ago

Indirect ones are also a lot. And if you check the deps having comments in the head, they are still present, and I see no justification for this project to be dependent on them. Do we really need 2 databases, an HTTP(S) client, an emoji library, several compression libs, and a CSS tokenizer in order to just merge some CIDR ranges?!