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 GO111MODULE=on
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_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
build: frps frpc
build: kanhole kanholec
env:
@go version
web: frps-web frpc-web
web: kanhole-web kanholec-web
frps-web:
kanhole-web:
$(MAKE) -C web/frps build
frpc-web:
kanholec-web:
$(MAKE) -C web/frpc build
fmt:
@@ -29,30 +30,30 @@ fmt-more:
gofumpt -l -w .
gci:
gci write -s standard -s default -s "prefix(github.com/fatedier/frp/)" ./
gci write -s standard -s default -s "prefix(kanhole/)" ./
vet:
go vet -tags "$(NOWEB_TAG)" ./...
frps:
env CGO_ENABLED=0 go build -trimpath -ldflags "$(LDFLAGS)" -tags "frps$(NOWEB_TAG)" -o bin/frps ./cmd/frps
kanhole:
env CGO_ENABLED=0 go build -trimpath -ldflags "$(LDFLAGS)" -tags "kanhole$(NOWEB_TAG)" -o bin/kanhole ./cmd/kanhole
frpc:
env CGO_ENABLED=0 go build -trimpath -ldflags "$(LDFLAGS)" -tags "frpc$(NOWEB_TAG)" -o bin/frpc ./cmd/frpc
kanholec:
env CGO_ENABLED=0 go build -trimpath -ldflags "$(LDFLAGS)" -tags "kanholec$(NOWEB_TAG)" -o bin/kanholec ./cmd/kanholec
frpc-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
kanholec-windows:
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:
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
kanholec-windows-arm64:
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
wixl -o bin/frpc-0.62.0.msi packaging/windows/frpc.wxs 2>/dev/null \
kanholec-windows-msi: kanholec-windows
wixl -o bin/kanholec-$(KANHOLE_VERSION).msi packaging/windows/kanholec.wxs 2>/dev/null \
|| { 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; }
.PHONY: frpc-windows frpc-windows-arm64 frpc-windows-msi
.PHONY: kanholec-windows kanholec-windows-arm64 kanholec-windows-msi
test: gotest
@@ -78,25 +79,11 @@ e2e-compatibility: build
e2e-compatibility-floor: build
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
clean:
rm -f ./bin/frpc
rm -f ./bin/frps
rm -f ./bin/kanhole
rm -f ./bin/kanholec
rm -rf ./lastversion
rm -rf ./.cache
rm -rf ./.compat
+4 -4
View File
@@ -17,10 +17,10 @@ package client
import (
"net/http"
adminapi "github.com/fatedier/frp/client/http"
"github.com/fatedier/frp/client/proxy"
httppkg "github.com/fatedier/frp/pkg/util/http"
netpkg "github.com/fatedier/frp/pkg/util/net"
adminapi "kanhole/client/http"
"kanhole/client/proxy"
httppkg "kanhole/pkg/util/http"
netpkg "kanhole/pkg/util/net"
)
func (svr *Service) registerRouteHandlers(helper *httppkg.RouterRegisterHelper) {
+7 -7
View File
@@ -6,13 +6,13 @@ import (
"os"
"time"
"github.com/fatedier/frp/client/configmgmt"
"github.com/fatedier/frp/client/proxy"
"github.com/fatedier/frp/pkg/config"
"github.com/fatedier/frp/pkg/config/source"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/config/v1/validation"
"github.com/fatedier/frp/pkg/util/log"
"kanhole/client/configmgmt"
"kanhole/client/proxy"
"kanhole/pkg/config"
"kanhole/pkg/config/source"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/config/v1/validation"
"kanhole/pkg/util/log"
)
type serviceConfigManager struct {
+3 -3
View File
@@ -5,9 +5,9 @@ import (
"path/filepath"
"testing"
"github.com/fatedier/frp/client/configmgmt"
"github.com/fatedier/frp/pkg/config/source"
v1 "github.com/fatedier/frp/pkg/config/v1"
"kanhole/client/configmgmt"
"kanhole/pkg/config/source"
v1 "kanhole/pkg/config/v1"
)
func newTestRawTCPProxyConfig(name string) *v1.TCPProxyConfig {
+2 -2
View File
@@ -4,8 +4,8 @@ import (
"errors"
"time"
"github.com/fatedier/frp/client/proxy"
v1 "github.com/fatedier/frp/pkg/config/v1"
"kanhole/client/proxy"
v1 "kanhole/pkg/config/v1"
)
var (
+6 -6
View File
@@ -28,12 +28,12 @@ import (
quic "github.com/quic-go/quic-go"
"github.com/samber/lo"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg"
"github.com/fatedier/frp/pkg/proto/wire"
"github.com/fatedier/frp/pkg/transport"
netpkg "github.com/fatedier/frp/pkg/util/net"
"github.com/fatedier/frp/pkg/util/xlog"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/msg"
"kanhole/pkg/proto/wire"
"kanhole/pkg/transport"
netpkg "kanhole/pkg/util/net"
"kanhole/pkg/util/xlog"
)
// Connector is an interface for establishing connections to the server.
+10 -10
View File
@@ -20,16 +20,16 @@ import (
"sync/atomic"
"time"
"github.com/fatedier/frp/client/proxy"
"github.com/fatedier/frp/client/visitor"
"github.com/fatedier/frp/pkg/auth"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg"
"github.com/fatedier/frp/pkg/naming"
"github.com/fatedier/frp/pkg/transport"
"github.com/fatedier/frp/pkg/util/wait"
"github.com/fatedier/frp/pkg/util/xlog"
"github.com/fatedier/frp/pkg/vnet"
"kanhole/client/proxy"
"kanhole/client/visitor"
"kanhole/pkg/auth"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/msg"
"kanhole/pkg/naming"
"kanhole/pkg/transport"
"kanhole/pkg/util/wait"
"kanhole/pkg/util/xlog"
"kanhole/pkg/vnet"
)
type SessionContext struct {
+7 -7
View File
@@ -26,13 +26,13 @@ import (
"github.com/samber/lo"
"github.com/fatedier/frp/pkg/auth"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg"
"github.com/fatedier/frp/pkg/proto/wire"
netpkg "github.com/fatedier/frp/pkg/util/net"
"github.com/fatedier/frp/pkg/util/version"
"github.com/fatedier/frp/pkg/vnet"
"kanhole/pkg/auth"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/msg"
"kanhole/pkg/proto/wire"
netpkg "kanhole/pkg/util/net"
"kanhole/pkg/util/version"
"kanhole/pkg/vnet"
)
type controlSessionDialer struct {
+5 -5
View File
@@ -25,11 +25,11 @@ import (
"github.com/stretchr/testify/require"
"github.com/fatedier/frp/pkg/auth"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg"
"github.com/fatedier/frp/pkg/proto/wire"
netpkg "github.com/fatedier/frp/pkg/util/net"
"kanhole/pkg/auth"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/msg"
"kanhole/pkg/proto/wire"
netpkg "kanhole/pkg/util/net"
)
type testConnector struct {
+1 -1
View File
@@ -3,7 +3,7 @@ package event
import (
"errors"
"github.com/fatedier/frp/pkg/msg"
"kanhole/pkg/msg"
)
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
@@ -17,9 +17,9 @@ import (
"fyne.io/fyne/v2/theme"
"fyne.io/fyne/v2/widget"
"github.com/fatedier/frp/pkg/config"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/util/log"
"kanhole/pkg/config"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/util/log"
)
type App struct {
@@ -44,7 +44,7 @@ type App struct {
func New() *App {
a := &App{}
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.SetMaster()
a.setupUI()
+2 -2
View File
@@ -24,8 +24,8 @@ import (
"strings"
"time"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/util/xlog"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/util/xlog"
)
var ErrHealthCheckType = errors.New("error health check type")
+5 -5
View File
@@ -24,11 +24,11 @@ import (
"strconv"
"time"
"github.com/fatedier/frp/client/configmgmt"
"github.com/fatedier/frp/client/http/model"
"github.com/fatedier/frp/client/proxy"
httppkg "github.com/fatedier/frp/pkg/util/http"
"github.com/fatedier/frp/pkg/util/jsonx"
"kanhole/client/configmgmt"
"kanhole/client/http/model"
"kanhole/client/proxy"
httppkg "kanhole/pkg/util/http"
"kanhole/pkg/util/jsonx"
)
// Controller handles HTTP API requests for frpc.
+5 -5
View File
@@ -12,11 +12,11 @@ import (
"github.com/gorilla/mux"
"github.com/fatedier/frp/client/configmgmt"
"github.com/fatedier/frp/client/http/model"
"github.com/fatedier/frp/client/proxy"
v1 "github.com/fatedier/frp/pkg/config/v1"
httppkg "github.com/fatedier/frp/pkg/util/http"
"kanhole/client/configmgmt"
"kanhole/client/http/model"
"kanhole/client/proxy"
v1 "kanhole/pkg/config/v1"
httppkg "kanhole/pkg/util/http"
)
type fakeConfigManager struct {
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"fmt"
"strings"
v1 "github.com/fatedier/frp/pkg/config/v1"
v1 "kanhole/pkg/config/v1"
)
type ProxyDefinition struct {
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"fmt"
"strings"
v1 "github.com/fatedier/frp/pkg/config/v1"
v1 "kanhole/pkg/config/v1"
)
type VisitorDefinition struct {
+1 -1
View File
@@ -17,7 +17,7 @@ package proxy
import (
"reflect"
v1 "github.com/fatedier/frp/pkg/config/v1"
v1 "kanhole/pkg/config/v1"
)
func init() {
+9 -9
View File
@@ -28,15 +28,15 @@ import (
libnet "github.com/fatedier/golib/net"
"golang.org/x/time/rate"
"github.com/fatedier/frp/pkg/config/types"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg"
plugin "github.com/fatedier/frp/pkg/plugin/client"
"github.com/fatedier/frp/pkg/transport"
"github.com/fatedier/frp/pkg/util/limit"
netpkg "github.com/fatedier/frp/pkg/util/net"
"github.com/fatedier/frp/pkg/util/xlog"
"github.com/fatedier/frp/pkg/vnet"
"kanhole/pkg/config/types"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/msg"
plugin "kanhole/pkg/plugin/client"
"kanhole/pkg/transport"
"kanhole/pkg/util/limit"
netpkg "kanhole/pkg/util/net"
"kanhole/pkg/util/xlog"
"kanhole/pkg/vnet"
)
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/fatedier/frp/client/event"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg"
"github.com/fatedier/frp/pkg/transport"
"github.com/fatedier/frp/pkg/util/xlog"
"github.com/fatedier/frp/pkg/vnet"
"kanhole/client/event"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/msg"
"kanhole/pkg/transport"
"kanhole/pkg/util/xlog"
"kanhole/pkg/vnet"
)
type Manager struct {
+8 -8
View File
@@ -25,14 +25,14 @@ import (
"github.com/fatedier/golib/errors"
"github.com/fatedier/frp/client/event"
"github.com/fatedier/frp/client/health"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg"
"github.com/fatedier/frp/pkg/naming"
"github.com/fatedier/frp/pkg/transport"
"github.com/fatedier/frp/pkg/util/xlog"
"github.com/fatedier/frp/pkg/vnet"
"kanhole/client/event"
"kanhole/client/health"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/msg"
"kanhole/pkg/naming"
"kanhole/pkg/transport"
"kanhole/pkg/util/xlog"
"kanhole/pkg/vnet"
)
const (
+4 -4
View File
@@ -25,10 +25,10 @@ import (
"github.com/fatedier/golib/errors"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg"
"github.com/fatedier/frp/pkg/proto/udp"
netpkg "github.com/fatedier/frp/pkg/util/net"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/msg"
"kanhole/pkg/proto/udp"
netpkg "kanhole/pkg/util/net"
)
func init() {
+4 -4
View File
@@ -24,10 +24,10 @@ import (
"github.com/fatedier/golib/errors"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg"
"github.com/fatedier/frp/pkg/proto/udp"
netpkg "github.com/fatedier/frp/pkg/util/net"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/msg"
"kanhole/pkg/proto/udp"
netpkg "kanhole/pkg/util/net"
)
func init() {
+6 -6
View File
@@ -25,12 +25,12 @@ import (
fmux "github.com/hashicorp/yamux"
"github.com/quic-go/quic-go"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg"
"github.com/fatedier/frp/pkg/naming"
"github.com/fatedier/frp/pkg/nathole"
"github.com/fatedier/frp/pkg/transport"
netpkg "github.com/fatedier/frp/pkg/util/net"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/msg"
"kanhole/pkg/naming"
"kanhole/pkg/nathole"
"kanhole/pkg/transport"
netpkg "kanhole/pkg/util/net"
)
func init() {
+2 -2
View File
@@ -23,8 +23,8 @@ import (
"github.com/stretchr/testify/require"
"github.com/fatedier/frp/pkg/msg"
"github.com/fatedier/frp/pkg/proto/wire"
"kanhole/pkg/msg"
"kanhole/pkg/proto/wire"
)
func TestReadNatHoleSidUsesSelectedWireProtocol(t *testing.T) {
+13 -13
View File
@@ -28,19 +28,19 @@ import (
"github.com/fatedier/golib/crypto"
"github.com/samber/lo"
"github.com/fatedier/frp/client/proxy"
"github.com/fatedier/frp/pkg/auth"
"github.com/fatedier/frp/pkg/config"
"github.com/fatedier/frp/pkg/config/source"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg"
"github.com/fatedier/frp/pkg/policy/security"
httppkg "github.com/fatedier/frp/pkg/util/http"
"github.com/fatedier/frp/pkg/util/log"
netpkg "github.com/fatedier/frp/pkg/util/net"
"github.com/fatedier/frp/pkg/util/wait"
"github.com/fatedier/frp/pkg/util/xlog"
"github.com/fatedier/frp/pkg/vnet"
"kanhole/client/proxy"
"kanhole/pkg/auth"
"kanhole/pkg/config"
"kanhole/pkg/config/source"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/msg"
"kanhole/pkg/policy/security"
httppkg "kanhole/pkg/util/http"
"kanhole/pkg/util/log"
netpkg "kanhole/pkg/util/net"
"kanhole/pkg/util/wait"
"kanhole/pkg/util/xlog"
"kanhole/pkg/vnet"
)
func init() {
+2 -2
View File
@@ -11,8 +11,8 @@ import (
"github.com/samber/lo"
"github.com/fatedier/frp/pkg/config/source"
v1 "github.com/fatedier/frp/pkg/config/v1"
"kanhole/pkg/config/source"
v1 "kanhole/pkg/config/v1"
)
type failingConnector struct {
+2 -2
View File
@@ -20,8 +20,8 @@ import (
libio "github.com/fatedier/golib/io"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/util/xlog"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/util/xlog"
)
type STCPVisitor struct {
+5 -5
View File
@@ -23,11 +23,11 @@ import (
"github.com/fatedier/golib/errors"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg"
"github.com/fatedier/frp/pkg/proto/udp"
netpkg "github.com/fatedier/frp/pkg/util/net"
"github.com/fatedier/frp/pkg/util/xlog"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/msg"
"kanhole/pkg/proto/udp"
netpkg "kanhole/pkg/util/net"
"kanhole/pkg/util/xlog"
)
type SUDPVisitor struct {
+9 -9
View File
@@ -24,15 +24,15 @@ import (
libio "github.com/fatedier/golib/io"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg"
"github.com/fatedier/frp/pkg/naming"
plugin "github.com/fatedier/frp/pkg/plugin/visitor"
"github.com/fatedier/frp/pkg/transport"
netpkg "github.com/fatedier/frp/pkg/util/net"
"github.com/fatedier/frp/pkg/util/util"
"github.com/fatedier/frp/pkg/util/xlog"
"github.com/fatedier/frp/pkg/vnet"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/msg"
"kanhole/pkg/naming"
plugin "kanhole/pkg/plugin/visitor"
"kanhole/pkg/transport"
netpkg "kanhole/pkg/util/net"
"kanhole/pkg/util/util"
"kanhole/pkg/util/xlog"
"kanhole/pkg/vnet"
)
// Helper wraps some functions for visitor to use.
+5 -5
View File
@@ -24,11 +24,11 @@ import (
"github.com/samber/lo"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg"
"github.com/fatedier/frp/pkg/transport"
"github.com/fatedier/frp/pkg/util/xlog"
"github.com/fatedier/frp/pkg/vnet"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/msg"
"kanhole/pkg/transport"
"kanhole/pkg/util/xlog"
"kanhole/pkg/vnet"
)
type Manager struct {
+8 -8
View File
@@ -29,14 +29,14 @@ import (
quic "github.com/quic-go/quic-go"
"golang.org/x/time/rate"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg"
"github.com/fatedier/frp/pkg/naming"
"github.com/fatedier/frp/pkg/nathole"
"github.com/fatedier/frp/pkg/transport"
netpkg "github.com/fatedier/frp/pkg/util/net"
"github.com/fatedier/frp/pkg/util/util"
"github.com/fatedier/frp/pkg/util/xlog"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/msg"
"kanhole/pkg/naming"
"kanhole/pkg/nathole"
"kanhole/pkg/transport"
netpkg "kanhole/pkg/util/net"
"kanhole/pkg/util/util"
"kanhole/pkg/util/xlog"
)
var ErrNoTunnelSession = errors.New("no tunnel session")
+3 -3
View File
@@ -15,9 +15,9 @@
package main
import (
_ "github.com/fatedier/frp/pkg/metrics"
"github.com/fatedier/frp/pkg/util/system"
_ "github.com/fatedier/frp/web/frps"
_ "kanhole/pkg/metrics"
"kanhole/pkg/util/system"
_ "kanhole/web/frps"
)
func main() {
+17 -17
View File
@@ -8,14 +8,14 @@ import (
"github.com/spf13/cobra"
"github.com/fatedier/frp/pkg/config"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/config/v1/validation"
"github.com/fatedier/frp/pkg/db"
"github.com/fatedier/frp/pkg/policy/security"
"github.com/fatedier/frp/pkg/util/log"
"github.com/fatedier/frp/pkg/util/version"
"github.com/fatedier/frp/server"
"kanhole/pkg/config"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/config/v1/validation"
"kanhole/pkg/db"
"kanhole/pkg/policy/security"
"kanhole/pkg/util/log"
"kanhole/pkg/util/version"
"kanhole/server"
)
var (
@@ -28,8 +28,8 @@ var (
)
func init() {
rootCmd.PersistentFlags().StringVarP(&cfgFile, "config", "c", "", "config file of frps")
rootCmd.PersistentFlags().BoolVarP(&showVersion, "version", "v", false, "version of frps")
rootCmd.PersistentFlags().StringVarP(&cfgFile, "config", "c", "", "config file of kanhole")
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().StringSliceVarP(&allowUnsafe, "allow-unsafe", "", []string{},
fmt.Sprintf("allowed unsafe features, one or more of: %s", strings.Join(security.ServerUnsafeFeatures, ", ")))
@@ -38,8 +38,8 @@ func init() {
}
var rootCmd = &cobra.Command{
Use: "frps",
Short: "frps is the server of frp (https://github.com/fatedier/frp)",
Use: "kanhole",
Short: "kanhole is the server component of kanhole",
RunE: func(cmd *cobra.Command, args []string) error {
if showVersion {
fmt.Println(version.Full())
@@ -114,7 +114,7 @@ func loadConfigFromDB() (*v1.ServerConfig, error) {
if err := cfg.Complete(); err != nil {
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
}
@@ -125,7 +125,7 @@ func loadConfigFromDB() (*v1.ServerConfig, error) {
if err := db.SaveServerConfig(cfg); err != nil {
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
}
@@ -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)
if cfgFile != "" {
log.Infof("frps uses config file: %s", cfgFile)
log.Infof("kanhole uses config file: %s", cfgFile)
} else {
log.Infof("frps uses database configuration")
log.Infof("kanhole uses database configuration")
}
svr, err := server.NewService(cfg)
if err != nil {
return err
}
log.Infof("frps started successfully")
log.Infof("kanhole started successfully")
svr.Run(context.Background())
return
}
+5 -5
View File
@@ -20,9 +20,9 @@ import (
"github.com/spf13/cobra"
"github.com/fatedier/frp/pkg/config"
"github.com/fatedier/frp/pkg/config/v1/validation"
"github.com/fatedier/frp/pkg/policy/security"
"kanhole/pkg/config"
"kanhole/pkg/config/v1/validation"
"kanhole/pkg/policy/security"
)
func init() {
@@ -34,7 +34,7 @@ var verifyCmd = &cobra.Command{
Short: "Verify that the configures is valid",
RunE: func(cmd *cobra.Command, args []string) error {
if cfgFile == "" {
fmt.Println("frps: the configuration file is not specified")
fmt.Println("kanhole: the configuration file is not specified")
return nil
}
svrCfg, _, err := config.LoadServerConfig(cfgFile, strictConfigMode)
@@ -53,7 +53,7 @@ var verifyCmd = &cobra.Command{
fmt.Println(err)
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
},
}
+3 -3
View File
@@ -15,9 +15,9 @@
package main
import (
"github.com/fatedier/frp/cmd/frpc/sub"
"github.com/fatedier/frp/pkg/util/system"
_ "github.com/fatedier/frp/web/frpc"
"kanhole/cmd/kanholec/sub"
"kanhole/pkg/util/system"
_ "kanhole/web/frpc"
)
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");
// you may not use this file except in compliance with the License.
@@ -24,9 +24,9 @@ import (
"github.com/rodaine/table"
"github.com/spf13/cobra"
"github.com/fatedier/frp/pkg/config"
v1 "github.com/fatedier/frp/pkg/config/v1"
clientsdk "github.com/fatedier/frp/pkg/sdk/client"
"kanhole/pkg/config"
v1 "kanhole/pkg/config/v1"
clientsdk "kanhole/pkg/sdk/client"
)
var adminAPITimeout = 30 * time.Second
@@ -37,9 +37,9 @@ func init() {
description string
handler func(*v1.ClientCommonConfig) error
}{
{"reload", "Hot-Reload frpc configuration", ReloadHandler},
{"reload", "Hot-Reload kanholec configuration", ReloadHandler},
{"status", "Overview of all proxies status", StatusHandler},
{"stop", "Stop the running frpc", StopHandler},
{"stop", "Stop the running kanholec", StopHandler},
}
for _, cmdConfig := range commands {
@@ -11,7 +11,7 @@ import (
"github.com/spf13/cobra"
"github.com/fatedier/frp/pkg/util/log"
"kanhole/pkg/util/log"
)
var (
@@ -22,14 +22,14 @@ var (
func init() {
authCmd := &cobra.Command{
Use: "auth",
Short: "Authenticate frpc with a frp server",
Long: `Authenticate this frpc instance with a frp server.
Short: "Authenticate kanholec with a kanhole server",
Long: `Authenticate this kanholec instance with a kanhole server.
One-time token:
frpc auth token <token> --server http://server:7500
kanholec auth token <token> --server http://server:7500
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),
RunE: runAuthToken,
}
tokenCmd.Flags().StringVarP(&authServer, "server", "s", "http://localhost:7500", "frp server admin URL")
tokenCmd.Flags().StringVarP(&authOutput, "output", "o", "", "output config file path (default: ./frpc-<client-name>.toml)")
tokenCmd.Flags().StringVarP(&authServer, "server", "s", "http://localhost:7500", "kanhole server admin URL")
tokenCmd.Flags().StringVarP(&authOutput, "output", "o", "", "output config file path (default: ./kanholec-<client-name>.toml)")
loginCmd := &cobra.Command{
Use: "login",
Short: "Authenticate using admin credentials",
RunE: runAuthLogin,
}
loginCmd.Flags().StringVarP(&authServer, "server", "s", "http://localhost:7500", "frp server admin URL")
loginCmd.Flags().StringVarP(&authOutput, "output", "o", "", "output config file path (default: ./frpc-<client-name>.toml)")
loginCmd.Flags().StringVarP(&authServer, "server", "s", "http://localhost:7500", "kanhole server admin URL")
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("password", "", "admin password (prompts if empty)")
loginCmd.Flags().String("client-name", "", "client name (fetches list if empty)")
@@ -161,7 +161,7 @@ func saveConfig(data []byte) error {
outputPath := authOutput
if outputPath == "" {
// Try to extract client name from config
outputPath = "frpc.toml"
outputPath = "kanholec.toml"
}
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)
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
}
@@ -1,17 +1,17 @@
//go:build frpc_gui
//go:build kanholec_gui
package sub
import (
"github.com/spf13/cobra"
"github.com/fatedier/frp/client/gui"
"kanhole/client/gui"
)
func init() {
guiCmd := &cobra.Command{
Use: "gui",
Short: "Start the frpc graphical user interface",
Short: "Start the kanholec graphical user interface",
RunE: func(cmd *cobra.Command, args []string) error {
gui.Run()
return nil
@@ -1,4 +1,4 @@
//go:build !frpc_gui
//go:build !kanholec_gui
package sub
@@ -11,11 +11,11 @@ import (
func init() {
guiCmd := &cobra.Command{
Use: "gui",
Short: "Start the frpc graphical user interface",
Short: "Start the kanholec graphical user interface",
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(" 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
},
}
@@ -1,4 +1,4 @@
// Copyright 2023 The frp Authors
// Copyright 2023 The kanhole Authors
//
// Licensed under the Apache License, Version 2.0 (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/fatedier/frp/pkg/config"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/nathole"
"kanhole/pkg/config"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/nathole"
)
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");
// you may not use this file except in compliance with the License.
@@ -21,11 +21,11 @@ import (
"github.com/spf13/cobra"
"github.com/fatedier/frp/pkg/config"
"github.com/fatedier/frp/pkg/config/source"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/config/v1/validation"
"github.com/fatedier/frp/pkg/policy/security"
"kanhole/pkg/config"
"kanhole/pkg/config/source"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/config/v1/validation"
"kanhole/pkg/policy/security"
)
var proxyTypes = []v1.ProxyType{
@@ -73,7 +73,7 @@ func init() {
func NewProxyCommand(name string, c v1.ProxyConfigurer, clientCfg *v1.ClientCommonConfig) *cobra.Command {
return &cobra.Command{
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) {
if err := clientCfg.Complete(); err != nil {
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 {
return &cobra.Command{
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) {
if err := clientCfg.Complete(); err != nil {
fmt.Println(err)
@@ -30,15 +30,15 @@ import (
"github.com/spf13/cobra"
"github.com/fatedier/frp/client"
"github.com/fatedier/frp/pkg/config"
"github.com/fatedier/frp/pkg/config/source"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/config/v1/validation"
"github.com/fatedier/frp/pkg/policy/featuregate"
"github.com/fatedier/frp/pkg/policy/security"
"github.com/fatedier/frp/pkg/util/log"
"github.com/fatedier/frp/pkg/util/version"
"kanhole/client"
"kanhole/pkg/config"
"kanhole/pkg/config/source"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/config/v1/validation"
"kanhole/pkg/policy/featuregate"
"kanhole/pkg/policy/security"
"kanhole/pkg/util/log"
"kanhole/pkg/util/version"
)
var (
@@ -51,9 +51,9 @@ var (
)
func init() {
rootCmd.PersistentFlags().StringVarP(&cfgFile, "config", "c", "./frpc.ini", "config file of frpc")
rootCmd.PersistentFlags().StringVarP(&cfgDir, "config_dir", "", "", "config directory, run one frpc service for each file in config directory")
rootCmd.PersistentFlags().BoolVarP(&showVersion, "version", "v", false, "version of frpc")
rootCmd.PersistentFlags().StringVarP(&cfgFile, "config", "c", "./kanholec.toml", "config file of kanholec")
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 kanholec")
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)")
@@ -62,8 +62,8 @@ func init() {
}
var rootCmd = &cobra.Command{
Use: "frpc",
Short: "frpc is the client of frp (https://github.com/fatedier/frp)",
Use: "kanholec",
Short: "kanholec is the client component of kanhole",
RunE: func(cmd *cobra.Command, args []string) error {
if showVersion {
fmt.Println(version.Full())
@@ -72,7 +72,7 @@ var rootCmd = &cobra.Command{
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.
if cfgDir != "" {
_ = runMultipleClients(cfgDir, unsafeFeatures)
@@ -111,7 +111,7 @@ func runMultipleClients(cfgDir string, unsafeFeatures *security.UnsafeFeatures)
defer wg.Done()
err := runClient(path, unsafeFeatures)
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
@@ -243,8 +243,8 @@ func startServiceWithAggregator(
log.InitLogger(cfg.Log.To, cfg.Log.Level, int(cfg.Log.MaxDays), cfg.Log.DisablePrintColor)
if cfgFile != "" {
log.Infof("start frpc service for config file [%s] with aggregated configuration", cfgFile)
defer log.Infof("frpc service for config file [%s] stopped", cfgFile)
log.Infof("start kanholec service for config file [%s] with aggregated configuration", cfgFile)
defer log.Infof("kanholec service for config file [%s] stopped", cfgFile)
}
svr, err := client.NewService(client.ServiceOptions{
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");
// you may not use this file except in compliance with the License.
@@ -20,9 +20,9 @@ import (
"github.com/spf13/cobra"
"github.com/fatedier/frp/pkg/config"
"github.com/fatedier/frp/pkg/config/v1/validation"
"github.com/fatedier/frp/pkg/policy/security"
"kanhole/pkg/config"
"kanhole/pkg/config/v1/validation"
"kanhole/pkg/policy/security"
)
func init() {
@@ -34,7 +34,7 @@ var verifyCmd = &cobra.Command{
Short: "Verify that the configures is valid",
RunE: func(cmd *cobra.Command, args []string) error {
if cfgFile == "" {
fmt.Println("frpc: the configuration file is not specified")
fmt.Println("kanholec: the configuration file is not specified")
return nil
}
@@ -53,7 +53,7 @@ var verifyCmd = &cobra.Command{
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
},
}
+1 -1
View File
@@ -1,4 +1,4 @@
module github.com/fatedier/frp
module kanhole
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
frpc Windows Setup Wizard (Interactive PowerShell Installer)
kanholec Windows Setup Wizard (Interactive PowerShell Installer)
.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).
.PARAMETER Unattended
Run in silent mode with defaults.
.PARAMETER InstallDir
Installation directory (default: $env:ProgramFiles\frpc).
Installation directory (default: $env:ProgramFiles\kanholec).
.EXAMPLE
.\install.ps1
.\install.ps1 -Unattended
@@ -15,17 +15,17 @@
param(
[switch]$Unattended,
[string]$InstallDir = "$env:ProgramFiles\frpc"
[string]$InstallDir = "$env:ProgramFiles\kanholec"
)
$ErrorActionPreference = "Stop"
$host.UI.RawUI.WindowTitle = "frpc Setup Wizard"
$env:FRPC_VERSION = "0.62.0"
$host.UI.RawUI.WindowTitle = "kanholec Setup Wizard"
$env:KANHOLEC_VERSION = "0.62.0"
function Write-Banner {
Clear-Host
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 "========================================" -ForegroundColor Cyan
Write-Host ""
@@ -40,7 +40,7 @@ function Show-License {
if (Test-Path $Path) {
Get-Content $Path | ForEach-Object { Write-Host $_ }
} 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 ""
@@ -86,7 +86,7 @@ function Select-Components {
Write-Host ""
$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}
"StartMenu" = @{Desc="Start Menu shortcuts"; Default=$true}
"Desktop" = @{Desc="Desktop shortcut"; Default=$false}
@@ -144,42 +144,42 @@ function Install-Frpc {
)
Write-Banner
Write-Host "Installing frpc..." -ForegroundColor Yellow
Write-Host "Installing kanholec..." -ForegroundColor Yellow
Write-Host "==================" -ForegroundColor Yellow
Write-Host ""
# Create directories
Write-Host " Creating directories..." -NoNewline
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
Write-Host " OK" -ForegroundColor Green
# Copy binary
Write-Host " Copying frpc.exe..." -NoNewline
Write-Host " Copying kanholec.exe..." -NoNewline
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 {
# Download from GitHub
$url = "https://github.com/fatedier/frp/releases/download/v$env:FRPC_VERSION/frp_${env:FRPC_VERSION}_windows_amd64.zip"
$zipPath = "$env:TEMP\frpc.zip"
$url = "https://github.com/fatedier/kanhole/releases/download/v$env:KANHOLEC_VERSION/kanhole_${env:KANHOLEC_VERSION}_windows_amd64.zip"
$zipPath = "$env:TEMP\kanholec.zip"
Write-Host ""
Write-Host " Downloading from GitHub..." -NoNewline
Invoke-WebRequest -Uri $url -OutFile $zipPath -UseBasicParsing
Expand-Archive -Path $zipPath -DestinationPath "$env:TEMP\frpc" -Force
$exePath = Get-ChildItem -Path "$env:TEMP\frpc" -Recurse -Filter "frpc.exe" | Select-Object -First 1 -ExpandProperty FullName
if (-not $exePath) { throw "frpc.exe not found in archive" }
Copy-Item -Path $exePath -Destination "$InstallDir\frpc.exe" -Force
Expand-Archive -Path $zipPath -DestinationPath "$env:TEMP\kanholec" -Force
$exePath = Get-ChildItem -Path "$env:TEMP\kanholec" -Recurse -Filter "kanholec.exe" | Select-Object -First 1 -ExpandProperty FullName
if (-not $exePath) { throw "kanholec.exe not found in archive" }
Copy-Item -Path $exePath -Destination "$InstallDir\kanholec.exe" -Force
}
Write-Host " OK" -ForegroundColor Green
# Config file
Write-Host " Creating config..." -NoNewline
$configFile = "$configDir\frpc.toml"
$configFile = "$configDir\kanholec.toml"
if (-not (Test-Path $configFile)) {
@"
# frpc configuration
# Edit this file to configure your frp client.
# kanholec configuration
# Edit this file to configure your kanhole client.
serverAddr = "127.0.0.1"
serverPort = 7000
@@ -203,13 +203,13 @@ auth.token = ""
# Start Menu
if ($Components["StartMenu"]) {
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
$wshell = New-Object -ComObject WScript.Shell
$shortcut = $wshell.CreateShortcut("$startMenu\frpc.lnk")
$shortcut.TargetPath = "$InstallDir\frpc.exe"
$shortcut = $wshell.CreateShortcut("$startMenu\kanholec.lnk")
$shortcut.TargetPath = "$InstallDir\kanholec.exe"
$shortcut.Save()
$unlink = $wshell.CreateShortcut("$startMenu\Uninstall frpc.lnk")
$unlink = $wshell.CreateShortcut("$startMenu\Uninstall kanholec.lnk")
$unlink.TargetPath = "$InstallDir\uninstall.ps1"
$unlink.Save()
Write-Host " OK" -ForegroundColor Green
@@ -220,8 +220,8 @@ auth.token = ""
Write-Host " Creating desktop shortcut..." -NoNewline
$desktop = [Environment]::GetFolderPath('Desktop')
$wshell = New-Object -ComObject WScript.Shell
$shortcut = $wshell.CreateShortcut("$desktop\frpc.lnk")
$shortcut.TargetPath = "$InstallDir\frpc.exe"
$shortcut = $wshell.CreateShortcut("$desktop\kanholec.lnk")
$shortcut.TargetPath = "$InstallDir\kanholec.exe"
$shortcut.Save()
Write-Host " OK" -ForegroundColor Green
}
@@ -232,17 +232,17 @@ auth.token = ""
param([switch]`$Silent)
`$InstallDir = "$InstallDir"
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 }
}
# 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" -Force -ErrorAction SilentlyContinue
# Remove shortcuts
Remove-Item -Path "$([Environment]::GetFolderPath('CommonStartMenu'))\Programs\frpc" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "$([Environment]::GetFolderPath('Desktop'))\frpc.lnk" -Force -ErrorAction SilentlyContinue
Write-Host "frpc has been uninstalled."
Remove-Item -Path "$([Environment]::GetFolderPath('CommonStartMenu'))\Programs\kanholec" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "$([Environment]::GetFolderPath('Desktop'))\kanholec.lnk" -Force -ErrorAction SilentlyContinue
Write-Host "kanholec has been uninstalled."
"@ | Out-File -FilePath "$InstallDir\uninstall.ps1" -Encoding utf8
Write-Host " OK" -ForegroundColor Green
@@ -250,21 +250,21 @@ Write-Host "frpc has been uninstalled."
Write-Host "Installation complete!" -ForegroundColor Green
Write-Host ""
Write-Host "Quick start:" -ForegroundColor Yellow
Write-Host " frpc --help"
Write-Host " frpc --server-config http://your-server:7500/admin/api/frpc/proxy-config/YOUR_KEY"
Write-Host " frpc -c $configFile"
Write-Host " kanholec --help"
Write-Host " kanholec --server-config http://your-server:7500/admin/api/kanholec/proxy-config/YOUR_KEY"
Write-Host " kanholec -c $configFile"
Write-Host ""
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 ""
}
# ===== Main =====
$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)) {
$binarySource = Join-Path $scriptDir "frpc-windows-amd64.exe"
$binarySource = Join-Path $scriptDir "kanholec-windows-amd64.exe"
}
if (-not (Test-Path $binarySource)) {
$binarySource = $null
@@ -296,14 +296,14 @@ if ($Unattended) {
Write-Host ""
$runNow = $host.UI.PromptForChoice(
"Setup Complete",
"Run frpc now?",
"Run kanholec now?",
[System.Management.Automation.Host.ChoiceDescription[]]@(
@{Label="&Yes"; Help="Run frpc"},
@{Label="&Yes"; Help="Run kanholec"},
@{Label="&No"; Help="Close"}
),
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)
; Build: makensis frpc.nsi
; kanholec Windows Installer (NSIS)
; Build: makensis kanholec.nsi
; Requires: NSIS 3.x (https://nsis.sourceforge.io)
!define PRODUCT_NAME "frpc"
!define PRODUCT_NAME "kanholec"
!define PRODUCT_VERSION "0.62.0"
!define PRODUCT_PUBLISHER "frp Contributors"
!define PRODUCT_WEB_SITE "https://github.com/fatedier/frp"
!define PRODUCT_PUBLISHER "kanhole Contributors"
!define PRODUCT_WEB_SITE "https://github.com/kanhole/kanhole"
!define PRODUCT_DIR "$PROGRAMFILES64\${PRODUCT_NAME}"
!define PRODUCT_UNINSTALL_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "..\..\bin\frpc-${PRODUCT_VERSION}-setup.exe"
OutFile "..\..\bin\kanholec-${PRODUCT_VERSION}-setup.exe"
InstallDir "${PRODUCT_DIR}"
InstallDirRegKey HKLM "${PRODUCT_UNINSTALL_KEY}" "InstallLocation"
RequestExecutionLevel admin
@@ -53,7 +53,7 @@ Function setFinishPage
${NSD_CreateLabel} 0 0 100% 24 "Setup Complete"
Pop $0
${NSD_CreateCheckbox} 0 30 100% 12 "Run frpc now"
${NSD_CreateCheckbox} 0 30 100% 12 "Run kanholec now"
Pop $RunNowCheckbox
${NSD_Check} $RunNowCheckbox
@@ -68,24 +68,24 @@ Function .onGUIEnd
${NSD_GetState} $ShowReadmeCheckbox $ReadmeState
${If} $RunNowState == ${BST_CHECKED}
ExecShell "open" "$INSTDIR\frpc.exe"
ExecShell "open" "$INSTDIR\kanholec.exe"
${EndIf}
${If} $ReadmeState == ${BST_CHECKED}
ExecShell "open" "$PROGRAMDATA\frpc"
ExecShell "open" "$PROGRAMDATA\kanholec"
${EndIf}
FunctionEnd
Section "frpc (required)" SEC_FRPC
Section "kanholec (required)" SEC_KANHOLEC
SectionIn RO
SetOutPath "$INSTDIR"
File "..\..\bin\frpc-windows-amd64.exe"
Rename "$INSTDIR\frpc-windows-amd64.exe" "$INSTDIR\frpc.exe"
File "..\..\bin\kanholec-windows-amd64.exe"
Rename "$INSTDIR\kanholec-windows-amd64.exe" "$INSTDIR\kanholec.exe"
; Config directory
CreateDirectory "$PROGRAMDATA\frpc"
SetOutPath "$PROGRAMDATA\frpc"
File "/oname=frpc.toml" "..\..\packaging\windows\frpc.default.toml"
CreateDirectory "$PROGRAMDATA\kanholec"
SetOutPath "$PROGRAMDATA\kanholec"
File "/oname=kanholec.toml" "..\..\packaging\windows\kanholec.default.toml"
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}" "Publisher" "${PRODUCT_PUBLISHER}"
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"
WriteRegDWORD HKLM "${PRODUCT_UNINSTALL_KEY}" "NoModify" 1
WriteRegDWORD HKLM "${PRODUCT_UNINSTALL_KEY}" "NoRepair" 1
@@ -103,8 +103,8 @@ SectionEnd
Section "Start Menu Shortcuts" SEC_SHORTCUTS
CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\frpc.lnk" "$INSTDIR\frpc.exe" "" "$INSTDIR\frpc.exe" 0
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Config Directory.lnk" "$PROGRAMDATA\frpc"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\kanholec.lnk" "$INSTDIR\kanholec.exe" "" "$INSTDIR\kanholec.exe" 0
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Config Directory.lnk" "$PROGRAMDATA\kanholec"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall.lnk" "$INSTDIR\uninstall.exe"
SectionEnd
@@ -114,33 +114,33 @@ Section "Add to PATH" SEC_PATH
SectionEnd
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
; Descriptions
LangString DESC_SEC_FRPC ${LANG_ENGLISH} "frpc binary and default configuration."
LangString DESC_SEC_SHORTCUTS ${LANG_ENGLISH} "Start menu shortcuts for frpc."
LangString DESC_SEC_PATH ${LANG_ENGLISH} "Add frpc installation directory to system PATH."
LangString DESC_SEC_DESKTOP ${LANG_ENGLISH} "Create a desktop shortcut for frpc."
LangString DESC_SEC_KANHOLEC ${LANG_ENGLISH} "kanholec binary and default configuration."
LangString DESC_SEC_SHORTCUTS ${LANG_ENGLISH} "Start menu shortcuts for kanholec."
LangString DESC_SEC_PATH ${LANG_ENGLISH} "Add kanholec installation directory to system PATH."
LangString DESC_SEC_DESKTOP ${LANG_ENGLISH} "Create a desktop shortcut for kanholec."
!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_PATH} $(DESC_SEC_PATH)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_DESKTOP} $(DESC_SEC_DESKTOP)
!insertmacro MUI_FUNCTION_DESCRIPTION_END
Section "Uninstall"
Delete "$INSTDIR\frpc.exe"
Delete "$INSTDIR\kanholec.exe"
Delete "$INSTDIR\uninstall.exe"
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}\Uninstall.lnk"
RMDir "$SMPROGRAMS\${PRODUCT_NAME}"
Delete "$DESKTOP\frpc.lnk"
Delete "$DESKTOP\kanholec.lnk"
EnVar::DeleteValue "PATH" "$INSTDIR"
@@ -1,45 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://wixtoolset.org/schemas/v3/wxs">
<Product
Name="frpc"
Name="kanholec"
Id="*"
UpgradeCode="A1B2C3D4-E5F6-7890-ABCD-EF1234567890"
Language="1033"
Codepage="1252"
Version="0.62.0"
Manufacturer="frp Contributors">
Manufacturer="kanhole Contributors">
<Package
InstallerVersion="200"
Compressed="yes"
InstallScope="perMachine"
Description="frp Client"
Comments="frpc is the client component of frp - a fast reverse proxy." />
Description="kanhole Client"
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="ProgramFiles64Folder">
<Directory Id="INSTALLDIR" Name="frpc">
<Directory Id="INSTALLDIR" Name="kanholec">
<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>
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="frpc">
<Directory Id="ApplicationProgramsFolder" Name="kanholec">
<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="UninstallShortcut" Name="Uninstall frpc" Target="[System64Folder]msiexec.exe" Arguments="/x [ProductCode]" />
<Shortcut Id="FrpcShortcut" Name="kanholec" Target="[INSTALLDIR]kanholec.exe" WorkingDirectory="INSTALLDIR" Description="kanhole client" />
<Shortcut Id="UninstallShortcut" Name="Uninstall kanholec" Target="[System64Folder]msiexec.exe" Arguments="/x [ProductCode]" />
<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>
</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="StartMenuShortcuts" />
</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;}}
{\colortbl\red0\green0\blue0;\red255\green255\blue255;}
\viewkind4\uc1\pard\qc\b\fs28 frpc - frp Client\par
\b0\fs20 Version 0.62.0\par
\viewkind4\uc1\pard\qc\b\fs28 kanholec\par
\b0\fs20 Version 0.1.0\par
\pard\sa200\sl240\slmult1\fs20\par
\pard\sa200\sl240\slmult1\b\fs24 License Agreement\b0\fs20\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\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\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)
=====================================
Copyright (c) frp project contributors.
kanholec - kanhole Client (version 0.1.0)
============================================
Copyright (c) kanhole project contributors.
Licensed under the Apache License, Version 2.0.
TERMS AND CONDITIONS
+2 -2
View File
@@ -18,8 +18,8 @@ import (
"context"
"fmt"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/msg"
)
type Setter interface {
+3 -3
View File
@@ -29,9 +29,9 @@ import (
"golang.org/x/oauth2"
"golang.org/x/oauth2/clientcredentials"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/config/v1/validation"
"github.com/fatedier/frp/pkg/msg"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/config/v1/validation"
"kanhole/pkg/msg"
)
// 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/stretchr/testify/require"
"github.com/fatedier/frp/pkg/auth"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg"
"kanhole/pkg/auth"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/msg"
)
type mockTokenVerifier struct{}
+1 -1
View File
@@ -15,7 +15,7 @@
package auth
import (
"github.com/fatedier/frp/pkg/msg"
"kanhole/pkg/msg"
)
var AlwaysPassVerifier = &alwaysPass{}
+3 -3
View File
@@ -19,9 +19,9 @@ import (
"slices"
"time"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg"
"github.com/fatedier/frp/pkg/util/util"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/msg"
"kanhole/pkg/util/util"
)
type TokenAuthSetterVerifier struct {
+6 -6
View File
@@ -22,9 +22,9 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/fatedier/frp/pkg/config/types"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/config/v1/validation"
"kanhole/pkg/config/types"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/config/v1/validation"
)
// WordSepNormalizeFunc changes all flags that contain "_" separators
@@ -154,8 +154,8 @@ func RegisterClientCommonConfigFlags(cmd *cobra.Command, c *v1.ClientCommonConfi
}
if !options.sshMode {
cmd.PersistentFlags().StringVarP(&c.ServerAddr, "server_addr", "s", "127.0.0.1", "frp server's address")
cmd.PersistentFlags().IntVarP(&c.ServerPort, "server_port", "P", 7000, "frp server's port")
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, "kanhole server's port")
cmd.PersistentFlags().StringVarP(&c.Transport.Protocol, "protocol", "p", "tcp",
fmt.Sprintf("optional values are %v", validation.SupportedTransportProtocols))
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().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().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{}
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"
legacyauth "github.com/fatedier/frp/pkg/auth/legacy"
"github.com/fatedier/frp/pkg/util/util"
legacyauth "kanhole/pkg/auth/legacy"
"kanhole/pkg/util/util"
)
// ClientCommonConf is the configuration parsed from ini.
+2 -2
View File
@@ -19,8 +19,8 @@ import (
"github.com/samber/lo"
"github.com/fatedier/frp/pkg/config/types"
v1 "github.com/fatedier/frp/pkg/config/v1"
"kanhole/pkg/config/types"
v1 "kanhole/pkg/config/v1"
)
func Convert_ClientCommonConf_To_v1(conf *ClientCommonConf) *v1.ClientCommonConfig {
+1 -1
View File
@@ -20,7 +20,7 @@ import (
"gopkg.in/ini.v1"
"github.com/fatedier/frp/pkg/config/types"
"kanhole/pkg/config/types"
)
type ProxyType string
+2 -2
View File
@@ -19,7 +19,7 @@ import (
"gopkg.in/ini.v1"
legacyauth "github.com/fatedier/frp/pkg/auth/legacy"
legacyauth "kanhole/pkg/auth/legacy"
)
type HTTPPluginOptions struct {
@@ -131,7 +131,7 @@ type ServerCommonConf struct {
// SubDomainHost specifies the domain that will be attached to sub-domains
// 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
// value is "".
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) {
tmpl, errRet := template.New("frp").Parse(string(in))
tmpl, errRet := template.New("kanhole").Parse(string(in))
if errRet != nil {
err = errRet
return
+7 -7
View File
@@ -30,12 +30,12 @@ import (
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/yaml"
"github.com/fatedier/frp/pkg/config/legacy"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/config/v1/validation"
"github.com/fatedier/frp/pkg/msg"
"github.com/fatedier/frp/pkg/util/jsonx"
"github.com/fatedier/frp/pkg/util/util"
"kanhole/pkg/config/legacy"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/config/v1/validation"
"kanhole/pkg/msg"
"kanhole/pkg/util/jsonx"
"kanhole/pkg/util/util"
)
var glbEnvs map[string]string
@@ -82,7 +82,7 @@ func DetectLegacyINIFormatFromFile(path string) bool {
}
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,
"parseNumberRangePair": parseNumberRangePair,
}).Parse(string(in))
+1 -1
View File
@@ -22,7 +22,7 @@ import (
"github.com/stretchr/testify/require"
v1 "github.com/fatedier/frp/pkg/config/v1"
v1 "kanhole/pkg/config/v1"
)
const tomlServerContent = `
+1 -1
View File
@@ -22,7 +22,7 @@ import (
"slices"
"sync"
v1 "github.com/fatedier/frp/pkg/config/v1"
v1 "kanhole/pkg/config/v1"
)
type Aggregator struct {
+1 -1
View File
@@ -20,7 +20,7 @@ import (
"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
+1 -1
View File
@@ -17,7 +17,7 @@ package source
import (
"sync"
v1 "github.com/fatedier/frp/pkg/config/v1"
v1 "kanhole/pkg/config/v1"
)
// baseSource provides shared state and behavior for Source implementations.
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"github.com/stretchr/testify/require"
v1 "github.com/fatedier/frp/pkg/config/v1"
v1 "kanhole/pkg/config/v1"
)
func TestBaseSourceLoadReturnsClonedConfigurers(t *testing.T) {
+1 -1
View File
@@ -17,7 +17,7 @@ package source
import (
"fmt"
v1 "github.com/fatedier/frp/pkg/config/v1"
v1 "kanhole/pkg/config/v1"
)
func cloneConfigurers(
+1 -1
View File
@@ -14,7 +14,7 @@
package source
import v1 "github.com/fatedier/frp/pkg/config/v1"
import v1 "kanhole/pkg/config/v1"
// ConfigSource implements Source for in-memory configuration.
// All operations are thread-safe.
+1 -1
View File
@@ -19,7 +19,7 @@ import (
"github.com/stretchr/testify/require"
v1 "github.com/fatedier/frp/pkg/config/v1"
v1 "kanhole/pkg/config/v1"
)
func TestNewConfigSource(t *testing.T) {
+1 -1
View File
@@ -15,7 +15,7 @@
package source
import (
v1 "github.com/fatedier/frp/pkg/config/v1"
v1 "kanhole/pkg/config/v1"
)
// Source is the interface for configuration sources.
+2 -2
View File
@@ -20,8 +20,8 @@ import (
"os"
"path/filepath"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/util/jsonx"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/util/jsonx"
)
type StoreSourceConfig struct {
+2 -2
View File
@@ -22,8 +22,8 @@ import (
"github.com/stretchr/testify/require"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/util/jsonx"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/util/jsonx"
)
func TestStoreSource_AddProxyAndVisitor_DoesNotApplyRuntimeDefaults(t *testing.T) {
+1 -1
View File
@@ -17,7 +17,7 @@ package source
import (
"fmt"
v1 "github.com/fatedier/frp/pkg/config/v1"
v1 "kanhole/pkg/config/v1"
)
func validateProxyName(proxy v1.ProxyConfigurer) (string, error) {
+1 -1
View File
@@ -17,7 +17,7 @@ package config
import (
"fmt"
"github.com/fatedier/frp/pkg/util/util"
"kanhole/pkg/util/util"
)
type NumberPair struct {
+1 -1
View File
@@ -19,7 +19,7 @@ import (
"github.com/samber/lo"
"github.com/fatedier/frp/pkg/util/util"
"kanhole/pkg/util/util"
)
type ClientConfig struct {
+1 -1
View File
@@ -17,7 +17,7 @@ package v1
import (
"maps"
"github.com/fatedier/frp/pkg/util/util"
"kanhole/pkg/util/util"
)
type AuthScope string
+1 -1
View File
@@ -19,7 +19,7 @@ import (
"fmt"
"reflect"
"github.com/fatedier/frp/pkg/util/jsonx"
"kanhole/pkg/util/jsonx"
)
type DecodeOptions struct {
+4 -4
View File
@@ -19,10 +19,10 @@ import (
"reflect"
"slices"
"github.com/fatedier/frp/pkg/config/types"
"github.com/fatedier/frp/pkg/msg"
"github.com/fatedier/frp/pkg/util/jsonx"
"github.com/fatedier/frp/pkg/util/util"
"kanhole/pkg/config/types"
"kanhole/pkg/msg"
"kanhole/pkg/util/jsonx"
"kanhole/pkg/util/util"
)
type ProxyTransport struct {
+2 -2
View File
@@ -19,8 +19,8 @@ import (
"github.com/samber/lo"
"github.com/fatedier/frp/pkg/util/jsonx"
"github.com/fatedier/frp/pkg/util/util"
"kanhole/pkg/util/jsonx"
"kanhole/pkg/util/util"
)
const (
+3 -3
View File
@@ -17,8 +17,8 @@ package v1
import (
"github.com/samber/lo"
"github.com/fatedier/frp/pkg/config/types"
"github.com/fatedier/frp/pkg/util/util"
"kanhole/pkg/config/types"
"kanhole/pkg/util/util"
)
type ServerConfig struct {
@@ -60,7 +60,7 @@ type ServerConfig struct {
TCPMuxPassthrough bool `json:"tcpmuxPassthrough,omitempty"`
// SubDomainHost specifies the domain that will be attached to sub-domains
// 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".
SubDomainHost string `json:"subDomainHost,omitempty"`
// Custom404Page specifies a path to a custom 404 page to display. If this
+2 -2
View File
@@ -17,8 +17,8 @@ package validation
import (
"fmt"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/policy/security"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/policy/security"
)
func (v *ConfigValidator) validateAuthTokenSource(token string, tokenSource *v1.ValueSource) error {
+2 -2
View File
@@ -19,8 +19,8 @@ import (
"github.com/stretchr/testify/require"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/policy/security"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/policy/security"
)
const (
+3 -3
View File
@@ -22,9 +22,9 @@ import (
"github.com/samber/lo"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/policy/featuregate"
"github.com/fatedier/frp/pkg/policy/security"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/policy/featuregate"
"kanhole/pkg/policy/security"
)
func (v *ConfigValidator) ValidateClientCommonConfig(c *v1.ClientCommonConfig) (Warning, error) {
+1 -1
View File
@@ -18,7 +18,7 @@ import (
"fmt"
"slices"
v1 "github.com/fatedier/frp/pkg/config/v1"
v1 "kanhole/pkg/config/v1"
)
func validateWebServerConfig(c *v1.WebServerConfig) error {
+1 -1
View File
@@ -19,7 +19,7 @@ import (
"net/url"
"strings"
v1 "github.com/fatedier/frp/pkg/config/v1"
v1 "kanhole/pkg/config/v1"
)
func ValidateOIDCClientCredentialsConfig(c *v1.AuthOIDCClientConfig) error {
+1 -1
View File
@@ -21,7 +21,7 @@ import (
"github.com/stretchr/testify/require"
v1 "github.com/fatedier/frp/pkg/config/v1"
v1 "kanhole/pkg/config/v1"
)
func TestValidateOIDCClientCredentialsConfig(t *testing.T) {
+1 -1
View File
@@ -17,7 +17,7 @@ package validation
import (
"errors"
v1 "github.com/fatedier/frp/pkg/config/v1"
v1 "kanhole/pkg/config/v1"
)
func ValidateClientPluginOptions(c v1.ClientPluginOptions) error {
+1 -1
View File
@@ -22,7 +22,7 @@ import (
"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 {
+1 -1
View File
@@ -20,7 +20,7 @@ import (
"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) {
+2 -2
View File
@@ -17,8 +17,8 @@ package validation
import (
"errors"
v1 "github.com/fatedier/frp/pkg/config/v1"
splugin "github.com/fatedier/frp/pkg/plugin/server"
v1 "kanhole/pkg/config/v1"
splugin "kanhole/pkg/plugin/server"
)
var (
+1 -1
View File
@@ -3,7 +3,7 @@ package validation
import (
"fmt"
"github.com/fatedier/frp/pkg/policy/security"
"kanhole/pkg/policy/security"
)
// ConfigValidator holds the context dependencies for configuration validation.
+1 -1
View File
@@ -19,7 +19,7 @@ import (
"fmt"
"slices"
v1 "github.com/fatedier/frp/pkg/config/v1"
v1 "kanhole/pkg/config/v1"
)
func ValidateVisitorConfigurer(c v1.VisitorConfigurer) error {
+2 -2
View File
@@ -17,8 +17,8 @@ package v1
import (
"reflect"
"github.com/fatedier/frp/pkg/util/jsonx"
"github.com/fatedier/frp/pkg/util/util"
"kanhole/pkg/util/jsonx"
"kanhole/pkg/util/util"
)
type VisitorTransport struct {
+1 -1
View File
@@ -17,7 +17,7 @@ package v1
import (
"reflect"
"github.com/fatedier/frp/pkg/util/jsonx"
"kanhole/pkg/util/jsonx"
)
const (
+2 -2
View File
@@ -5,8 +5,8 @@ import (
"encoding/json"
"fmt"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/db/ent/serverconfig"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/db/ent/serverconfig"
)
const configKey = "server_config"
+1 -1
View File
@@ -12,7 +12,7 @@ import (
entsql "entgo.io/ent/dialect/sql"
"golang.org/x/crypto/bcrypt"
"github.com/fatedier/frp/pkg/db/ent"
"kanhole/pkg/db/ent"
)
var (
+5 -5
View File
@@ -9,15 +9,15 @@ import (
"log"
"reflect"
"github.com/fatedier/frp/pkg/db/ent/migrate"
"kanhole/pkg/db/ent/migrate"
"entgo.io/ent"
"entgo.io/ent/dialect"
"entgo.io/ent/dialect/sql"
"github.com/fatedier/frp/pkg/db/ent/frpcclient"
"github.com/fatedier/frp/pkg/db/ent/proxy"
"github.com/fatedier/frp/pkg/db/ent/serverconfig"
"github.com/fatedier/frp/pkg/db/ent/user"
"kanhole/pkg/db/ent/frpcclient"
"kanhole/pkg/db/ent/proxy"
"kanhole/pkg/db/ent/serverconfig"
"kanhole/pkg/db/ent/user"
)
// Client is the client that holds all ent builders.
+4 -4
View File
@@ -12,10 +12,10 @@ import (
"entgo.io/ent"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
"github.com/fatedier/frp/pkg/db/ent/frpcclient"
"github.com/fatedier/frp/pkg/db/ent/proxy"
"github.com/fatedier/frp/pkg/db/ent/serverconfig"
"github.com/fatedier/frp/pkg/db/ent/user"
"kanhole/pkg/db/ent/frpcclient"
"kanhole/pkg/db/ent/proxy"
"kanhole/pkg/db/ent/serverconfig"
"kanhole/pkg/db/ent/user"
)
// 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