mirror of
https://gitee.com/konyshe/goodlink.git
synced 2025-09-26 20:51:22 +08:00
add go2
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -5,7 +5,7 @@ __debug_bin*
|
|||||||
*.pdf
|
*.pdf
|
||||||
bin
|
bin
|
||||||
upx
|
upx
|
||||||
gotools
|
go2
|
||||||
*.exe
|
*.exe
|
||||||
fyne_metadata_init.go
|
fyne_metadata_init.go
|
||||||
fyne.syso
|
fyne.syso
|
||||||
|
@@ -16,7 +16,7 @@ COPY --from=tonistiigi/xx:golang / /
|
|||||||
ARG TARGETOS TARGETARCH TARGETVARIANT
|
ARG TARGETOS TARGETARCH TARGETVARIANT
|
||||||
|
|
||||||
RUN echo 111111111111
|
RUN echo 111111111111
|
||||||
COPY gotools /go/src/gotools
|
COPY go2 /go/src/go2
|
||||||
COPY goodlink2 /go/src/goodlink2
|
COPY goodlink2 /go/src/goodlink2
|
||||||
|
|
||||||
RUN --mount=target=. \
|
RUN --mount=target=. \
|
||||||
|
6
Makefile
6
Makefile
@@ -6,9 +6,9 @@ BuildTime=$(shell date +'%Y-%m-%d %H:%M:%S')
|
|||||||
GOBUILD=GO111MODULE=on \
|
GOBUILD=GO111MODULE=on \
|
||||||
GOPROXY="https://goproxy.cn,direct" \
|
GOPROXY="https://goproxy.cn,direct" \
|
||||||
go build -trimpath -ldflags \
|
go build -trimpath -ldflags \
|
||||||
'-X "gotools.GitCommitLog=$(GitCommitLog)" \
|
'-X "go2.GitCommitLog=$(GitCommitLog)" \
|
||||||
-X "gotools.GitStatus=$(GitStatus)" \
|
-X "go2.GitStatus=$(GitStatus)" \
|
||||||
-X "gotools.BuildTime=$(BuildTime)" \
|
-X "go2.BuildTime=$(BuildTime)" \
|
||||||
-w -s -buildid='
|
-w -s -buildid='
|
||||||
|
|
||||||
PLATFORM_LIST = \
|
PLATFORM_LIST = \
|
||||||
|
6
build.sh
6
build.sh
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
rm -rf gotools goodlink2
|
rm -rf go2 goodlink2
|
||||||
cp -r ../gotools .
|
cp -r ../go2 .
|
||||||
cp -r ../goodlink2 .
|
cp -r ../goodlink2 .
|
||||||
|
|
||||||
if [ -e "/usr/bin/upx" ]; then
|
if [ -e "/usr/bin/upx" ]; then
|
||||||
@@ -26,7 +26,7 @@ docker pull tonistiigi/xx:golang
|
|||||||
|
|
||||||
docker buildx build --platform linux/amd64 -t dev/goodlink:latest .
|
docker buildx build --platform linux/amd64 -t dev/goodlink:latest .
|
||||||
|
|
||||||
rm -rf gotools goodlink2 upx
|
rm -rf go2 goodlink2 upx
|
||||||
|
|
||||||
sed -i "/$BUILD_TIME/s/$BUILD_TIME/111111111111/g" Dockerfile
|
sed -i "/$BUILD_TIME/s/$BUILD_TIME/111111111111/g" Dockerfile
|
||||||
|
|
||||||
|
@@ -3,7 +3,7 @@ package config
|
|||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"gotools"
|
"go2"
|
||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ func Help(ver string) {
|
|||||||
|
|
||||||
if *v {
|
if *v {
|
||||||
fmt.Printf("Version: %s\n", ver)
|
fmt.Printf("Version: %s\n", ver)
|
||||||
fmt.Print(gotools.BuildVersion())
|
fmt.Print(go2.BuildVersion())
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -3,8 +3,8 @@ package config
|
|||||||
import (
|
import (
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"go2"
|
||||||
"goodlink/aes"
|
"goodlink/aes"
|
||||||
"gotools"
|
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
@@ -38,7 +38,7 @@ func Init() error {
|
|||||||
var err error
|
var err error
|
||||||
var resp *http.Response
|
var resp *http.Response
|
||||||
|
|
||||||
if res = gotools.Utils().FileReadAll("config.json"); res == nil {
|
if res = go2.Utils().FileReadAll("config.json"); res == nil {
|
||||||
client := &http.Client{
|
client := &http.Client{
|
||||||
Transport: &http.Transport{
|
Transport: &http.Transport{
|
||||||
TLSClientConfig: &tls.Config{
|
TLSClientConfig: &tls.Config{
|
||||||
@@ -70,8 +70,8 @@ func Init() error {
|
|||||||
|
|
||||||
body, _ := json.Marshal(configInfo)
|
body, _ := json.Marshal(configInfo)
|
||||||
temp3 := aes.Encrypt(body, "goodlink")
|
temp3 := aes.Encrypt(body, "goodlink")
|
||||||
gotools.Utils().FileDel("config.json")
|
go2.Utils().FileDel("config.json")
|
||||||
gotools.Utils().FileAppend("config.json", []byte(temp3))
|
go2.Utils().FileAppend("config.json", []byte(temp3))
|
||||||
*/
|
*/
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
4
go.mod
4
go.mod
@@ -17,7 +17,7 @@ require (
|
|||||||
golang.org/x/sys v0.34.0
|
golang.org/x/sys v0.34.0
|
||||||
golang.zx2c4.com/wireguard v0.0.0-20250521234502-f333402bd9cb
|
golang.zx2c4.com/wireguard v0.0.0-20250521234502-f333402bd9cb
|
||||||
goodlink2 v0.0.0
|
goodlink2 v0.0.0
|
||||||
gotools v0.0.0
|
go2 v0.0.0
|
||||||
gvisor.dev/gvisor v0.0.0-20250806010417-2099bc1c6a2e
|
gvisor.dev/gvisor v0.0.0-20250806010417-2099bc1c6a2e
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@ require (
|
|||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
replace gotools => ../gotools
|
replace go2 => ../go2
|
||||||
|
|
||||||
replace goodlink2 => ../goodlink2
|
replace goodlink2 => ../goodlink2
|
||||||
|
|
||||||
|
@@ -5,8 +5,8 @@ package netstack
|
|||||||
import (
|
import (
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"go2"
|
||||||
"goodlink/winipcfg"
|
"goodlink/winipcfg"
|
||||||
"gotools"
|
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/netip"
|
"net/netip"
|
||||||
@@ -70,7 +70,7 @@ func InitWintunDll() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
gotools.Utils().FileAppend("wintun.dll", res)
|
go2.Utils().FileAppend("wintun.dll", res)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@@ -4,7 +4,7 @@ package ui2
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"gotools"
|
"go2"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"sync"
|
"sync"
|
||||||
@@ -89,7 +89,7 @@ func start_button_click() {
|
|||||||
})
|
})
|
||||||
log.Println(string(configByte))
|
log.Println(string(configByte))
|
||||||
os.Remove("goodlink.json")
|
os.Remove("goodlink.json")
|
||||||
gotools.Utils().FileAppend("goodlink.json", configByte)
|
go2.Utils().FileAppend("goodlink.json", configByte)
|
||||||
}
|
}
|
||||||
|
|
||||||
switch m_stats_start_button {
|
switch m_stats_start_button {
|
||||||
|
@@ -4,7 +4,7 @@ package ui2
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"gotools"
|
"go2"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"goodlink/config"
|
"goodlink/config"
|
||||||
@@ -37,7 +37,7 @@ const (
|
|||||||
|
|
||||||
func GetMainUI(myWindow *fyne.Window) *fyne.Container {
|
func GetMainUI(myWindow *fyne.Window) *fyne.Container {
|
||||||
var configInfo config.ConfigInfo
|
var configInfo config.ConfigInfo
|
||||||
json.Unmarshal(gotools.Utils().FileReadAll("goodlink.json"), &configInfo)
|
json.Unmarshal(go2.Utils().FileReadAll("goodlink.json"), &configInfo)
|
||||||
log.Println(configInfo)
|
log.Println(configInfo)
|
||||||
|
|
||||||
m_validated_key = widget.NewEntry()
|
m_validated_key = widget.NewEntry()
|
||||||
|
Reference in New Issue
Block a user