diff --git a/Makefile b/Makefile index eecca5b..89ec4b5 100644 --- a/Makefile +++ b/Makefile @@ -8,48 +8,48 @@ GOFILES=*.go PLATFORM_LIST = \ linux-amd64 \ - linux-arm64 + # linux-arm64 WINDOWS_ARCH_LIST = \ windows-amd64 \ windows-arm64 linux-amd64: - GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build --ldflags="-s -w" -v -x -a -o $(BINDIR)/$(NAME)-$@ $(GOFILES) + GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build --ldflags="-s -w" -v -x -a -o $(BINDIR)/$(NAME)-$(VERSION)-$@ $(GOFILES) linux-arm64: - GOOS=linux GOARCH=arm64 CGO_ENABLED=1 go build --ldflags="-s -w" -v -x -a -o $(BINDIR)/$(NAME)-$@ $(GOFILES) + GOOS=linux GOARCH=arm64 CGO_ENABLED=1 go build --ldflags="-s -w" -v -x -a -o $(BINDIR)/$(NAME)-$(VERSION)-$@ $(GOFILES) darwin-amd64: - GOOS=darwin GOARCH=amd64 $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ $(GOFILES) + GOOS=darwin GOARCH=amd64 $(GOBUILD) -o $(BINDIR)/$(NAME)-$(VERSION)-$@ $(GOFILES) darwin-arm64: - GOOS=darwin GOARCH=arm64 $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ $(GOFILES) + GOOS=darwin GOARCH=arm64 $(GOBUILD) -o $(BINDIR)/$(NAME)-$(VERSION)-$@ $(GOFILES) # https://github.com/tc-hib/go-winres windows-amd64: GOOS=windows GOARCH=amd64 go-winres make --in winres/winres.json --out winres/rsrc - GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s -w -H windowsgui" -o $(BINDIR)/$(NAME)-$@.exe $(GOFILES) + GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s -w -H windowsgui" -o $(BINDIR)/$(NAME)-$(VERSION)-$@.exe $(GOFILES) windows-arm64: GOOS=windows GOARCH=arm64 go-winres make --in winres/winres.json --out winres/rsrc - GOOS=windows GOARCH=arm64 CGO_ENABLED=0 go build -ldflags="-s -w -H windowsgui" -o $(BINDIR)/$(NAME)-$@.exe $(GOFILES) + GOOS=windows GOARCH=arm64 CGO_ENABLED=0 go build -ldflags="-s -w -H windowsgui" -o $(BINDIR)/$(NAME)-$(VERSION)-$@.exe $(GOFILES) # go install gioui.org/cmd/gogio@latest android: - gogio -x -work -target android -minsdk 33 -version $(VERSION).3 -signkey build/sign.keystore -signpass android -appid gost.plus -o $(BINDIR)/$(NAME)-$(VERSION).aab . + gogio -x -work -target android -minsdk 22 -version $(VERSION).7 -name GOST+ -signkey build/sign.keystore -signpass android -appid gost.plus -o $(BINDIR)/$(NAME)-$(VERSION).aab . 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 $@) + chmod +x $(BINDIR)/$(NAME)-$(VERSION)-$(basename $@) + gzip -f -S .gz $(BINDIR)/$(NAME)-$(VERSION)-$(basename $@) $(zip_releases): %.zip : % - zip -m -j $(BINDIR)/$(NAME)-$(basename $@)-$(VERSION).zip $(BINDIR)/$(NAME)-$(basename $@).exe + zip -m -j $(BINDIR)/$(NAME)-$(VERSION)-$(basename $@).zip $(BINDIR)/$(NAME)-$(VERSION)-$(basename $@).exe -releases: $(gz_releases) $(zip_releases) +releases: $(gz_releases) $(zip_releases) android clean: rm *.syso -f diff --git a/assets/add-android.png b/assets/add-android.png index f83ef44..3bdd052 100644 Binary files a/assets/add-android.png and b/assets/add-android.png differ diff --git a/assets/add.png b/assets/add.png index f82a663..88d53ef 100644 Binary files a/assets/add.png and b/assets/add.png differ diff --git a/assets/edit-android.png b/assets/edit-android.png index bdd580f..8223c55 100644 Binary files a/assets/edit-android.png and b/assets/edit-android.png differ diff --git a/assets/edit.png b/assets/edit.png index a05aab2..ea526aa 100644 Binary files a/assets/edit.png and b/assets/edit.png differ diff --git a/assets/file-tunnel.gif b/assets/file-tunnel.gif index 3cb7854..7295348 100644 Binary files a/assets/file-tunnel.gif and b/assets/file-tunnel.gif differ diff --git a/assets/http-tunnel.gif b/assets/http-tunnel.gif index 738e9cd..9537ee2 100644 Binary files a/assets/http-tunnel.gif and b/assets/http-tunnel.gif differ diff --git a/assets/list-android.png b/assets/list-android.png index 080c8a1..64e0358 100644 Binary files a/assets/list-android.png and b/assets/list-android.png differ diff --git a/assets/list.png b/assets/list.png index a08f5f4..bb22872 100644 Binary files a/assets/list.png and b/assets/list.png differ diff --git a/assets/menu.png b/assets/menu.png index 5214f70..5325284 100644 Binary files a/assets/menu.png and b/assets/menu.png differ diff --git a/assets/tcp-tunnel.gif b/assets/tcp-tunnel.gif index 7e71854..819e58d 100644 Binary files a/assets/tcp-tunnel.gif and b/assets/tcp-tunnel.gif differ diff --git a/assets/udp-tunnel.gif b/assets/udp-tunnel.gif index e5d62f3..88d7379 100644 Binary files a/assets/udp-tunnel.gif and b/assets/udp-tunnel.gif differ diff --git a/tunnel/http.go b/tunnel/http.go index 10bda46..eceddb3 100644 --- a/tunnel/http.go +++ b/tunnel/http.go @@ -109,17 +109,16 @@ func (s *httpTunnel) init() error { node := &config.ForwardNodeConfig{ Name: s.opts.Name, Addr: s.opts.Endpoint, + HTTP: &config.HTTPNodeConfig{}, } if s.opts.Username != "" { - node.Auth = &config.AuthConfig{ + node.HTTP.Auth = &config.AuthConfig{ Username: s.opts.Username, Password: s.opts.Password, } } if s.opts.Hostname != "" { - node.HTTP = &config.HTTPNodeConfig{ - Host: s.opts.Hostname, - } + node.HTTP.Host = s.opts.Hostname } if s.opts.EnableTLS { node.TLS = &config.TLSNodeConfig{} diff --git a/ui/fonts/NotoSansSC-Bold.ttf b/ui/fonts/NotoSansSC-Bold.ttf deleted file mode 100644 index b9010df..0000000 Binary files a/ui/fonts/NotoSansSC-Bold.ttf and /dev/null differ diff --git a/ui/fonts/NotoSansSC-Regular.ttf b/ui/fonts/NotoSansSC-Regular.ttf deleted file mode 100644 index 4d4cadb..0000000 Binary files a/ui/fonts/NotoSansSC-Regular.ttf and /dev/null differ diff --git a/ui/fonts/font.go b/ui/fonts/font.go deleted file mode 100644 index 40f154c..0000000 --- a/ui/fonts/font.go +++ /dev/null @@ -1,36 +0,0 @@ -package fonts - -import ( - _ "embed" - "fmt" - - "gioui.org/font" - "gioui.org/font/opentype" -) - -//go:embed NotoSansSC-Regular.ttf -var fontNotoRegular []byte - -//go:embed NotoSansSC-Bold.ttf -var fontNotoBold []byte - -var ( - collection []font.FontFace -) - -func init() { - register(fontNotoRegular) - register(fontNotoBold) -} - -func Collection() []font.FontFace { - return collection -} - -func register(ttf []byte) { - faces, err := opentype.ParseCollection(ttf) - if err != nil { - panic(fmt.Errorf("failed to parse font: %v", err)) - } - collection = append(collection, faces[0]) -} diff --git a/ui/ui.go b/ui/ui.go index 913dcd9..603c3e1 100644 --- a/ui/ui.go +++ b/ui/ui.go @@ -1,11 +1,11 @@ package ui import ( + "gioui.org/font/gofont" "gioui.org/layout" "gioui.org/text" "gioui.org/widget/material" "github.com/go-gost/gost.plus/config" - "github.com/go-gost/gost.plus/ui/fonts" "github.com/go-gost/gost.plus/ui/i18n" "github.com/go-gost/gost.plus/ui/page" "github.com/go-gost/gost.plus/ui/page/entrypoint" @@ -40,8 +40,7 @@ func NewUI() *UI { } th := material.NewTheme() - // th.Shaper = text.NewShaper(text.WithCollection(gofont.Collection())) - th.Shaper = text.NewShaper(text.WithCollection(fonts.Collection())) + th.Shaper = text.NewShaper(text.WithCollection(gofont.Collection())) th.Palette = theme.Current().Material router := page.NewRouter(th) diff --git a/version/version.go b/version/version.go index 3494801..d13f706 100644 --- a/version/version.go +++ b/version/version.go @@ -1,3 +1,3 @@ package version -var Version = "0.3.0" +var Version = "0.3.1"