-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
重新实现了 wry 格式数据库解析,包括 qqwry 和 zxipv6wry,支持并发查询
修复wry文件不完整时crash的问题 对 nali 的数据库和配置文件目录进行了规范,具体见 [文档-工作目录](https://github.com/zu1k/nali#%E5%B7%A5%E4%BD%9C%E7%9B%AE%E5%BD%95) 优先使用环境变量 NALI_HOME、NALI_CONFIG_HOME、NALI_DB_HOME 指定的目录 未指定 nali 特定环境变量的情况下默认使用 XDG 规范,配置文件目录在 $XDG_CONFIG_HOME/nali,数据库文件目录在 $XDG_DATA_HOME/nali 若未检测到 XDG 相关环境变量,将根据平台使用默认目录,具体见 XDG Base Directory 中 XDG_CONFIG_HOME 和 XDG_DATA_HOME 部分 初次运行此版本将会进行目录和数据的迁移,将 ~/.nali 下的配置文件和数据库转移到相应目录,并删除 ~/.nali 目录 支持使用环境变量指定的代理下载数据库,thanks to @jingjingxyk zu1k#126 修复了 pipe mtr 时无法获取内容和格式错乱的问题,thanks to @mzz2017 zu1k#132 , fix zu1k#12, zu1k#61, zu1k#85, zu1k#115, zu1k#123. cache map 使用并发安全的版本,thanks to @lhcn zu1k#125 升级 Go 版本到 1.19,更新了依赖 不再支持 ip2region 旧数据库格式,目前仅支持 ip2region xdb 格式 去除了已过时的数据库下载代码 从 git 历史记录中去除了数据库文件 修复自动迁移导致生成空配置文件的bug 更新纯真IP数据库的下载地址
- Loading branch information
Showing
45 changed files
with
2,101 additions
and
2,049 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,108 +1,105 @@ | ||
NAME=nali | ||
BINDIR=bin | ||
VERSION=$(shell git describe --tags || echo "unknown version") | ||
BUILDTIME=$(shell date -u) | ||
GOBUILD=CGO_ENABLED=0 go build -trimpath -ldflags '-X "github.com/zu1k/nali/internal/constant.Version=$(VERSION)" \ | ||
-X "github.com/zu1k/nali/internal/constant.BuildTime=$(BUILDTIME)" \ | ||
-w -s' | ||
|
||
PLATFORM_LIST = \ | ||
darwin-arm64 \ | ||
darwin-amd64 \ | ||
linux-386 \ | ||
linux-amd64 \ | ||
linux-armv5 \ | ||
linux-armv6 \ | ||
linux-armv7 \ | ||
linux-armv8 \ | ||
linux-mips-softfloat \ | ||
linux-mips-hardfloat \ | ||
linux-mipsle-softfloat \ | ||
linux-mipsle-hardfloat \ | ||
linux-mips64 \ | ||
linux-mips64le \ | ||
freebsd-386 \ | ||
freebsd-amd64 | ||
|
||
WINDOWS_ARCH_LIST = \ | ||
windows-386 \ | ||
windows-amd64 | ||
|
||
all: linux-amd64 darwin-amd64 windows-amd64 # Most used | ||
|
||
docker: | ||
$(GOBUILD) -o $(BINDIR)/$(NAME)-$@ | ||
|
||
darwin-arm64: | ||
GOARCH=arm64 GOOS=darwin $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ | ||
|
||
darwin-amd64: | ||
GOARCH=amd64 GOOS=darwin $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ | ||
|
||
linux-386: | ||
GOARCH=386 GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ | ||
|
||
linux-amd64: | ||
GOARCH=amd64 GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ | ||
|
||
linux-armv5: | ||
GOARCH=arm GOOS=linux GOARM=5 $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ | ||
|
||
linux-armv6: | ||
GOARCH=arm GOOS=linux GOARM=6 $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ | ||
|
||
linux-armv7: | ||
GOARCH=arm GOOS=linux GOARM=7 $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ | ||
|
||
linux-armv8: | ||
GOARCH=arm64 GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ | ||
|
||
linux-mips-softfloat: | ||
GOARCH=mips GOMIPS=softfloat GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ | ||
|
||
linux-mips-hardfloat: | ||
GOARCH=mips GOMIPS=hardfloat GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ | ||
|
||
linux-mipsle-softfloat: | ||
GOARCH=mipsle GOMIPS=softfloat GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ | ||
|
||
linux-mipsle-hardfloat: | ||
GOARCH=mipsle GOMIPS=hardfloat GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ | ||
|
||
linux-mips64: | ||
GOARCH=mips64 GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ | ||
|
||
linux-mips64le: | ||
GOARCH=mips64le GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ | ||
|
||
freebsd-386: | ||
GOARCH=386 GOOS=freebsd $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ | ||
|
||
freebsd-amd64: | ||
GOARCH=amd64 GOOS=freebsd $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ | ||
|
||
windows-386: | ||
GOARCH=386 GOOS=windows $(GOBUILD) -o $(BINDIR)/$(NAME)-$@.exe | ||
|
||
windows-amd64: | ||
GOARCH=amd64 GOOS=windows $(GOBUILD) -o $(BINDIR)/$(NAME)-$@.exe | ||
|
||
gz_releases=$(addsuffix .gz, $(PLATFORM_LIST)) | ||
zip_releases=$(addsuffix .zip, $(WINDOWS_ARCH_LIST)) | ||
|
||
$(gz_releases): %.gz : % | ||
chmod +x $(BINDIR)/$(NAME)-$(basename $@) | ||
gzip -f -S -$(VERSION).gz $(BINDIR)/$(NAME)-$(basename $@) | ||
|
||
$(zip_releases): %.zip : % | ||
zip -m -j $(BINDIR)/$(NAME)-$(basename $@)-$(VERSION).zip $(BINDIR)/$(NAME)-$(basename $@).exe | ||
|
||
all-arch: $(PLATFORM_LIST) $(WINDOWS_ARCH_LIST) | ||
|
||
releases: $(gz_releases) $(zip_releases) | ||
|
||
sha256sum: | ||
cd $(BINDIR); for file in *; do sha256sum $$file > $$file.sha256; done | ||
|
||
clean: | ||
rm $(BINDIR)/* | ||
NAME=nali | ||
BINDIR=bin | ||
VERSION=$(shell git describe --tags || echo "unknown version") | ||
GOBUILD=CGO_ENABLED=0 go build -trimpath -ldflags '-X "github.com/zu1k/nali/internal/constant.Version=$(VERSION)" -w -s' | ||
|
||
PLATFORM_LIST = \ | ||
darwin-arm64 \ | ||
darwin-amd64 \ | ||
linux-386 \ | ||
linux-amd64 \ | ||
linux-armv5 \ | ||
linux-armv6 \ | ||
linux-armv7 \ | ||
linux-armv8 \ | ||
linux-mips-softfloat \ | ||
linux-mips-hardfloat \ | ||
linux-mipsle-softfloat \ | ||
linux-mipsle-hardfloat \ | ||
linux-mips64 \ | ||
linux-mips64le \ | ||
freebsd-386 \ | ||
freebsd-amd64 | ||
|
||
WINDOWS_ARCH_LIST = \ | ||
windows-386 \ | ||
windows-amd64 | ||
|
||
all: linux-amd64 darwin-amd64 windows-amd64 # Most used | ||
|
||
docker: | ||
$(GOBUILD) -o $(BINDIR)/$(NAME)-$@ | ||
|
||
darwin-arm64: | ||
GOARCH=arm64 GOOS=darwin $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ | ||
|
||
darwin-amd64: | ||
GOARCH=amd64 GOOS=darwin $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ | ||
|
||
linux-386: | ||
GOARCH=386 GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ | ||
|
||
linux-amd64: | ||
GOARCH=amd64 GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ | ||
|
||
linux-armv5: | ||
GOARCH=arm GOOS=linux GOARM=5 $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ | ||
|
||
linux-armv6: | ||
GOARCH=arm GOOS=linux GOARM=6 $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ | ||
|
||
linux-armv7: | ||
GOARCH=arm GOOS=linux GOARM=7 $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ | ||
|
||
linux-armv8: | ||
GOARCH=arm64 GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ | ||
|
||
linux-mips-softfloat: | ||
GOARCH=mips GOMIPS=softfloat GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ | ||
|
||
linux-mips-hardfloat: | ||
GOARCH=mips GOMIPS=hardfloat GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ | ||
|
||
linux-mipsle-softfloat: | ||
GOARCH=mipsle GOMIPS=softfloat GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ | ||
|
||
linux-mipsle-hardfloat: | ||
GOARCH=mipsle GOMIPS=hardfloat GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ | ||
|
||
linux-mips64: | ||
GOARCH=mips64 GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ | ||
|
||
linux-mips64le: | ||
GOARCH=mips64le GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ | ||
|
||
freebsd-386: | ||
GOARCH=386 GOOS=freebsd $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ | ||
|
||
freebsd-amd64: | ||
GOARCH=amd64 GOOS=freebsd $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ | ||
|
||
windows-386: | ||
GOARCH=386 GOOS=windows $(GOBUILD) -o $(BINDIR)/$(NAME)-$@.exe | ||
|
||
windows-amd64: | ||
GOARCH=amd64 GOOS=windows $(GOBUILD) -o $(BINDIR)/$(NAME)-$@.exe | ||
|
||
gz_releases=$(addsuffix .gz, $(PLATFORM_LIST)) | ||
zip_releases=$(addsuffix .zip, $(WINDOWS_ARCH_LIST)) | ||
|
||
$(gz_releases): %.gz : % | ||
chmod +x $(BINDIR)/$(NAME)-$(basename $@) | ||
gzip -f -S -$(VERSION).gz $(BINDIR)/$(NAME)-$(basename $@) | ||
|
||
$(zip_releases): %.zip : % | ||
zip -m -j $(BINDIR)/$(NAME)-$(basename $@)-$(VERSION).zip $(BINDIR)/$(NAME)-$(basename $@).exe | ||
|
||
all-arch: $(PLATFORM_LIST) $(WINDOWS_ARCH_LIST) | ||
|
||
releases: $(gz_releases) $(zip_releases) | ||
|
||
sha256sum: | ||
cd $(BINDIR); for file in *; do sha256sum $$file > $$file.sha256; done | ||
|
||
clean: | ||
rm $(BINDIR)/* |
Oops, something went wrong.