rebrand: frp -> kanhole (kanhole server, kanholec client)
golangci-lint / lint (push) Failing after 1m5s

This commit is contained in:
kannn
2026-05-29 09:05:34 +00:00
Unverified
parent a0a42a4966
commit 2cd3052da1
265 changed files with 949 additions and 962 deletions
+22 -35
View File
@@ -1,25 +1,26 @@
export PATH := $(PATH):`go env GOPATH`/bin export PATH := $(PATH):`go env GOPATH`/bin
export GO111MODULE=on export GO111MODULE=on
LDFLAGS := -s -w LDFLAGS := -s -w
NOWEB_TAG = $(shell [ ! -d web/frps/dist ] || [ ! -d web/frpc/dist ] && echo ',noweb') NOWEB_TAG = $(shell [ ! -d web/kanhole/dist ] || [ ! -d web/kanholec/dist ] && echo ',noweb')
KANHOLE_VERSION ?= 0.1.0
FRP_COMPAT_BASELINE_COUNT ?= 8 FRP_COMPAT_BASELINE_COUNT ?= 8
FRP_COMPAT_FLOOR_VERSION ?= 0.61.0 FRP_COMPAT_FLOOR_VERSION ?= 0.61.0
.PHONY: web frps-web frpc-web frps frpc frpc-gui e2e-compatibility-smoke e2e-compatibility e2e-compatibility-floor .PHONY: web kanhole-web kanholec-web kanhole kanholec kanholec-gui e2e-compatibility-smoke e2e-compatibility e2e-compatibility-floor
all: env fmt web build all: env fmt web build
build: frps frpc build: kanhole kanholec
env: env:
@go version @go version
web: frps-web frpc-web web: kanhole-web kanholec-web
frps-web: kanhole-web:
$(MAKE) -C web/frps build $(MAKE) -C web/frps build
frpc-web: kanholec-web:
$(MAKE) -C web/frpc build $(MAKE) -C web/frpc build
fmt: fmt:
@@ -29,30 +30,30 @@ fmt-more:
gofumpt -l -w . gofumpt -l -w .
gci: gci:
gci write -s standard -s default -s "prefix(github.com/fatedier/frp/)" ./ gci write -s standard -s default -s "prefix(kanhole/)" ./
vet: vet:
go vet -tags "$(NOWEB_TAG)" ./... go vet -tags "$(NOWEB_TAG)" ./...
frps: kanhole:
env CGO_ENABLED=0 go build -trimpath -ldflags "$(LDFLAGS)" -tags "frps$(NOWEB_TAG)" -o bin/frps ./cmd/frps env CGO_ENABLED=0 go build -trimpath -ldflags "$(LDFLAGS)" -tags "kanhole$(NOWEB_TAG)" -o bin/kanhole ./cmd/kanhole
frpc: kanholec:
env CGO_ENABLED=0 go build -trimpath -ldflags "$(LDFLAGS)" -tags "frpc$(NOWEB_TAG)" -o bin/frpc ./cmd/frpc env CGO_ENABLED=0 go build -trimpath -ldflags "$(LDFLAGS)" -tags "kanholec$(NOWEB_TAG)" -o bin/kanholec ./cmd/kanholec
frpc-windows: kanholec-windows:
env CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath -ldflags "$(LDFLAGS)" -tags "frpc$(NOWEB_TAG)" -o bin/frpc-windows-amd64.exe ./cmd/frpc env CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath -ldflags "$(LDFLAGS)" -tags "kanholec$(NOWEB_TAG)" -o bin/kanholec-windows-amd64.exe ./cmd/kanholec
frpc-windows-arm64: kanholec-windows-arm64:
env CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build -trimpath -ldflags "$(LDFLAGS)" -tags "frpc$(NOWEB_TAG)" -o bin/frpc-windows-arm64.exe ./cmd/frpc env CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build -trimpath -ldflags "$(LDFLAGS)" -tags "kanholec$(NOWEB_TAG)" -o bin/kanholec-windows-arm64.exe ./cmd/kanholec
frpc-windows-msi: frpc-windows kanholec-windows-msi: kanholec-windows
wixl -o bin/frpc-0.62.0.msi packaging/windows/frpc.wxs 2>/dev/null \ wixl -o bin/kanholec-$(KANHOLE_VERSION).msi packaging/windows/kanholec.wxs 2>/dev/null \
|| { echo "wixl failed. Try: apt install msitools"; \ || { echo "wixl failed. Try: apt install msitools"; \
echo "Or on Windows: candle frpc.wxs -o frpc.wixobj && light frpc.wixobj -o frpc.msi"; \ echo "Or on Windows: candle kanholec.wxs -o kanholec.wixobj && light kanholec.wixobj -o kanholec.msi"; \
exit 1; } exit 1; }
.PHONY: frpc-windows frpc-windows-arm64 frpc-windows-msi .PHONY: kanholec-windows kanholec-windows-arm64 kanholec-windows-msi
test: gotest test: gotest
@@ -78,25 +79,11 @@ e2e-compatibility: build
e2e-compatibility-floor: build e2e-compatibility-floor: build
FRP_COMPAT_BASELINE_VERSIONS="$(FRP_COMPAT_FLOOR_VERSION)" ./hack/run-e2e-compatibility.sh FRP_COMPAT_BASELINE_VERSIONS="$(FRP_COMPAT_FLOOR_VERSION)" ./hack/run-e2e-compatibility.sh
e2e-compatibility-last-frpc:
if [ ! -d "./lastversion" ]; then \
TARGET_DIRNAME=lastversion ./hack/download.sh; \
fi
FRPC_PATH="`pwd`/lastversion/frpc" ./hack/run-e2e.sh
rm -r ./lastversion
e2e-compatibility-last-frps:
if [ ! -d "./lastversion" ]; then \
TARGET_DIRNAME=lastversion ./hack/download.sh; \
fi
FRPS_PATH="`pwd`/lastversion/frps" ./hack/run-e2e.sh
rm -r ./lastversion
alltest: vet gotest e2e alltest: vet gotest e2e
clean: clean:
rm -f ./bin/frpc rm -f ./bin/kanhole
rm -f ./bin/frps rm -f ./bin/kanholec
rm -rf ./lastversion rm -rf ./lastversion
rm -rf ./.cache rm -rf ./.cache
rm -rf ./.compat rm -rf ./.compat
+4 -4
View File
@@ -17,10 +17,10 @@ package client
import ( import (
"net/http" "net/http"
adminapi "github.com/fatedier/frp/client/http" adminapi "kanhole/client/http"
"github.com/fatedier/frp/client/proxy" "kanhole/client/proxy"
httppkg "github.com/fatedier/frp/pkg/util/http" httppkg "kanhole/pkg/util/http"
netpkg "github.com/fatedier/frp/pkg/util/net" netpkg "kanhole/pkg/util/net"
) )
func (svr *Service) registerRouteHandlers(helper *httppkg.RouterRegisterHelper) { func (svr *Service) registerRouteHandlers(helper *httppkg.RouterRegisterHelper) {
+7 -7
View File
@@ -6,13 +6,13 @@ import (
"os" "os"
"time" "time"
"github.com/fatedier/frp/client/configmgmt" "kanhole/client/configmgmt"
"github.com/fatedier/frp/client/proxy" "kanhole/client/proxy"
"github.com/fatedier/frp/pkg/config" "kanhole/pkg/config"
"github.com/fatedier/frp/pkg/config/source" "kanhole/pkg/config/source"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/config/v1/validation" "kanhole/pkg/config/v1/validation"
"github.com/fatedier/frp/pkg/util/log" "kanhole/pkg/util/log"
) )
type serviceConfigManager struct { type serviceConfigManager struct {
+3 -3
View File
@@ -5,9 +5,9 @@ import (
"path/filepath" "path/filepath"
"testing" "testing"
"github.com/fatedier/frp/client/configmgmt" "kanhole/client/configmgmt"
"github.com/fatedier/frp/pkg/config/source" "kanhole/pkg/config/source"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
) )
func newTestRawTCPProxyConfig(name string) *v1.TCPProxyConfig { func newTestRawTCPProxyConfig(name string) *v1.TCPProxyConfig {
+2 -2
View File
@@ -4,8 +4,8 @@ import (
"errors" "errors"
"time" "time"
"github.com/fatedier/frp/client/proxy" "kanhole/client/proxy"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
) )
var ( var (
+6 -6
View File
@@ -28,12 +28,12 @@ import (
quic "github.com/quic-go/quic-go" quic "github.com/quic-go/quic-go"
"github.com/samber/lo" "github.com/samber/lo"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg" "kanhole/pkg/msg"
"github.com/fatedier/frp/pkg/proto/wire" "kanhole/pkg/proto/wire"
"github.com/fatedier/frp/pkg/transport" "kanhole/pkg/transport"
netpkg "github.com/fatedier/frp/pkg/util/net" netpkg "kanhole/pkg/util/net"
"github.com/fatedier/frp/pkg/util/xlog" "kanhole/pkg/util/xlog"
) )
// Connector is an interface for establishing connections to the server. // Connector is an interface for establishing connections to the server.
+10 -10
View File
@@ -20,16 +20,16 @@ import (
"sync/atomic" "sync/atomic"
"time" "time"
"github.com/fatedier/frp/client/proxy" "kanhole/client/proxy"
"github.com/fatedier/frp/client/visitor" "kanhole/client/visitor"
"github.com/fatedier/frp/pkg/auth" "kanhole/pkg/auth"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg" "kanhole/pkg/msg"
"github.com/fatedier/frp/pkg/naming" "kanhole/pkg/naming"
"github.com/fatedier/frp/pkg/transport" "kanhole/pkg/transport"
"github.com/fatedier/frp/pkg/util/wait" "kanhole/pkg/util/wait"
"github.com/fatedier/frp/pkg/util/xlog" "kanhole/pkg/util/xlog"
"github.com/fatedier/frp/pkg/vnet" "kanhole/pkg/vnet"
) )
type SessionContext struct { type SessionContext struct {
+7 -7
View File
@@ -26,13 +26,13 @@ import (
"github.com/samber/lo" "github.com/samber/lo"
"github.com/fatedier/frp/pkg/auth" "kanhole/pkg/auth"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg" "kanhole/pkg/msg"
"github.com/fatedier/frp/pkg/proto/wire" "kanhole/pkg/proto/wire"
netpkg "github.com/fatedier/frp/pkg/util/net" netpkg "kanhole/pkg/util/net"
"github.com/fatedier/frp/pkg/util/version" "kanhole/pkg/util/version"
"github.com/fatedier/frp/pkg/vnet" "kanhole/pkg/vnet"
) )
type controlSessionDialer struct { type controlSessionDialer struct {
+5 -5
View File
@@ -25,11 +25,11 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/fatedier/frp/pkg/auth" "kanhole/pkg/auth"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg" "kanhole/pkg/msg"
"github.com/fatedier/frp/pkg/proto/wire" "kanhole/pkg/proto/wire"
netpkg "github.com/fatedier/frp/pkg/util/net" netpkg "kanhole/pkg/util/net"
) )
type testConnector struct { type testConnector struct {
+1 -1
View File
@@ -3,7 +3,7 @@ package event
import ( import (
"errors" "errors"
"github.com/fatedier/frp/pkg/msg" "kanhole/pkg/msg"
) )
var ErrPayloadType = errors.New("error payload type") var ErrPayloadType = errors.New("error payload type")
+5 -5
View File
@@ -1,4 +1,4 @@
//go:build frpc_gui //go:build kanholec_gui
package gui package gui
@@ -17,9 +17,9 @@ import (
"fyne.io/fyne/v2/theme" "fyne.io/fyne/v2/theme"
"fyne.io/fyne/v2/widget" "fyne.io/fyne/v2/widget"
"github.com/fatedier/frp/pkg/config" "kanhole/pkg/config"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/util/log" "kanhole/pkg/util/log"
) )
type App struct { type App struct {
@@ -44,7 +44,7 @@ type App struct {
func New() *App { func New() *App {
a := &App{} a := &App{}
a.fyneApp = app.New() a.fyneApp = app.New()
a.window = a.fyneApp.NewWindow("frpc GUI") a.window = a.fyneApp.NewWindow("kanholec GUI")
a.window.Resize(fyne.NewSize(850, 620)) a.window.Resize(fyne.NewSize(850, 620))
a.window.SetMaster() a.window.SetMaster()
a.setupUI() a.setupUI()
+2 -2
View File
@@ -24,8 +24,8 @@ import (
"strings" "strings"
"time" "time"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/util/xlog" "kanhole/pkg/util/xlog"
) )
var ErrHealthCheckType = errors.New("error health check type") var ErrHealthCheckType = errors.New("error health check type")
+5 -5
View File
@@ -24,11 +24,11 @@ import (
"strconv" "strconv"
"time" "time"
"github.com/fatedier/frp/client/configmgmt" "kanhole/client/configmgmt"
"github.com/fatedier/frp/client/http/model" "kanhole/client/http/model"
"github.com/fatedier/frp/client/proxy" "kanhole/client/proxy"
httppkg "github.com/fatedier/frp/pkg/util/http" httppkg "kanhole/pkg/util/http"
"github.com/fatedier/frp/pkg/util/jsonx" "kanhole/pkg/util/jsonx"
) )
// Controller handles HTTP API requests for frpc. // Controller handles HTTP API requests for frpc.
+5 -5
View File
@@ -12,11 +12,11 @@ import (
"github.com/gorilla/mux" "github.com/gorilla/mux"
"github.com/fatedier/frp/client/configmgmt" "kanhole/client/configmgmt"
"github.com/fatedier/frp/client/http/model" "kanhole/client/http/model"
"github.com/fatedier/frp/client/proxy" "kanhole/client/proxy"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
httppkg "github.com/fatedier/frp/pkg/util/http" httppkg "kanhole/pkg/util/http"
) )
type fakeConfigManager struct { type fakeConfigManager struct {
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"strings" "strings"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
) )
type ProxyDefinition struct { type ProxyDefinition struct {
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"strings" "strings"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
) )
type VisitorDefinition struct { type VisitorDefinition struct {
+1 -1
View File
@@ -17,7 +17,7 @@ package proxy
import ( import (
"reflect" "reflect"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
) )
func init() { func init() {
+9 -9
View File
@@ -28,15 +28,15 @@ import (
libnet "github.com/fatedier/golib/net" libnet "github.com/fatedier/golib/net"
"golang.org/x/time/rate" "golang.org/x/time/rate"
"github.com/fatedier/frp/pkg/config/types" "kanhole/pkg/config/types"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg" "kanhole/pkg/msg"
plugin "github.com/fatedier/frp/pkg/plugin/client" plugin "kanhole/pkg/plugin/client"
"github.com/fatedier/frp/pkg/transport" "kanhole/pkg/transport"
"github.com/fatedier/frp/pkg/util/limit" "kanhole/pkg/util/limit"
netpkg "github.com/fatedier/frp/pkg/util/net" netpkg "kanhole/pkg/util/net"
"github.com/fatedier/frp/pkg/util/xlog" "kanhole/pkg/util/xlog"
"github.com/fatedier/frp/pkg/vnet" "kanhole/pkg/vnet"
) )
var proxyFactoryRegistry = map[reflect.Type]func(*BaseProxy, v1.ProxyConfigurer) Proxy{} var proxyFactoryRegistry = map[reflect.Type]func(*BaseProxy, v1.ProxyConfigurer) Proxy{}
+6 -6
View File
@@ -23,12 +23,12 @@ import (
"github.com/samber/lo" "github.com/samber/lo"
"github.com/fatedier/frp/client/event" "kanhole/client/event"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg" "kanhole/pkg/msg"
"github.com/fatedier/frp/pkg/transport" "kanhole/pkg/transport"
"github.com/fatedier/frp/pkg/util/xlog" "kanhole/pkg/util/xlog"
"github.com/fatedier/frp/pkg/vnet" "kanhole/pkg/vnet"
) )
type Manager struct { type Manager struct {
+8 -8
View File
@@ -25,14 +25,14 @@ import (
"github.com/fatedier/golib/errors" "github.com/fatedier/golib/errors"
"github.com/fatedier/frp/client/event" "kanhole/client/event"
"github.com/fatedier/frp/client/health" "kanhole/client/health"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg" "kanhole/pkg/msg"
"github.com/fatedier/frp/pkg/naming" "kanhole/pkg/naming"
"github.com/fatedier/frp/pkg/transport" "kanhole/pkg/transport"
"github.com/fatedier/frp/pkg/util/xlog" "kanhole/pkg/util/xlog"
"github.com/fatedier/frp/pkg/vnet" "kanhole/pkg/vnet"
) )
const ( const (
+4 -4
View File
@@ -25,10 +25,10 @@ import (
"github.com/fatedier/golib/errors" "github.com/fatedier/golib/errors"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg" "kanhole/pkg/msg"
"github.com/fatedier/frp/pkg/proto/udp" "kanhole/pkg/proto/udp"
netpkg "github.com/fatedier/frp/pkg/util/net" netpkg "kanhole/pkg/util/net"
) )
func init() { func init() {
+4 -4
View File
@@ -24,10 +24,10 @@ import (
"github.com/fatedier/golib/errors" "github.com/fatedier/golib/errors"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg" "kanhole/pkg/msg"
"github.com/fatedier/frp/pkg/proto/udp" "kanhole/pkg/proto/udp"
netpkg "github.com/fatedier/frp/pkg/util/net" netpkg "kanhole/pkg/util/net"
) )
func init() { func init() {
+6 -6
View File
@@ -25,12 +25,12 @@ import (
fmux "github.com/hashicorp/yamux" fmux "github.com/hashicorp/yamux"
"github.com/quic-go/quic-go" "github.com/quic-go/quic-go"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg" "kanhole/pkg/msg"
"github.com/fatedier/frp/pkg/naming" "kanhole/pkg/naming"
"github.com/fatedier/frp/pkg/nathole" "kanhole/pkg/nathole"
"github.com/fatedier/frp/pkg/transport" "kanhole/pkg/transport"
netpkg "github.com/fatedier/frp/pkg/util/net" netpkg "kanhole/pkg/util/net"
) )
func init() { func init() {
+2 -2
View File
@@ -23,8 +23,8 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/fatedier/frp/pkg/msg" "kanhole/pkg/msg"
"github.com/fatedier/frp/pkg/proto/wire" "kanhole/pkg/proto/wire"
) )
func TestReadNatHoleSidUsesSelectedWireProtocol(t *testing.T) { func TestReadNatHoleSidUsesSelectedWireProtocol(t *testing.T) {
+13 -13
View File
@@ -28,19 +28,19 @@ import (
"github.com/fatedier/golib/crypto" "github.com/fatedier/golib/crypto"
"github.com/samber/lo" "github.com/samber/lo"
"github.com/fatedier/frp/client/proxy" "kanhole/client/proxy"
"github.com/fatedier/frp/pkg/auth" "kanhole/pkg/auth"
"github.com/fatedier/frp/pkg/config" "kanhole/pkg/config"
"github.com/fatedier/frp/pkg/config/source" "kanhole/pkg/config/source"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg" "kanhole/pkg/msg"
"github.com/fatedier/frp/pkg/policy/security" "kanhole/pkg/policy/security"
httppkg "github.com/fatedier/frp/pkg/util/http" httppkg "kanhole/pkg/util/http"
"github.com/fatedier/frp/pkg/util/log" "kanhole/pkg/util/log"
netpkg "github.com/fatedier/frp/pkg/util/net" netpkg "kanhole/pkg/util/net"
"github.com/fatedier/frp/pkg/util/wait" "kanhole/pkg/util/wait"
"github.com/fatedier/frp/pkg/util/xlog" "kanhole/pkg/util/xlog"
"github.com/fatedier/frp/pkg/vnet" "kanhole/pkg/vnet"
) )
func init() { func init() {
+2 -2
View File
@@ -11,8 +11,8 @@ import (
"github.com/samber/lo" "github.com/samber/lo"
"github.com/fatedier/frp/pkg/config/source" "kanhole/pkg/config/source"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
) )
type failingConnector struct { type failingConnector struct {
+2 -2
View File
@@ -20,8 +20,8 @@ import (
libio "github.com/fatedier/golib/io" libio "github.com/fatedier/golib/io"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/util/xlog" "kanhole/pkg/util/xlog"
) )
type STCPVisitor struct { type STCPVisitor struct {
+5 -5
View File
@@ -23,11 +23,11 @@ import (
"github.com/fatedier/golib/errors" "github.com/fatedier/golib/errors"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg" "kanhole/pkg/msg"
"github.com/fatedier/frp/pkg/proto/udp" "kanhole/pkg/proto/udp"
netpkg "github.com/fatedier/frp/pkg/util/net" netpkg "kanhole/pkg/util/net"
"github.com/fatedier/frp/pkg/util/xlog" "kanhole/pkg/util/xlog"
) )
type SUDPVisitor struct { type SUDPVisitor struct {
+9 -9
View File
@@ -24,15 +24,15 @@ import (
libio "github.com/fatedier/golib/io" libio "github.com/fatedier/golib/io"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg" "kanhole/pkg/msg"
"github.com/fatedier/frp/pkg/naming" "kanhole/pkg/naming"
plugin "github.com/fatedier/frp/pkg/plugin/visitor" plugin "kanhole/pkg/plugin/visitor"
"github.com/fatedier/frp/pkg/transport" "kanhole/pkg/transport"
netpkg "github.com/fatedier/frp/pkg/util/net" netpkg "kanhole/pkg/util/net"
"github.com/fatedier/frp/pkg/util/util" "kanhole/pkg/util/util"
"github.com/fatedier/frp/pkg/util/xlog" "kanhole/pkg/util/xlog"
"github.com/fatedier/frp/pkg/vnet" "kanhole/pkg/vnet"
) )
// Helper wraps some functions for visitor to use. // Helper wraps some functions for visitor to use.
+5 -5
View File
@@ -24,11 +24,11 @@ import (
"github.com/samber/lo" "github.com/samber/lo"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg" "kanhole/pkg/msg"
"github.com/fatedier/frp/pkg/transport" "kanhole/pkg/transport"
"github.com/fatedier/frp/pkg/util/xlog" "kanhole/pkg/util/xlog"
"github.com/fatedier/frp/pkg/vnet" "kanhole/pkg/vnet"
) )
type Manager struct { type Manager struct {
+8 -8
View File
@@ -29,14 +29,14 @@ import (
quic "github.com/quic-go/quic-go" quic "github.com/quic-go/quic-go"
"golang.org/x/time/rate" "golang.org/x/time/rate"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg" "kanhole/pkg/msg"
"github.com/fatedier/frp/pkg/naming" "kanhole/pkg/naming"
"github.com/fatedier/frp/pkg/nathole" "kanhole/pkg/nathole"
"github.com/fatedier/frp/pkg/transport" "kanhole/pkg/transport"
netpkg "github.com/fatedier/frp/pkg/util/net" netpkg "kanhole/pkg/util/net"
"github.com/fatedier/frp/pkg/util/util" "kanhole/pkg/util/util"
"github.com/fatedier/frp/pkg/util/xlog" "kanhole/pkg/util/xlog"
) )
var ErrNoTunnelSession = errors.New("no tunnel session") var ErrNoTunnelSession = errors.New("no tunnel session")
+3 -3
View File
@@ -15,9 +15,9 @@
package main package main
import ( import (
_ "github.com/fatedier/frp/pkg/metrics" _ "kanhole/pkg/metrics"
"github.com/fatedier/frp/pkg/util/system" "kanhole/pkg/util/system"
_ "github.com/fatedier/frp/web/frps" _ "kanhole/web/frps"
) )
func main() { func main() {
+17 -17
View File
@@ -8,14 +8,14 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/fatedier/frp/pkg/config" "kanhole/pkg/config"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/config/v1/validation" "kanhole/pkg/config/v1/validation"
"github.com/fatedier/frp/pkg/db" "kanhole/pkg/db"
"github.com/fatedier/frp/pkg/policy/security" "kanhole/pkg/policy/security"
"github.com/fatedier/frp/pkg/util/log" "kanhole/pkg/util/log"
"github.com/fatedier/frp/pkg/util/version" "kanhole/pkg/util/version"
"github.com/fatedier/frp/server" "kanhole/server"
) )
var ( var (
@@ -28,8 +28,8 @@ var (
) )
func init() { func init() {
rootCmd.PersistentFlags().StringVarP(&cfgFile, "config", "c", "", "config file of frps") rootCmd.PersistentFlags().StringVarP(&cfgFile, "config", "c", "", "config file of kanhole")
rootCmd.PersistentFlags().BoolVarP(&showVersion, "version", "v", false, "version of frps") rootCmd.PersistentFlags().BoolVarP(&showVersion, "version", "v", false, "version of kanhole")
rootCmd.PersistentFlags().BoolVarP(&strictConfigMode, "strict_config", "", true, "strict config parsing mode, unknown fields will cause errors") rootCmd.PersistentFlags().BoolVarP(&strictConfigMode, "strict_config", "", true, "strict config parsing mode, unknown fields will cause errors")
rootCmd.PersistentFlags().StringSliceVarP(&allowUnsafe, "allow-unsafe", "", []string{}, rootCmd.PersistentFlags().StringSliceVarP(&allowUnsafe, "allow-unsafe", "", []string{},
fmt.Sprintf("allowed unsafe features, one or more of: %s", strings.Join(security.ServerUnsafeFeatures, ", "))) fmt.Sprintf("allowed unsafe features, one or more of: %s", strings.Join(security.ServerUnsafeFeatures, ", ")))
@@ -38,8 +38,8 @@ func init() {
} }
var rootCmd = &cobra.Command{ var rootCmd = &cobra.Command{
Use: "frps", Use: "kanhole",
Short: "frps is the server of frp (https://github.com/fatedier/frp)", Short: "kanhole is the server component of kanhole",
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
if showVersion { if showVersion {
fmt.Println(version.Full()) fmt.Println(version.Full())
@@ -114,7 +114,7 @@ func loadConfigFromDB() (*v1.ServerConfig, error) {
if err := cfg.Complete(); err != nil { if err := cfg.Complete(); err != nil {
return nil, fmt.Errorf("failed to complete server config: %w", err) return nil, fmt.Errorf("failed to complete server config: %w", err)
} }
log.Infof("frps uses database configuration") log.Infof("kanhole uses database configuration")
return cfg, nil return cfg, nil
} }
@@ -125,7 +125,7 @@ func loadConfigFromDB() (*v1.ServerConfig, error) {
if err := db.SaveServerConfig(cfg); err != nil { if err := db.SaveServerConfig(cfg); err != nil {
log.Warnf("failed to save default config to db: %v", err) log.Warnf("failed to save default config to db: %v", err)
} }
log.Infof("frps started with default configuration (first run)") log.Infof("kanhole started with default configuration (first run)")
return cfg, nil return cfg, nil
} }
@@ -133,16 +133,16 @@ func runServer(cfg *v1.ServerConfig) (err error) {
log.InitLogger(cfg.Log.To, cfg.Log.Level, int(cfg.Log.MaxDays), cfg.Log.DisablePrintColor) log.InitLogger(cfg.Log.To, cfg.Log.Level, int(cfg.Log.MaxDays), cfg.Log.DisablePrintColor)
if cfgFile != "" { if cfgFile != "" {
log.Infof("frps uses config file: %s", cfgFile) log.Infof("kanhole uses config file: %s", cfgFile)
} else { } else {
log.Infof("frps uses database configuration") log.Infof("kanhole uses database configuration")
} }
svr, err := server.NewService(cfg) svr, err := server.NewService(cfg)
if err != nil { if err != nil {
return err return err
} }
log.Infof("frps started successfully") log.Infof("kanhole started successfully")
svr.Run(context.Background()) svr.Run(context.Background())
return return
} }
+5 -5
View File
@@ -20,9 +20,9 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/fatedier/frp/pkg/config" "kanhole/pkg/config"
"github.com/fatedier/frp/pkg/config/v1/validation" "kanhole/pkg/config/v1/validation"
"github.com/fatedier/frp/pkg/policy/security" "kanhole/pkg/policy/security"
) )
func init() { func init() {
@@ -34,7 +34,7 @@ var verifyCmd = &cobra.Command{
Short: "Verify that the configures is valid", Short: "Verify that the configures is valid",
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
if cfgFile == "" { if cfgFile == "" {
fmt.Println("frps: the configuration file is not specified") fmt.Println("kanhole: the configuration file is not specified")
return nil return nil
} }
svrCfg, _, err := config.LoadServerConfig(cfgFile, strictConfigMode) svrCfg, _, err := config.LoadServerConfig(cfgFile, strictConfigMode)
@@ -53,7 +53,7 @@ var verifyCmd = &cobra.Command{
fmt.Println(err) fmt.Println(err)
os.Exit(1) os.Exit(1)
} }
fmt.Printf("frps: the configuration file %s syntax is ok\n", cfgFile) fmt.Printf("kanhole: the configuration file %s syntax is ok\n", cfgFile)
return nil return nil
}, },
} }
+3 -3
View File
@@ -15,9 +15,9 @@
package main package main
import ( import (
"github.com/fatedier/frp/cmd/frpc/sub" "kanhole/cmd/kanholec/sub"
"github.com/fatedier/frp/pkg/util/system" "kanhole/pkg/util/system"
_ "github.com/fatedier/frp/web/frpc" _ "kanhole/web/frpc"
) )
func main() { func main() {
@@ -1,4 +1,4 @@
// Copyright 2023 The frp Authors // Copyright 2023 The kanhole Authors
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -24,9 +24,9 @@ import (
"github.com/rodaine/table" "github.com/rodaine/table"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/fatedier/frp/pkg/config" "kanhole/pkg/config"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
clientsdk "github.com/fatedier/frp/pkg/sdk/client" clientsdk "kanhole/pkg/sdk/client"
) )
var adminAPITimeout = 30 * time.Second var adminAPITimeout = 30 * time.Second
@@ -37,9 +37,9 @@ func init() {
description string description string
handler func(*v1.ClientCommonConfig) error handler func(*v1.ClientCommonConfig) error
}{ }{
{"reload", "Hot-Reload frpc configuration", ReloadHandler}, {"reload", "Hot-Reload kanholec configuration", ReloadHandler},
{"status", "Overview of all proxies status", StatusHandler}, {"status", "Overview of all proxies status", StatusHandler},
{"stop", "Stop the running frpc", StopHandler}, {"stop", "Stop the running kanholec", StopHandler},
} }
for _, cmdConfig := range commands { for _, cmdConfig := range commands {
@@ -11,7 +11,7 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/fatedier/frp/pkg/util/log" "kanhole/pkg/util/log"
) )
var ( var (
@@ -22,14 +22,14 @@ var (
func init() { func init() {
authCmd := &cobra.Command{ authCmd := &cobra.Command{
Use: "auth", Use: "auth",
Short: "Authenticate frpc with a frp server", Short: "Authenticate kanholec with a kanhole server",
Long: `Authenticate this frpc instance with a frp server. Long: `Authenticate this kanholec instance with a kanhole server.
One-time token: One-time token:
frpc auth token <token> --server http://server:7500 kanholec auth token <token> --server http://server:7500
Interactive login: Interactive login:
frpc auth login --server http://server:7500 --client-name myclient kanholec auth login --server http://server:7500 --client-name myclient
`, `,
} }
@@ -39,16 +39,16 @@ Interactive login:
Args: cobra.ExactArgs(1), Args: cobra.ExactArgs(1),
RunE: runAuthToken, RunE: runAuthToken,
} }
tokenCmd.Flags().StringVarP(&authServer, "server", "s", "http://localhost:7500", "frp server admin URL") tokenCmd.Flags().StringVarP(&authServer, "server", "s", "http://localhost:7500", "kanhole server admin URL")
tokenCmd.Flags().StringVarP(&authOutput, "output", "o", "", "output config file path (default: ./frpc-<client-name>.toml)") tokenCmd.Flags().StringVarP(&authOutput, "output", "o", "", "output config file path (default: ./kanholec-<client-name>.toml)")
loginCmd := &cobra.Command{ loginCmd := &cobra.Command{
Use: "login", Use: "login",
Short: "Authenticate using admin credentials", Short: "Authenticate using admin credentials",
RunE: runAuthLogin, RunE: runAuthLogin,
} }
loginCmd.Flags().StringVarP(&authServer, "server", "s", "http://localhost:7500", "frp server admin URL") loginCmd.Flags().StringVarP(&authServer, "server", "s", "http://localhost:7500", "kanhole server admin URL")
loginCmd.Flags().StringVarP(&authOutput, "output", "o", "", "output config file path (default: ./frpc-<client-name>.toml)") loginCmd.Flags().StringVarP(&authOutput, "output", "o", "", "output config file path (default: ./kanholec-<client-name>.toml)")
loginCmd.Flags().String("username", "", "admin username (prompts if empty)") loginCmd.Flags().String("username", "", "admin username (prompts if empty)")
loginCmd.Flags().String("password", "", "admin password (prompts if empty)") loginCmd.Flags().String("password", "", "admin password (prompts if empty)")
loginCmd.Flags().String("client-name", "", "client name (fetches list if empty)") loginCmd.Flags().String("client-name", "", "client name (fetches list if empty)")
@@ -161,7 +161,7 @@ func saveConfig(data []byte) error {
outputPath := authOutput outputPath := authOutput
if outputPath == "" { if outputPath == "" {
// Try to extract client name from config // Try to extract client name from config
outputPath = "frpc.toml" outputPath = "kanholec.toml"
} }
if err := os.MkdirAll(filepath.Dir(outputPath), 0755); err != nil { if err := os.MkdirAll(filepath.Dir(outputPath), 0755); err != nil {
@@ -174,7 +174,7 @@ func saveConfig(data []byte) error {
log.Infof("config saved to %s", outputPath) log.Infof("config saved to %s", outputPath)
fmt.Printf("Config saved to %s\n", outputPath) fmt.Printf("Config saved to %s\n", outputPath)
fmt.Printf("Run: frpc -c %s\n", outputPath) fmt.Printf("Run: kanholec -c %s\n", outputPath)
return nil return nil
} }
@@ -1,17 +1,17 @@
//go:build frpc_gui //go:build kanholec_gui
package sub package sub
import ( import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/fatedier/frp/client/gui" "kanhole/client/gui"
) )
func init() { func init() {
guiCmd := &cobra.Command{ guiCmd := &cobra.Command{
Use: "gui", Use: "gui",
Short: "Start the frpc graphical user interface", Short: "Start the kanholec graphical user interface",
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
gui.Run() gui.Run()
return nil return nil
@@ -1,4 +1,4 @@
//go:build !frpc_gui //go:build !kanholec_gui
package sub package sub
@@ -11,11 +11,11 @@ import (
func init() { func init() {
guiCmd := &cobra.Command{ guiCmd := &cobra.Command{
Use: "gui", Use: "gui",
Short: "Start the frpc graphical user interface", Short: "Start the kanholec graphical user interface",
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
fmt.Println("frpc GUI is not available in this build.") fmt.Println("kanholec GUI is not available in this build.")
fmt.Println("To build with GUI support, install OpenGL and X11 dev libraries, then:") fmt.Println("To build with GUI support, install OpenGL and X11 dev libraries, then:")
fmt.Println(" CGO_ENABLED=1 go build -tags frpc_gui -o frpc ./cmd/frpc") fmt.Println(" CGO_ENABLED=1 go build -tags kanholec_gui -o kanholec ./cmd/kanholec")
return nil return nil
}, },
} }
@@ -1,4 +1,4 @@
// Copyright 2023 The frp Authors // Copyright 2023 The kanhole Authors
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -20,9 +20,9 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/fatedier/frp/pkg/config" "kanhole/pkg/config"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/nathole" "kanhole/pkg/nathole"
) )
var ( var (
@@ -1,4 +1,4 @@
// Copyright 2023 The frp Authors // Copyright 2023 The kanhole Authors
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -21,11 +21,11 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/fatedier/frp/pkg/config" "kanhole/pkg/config"
"github.com/fatedier/frp/pkg/config/source" "kanhole/pkg/config/source"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/config/v1/validation" "kanhole/pkg/config/v1/validation"
"github.com/fatedier/frp/pkg/policy/security" "kanhole/pkg/policy/security"
) )
var proxyTypes = []v1.ProxyType{ var proxyTypes = []v1.ProxyType{
@@ -73,7 +73,7 @@ func init() {
func NewProxyCommand(name string, c v1.ProxyConfigurer, clientCfg *v1.ClientCommonConfig) *cobra.Command { func NewProxyCommand(name string, c v1.ProxyConfigurer, clientCfg *v1.ClientCommonConfig) *cobra.Command {
return &cobra.Command{ return &cobra.Command{
Use: name, Use: name,
Short: fmt.Sprintf("Run frpc with a single %s proxy", name), Short: fmt.Sprintf("Run kanholec with a single %s proxy", name),
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
if err := clientCfg.Complete(); err != nil { if err := clientCfg.Complete(); err != nil {
fmt.Println(err) fmt.Println(err)
@@ -106,7 +106,7 @@ func NewProxyCommand(name string, c v1.ProxyConfigurer, clientCfg *v1.ClientComm
func NewVisitorCommand(name string, c v1.VisitorConfigurer, clientCfg *v1.ClientCommonConfig) *cobra.Command { func NewVisitorCommand(name string, c v1.VisitorConfigurer, clientCfg *v1.ClientCommonConfig) *cobra.Command {
return &cobra.Command{ return &cobra.Command{
Use: "visitor", Use: "visitor",
Short: fmt.Sprintf("Run frpc with a single %s visitor", name), Short: fmt.Sprintf("Run kanholec with a single %s visitor", name),
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
if err := clientCfg.Complete(); err != nil { if err := clientCfg.Complete(); err != nil {
fmt.Println(err) fmt.Println(err)
@@ -30,15 +30,15 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/fatedier/frp/client" "kanhole/client"
"github.com/fatedier/frp/pkg/config" "kanhole/pkg/config"
"github.com/fatedier/frp/pkg/config/source" "kanhole/pkg/config/source"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/config/v1/validation" "kanhole/pkg/config/v1/validation"
"github.com/fatedier/frp/pkg/policy/featuregate" "kanhole/pkg/policy/featuregate"
"github.com/fatedier/frp/pkg/policy/security" "kanhole/pkg/policy/security"
"github.com/fatedier/frp/pkg/util/log" "kanhole/pkg/util/log"
"github.com/fatedier/frp/pkg/util/version" "kanhole/pkg/util/version"
) )
var ( var (
@@ -51,9 +51,9 @@ var (
) )
func init() { func init() {
rootCmd.PersistentFlags().StringVarP(&cfgFile, "config", "c", "./frpc.ini", "config file of frpc") rootCmd.PersistentFlags().StringVarP(&cfgFile, "config", "c", "./kanholec.toml", "config file of kanholec")
rootCmd.PersistentFlags().StringVarP(&cfgDir, "config_dir", "", "", "config directory, run one frpc service for each file in config directory") rootCmd.PersistentFlags().StringVarP(&cfgDir, "config_dir", "", "", "config directory, run one kanholec service for each file in config directory")
rootCmd.PersistentFlags().BoolVarP(&showVersion, "version", "v", false, "version of frpc") rootCmd.PersistentFlags().BoolVarP(&showVersion, "version", "v", false, "version of kanholec")
rootCmd.PersistentFlags().BoolVarP(&strictConfigMode, "strict_config", "", true, "strict config parsing mode, unknown fields will cause an errors") rootCmd.PersistentFlags().BoolVarP(&strictConfigMode, "strict_config", "", true, "strict config parsing mode, unknown fields will cause an errors")
rootCmd.PersistentFlags().StringVarP(&serverConfigURL, "server-config", "", "", "fetch config from frps server URL (auto-reloads on change)") rootCmd.PersistentFlags().StringVarP(&serverConfigURL, "server-config", "", "", "fetch config from frps server URL (auto-reloads on change)")
@@ -62,8 +62,8 @@ func init() {
} }
var rootCmd = &cobra.Command{ var rootCmd = &cobra.Command{
Use: "frpc", Use: "kanholec",
Short: "frpc is the client of frp (https://github.com/fatedier/frp)", Short: "kanholec is the client component of kanhole",
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
if showVersion { if showVersion {
fmt.Println(version.Full()) fmt.Println(version.Full())
@@ -72,7 +72,7 @@ var rootCmd = &cobra.Command{
unsafeFeatures := security.NewUnsafeFeatures(allowUnsafe) unsafeFeatures := security.NewUnsafeFeatures(allowUnsafe)
// If cfgDir is not empty, run multiple frpc service for each config file in cfgDir. // If cfgDir is not empty, run multiple kanholec service for each config file in cfgDir.
// Note that it's only designed for testing. It's not guaranteed to be stable. // Note that it's only designed for testing. It's not guaranteed to be stable.
if cfgDir != "" { if cfgDir != "" {
_ = runMultipleClients(cfgDir, unsafeFeatures) _ = runMultipleClients(cfgDir, unsafeFeatures)
@@ -111,7 +111,7 @@ func runMultipleClients(cfgDir string, unsafeFeatures *security.UnsafeFeatures)
defer wg.Done() defer wg.Done()
err := runClient(path, unsafeFeatures) err := runClient(path, unsafeFeatures)
if err != nil { if err != nil {
fmt.Printf("frpc service error for config file [%s]\n", path) fmt.Printf("kanholec service error for config file [%s]\n", path)
} }
}() }()
return nil return nil
@@ -243,8 +243,8 @@ func startServiceWithAggregator(
log.InitLogger(cfg.Log.To, cfg.Log.Level, int(cfg.Log.MaxDays), cfg.Log.DisablePrintColor) log.InitLogger(cfg.Log.To, cfg.Log.Level, int(cfg.Log.MaxDays), cfg.Log.DisablePrintColor)
if cfgFile != "" { if cfgFile != "" {
log.Infof("start frpc service for config file [%s] with aggregated configuration", cfgFile) log.Infof("start kanholec service for config file [%s] with aggregated configuration", cfgFile)
defer log.Infof("frpc service for config file [%s] stopped", cfgFile) defer log.Infof("kanholec service for config file [%s] stopped", cfgFile)
} }
svr, err := client.NewService(client.ServiceOptions{ svr, err := client.NewService(client.ServiceOptions{
Common: cfg, Common: cfg,
@@ -1,4 +1,4 @@
// Copyright 2021 The frp Authors // Copyright 2021 The kanhole Authors
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -20,9 +20,9 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/fatedier/frp/pkg/config" "kanhole/pkg/config"
"github.com/fatedier/frp/pkg/config/v1/validation" "kanhole/pkg/config/v1/validation"
"github.com/fatedier/frp/pkg/policy/security" "kanhole/pkg/policy/security"
) )
func init() { func init() {
@@ -34,7 +34,7 @@ var verifyCmd = &cobra.Command{
Short: "Verify that the configures is valid", Short: "Verify that the configures is valid",
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
if cfgFile == "" { if cfgFile == "" {
fmt.Println("frpc: the configuration file is not specified") fmt.Println("kanholec: the configuration file is not specified")
return nil return nil
} }
@@ -53,7 +53,7 @@ var verifyCmd = &cobra.Command{
os.Exit(1) os.Exit(1)
} }
fmt.Printf("frpc: the configuration file %s syntax is ok\n", cfgFile) fmt.Printf("kanholec: the configuration file %s syntax is ok\n", cfgFile)
return nil return nil
}, },
} }
+1 -1
View File
@@ -1,4 +1,4 @@
module github.com/fatedier/frp module kanhole
go 1.25.0 go 1.25.0
-10
View File
@@ -1,10 +0,0 @@
# frpc configuration
# Generated by frpc installer
# Edit this file to configure your frp client.
serverAddr = "127.0.0.1"
serverPort = 7000
auth.token = ""
# Uncomment and set the URL to auto-fetch config from frps:
# configURL = "http://your-server:7500/admin/api/frpc/proxy-config/YOUR_KEY"
+42 -42
View File
@@ -1,13 +1,13 @@
<# <#
.SYNOPSIS .SYNOPSIS
frpc Windows Setup Wizard (Interactive PowerShell Installer) kanholec Windows Setup Wizard (Interactive PowerShell Installer)
.DESCRIPTION .DESCRIPTION
Interactive installer for frpc with EULA acceptance, directory selection, Interactive installer for kanholec with EULA acceptance, directory selection,
and optional features (PATH, shortcuts, desktop icon). and optional features (PATH, shortcuts, desktop icon).
.PARAMETER Unattended .PARAMETER Unattended
Run in silent mode with defaults. Run in silent mode with defaults.
.PARAMETER InstallDir .PARAMETER InstallDir
Installation directory (default: $env:ProgramFiles\frpc). Installation directory (default: $env:ProgramFiles\kanholec).
.EXAMPLE .EXAMPLE
.\install.ps1 .\install.ps1
.\install.ps1 -Unattended .\install.ps1 -Unattended
@@ -15,17 +15,17 @@
param( param(
[switch]$Unattended, [switch]$Unattended,
[string]$InstallDir = "$env:ProgramFiles\frpc" [string]$InstallDir = "$env:ProgramFiles\kanholec"
) )
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"
$host.UI.RawUI.WindowTitle = "frpc Setup Wizard" $host.UI.RawUI.WindowTitle = "kanholec Setup Wizard"
$env:FRPC_VERSION = "0.62.0" $env:KANHOLEC_VERSION = "0.62.0"
function Write-Banner { function Write-Banner {
Clear-Host Clear-Host
Write-Host "========================================" -ForegroundColor Cyan Write-Host "========================================" -ForegroundColor Cyan
Write-Host " frpc - frp Client v$env:FRPC_VERSION" -ForegroundColor Cyan Write-Host " kanholec - kanhole Client v$env:KANHOLEC_VERSION" -ForegroundColor Cyan
Write-Host " Setup Wizard" -ForegroundColor Cyan Write-Host " Setup Wizard" -ForegroundColor Cyan
Write-Host "========================================" -ForegroundColor Cyan Write-Host "========================================" -ForegroundColor Cyan
Write-Host "" Write-Host ""
@@ -40,7 +40,7 @@ function Show-License {
if (Test-Path $Path) { if (Test-Path $Path) {
Get-Content $Path | ForEach-Object { Write-Host $_ } Get-Content $Path | ForEach-Object { Write-Host $_ }
} else { } else {
Write-Host "frpc is licensed under the Apache License, Version 2.0." Write-Host "kanholec is licensed under the Apache License, Version 2.0."
Write-Host "See http://www.apache.org/licenses/LICENSE-2.0" Write-Host "See http://www.apache.org/licenses/LICENSE-2.0"
} }
Write-Host "" Write-Host ""
@@ -86,7 +86,7 @@ function Select-Components {
Write-Host "" Write-Host ""
$components = @{ $components = @{
"Main" = @{Desc="frpc binary and config"; Default=$true} "Main" = @{Desc="kanholec binary and config"; Default=$true}
"Path" = @{Desc="Add to system PATH"; Default=$true} "Path" = @{Desc="Add to system PATH"; Default=$true}
"StartMenu" = @{Desc="Start Menu shortcuts"; Default=$true} "StartMenu" = @{Desc="Start Menu shortcuts"; Default=$true}
"Desktop" = @{Desc="Desktop shortcut"; Default=$false} "Desktop" = @{Desc="Desktop shortcut"; Default=$false}
@@ -144,42 +144,42 @@ function Install-Frpc {
) )
Write-Banner Write-Banner
Write-Host "Installing frpc..." -ForegroundColor Yellow Write-Host "Installing kanholec..." -ForegroundColor Yellow
Write-Host "==================" -ForegroundColor Yellow Write-Host "==================" -ForegroundColor Yellow
Write-Host "" Write-Host ""
# Create directories # Create directories
Write-Host " Creating directories..." -NoNewline Write-Host " Creating directories..." -NoNewline
New-Item -Path $InstallDir -ItemType Directory -Force | Out-Null New-Item -Path $InstallDir -ItemType Directory -Force | Out-Null
$configDir = "$env:ProgramData\frpc" $configDir = "$env:ProgramData\kanholec"
New-Item -Path $configDir -ItemType Directory -Force | Out-Null New-Item -Path $configDir -ItemType Directory -Force | Out-Null
Write-Host " OK" -ForegroundColor Green Write-Host " OK" -ForegroundColor Green
# Copy binary # Copy binary
Write-Host " Copying frpc.exe..." -NoNewline Write-Host " Copying kanholec.exe..." -NoNewline
if ($BinarySource -and (Test-Path $BinarySource)) { if ($BinarySource -and (Test-Path $BinarySource)) {
Copy-Item -Path $BinarySource -Destination "$InstallDir\frpc.exe" -Force Copy-Item -Path $BinarySource -Destination "$InstallDir\kanholec.exe" -Force
} else { } else {
# Download from GitHub # Download from GitHub
$url = "https://github.com/fatedier/frp/releases/download/v$env:FRPC_VERSION/frp_${env:FRPC_VERSION}_windows_amd64.zip" $url = "https://github.com/fatedier/kanhole/releases/download/v$env:KANHOLEC_VERSION/kanhole_${env:KANHOLEC_VERSION}_windows_amd64.zip"
$zipPath = "$env:TEMP\frpc.zip" $zipPath = "$env:TEMP\kanholec.zip"
Write-Host "" Write-Host ""
Write-Host " Downloading from GitHub..." -NoNewline Write-Host " Downloading from GitHub..." -NoNewline
Invoke-WebRequest -Uri $url -OutFile $zipPath -UseBasicParsing Invoke-WebRequest -Uri $url -OutFile $zipPath -UseBasicParsing
Expand-Archive -Path $zipPath -DestinationPath "$env:TEMP\frpc" -Force Expand-Archive -Path $zipPath -DestinationPath "$env:TEMP\kanholec" -Force
$exePath = Get-ChildItem -Path "$env:TEMP\frpc" -Recurse -Filter "frpc.exe" | Select-Object -First 1 -ExpandProperty FullName $exePath = Get-ChildItem -Path "$env:TEMP\kanholec" -Recurse -Filter "kanholec.exe" | Select-Object -First 1 -ExpandProperty FullName
if (-not $exePath) { throw "frpc.exe not found in archive" } if (-not $exePath) { throw "kanholec.exe not found in archive" }
Copy-Item -Path $exePath -Destination "$InstallDir\frpc.exe" -Force Copy-Item -Path $exePath -Destination "$InstallDir\kanholec.exe" -Force
} }
Write-Host " OK" -ForegroundColor Green Write-Host " OK" -ForegroundColor Green
# Config file # Config file
Write-Host " Creating config..." -NoNewline Write-Host " Creating config..." -NoNewline
$configFile = "$configDir\frpc.toml" $configFile = "$configDir\kanholec.toml"
if (-not (Test-Path $configFile)) { if (-not (Test-Path $configFile)) {
@" @"
# frpc configuration # kanholec configuration
# Edit this file to configure your frp client. # Edit this file to configure your kanhole client.
serverAddr = "127.0.0.1" serverAddr = "127.0.0.1"
serverPort = 7000 serverPort = 7000
@@ -203,13 +203,13 @@ auth.token = ""
# Start Menu # Start Menu
if ($Components["StartMenu"]) { if ($Components["StartMenu"]) {
Write-Host " Creating Start Menu shortcuts..." -NoNewline Write-Host " Creating Start Menu shortcuts..." -NoNewline
$startMenu = "$([Environment]::GetFolderPath('CommonStartMenu'))\Programs\frpc" $startMenu = "$([Environment]::GetFolderPath('CommonStartMenu'))\Programs\kanholec"
New-Item -Path $startMenu -ItemType Directory -Force | Out-Null New-Item -Path $startMenu -ItemType Directory -Force | Out-Null
$wshell = New-Object -ComObject WScript.Shell $wshell = New-Object -ComObject WScript.Shell
$shortcut = $wshell.CreateShortcut("$startMenu\frpc.lnk") $shortcut = $wshell.CreateShortcut("$startMenu\kanholec.lnk")
$shortcut.TargetPath = "$InstallDir\frpc.exe" $shortcut.TargetPath = "$InstallDir\kanholec.exe"
$shortcut.Save() $shortcut.Save()
$unlink = $wshell.CreateShortcut("$startMenu\Uninstall frpc.lnk") $unlink = $wshell.CreateShortcut("$startMenu\Uninstall kanholec.lnk")
$unlink.TargetPath = "$InstallDir\uninstall.ps1" $unlink.TargetPath = "$InstallDir\uninstall.ps1"
$unlink.Save() $unlink.Save()
Write-Host " OK" -ForegroundColor Green Write-Host " OK" -ForegroundColor Green
@@ -220,8 +220,8 @@ auth.token = ""
Write-Host " Creating desktop shortcut..." -NoNewline Write-Host " Creating desktop shortcut..." -NoNewline
$desktop = [Environment]::GetFolderPath('Desktop') $desktop = [Environment]::GetFolderPath('Desktop')
$wshell = New-Object -ComObject WScript.Shell $wshell = New-Object -ComObject WScript.Shell
$shortcut = $wshell.CreateShortcut("$desktop\frpc.lnk") $shortcut = $wshell.CreateShortcut("$desktop\kanholec.lnk")
$shortcut.TargetPath = "$InstallDir\frpc.exe" $shortcut.TargetPath = "$InstallDir\kanholec.exe"
$shortcut.Save() $shortcut.Save()
Write-Host " OK" -ForegroundColor Green Write-Host " OK" -ForegroundColor Green
} }
@@ -232,17 +232,17 @@ auth.token = ""
param([switch]`$Silent) param([switch]`$Silent)
`$InstallDir = "$InstallDir" `$InstallDir = "$InstallDir"
if (-not `$Silent) { if (-not `$Silent) {
`$choice = `$host.UI.PromptForChoice("Uninstall frpc", "Remove frpc from this computer?", @(@{Label="&Yes"; Help=""}, @{Label="&No"; Help=""}), 1) `$choice = `$host.UI.PromptForChoice("Uninstall kanholec", "Remove kanholec from this computer?", @(@{Label="&Yes"; Help=""}, @{Label="&No"; Help=""}), 1)
if (`$choice -ne 0) { exit } if (`$choice -ne 0) { exit }
} }
# Remove files # Remove files
Remove-Item -Path "`$InstallDir\frpc.exe" -Force -ErrorAction SilentlyContinue Remove-Item -Path "`$InstallDir\kanholec.exe" -Force -ErrorAction SilentlyContinue
Remove-Item -Path "`$InstallDir\uninstall.ps1" -Force -ErrorAction SilentlyContinue Remove-Item -Path "`$InstallDir\uninstall.ps1" -Force -ErrorAction SilentlyContinue
Remove-Item -Path "`$InstallDir" -Force -ErrorAction SilentlyContinue Remove-Item -Path "`$InstallDir" -Force -ErrorAction SilentlyContinue
# Remove shortcuts # Remove shortcuts
Remove-Item -Path "$([Environment]::GetFolderPath('CommonStartMenu'))\Programs\frpc" -Recurse -Force -ErrorAction SilentlyContinue Remove-Item -Path "$([Environment]::GetFolderPath('CommonStartMenu'))\Programs\kanholec" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "$([Environment]::GetFolderPath('Desktop'))\frpc.lnk" -Force -ErrorAction SilentlyContinue Remove-Item -Path "$([Environment]::GetFolderPath('Desktop'))\kanholec.lnk" -Force -ErrorAction SilentlyContinue
Write-Host "frpc has been uninstalled." Write-Host "kanholec has been uninstalled."
"@ | Out-File -FilePath "$InstallDir\uninstall.ps1" -Encoding utf8 "@ | Out-File -FilePath "$InstallDir\uninstall.ps1" -Encoding utf8
Write-Host " OK" -ForegroundColor Green Write-Host " OK" -ForegroundColor Green
@@ -250,21 +250,21 @@ Write-Host "frpc has been uninstalled."
Write-Host "Installation complete!" -ForegroundColor Green Write-Host "Installation complete!" -ForegroundColor Green
Write-Host "" Write-Host ""
Write-Host "Quick start:" -ForegroundColor Yellow Write-Host "Quick start:" -ForegroundColor Yellow
Write-Host " frpc --help" Write-Host " kanholec --help"
Write-Host " frpc --server-config http://your-server:7500/admin/api/frpc/proxy-config/YOUR_KEY" Write-Host " kanholec --server-config http://your-server:7500/admin/api/kanholec/proxy-config/YOUR_KEY"
Write-Host " frpc -c $configFile" Write-Host " kanholec -c $configFile"
Write-Host "" Write-Host ""
Write-Host "Auth with provisioning token:" -ForegroundColor Yellow Write-Host "Auth with provisioning token:" -ForegroundColor Yellow
Write-Host " frpc auth login --server http://your-server:7500 --client-name myclient" Write-Host " kanholec auth login --server http://your-server:7500 --client-name myclient"
Write-Host "" Write-Host ""
} }
# ===== Main ===== # ===== Main =====
$scriptDir = Split-Path -Parent $PSCommandPath $scriptDir = Split-Path -Parent $PSCommandPath
$binarySource = Join-Path $scriptDir "..\bin\frpc-windows-amd64.exe" $binarySource = Join-Path $scriptDir "..\bin\kanholec-windows-amd64.exe"
if (-not (Test-Path $binarySource)) { if (-not (Test-Path $binarySource)) {
$binarySource = Join-Path $scriptDir "frpc-windows-amd64.exe" $binarySource = Join-Path $scriptDir "kanholec-windows-amd64.exe"
} }
if (-not (Test-Path $binarySource)) { if (-not (Test-Path $binarySource)) {
$binarySource = $null $binarySource = $null
@@ -296,14 +296,14 @@ if ($Unattended) {
Write-Host "" Write-Host ""
$runNow = $host.UI.PromptForChoice( $runNow = $host.UI.PromptForChoice(
"Setup Complete", "Setup Complete",
"Run frpc now?", "Run kanholec now?",
[System.Management.Automation.Host.ChoiceDescription[]]@( [System.Management.Automation.Host.ChoiceDescription[]]@(
@{Label="&Yes"; Help="Run frpc"}, @{Label="&Yes"; Help="Run kanholec"},
@{Label="&No"; Help="Close"} @{Label="&No"; Help="Close"}
), ),
0 0
) )
if ($runNow -eq 0) { if ($runNow -eq 0) {
Start-Process "$dir\frpc.exe" Start-Process "$dir\kanholec.exe"
} }
} }
+10
View File
@@ -0,0 +1,10 @@
# kanholec configuration
# Generated by kanholec installer
# Edit this file to configure your kanhole client.
serverAddr = "127.0.0.1"
serverPort = 7000
auth.token = ""
# Uncomment and set the URL to auto-fetch config from kanholes:
# configURL = "http://your-server:7500/admin/api/kanholec/proxy-config/YOUR_KEY"
@@ -1,16 +1,16 @@
; frpc Windows Installer (NSIS) ; kanholec Windows Installer (NSIS)
; Build: makensis frpc.nsi ; Build: makensis kanholec.nsi
; Requires: NSIS 3.x (https://nsis.sourceforge.io) ; Requires: NSIS 3.x (https://nsis.sourceforge.io)
!define PRODUCT_NAME "frpc" !define PRODUCT_NAME "kanholec"
!define PRODUCT_VERSION "0.62.0" !define PRODUCT_VERSION "0.62.0"
!define PRODUCT_PUBLISHER "frp Contributors" !define PRODUCT_PUBLISHER "kanhole Contributors"
!define PRODUCT_WEB_SITE "https://github.com/fatedier/frp" !define PRODUCT_WEB_SITE "https://github.com/kanhole/kanhole"
!define PRODUCT_DIR "$PROGRAMFILES64\${PRODUCT_NAME}" !define PRODUCT_DIR "$PROGRAMFILES64\${PRODUCT_NAME}"
!define PRODUCT_UNINSTALL_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" !define PRODUCT_UNINSTALL_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "..\..\bin\frpc-${PRODUCT_VERSION}-setup.exe" OutFile "..\..\bin\kanholec-${PRODUCT_VERSION}-setup.exe"
InstallDir "${PRODUCT_DIR}" InstallDir "${PRODUCT_DIR}"
InstallDirRegKey HKLM "${PRODUCT_UNINSTALL_KEY}" "InstallLocation" InstallDirRegKey HKLM "${PRODUCT_UNINSTALL_KEY}" "InstallLocation"
RequestExecutionLevel admin RequestExecutionLevel admin
@@ -53,7 +53,7 @@ Function setFinishPage
${NSD_CreateLabel} 0 0 100% 24 "Setup Complete" ${NSD_CreateLabel} 0 0 100% 24 "Setup Complete"
Pop $0 Pop $0
${NSD_CreateCheckbox} 0 30 100% 12 "Run frpc now" ${NSD_CreateCheckbox} 0 30 100% 12 "Run kanholec now"
Pop $RunNowCheckbox Pop $RunNowCheckbox
${NSD_Check} $RunNowCheckbox ${NSD_Check} $RunNowCheckbox
@@ -68,24 +68,24 @@ Function .onGUIEnd
${NSD_GetState} $ShowReadmeCheckbox $ReadmeState ${NSD_GetState} $ShowReadmeCheckbox $ReadmeState
${If} $RunNowState == ${BST_CHECKED} ${If} $RunNowState == ${BST_CHECKED}
ExecShell "open" "$INSTDIR\frpc.exe" ExecShell "open" "$INSTDIR\kanholec.exe"
${EndIf} ${EndIf}
${If} $ReadmeState == ${BST_CHECKED} ${If} $ReadmeState == ${BST_CHECKED}
ExecShell "open" "$PROGRAMDATA\frpc" ExecShell "open" "$PROGRAMDATA\kanholec"
${EndIf} ${EndIf}
FunctionEnd FunctionEnd
Section "frpc (required)" SEC_FRPC Section "kanholec (required)" SEC_KANHOLEC
SectionIn RO SectionIn RO
SetOutPath "$INSTDIR" SetOutPath "$INSTDIR"
File "..\..\bin\frpc-windows-amd64.exe" File "..\..\bin\kanholec-windows-amd64.exe"
Rename "$INSTDIR\frpc-windows-amd64.exe" "$INSTDIR\frpc.exe" Rename "$INSTDIR\kanholec-windows-amd64.exe" "$INSTDIR\kanholec.exe"
; Config directory ; Config directory
CreateDirectory "$PROGRAMDATA\frpc" CreateDirectory "$PROGRAMDATA\kanholec"
SetOutPath "$PROGRAMDATA\frpc" SetOutPath "$PROGRAMDATA\kanholec"
File "/oname=frpc.toml" "..\..\packaging\windows\frpc.default.toml" File "/oname=kanholec.toml" "..\..\packaging\windows\kanholec.default.toml"
WriteUninstaller "$INSTDIR\uninstall.exe" WriteUninstaller "$INSTDIR\uninstall.exe"
@@ -95,7 +95,7 @@ Section "frpc (required)" SEC_FRPC
WriteRegStr HKLM "${PRODUCT_UNINSTALL_KEY}" "DisplayVersion" "${PRODUCT_VERSION}" WriteRegStr HKLM "${PRODUCT_UNINSTALL_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr HKLM "${PRODUCT_UNINSTALL_KEY}" "Publisher" "${PRODUCT_PUBLISHER}" WriteRegStr HKLM "${PRODUCT_UNINSTALL_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
WriteRegStr HKLM "${PRODUCT_UNINSTALL_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}" WriteRegStr HKLM "${PRODUCT_UNINSTALL_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
WriteRegStr HKLM "${PRODUCT_UNINSTALL_KEY}" "DisplayIcon" "$INSTDIR\frpc.exe,0" WriteRegStr HKLM "${PRODUCT_UNINSTALL_KEY}" "DisplayIcon" "$INSTDIR\kanholec.exe,0"
WriteRegStr HKLM "${PRODUCT_UNINSTALL_KEY}" "InstallLocation" "$INSTDIR" WriteRegStr HKLM "${PRODUCT_UNINSTALL_KEY}" "InstallLocation" "$INSTDIR"
WriteRegDWORD HKLM "${PRODUCT_UNINSTALL_KEY}" "NoModify" 1 WriteRegDWORD HKLM "${PRODUCT_UNINSTALL_KEY}" "NoModify" 1
WriteRegDWORD HKLM "${PRODUCT_UNINSTALL_KEY}" "NoRepair" 1 WriteRegDWORD HKLM "${PRODUCT_UNINSTALL_KEY}" "NoRepair" 1
@@ -103,8 +103,8 @@ SectionEnd
Section "Start Menu Shortcuts" SEC_SHORTCUTS Section "Start Menu Shortcuts" SEC_SHORTCUTS
CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}" CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\frpc.lnk" "$INSTDIR\frpc.exe" "" "$INSTDIR\frpc.exe" 0 CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\kanholec.lnk" "$INSTDIR\kanholec.exe" "" "$INSTDIR\kanholec.exe" 0
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Config Directory.lnk" "$PROGRAMDATA\frpc" CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Config Directory.lnk" "$PROGRAMDATA\kanholec"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall.lnk" "$INSTDIR\uninstall.exe" CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall.lnk" "$INSTDIR\uninstall.exe"
SectionEnd SectionEnd
@@ -114,33 +114,33 @@ Section "Add to PATH" SEC_PATH
SectionEnd SectionEnd
Section "Desktop Shortcut" SEC_DESKTOP Section "Desktop Shortcut" SEC_DESKTOP
CreateShortCut "$DESKTOP\frpc.lnk" "$INSTDIR\frpc.exe" "" "$INSTDIR\frpc.exe" 0 CreateShortCut "$DESKTOP\kanholec.lnk" "$INSTDIR\kanholec.exe" "" "$INSTDIR\kanholec.exe" 0
SectionEnd SectionEnd
; Descriptions ; Descriptions
LangString DESC_SEC_FRPC ${LANG_ENGLISH} "frpc binary and default configuration." LangString DESC_SEC_KANHOLEC ${LANG_ENGLISH} "kanholec binary and default configuration."
LangString DESC_SEC_SHORTCUTS ${LANG_ENGLISH} "Start menu shortcuts for frpc." LangString DESC_SEC_SHORTCUTS ${LANG_ENGLISH} "Start menu shortcuts for kanholec."
LangString DESC_SEC_PATH ${LANG_ENGLISH} "Add frpc installation directory to system PATH." LangString DESC_SEC_PATH ${LANG_ENGLISH} "Add kanholec installation directory to system PATH."
LangString DESC_SEC_DESKTOP ${LANG_ENGLISH} "Create a desktop shortcut for frpc." LangString DESC_SEC_DESKTOP ${LANG_ENGLISH} "Create a desktop shortcut for kanholec."
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_FRPC} $(DESC_SEC_FRPC) !insertmacro MUI_DESCRIPTION_TEXT ${SEC_KANHOLEC} $(DESC_SEC_KANHOLEC)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_SHORTCUTS} $(DESC_SEC_SHORTCUTS) !insertmacro MUI_DESCRIPTION_TEXT ${SEC_SHORTCUTS} $(DESC_SEC_SHORTCUTS)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_PATH} $(DESC_SEC_PATH) !insertmacro MUI_DESCRIPTION_TEXT ${SEC_PATH} $(DESC_SEC_PATH)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_DESKTOP} $(DESC_SEC_DESKTOP) !insertmacro MUI_DESCRIPTION_TEXT ${SEC_DESKTOP} $(DESC_SEC_DESKTOP)
!insertmacro MUI_FUNCTION_DESCRIPTION_END !insertmacro MUI_FUNCTION_DESCRIPTION_END
Section "Uninstall" Section "Uninstall"
Delete "$INSTDIR\frpc.exe" Delete "$INSTDIR\kanholec.exe"
Delete "$INSTDIR\uninstall.exe" Delete "$INSTDIR\uninstall.exe"
RMDir "$INSTDIR" RMDir "$INSTDIR"
Delete "$SMPROGRAMS\${PRODUCT_NAME}\frpc.lnk" Delete "$SMPROGRAMS\${PRODUCT_NAME}\kanholec.lnk"
Delete "$SMPROGRAMS\${PRODUCT_NAME}\Config Directory.lnk" Delete "$SMPROGRAMS\${PRODUCT_NAME}\Config Directory.lnk"
Delete "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall.lnk" Delete "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall.lnk"
RMDir "$SMPROGRAMS\${PRODUCT_NAME}" RMDir "$SMPROGRAMS\${PRODUCT_NAME}"
Delete "$DESKTOP\frpc.lnk" Delete "$DESKTOP\kanholec.lnk"
EnVar::DeleteValue "PATH" "$INSTDIR" EnVar::DeleteValue "PATH" "$INSTDIR"
@@ -1,45 +1,45 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://wixtoolset.org/schemas/v3/wxs"> <Wix xmlns="http://wixtoolset.org/schemas/v3/wxs">
<Product <Product
Name="frpc" Name="kanholec"
Id="*" Id="*"
UpgradeCode="A1B2C3D4-E5F6-7890-ABCD-EF1234567890" UpgradeCode="A1B2C3D4-E5F6-7890-ABCD-EF1234567890"
Language="1033" Language="1033"
Codepage="1252" Codepage="1252"
Version="0.62.0" Version="0.62.0"
Manufacturer="frp Contributors"> Manufacturer="kanhole Contributors">
<Package <Package
InstallerVersion="200" InstallerVersion="200"
Compressed="yes" Compressed="yes"
InstallScope="perMachine" InstallScope="perMachine"
Description="frp Client" Description="kanhole Client"
Comments="frpc is the client component of frp - a fast reverse proxy." /> Comments="kanholec is the client component of kanhole - a fast reverse proxy." />
<Media Id="1" Cabinet="frpc.cab" EmbedCab="yes" /> <Media Id="1" Cabinet="kanholec.cab" EmbedCab="yes" />
<Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder"> <Directory Id="ProgramFiles64Folder">
<Directory Id="INSTALLDIR" Name="frpc"> <Directory Id="INSTALLDIR" Name="kanholec">
<Component Id="FrpcBinary" Guid="E1B2C3D4-E5F6-7890-ABCD-EF1234567894"> <Component Id="FrpcBinary" Guid="E1B2C3D4-E5F6-7890-ABCD-EF1234567894">
<File Id="FrpcExe" Name="frpc.exe" DiskId="1" Source="bin/frpc-windows-amd64.exe" KeyPath="yes" /> <File Id="FrpcExe" Name="kanholec.exe" DiskId="1" Source="bin/kanholec-windows-amd64.exe" KeyPath="yes" />
</Component> </Component>
</Directory> </Directory>
</Directory> </Directory>
<Directory Id="ProgramMenuFolder"> <Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="frpc"> <Directory Id="ApplicationProgramsFolder" Name="kanholec">
<Component Id="StartMenuShortcuts" Guid="A2B2C3D4-E5F6-7890-ABCD-EF1234567892"> <Component Id="StartMenuShortcuts" Guid="A2B2C3D4-E5F6-7890-ABCD-EF1234567892">
<Shortcut Id="FrpcShortcut" Name="frpc" Target="[INSTALLDIR]frpc.exe" WorkingDirectory="INSTALLDIR" Description="frp client" /> <Shortcut Id="FrpcShortcut" Name="kanholec" Target="[INSTALLDIR]kanholec.exe" WorkingDirectory="INSTALLDIR" Description="kanhole client" />
<Shortcut Id="UninstallShortcut" Name="Uninstall frpc" Target="[System64Folder]msiexec.exe" Arguments="/x [ProductCode]" /> <Shortcut Id="UninstallShortcut" Name="Uninstall kanholec" Target="[System64Folder]msiexec.exe" Arguments="/x [ProductCode]" />
<RemoveFolder Id="RemoveApplicationProgramsFolder" On="uninstall" /> <RemoveFolder Id="RemoveApplicationProgramsFolder" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\frp\frpc" Name="installed" Type="integer" Value="1" /> <RegistryValue Root="HKCU" Key="Software\kanhole\kanholec" Name="installed" Type="integer" Value="1" />
</Component> </Component>
</Directory> </Directory>
</Directory> </Directory>
</Directory> </Directory>
<Feature Id="Main" Title="frpc" Description="frp client binary" Level="1"> <Feature Id="Main" Title="kanholec" Description="kanhole client binary" Level="1">
<ComponentRef Id="FrpcBinary" /> <ComponentRef Id="FrpcBinary" />
<ComponentRef Id="StartMenuShortcuts" /> <ComponentRef Id="StartMenuShortcuts" />
</Feature> </Feature>
+4 -4
View File
@@ -1,14 +1,14 @@
{\rtf1\ansi\ansicpg1252\deff0\deflang1033\deftab720{\fonttbl{\f0\fnil\fcharset0 Arial;}{\f1\fmodern\fcharset0 Courier New;}} {\rtf1\ansi\ansicpg1252\deff0\deflang1033\deftab720{\fonttbl{\f0\fnil\fcharset0 Arial;}{\f1\fmodern\fcharset0 Courier New;}}
{\colortbl\red0\green0\blue0;\red255\green255\blue255;} {\colortbl\red0\green0\blue0;\red255\green255\blue255;}
\viewkind4\uc1\pard\qc\b\fs28 frpc - frp Client\par \viewkind4\uc1\pard\qc\b\fs28 kanholec\par
\b0\fs20 Version 0.62.0\par \b0\fs20 Version 0.1.0\par
\pard\sa200\sl240\slmult1\fs20\par \pard\sa200\sl240\slmult1\fs20\par
\pard\sa200\sl240\slmult1\b\fs24 License Agreement\b0\fs20\par \pard\sa200\sl240\slmult1\b\fs24 License Agreement\b0\fs20\par
\pard\sa200\sl240\slmult1\par \pard\sa200\sl240\slmult1\par
\pard\sa200\sl240\slmult1\fs20 This is a legal agreement between you (the "Licensee") and the frp project contributors ("Licensor"). By installing or using frpc, you agree to the following terms and conditions.\par \pard\sa200\sl240\slmult1\fs20 This is a legal agreement between you (the "Licensee") and the kanhole project contributors ("Licensor"). By installing or using kanholec, you agree to the following terms and conditions.\par
\pard\sa200\sl240\slmult1\par \pard\sa200\sl240\slmult1\par
\pard\sa200\sl240\slmult1\b 1. Grant of License\b0\par \pard\sa200\sl240\slmult1\b 1. Grant of License\b0\par
\pard\sa200\sl240\slmult1 The frpc software is licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at:\par \pard\sa200\sl240\slmult1 The kanholec software is licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at:\par
\pard\sa200\sl240\slmult1 http://www.apache.org/licenses/LICENSE-2.0\par \pard\sa200\sl240\slmult1 http://www.apache.org/licenses/LICENSE-2.0\par
\pard\sa200\sl240\slmult1\par \pard\sa200\sl240\slmult1\par
\pard\sa200\sl240\slmult1\b 2. Distribution\b0\par \pard\sa200\sl240\slmult1\b 2. Distribution\b0\par
+3 -3
View File
@@ -1,6 +1,6 @@
frpc - frp Client (version 0.62.0) kanholec - kanhole Client (version 0.1.0)
===================================== ============================================
Copyright (c) frp project contributors. Copyright (c) kanhole project contributors.
Licensed under the Apache License, Version 2.0. Licensed under the Apache License, Version 2.0.
TERMS AND CONDITIONS TERMS AND CONDITIONS
+2 -2
View File
@@ -18,8 +18,8 @@ import (
"context" "context"
"fmt" "fmt"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg" "kanhole/pkg/msg"
) )
type Setter interface { type Setter interface {
+3 -3
View File
@@ -29,9 +29,9 @@ import (
"golang.org/x/oauth2" "golang.org/x/oauth2"
"golang.org/x/oauth2/clientcredentials" "golang.org/x/oauth2/clientcredentials"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/config/v1/validation" "kanhole/pkg/config/v1/validation"
"github.com/fatedier/frp/pkg/msg" "kanhole/pkg/msg"
) )
// createOIDCHTTPClient creates an HTTP client with custom TLS and proxy configuration for OIDC token requests // createOIDCHTTPClient creates an HTTP client with custom TLS and proxy configuration for OIDC token requests
+3 -3
View File
@@ -12,9 +12,9 @@ import (
"github.com/coreos/go-oidc/v3/oidc" "github.com/coreos/go-oidc/v3/oidc"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/fatedier/frp/pkg/auth" "kanhole/pkg/auth"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg" "kanhole/pkg/msg"
) )
type mockTokenVerifier struct{} type mockTokenVerifier struct{}
+1 -1
View File
@@ -15,7 +15,7 @@
package auth package auth
import ( import (
"github.com/fatedier/frp/pkg/msg" "kanhole/pkg/msg"
) )
var AlwaysPassVerifier = &alwaysPass{} var AlwaysPassVerifier = &alwaysPass{}
+3 -3
View File
@@ -19,9 +19,9 @@ import (
"slices" "slices"
"time" "time"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg" "kanhole/pkg/msg"
"github.com/fatedier/frp/pkg/util/util" "kanhole/pkg/util/util"
) )
type TokenAuthSetterVerifier struct { type TokenAuthSetterVerifier struct {
+6 -6
View File
@@ -22,9 +22,9 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/pflag" "github.com/spf13/pflag"
"github.com/fatedier/frp/pkg/config/types" "kanhole/pkg/config/types"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/config/v1/validation" "kanhole/pkg/config/v1/validation"
) )
// WordSepNormalizeFunc changes all flags that contain "_" separators // WordSepNormalizeFunc changes all flags that contain "_" separators
@@ -154,8 +154,8 @@ func RegisterClientCommonConfigFlags(cmd *cobra.Command, c *v1.ClientCommonConfi
} }
if !options.sshMode { if !options.sshMode {
cmd.PersistentFlags().StringVarP(&c.ServerAddr, "server_addr", "s", "127.0.0.1", "frp server's address") cmd.PersistentFlags().StringVarP(&c.ServerAddr, "server_addr", "s", "127.0.0.1", "kanhole server's address")
cmd.PersistentFlags().IntVarP(&c.ServerPort, "server_port", "P", 7000, "frp server's port") cmd.PersistentFlags().IntVarP(&c.ServerPort, "server_port", "P", 7000, "kanhole server's port")
cmd.PersistentFlags().StringVarP(&c.Transport.Protocol, "protocol", "p", "tcp", cmd.PersistentFlags().StringVarP(&c.Transport.Protocol, "protocol", "p", "tcp",
fmt.Sprintf("optional values are %v", validation.SupportedTransportProtocols)) fmt.Sprintf("optional values are %v", validation.SupportedTransportProtocols))
cmd.PersistentFlags().StringVarP(&c.Log.Level, "log_level", "", "info", "log level") cmd.PersistentFlags().StringVarP(&c.Log.Level, "log_level", "", "info", "log level")
@@ -248,7 +248,7 @@ func RegisterServerConfigFlags(cmd *cobra.Command, c *v1.ServerConfig, opts ...R
cmd.PersistentFlags().StringVarP(&c.SubDomainHost, "subdomain_host", "", "", "subdomain host") cmd.PersistentFlags().StringVarP(&c.SubDomainHost, "subdomain_host", "", "", "subdomain host")
cmd.PersistentFlags().VarP(&PortsRangeSliceFlag{V: &c.AllowPorts}, "allow_ports", "", "allow ports") cmd.PersistentFlags().VarP(&PortsRangeSliceFlag{V: &c.AllowPorts}, "allow_ports", "", "allow ports")
cmd.PersistentFlags().Int64VarP(&c.MaxPortsPerClient, "max_ports_per_client", "", 0, "max ports per client") cmd.PersistentFlags().Int64VarP(&c.MaxPortsPerClient, "max_ports_per_client", "", 0, "max ports per client")
cmd.PersistentFlags().BoolVarP(&c.Transport.TLS.Force, "tls_only", "", false, "frps tls only") cmd.PersistentFlags().BoolVarP(&c.Transport.TLS.Force, "tls_only", "", false, "kanhole tls only")
webServerTLS := v1.TLSConfig{} webServerTLS := v1.TLSConfig{}
cmd.PersistentFlags().StringVarP(&webServerTLS.CertFile, "dashboard_tls_cert_file", "", "", "dashboard tls cert file") cmd.PersistentFlags().StringVarP(&webServerTLS.CertFile, "dashboard_tls_cert_file", "", "", "dashboard tls cert file")
+2 -2
View File
@@ -23,8 +23,8 @@ import (
"gopkg.in/ini.v1" "gopkg.in/ini.v1"
legacyauth "github.com/fatedier/frp/pkg/auth/legacy" legacyauth "kanhole/pkg/auth/legacy"
"github.com/fatedier/frp/pkg/util/util" "kanhole/pkg/util/util"
) )
// ClientCommonConf is the configuration parsed from ini. // ClientCommonConf is the configuration parsed from ini.
+2 -2
View File
@@ -19,8 +19,8 @@ import (
"github.com/samber/lo" "github.com/samber/lo"
"github.com/fatedier/frp/pkg/config/types" "kanhole/pkg/config/types"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
) )
func Convert_ClientCommonConf_To_v1(conf *ClientCommonConf) *v1.ClientCommonConfig { func Convert_ClientCommonConf_To_v1(conf *ClientCommonConf) *v1.ClientCommonConfig {
+1 -1
View File
@@ -20,7 +20,7 @@ import (
"gopkg.in/ini.v1" "gopkg.in/ini.v1"
"github.com/fatedier/frp/pkg/config/types" "kanhole/pkg/config/types"
) )
type ProxyType string type ProxyType string
+2 -2
View File
@@ -19,7 +19,7 @@ import (
"gopkg.in/ini.v1" "gopkg.in/ini.v1"
legacyauth "github.com/fatedier/frp/pkg/auth/legacy" legacyauth "kanhole/pkg/auth/legacy"
) )
type HTTPPluginOptions struct { type HTTPPluginOptions struct {
@@ -131,7 +131,7 @@ type ServerCommonConf struct {
// SubDomainHost specifies the domain that will be attached to sub-domains // SubDomainHost specifies the domain that will be attached to sub-domains
// requested by the client when using Vhost proxying. For example, if this // requested by the client when using Vhost proxying. For example, if this
// value is set to "frps.com" and the client requested the subdomain // value is set to "kanhole.com" and the client requested the subdomain
// "test", the resulting URL would be "test.frps.com". By default, this // "test", the resulting URL would be "test.frps.com". By default, this
// value is "". // value is "".
SubDomainHost string `ini:"subdomain_host" json:"subdomain_host"` SubDomainHost string `ini:"subdomain_host" json:"subdomain_host"`
+1 -1
View File
@@ -46,7 +46,7 @@ func GetValues() *Values {
} }
func RenderContent(in []byte) (out []byte, err error) { func RenderContent(in []byte) (out []byte, err error) {
tmpl, errRet := template.New("frp").Parse(string(in)) tmpl, errRet := template.New("kanhole").Parse(string(in))
if errRet != nil { if errRet != nil {
err = errRet err = errRet
return return
+7 -7
View File
@@ -30,12 +30,12 @@ import (
"k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/yaml" "k8s.io/apimachinery/pkg/util/yaml"
"github.com/fatedier/frp/pkg/config/legacy" "kanhole/pkg/config/legacy"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/config/v1/validation" "kanhole/pkg/config/v1/validation"
"github.com/fatedier/frp/pkg/msg" "kanhole/pkg/msg"
"github.com/fatedier/frp/pkg/util/jsonx" "kanhole/pkg/util/jsonx"
"github.com/fatedier/frp/pkg/util/util" "kanhole/pkg/util/util"
) )
var glbEnvs map[string]string var glbEnvs map[string]string
@@ -82,7 +82,7 @@ func DetectLegacyINIFormatFromFile(path string) bool {
} }
func RenderWithTemplate(in []byte, values *Values) ([]byte, error) { func RenderWithTemplate(in []byte, values *Values) ([]byte, error) {
tmpl, err := template.New("frp").Funcs(template.FuncMap{ tmpl, err := template.New("kanhole").Funcs(template.FuncMap{
"parseNumberRange": parseNumberRange, "parseNumberRange": parseNumberRange,
"parseNumberRangePair": parseNumberRangePair, "parseNumberRangePair": parseNumberRangePair,
}).Parse(string(in)) }).Parse(string(in))
+1 -1
View File
@@ -22,7 +22,7 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
) )
const tomlServerContent = ` const tomlServerContent = `
+1 -1
View File
@@ -22,7 +22,7 @@ import (
"slices" "slices"
"sync" "sync"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
) )
type Aggregator struct { type Aggregator struct {
+1 -1
View File
@@ -20,7 +20,7 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
) )
// mockProxy creates a TCP proxy config for testing // mockProxy creates a TCP proxy config for testing
+1 -1
View File
@@ -17,7 +17,7 @@ package source
import ( import (
"sync" "sync"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
) )
// baseSource provides shared state and behavior for Source implementations. // baseSource provides shared state and behavior for Source implementations.
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
) )
func TestBaseSourceLoadReturnsClonedConfigurers(t *testing.T) { func TestBaseSourceLoadReturnsClonedConfigurers(t *testing.T) {
+1 -1
View File
@@ -17,7 +17,7 @@ package source
import ( import (
"fmt" "fmt"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
) )
func cloneConfigurers( func cloneConfigurers(
+1 -1
View File
@@ -14,7 +14,7 @@
package source package source
import v1 "github.com/fatedier/frp/pkg/config/v1" import v1 "kanhole/pkg/config/v1"
// ConfigSource implements Source for in-memory configuration. // ConfigSource implements Source for in-memory configuration.
// All operations are thread-safe. // All operations are thread-safe.
+1 -1
View File
@@ -19,7 +19,7 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
) )
func TestNewConfigSource(t *testing.T) { func TestNewConfigSource(t *testing.T) {
+1 -1
View File
@@ -15,7 +15,7 @@
package source package source
import ( import (
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
) )
// Source is the interface for configuration sources. // Source is the interface for configuration sources.
+2 -2
View File
@@ -20,8 +20,8 @@ import (
"os" "os"
"path/filepath" "path/filepath"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/util/jsonx" "kanhole/pkg/util/jsonx"
) )
type StoreSourceConfig struct { type StoreSourceConfig struct {
+2 -2
View File
@@ -22,8 +22,8 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/util/jsonx" "kanhole/pkg/util/jsonx"
) )
func TestStoreSource_AddProxyAndVisitor_DoesNotApplyRuntimeDefaults(t *testing.T) { func TestStoreSource_AddProxyAndVisitor_DoesNotApplyRuntimeDefaults(t *testing.T) {
+1 -1
View File
@@ -17,7 +17,7 @@ package source
import ( import (
"fmt" "fmt"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
) )
func validateProxyName(proxy v1.ProxyConfigurer) (string, error) { func validateProxyName(proxy v1.ProxyConfigurer) (string, error) {
+1 -1
View File
@@ -17,7 +17,7 @@ package config
import ( import (
"fmt" "fmt"
"github.com/fatedier/frp/pkg/util/util" "kanhole/pkg/util/util"
) )
type NumberPair struct { type NumberPair struct {
+1 -1
View File
@@ -19,7 +19,7 @@ import (
"github.com/samber/lo" "github.com/samber/lo"
"github.com/fatedier/frp/pkg/util/util" "kanhole/pkg/util/util"
) )
type ClientConfig struct { type ClientConfig struct {
+1 -1
View File
@@ -17,7 +17,7 @@ package v1
import ( import (
"maps" "maps"
"github.com/fatedier/frp/pkg/util/util" "kanhole/pkg/util/util"
) )
type AuthScope string type AuthScope string
+1 -1
View File
@@ -19,7 +19,7 @@ import (
"fmt" "fmt"
"reflect" "reflect"
"github.com/fatedier/frp/pkg/util/jsonx" "kanhole/pkg/util/jsonx"
) )
type DecodeOptions struct { type DecodeOptions struct {
+4 -4
View File
@@ -19,10 +19,10 @@ import (
"reflect" "reflect"
"slices" "slices"
"github.com/fatedier/frp/pkg/config/types" "kanhole/pkg/config/types"
"github.com/fatedier/frp/pkg/msg" "kanhole/pkg/msg"
"github.com/fatedier/frp/pkg/util/jsonx" "kanhole/pkg/util/jsonx"
"github.com/fatedier/frp/pkg/util/util" "kanhole/pkg/util/util"
) )
type ProxyTransport struct { type ProxyTransport struct {
+2 -2
View File
@@ -19,8 +19,8 @@ import (
"github.com/samber/lo" "github.com/samber/lo"
"github.com/fatedier/frp/pkg/util/jsonx" "kanhole/pkg/util/jsonx"
"github.com/fatedier/frp/pkg/util/util" "kanhole/pkg/util/util"
) )
const ( const (
+3 -3
View File
@@ -17,8 +17,8 @@ package v1
import ( import (
"github.com/samber/lo" "github.com/samber/lo"
"github.com/fatedier/frp/pkg/config/types" "kanhole/pkg/config/types"
"github.com/fatedier/frp/pkg/util/util" "kanhole/pkg/util/util"
) )
type ServerConfig struct { type ServerConfig struct {
@@ -60,7 +60,7 @@ type ServerConfig struct {
TCPMuxPassthrough bool `json:"tcpmuxPassthrough,omitempty"` TCPMuxPassthrough bool `json:"tcpmuxPassthrough,omitempty"`
// SubDomainHost specifies the domain that will be attached to sub-domains // SubDomainHost specifies the domain that will be attached to sub-domains
// requested by the client when using Vhost proxying. For example, if this // requested by the client when using Vhost proxying. For example, if this
// value is set to "frps.com" and the client requested the subdomain // value is set to "kanhole.com" and the client requested the subdomain
// "test", the resulting URL would be "test.frps.com". // "test", the resulting URL would be "test.frps.com".
SubDomainHost string `json:"subDomainHost,omitempty"` SubDomainHost string `json:"subDomainHost,omitempty"`
// Custom404Page specifies a path to a custom 404 page to display. If this // Custom404Page specifies a path to a custom 404 page to display. If this
+2 -2
View File
@@ -17,8 +17,8 @@ package validation
import ( import (
"fmt" "fmt"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/policy/security" "kanhole/pkg/policy/security"
) )
func (v *ConfigValidator) validateAuthTokenSource(token string, tokenSource *v1.ValueSource) error { func (v *ConfigValidator) validateAuthTokenSource(token string, tokenSource *v1.ValueSource) error {
+2 -2
View File
@@ -19,8 +19,8 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/policy/security" "kanhole/pkg/policy/security"
) )
const ( const (
+3 -3
View File
@@ -22,9 +22,9 @@ import (
"github.com/samber/lo" "github.com/samber/lo"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/policy/featuregate" "kanhole/pkg/policy/featuregate"
"github.com/fatedier/frp/pkg/policy/security" "kanhole/pkg/policy/security"
) )
func (v *ConfigValidator) ValidateClientCommonConfig(c *v1.ClientCommonConfig) (Warning, error) { func (v *ConfigValidator) ValidateClientCommonConfig(c *v1.ClientCommonConfig) (Warning, error) {
+1 -1
View File
@@ -18,7 +18,7 @@ import (
"fmt" "fmt"
"slices" "slices"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
) )
func validateWebServerConfig(c *v1.WebServerConfig) error { func validateWebServerConfig(c *v1.WebServerConfig) error {
+1 -1
View File
@@ -19,7 +19,7 @@ import (
"net/url" "net/url"
"strings" "strings"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
) )
func ValidateOIDCClientCredentialsConfig(c *v1.AuthOIDCClientConfig) error { func ValidateOIDCClientCredentialsConfig(c *v1.AuthOIDCClientConfig) error {
+1 -1
View File
@@ -21,7 +21,7 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
) )
func TestValidateOIDCClientCredentialsConfig(t *testing.T) { func TestValidateOIDCClientCredentialsConfig(t *testing.T) {
+1 -1
View File
@@ -17,7 +17,7 @@ package validation
import ( import (
"errors" "errors"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
) )
func ValidateClientPluginOptions(c v1.ClientPluginOptions) error { func ValidateClientPluginOptions(c v1.ClientPluginOptions) error {
+1 -1
View File
@@ -22,7 +22,7 @@ import (
"k8s.io/apimachinery/pkg/util/validation" "k8s.io/apimachinery/pkg/util/validation"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
) )
func validateProxyBaseConfigForClient(c *v1.ProxyBaseConfig) error { func validateProxyBaseConfigForClient(c *v1.ProxyBaseConfig) error {
+1 -1
View File
@@ -20,7 +20,7 @@ import (
"github.com/samber/lo" "github.com/samber/lo"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
) )
func (v *ConfigValidator) ValidateServerConfig(c *v1.ServerConfig) (Warning, error) { func (v *ConfigValidator) ValidateServerConfig(c *v1.ServerConfig) (Warning, error) {
+2 -2
View File
@@ -17,8 +17,8 @@ package validation
import ( import (
"errors" "errors"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
splugin "github.com/fatedier/frp/pkg/plugin/server" splugin "kanhole/pkg/plugin/server"
) )
var ( var (
+1 -1
View File
@@ -3,7 +3,7 @@ package validation
import ( import (
"fmt" "fmt"
"github.com/fatedier/frp/pkg/policy/security" "kanhole/pkg/policy/security"
) )
// ConfigValidator holds the context dependencies for configuration validation. // ConfigValidator holds the context dependencies for configuration validation.
+1 -1
View File
@@ -19,7 +19,7 @@ import (
"fmt" "fmt"
"slices" "slices"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
) )
func ValidateVisitorConfigurer(c v1.VisitorConfigurer) error { func ValidateVisitorConfigurer(c v1.VisitorConfigurer) error {
+2 -2
View File
@@ -17,8 +17,8 @@ package v1
import ( import (
"reflect" "reflect"
"github.com/fatedier/frp/pkg/util/jsonx" "kanhole/pkg/util/jsonx"
"github.com/fatedier/frp/pkg/util/util" "kanhole/pkg/util/util"
) )
type VisitorTransport struct { type VisitorTransport struct {
+1 -1
View File
@@ -17,7 +17,7 @@ package v1
import ( import (
"reflect" "reflect"
"github.com/fatedier/frp/pkg/util/jsonx" "kanhole/pkg/util/jsonx"
) )
const ( const (
+2 -2
View File
@@ -5,8 +5,8 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
v1 "github.com/fatedier/frp/pkg/config/v1" v1 "kanhole/pkg/config/v1"
"github.com/fatedier/frp/pkg/db/ent/serverconfig" "kanhole/pkg/db/ent/serverconfig"
) )
const configKey = "server_config" const configKey = "server_config"
+1 -1
View File
@@ -12,7 +12,7 @@ import (
entsql "entgo.io/ent/dialect/sql" entsql "entgo.io/ent/dialect/sql"
"golang.org/x/crypto/bcrypt" "golang.org/x/crypto/bcrypt"
"github.com/fatedier/frp/pkg/db/ent" "kanhole/pkg/db/ent"
) )
var ( var (
+5 -5
View File
@@ -9,15 +9,15 @@ import (
"log" "log"
"reflect" "reflect"
"github.com/fatedier/frp/pkg/db/ent/migrate" "kanhole/pkg/db/ent/migrate"
"entgo.io/ent" "entgo.io/ent"
"entgo.io/ent/dialect" "entgo.io/ent/dialect"
"entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql"
"github.com/fatedier/frp/pkg/db/ent/frpcclient" "kanhole/pkg/db/ent/frpcclient"
"github.com/fatedier/frp/pkg/db/ent/proxy" "kanhole/pkg/db/ent/proxy"
"github.com/fatedier/frp/pkg/db/ent/serverconfig" "kanhole/pkg/db/ent/serverconfig"
"github.com/fatedier/frp/pkg/db/ent/user" "kanhole/pkg/db/ent/user"
) )
// Client is the client that holds all ent builders. // Client is the client that holds all ent builders.
+4 -4
View File
@@ -12,10 +12,10 @@ import (
"entgo.io/ent" "entgo.io/ent"
"entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/dialect/sql/sqlgraph"
"github.com/fatedier/frp/pkg/db/ent/frpcclient" "kanhole/pkg/db/ent/frpcclient"
"github.com/fatedier/frp/pkg/db/ent/proxy" "kanhole/pkg/db/ent/proxy"
"github.com/fatedier/frp/pkg/db/ent/serverconfig" "kanhole/pkg/db/ent/serverconfig"
"github.com/fatedier/frp/pkg/db/ent/user" "kanhole/pkg/db/ent/user"
) )
// ent aliases to avoid import conflicts in user's code. // ent aliases to avoid import conflicts in user's code.

Some files were not shown because too many files have changed in this diff Show More