1
0
mirror of https://github.com/zu1k/nali.git synced 2025-02-13 15:52:41 +08:00

add ipv6 support

This commit is contained in:
zu1k 2020-07-18 09:59:48 +08:00
parent e453848e18
commit ae7eed8de6
2 changed files with 5 additions and 9 deletions

View File

@ -19,10 +19,12 @@
## Feature
- Chunzhen qqip database
- ZX ipv6 database
- Geoip2 city database
- Pipeline support
- Interactive query
- Offline query
- Both ipv4 and ipv6 support
## Install
@ -177,6 +179,7 @@ export NALI_DB=geoip
- [纯真QQIP离线数据库](http://www.cz88.net/fox/ipdat.shtml)
- [qqwry mirror](https://qqwry.mirror.noc.one/)
- [qqwry纯真数据库解析](https://github.com/yinheli/qqwry)
- [ZX公网ipv6数据库](https://ip.zxinc.org/ipquery/)
- [Geoip2 city数据库](https://www.maxmind.com/en/geoip2-precision-city-service)
- [geoip2-golang解析器](https://github.com/oschwald/geoip2-golang)
- [Cobra CLI库](https://github.com/spf13/cobra)

View File

@ -23,15 +23,8 @@ func NewZXwry(filePath string) ZXwry {
// 判断文件是否存在
_, err := os.Stat(filePath)
if err != nil && os.IsNotExist(err) {
log.Println("文件不存在尝试从网络获取最新ZX IPv6 库")
tmpData, err = GetOnline()
if err != nil {
panic(err)
} else {
if err := ioutil.WriteFile(filePath, tmpData, 0644); err == nil {
log.Printf("已将最新的ZX IPv6 库保存到本地 %s ", filePath)
}
}
log.Println("文件不存在,请自行下载 ZX IPV6库并保存在", filePath)
os.Exit(1)
} else {
// 打开文件句柄
fileInfo.FileBase, err = os.OpenFile(filePath, os.O_RDONLY, 0400)