Skip to content

Commit

Permalink
fix auth for http tunnel
Browse files Browse the repository at this point in the history
  • Loading branch information
ginuerzh committed Apr 23, 2024
1 parent 4cb9abe commit 64838e2
Show file tree
Hide file tree
Showing 18 changed files with 18 additions and 56 deletions.
24 changes: 12 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file modified assets/add-android.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/edit-android.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/file-tunnel.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/http-tunnel.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/list-android.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/tcp-tunnel.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/udp-tunnel.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 3 additions & 4 deletions tunnel/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down
Binary file removed ui/fonts/NotoSansSC-Bold.ttf
Binary file not shown.
Binary file removed ui/fonts/NotoSansSC-Regular.ttf
Binary file not shown.
36 changes: 0 additions & 36 deletions ui/fonts/font.go

This file was deleted.

5 changes: 2 additions & 3 deletions ui/ui.go
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package version

var Version = "0.3.0"
var Version = "0.3.1"

0 comments on commit 64838e2

Please sign in to comment.