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
+15 -15
View File
@@ -15,12 +15,12 @@ import (
"github.com/gorilla/mux"
"golang.org/x/crypto/bcrypt"
"github.com/fatedier/frp/pkg/db"
"github.com/fatedier/frp/pkg/db/ent"
"github.com/fatedier/frp/pkg/db/ent/frpcclient"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/db/ent/proxy"
"github.com/fatedier/frp/pkg/db/ent/user"
"kanhole/pkg/db"
"kanhole/pkg/db/ent"
"kanhole/pkg/db/ent/frpcclient"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/db/ent/proxy"
"kanhole/pkg/db/ent/user"
)
type sessionInfo struct {
@@ -536,7 +536,7 @@ serverPort = %d
auth.token = %q
`, serverAddr, serverPort, authToken)
oneLiner := fmt.Sprintf(`curl -sL https://github.com/fatedier/frp/releases/latest/download/frp_linux_amd64.tar.gz | tar xz && cat > frpc.toml << 'EOF'
oneLiner := fmt.Sprintf(`curl -sL https://kanhole/releases/latest/download/frp_linux_amd64.tar.gz | tar xz && cat > frpc.toml << 'EOF'
%s
EOF
./frp_*/frpc -c frpc.toml`, frpcConfig)
@@ -578,8 +578,8 @@ func (h *Handler) handleClientConfigDownload(w http.ResponseWriter, r *http.Requ
proxies, _ := db.Client().Proxy.Query().Where(proxy.ClientIDEQ(c.ID)).All(ctx)
content := fmt.Sprintf(`# frpc config for %s
# Auto-generated by frp admin dashboard
content := fmt.Sprintf(`# kanholec config for %s
# Auto-generated by kanhole admin dashboard
serverAddr = %q
serverPort = %d
@@ -624,11 +624,11 @@ func (h *Handler) handleClientProvisionScript(w http.ResponseWriter, r *http.Req
serverHost := r.Host
script := fmt.Sprintf(`#!/bin/bash
# frp auto-provisioning for: %s
# kanhole auto-provisioning for: %s
set -e
CONFIG_URL="http://%s/admin/api/frpc/proxy-config/%s"
echo "==> Downloading frpc with server-config support..."
curl -sL https://github.com/fatedier/frp/releases/latest/download/frp_linux_amd64.tar.gz | tar xz
curl -sL https://kanhole/releases/latest/download/frp_linux_amd64.tar.gz | tar xz
FRPC_DIR=$(ls -d frp_* 2>/dev/null | head -1)
echo "==> Starting frpc for %s..."
"$FRPC_DIR/frpc" --server-config "$CONFIG_URL"
@@ -790,8 +790,8 @@ func (h *Handler) writeClientConfig(w http.ResponseWriter, ctx context.Context,
proxies, _ := db.Client().Proxy.Query().Where(proxy.ClientIDEQ(c.ID)).All(ctx)
content := fmt.Sprintf(`# frpc config for %s
# Auto-generated by frp admin server
content := fmt.Sprintf(`# kanholec config for %s
# Auto-generated by kanhole admin server
serverAddr = %q
serverPort = %d
@@ -839,8 +839,8 @@ func (h *Handler) handleFrpcProxyConfig(w http.ResponseWriter, r *http.Request)
proxies, _ := db.Client().Proxy.Query().Where(proxy.ClientIDEQ(client.ID)).All(ctx)
content := fmt.Sprintf(`# frpc config for %s
# Auto-generated by frp admin server
content := fmt.Sprintf(`# kanholec config for %s
# Auto-generated by kanhole admin server
serverAddr = %q
serverPort = %d
+1 -1
View File
@@ -15,7 +15,7 @@
<div style="border:1px solid var(--border);padding:20px;margin-bottom:16px">
<h2 style="font-size:12px;font-weight:600;letter-spacing:.3px;color:var(--fg2);margin-bottom:12px;text-transform:uppercase">One-Liner Setup</h2>
<p style="font-size:12px;color:var(--fg2);margin-bottom:8px">Run this on your client machine. It downloads frpc and auto-updates from this server:</p>
<pre class="text-mono" style="padding:12px;background:var(--bg2);border:1px solid var(--border);overflow-x:auto;white-space:pre-wrap;word-break:break-all;font-size:12px">curl -sL https://github.com/fatedier/frp/releases/latest/download/frp_linux_amd64.tar.gz | tar xz \
<pre class="text-mono" style="padding:12px;background:var(--bg2);border:1px solid var(--border);overflow-x:auto;white-space:pre-wrap;word-break:break-all;font-size:12px">curl -sL https://github.com/kanhole/kanhole/releases/latest/download/frp_linux_amd64.tar.gz | tar xz \
&& ./frp_*/frpc --server-config http://{{.ServerAddr}}:{{.ServerPort}}/admin/api/frpc/proxy-config/{{.Client.Key}}</pre>
</div>
+3 -3
View File
@@ -5,9 +5,9 @@ import (
"github.com/prometheus/client_golang/prometheus/promhttp"
httppkg "github.com/fatedier/frp/pkg/util/http"
netpkg "github.com/fatedier/frp/pkg/util/net"
adminapi "github.com/fatedier/frp/server/http"
httppkg "kanhole/pkg/util/http"
netpkg "kanhole/pkg/util/net"
adminapi "kanhole/server/http"
)
func (svr *Service) registerRouteHandlers(helper *httppkg.RouterRegisterHelper) {
+14 -14
View File
@@ -24,20 +24,20 @@ import (
"github.com/samber/lo"
"github.com/fatedier/frp/pkg/auth"
"github.com/fatedier/frp/pkg/config"
v1 "github.com/fatedier/frp/pkg/config/v1"
pkgerr "github.com/fatedier/frp/pkg/errors"
"github.com/fatedier/frp/pkg/msg"
plugin "github.com/fatedier/frp/pkg/plugin/server"
"github.com/fatedier/frp/pkg/transport"
"github.com/fatedier/frp/pkg/util/util"
"github.com/fatedier/frp/pkg/util/wait"
"github.com/fatedier/frp/pkg/util/xlog"
"github.com/fatedier/frp/server/controller"
"github.com/fatedier/frp/server/metrics"
"github.com/fatedier/frp/server/proxy"
"github.com/fatedier/frp/server/registry"
"kanhole/pkg/auth"
"kanhole/pkg/config"
v1 "kanhole/pkg/config/v1"
pkgerr "kanhole/pkg/errors"
"kanhole/pkg/msg"
plugin "kanhole/pkg/plugin/server"
"kanhole/pkg/transport"
"kanhole/pkg/util/util"
"kanhole/pkg/util/wait"
"kanhole/pkg/util/xlog"
"kanhole/server/controller"
"kanhole/server/metrics"
"kanhole/server/proxy"
"kanhole/server/registry"
)
type ControlManager struct {
+7 -7
View File
@@ -15,13 +15,13 @@
package controller
import (
"github.com/fatedier/frp/pkg/nathole"
plugin "github.com/fatedier/frp/pkg/plugin/server"
"github.com/fatedier/frp/pkg/util/tcpmux"
"github.com/fatedier/frp/pkg/util/vhost"
"github.com/fatedier/frp/server/group"
"github.com/fatedier/frp/server/ports"
"github.com/fatedier/frp/server/visitor"
"kanhole/pkg/nathole"
plugin "kanhole/pkg/plugin/server"
"kanhole/pkg/util/tcpmux"
"kanhole/pkg/util/vhost"
"kanhole/server/group"
"kanhole/server/ports"
"kanhole/server/visitor"
)
// All resource managers and controllers
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"sync"
"sync/atomic"
"github.com/fatedier/frp/pkg/util/vhost"
"kanhole/pkg/util/vhost"
)
// HTTPGroupController manages HTTP groups that use round-robin
+1 -1
View File
@@ -18,7 +18,7 @@ import (
"context"
"net"
"github.com/fatedier/frp/pkg/util/vhost"
"kanhole/pkg/util/vhost"
)
type HTTPSGroupController struct {
+1 -1
View File
@@ -18,7 +18,7 @@ import (
"net"
"strconv"
"github.com/fatedier/frp/server/ports"
"kanhole/server/ports"
)
// TCPGroupCtl manages all TCPGroups.
+3 -3
View File
@@ -19,9 +19,9 @@ import (
"fmt"
"net"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/util/tcpmux"
"github.com/fatedier/frp/pkg/util/vhost"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/util/tcpmux"
"kanhole/pkg/util/vhost"
)
// TCPMuxGroupCtl manages all TCPMuxGroups.
+9 -9
View File
@@ -22,15 +22,15 @@ import (
"strings"
"time"
"github.com/fatedier/frp/pkg/config/types"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/metrics/mem"
httppkg "github.com/fatedier/frp/pkg/util/http"
"github.com/fatedier/frp/pkg/util/log"
"github.com/fatedier/frp/pkg/util/version"
"github.com/fatedier/frp/server/http/model"
"github.com/fatedier/frp/server/proxy"
"github.com/fatedier/frp/server/registry"
"kanhole/pkg/config/types"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/metrics/mem"
httppkg "kanhole/pkg/util/http"
"kanhole/pkg/util/log"
"kanhole/pkg/util/version"
"kanhole/server/http/model"
"kanhole/server/proxy"
"kanhole/server/registry"
)
type Controller struct {
+3 -3
View File
@@ -19,9 +19,9 @@ import (
"testing"
"time"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/proto/wire"
"github.com/fatedier/frp/server/registry"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/proto/wire"
"kanhole/server/registry"
)
func TestGetConfFromConfigurerKeepsPluginFields(t *testing.T) {
+1 -1
View File
@@ -15,7 +15,7 @@
package model
import (
v1 "github.com/fatedier/frp/pkg/config/v1"
v1 "kanhole/pkg/config/v1"
)
type ServerInfoResp struct {
+1 -1
View File
@@ -9,7 +9,7 @@ import (
"k8s.io/utils/clock"
"github.com/fatedier/frp/pkg/config/types"
"kanhole/pkg/config/types"
)
const (
+1 -1
View File
@@ -8,7 +8,7 @@ import (
"github.com/stretchr/testify/require"
clocktesting "k8s.io/utils/clock/testing"
"github.com/fatedier/frp/pkg/config/types"
"kanhole/pkg/config/types"
)
func TestManagerUsesClockForPortTimestamps(t *testing.T) {
+6 -6
View File
@@ -22,12 +22,12 @@ import (
libio "github.com/fatedier/golib/io"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/util/limit"
netpkg "github.com/fatedier/frp/pkg/util/net"
"github.com/fatedier/frp/pkg/util/util"
"github.com/fatedier/frp/pkg/util/vhost"
"github.com/fatedier/frp/server/metrics"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/util/limit"
netpkg "kanhole/pkg/util/net"
"kanhole/pkg/util/util"
"kanhole/pkg/util/vhost"
"kanhole/server/metrics"
)
func init() {
+3 -3
View File
@@ -19,9 +19,9 @@ import (
"reflect"
"strings"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/util/util"
"github.com/fatedier/frp/pkg/util/vhost"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/util/util"
"kanhole/pkg/util/vhost"
)
func init() {
+9 -9
View File
@@ -27,15 +27,15 @@ import (
libio "github.com/fatedier/golib/io"
"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/server"
"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/server/controller"
"github.com/fatedier/frp/server/metrics"
"kanhole/pkg/config/types"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/msg"
plugin "kanhole/pkg/plugin/server"
"kanhole/pkg/util/limit"
netpkg "kanhole/pkg/util/net"
"kanhole/pkg/util/xlog"
"kanhole/server/controller"
"kanhole/server/metrics"
)
var proxyFactoryRegistry = map[reflect.Type]func(*BaseProxy) Proxy{}
+3 -3
View File
@@ -21,9 +21,9 @@ import (
"github.com/stretchr/testify/require"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg"
"github.com/fatedier/frp/pkg/proto/wire"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/msg"
"kanhole/pkg/proto/wire"
)
func TestWorkConnStartWritesStartWorkConn(t *testing.T) {
+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() {
+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() {
+1 -1
View File
@@ -20,7 +20,7 @@ import (
"reflect"
"strconv"
v1 "github.com/fatedier/frp/pkg/config/v1"
v1 "kanhole/pkg/config/v1"
)
func init() {
+3 -3
View File
@@ -20,9 +20,9 @@ import (
"reflect"
"strings"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/util/util"
"github.com/fatedier/frp/pkg/util/vhost"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/util/util"
"kanhole/pkg/util/vhost"
)
func init() {
+6 -6
View File
@@ -26,12 +26,12 @@ import (
"github.com/fatedier/golib/errors"
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/proto/udp"
"github.com/fatedier/frp/pkg/util/limit"
netpkg "github.com/fatedier/frp/pkg/util/net"
"github.com/fatedier/frp/server/metrics"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/msg"
"kanhole/pkg/proto/udp"
"kanhole/pkg/util/limit"
netpkg "kanhole/pkg/util/net"
"kanhole/server/metrics"
)
func init() {
+2 -2
View File
@@ -20,8 +20,8 @@ import (
"reflect"
"sync"
v1 "github.com/fatedier/frp/pkg/config/v1"
"github.com/fatedier/frp/pkg/msg"
v1 "kanhole/pkg/config/v1"
"kanhole/pkg/msg"
)
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 TestWriteNatHoleSidUsesWireV2MessageFrame(t *testing.T) {
+1 -1
View File
@@ -20,7 +20,7 @@ import (
clocktesting "k8s.io/utils/clock/testing"
"github.com/fatedier/frp/pkg/proto/wire"
"kanhole/pkg/proto/wire"
)
func TestClientRegistryRegisterStoresWireProtocol(t *testing.T) {
+25 -25
View File
@@ -32,31 +32,31 @@ import (
quic "github.com/quic-go/quic-go"
"github.com/samber/lo"
"github.com/fatedier/frp/pkg/auth"
v1 "github.com/fatedier/frp/pkg/config/v1"
modelmetrics "github.com/fatedier/frp/pkg/metrics"
"github.com/fatedier/frp/pkg/msg"
"github.com/fatedier/frp/pkg/nathole"
plugin "github.com/fatedier/frp/pkg/plugin/server"
"github.com/fatedier/frp/pkg/proto/wire"
"github.com/fatedier/frp/pkg/ssh"
"github.com/fatedier/frp/pkg/transport"
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/tcpmux"
"github.com/fatedier/frp/pkg/util/util"
"github.com/fatedier/frp/pkg/util/version"
"github.com/fatedier/frp/pkg/util/vhost"
"github.com/fatedier/frp/pkg/util/xlog"
"github.com/fatedier/frp/server/admin"
"github.com/fatedier/frp/server/controller"
"github.com/fatedier/frp/server/group"
"github.com/fatedier/frp/server/metrics"
"github.com/fatedier/frp/server/ports"
"github.com/fatedier/frp/server/proxy"
"github.com/fatedier/frp/server/registry"
"github.com/fatedier/frp/server/visitor"
"kanhole/pkg/auth"
v1 "kanhole/pkg/config/v1"
modelmetrics "kanhole/pkg/metrics"
"kanhole/pkg/msg"
"kanhole/pkg/nathole"
plugin "kanhole/pkg/plugin/server"
"kanhole/pkg/proto/wire"
"kanhole/pkg/ssh"
"kanhole/pkg/transport"
httppkg "kanhole/pkg/util/http"
"kanhole/pkg/util/log"
netpkg "kanhole/pkg/util/net"
"kanhole/pkg/util/tcpmux"
"kanhole/pkg/util/util"
"kanhole/pkg/util/version"
"kanhole/pkg/util/vhost"
"kanhole/pkg/util/xlog"
"kanhole/server/admin"
"kanhole/server/controller"
"kanhole/server/group"
"kanhole/server/metrics"
"kanhole/server/ports"
"kanhole/server/proxy"
"kanhole/server/registry"
"kanhole/server/visitor"
)
const (
+2 -2
View File
@@ -23,8 +23,8 @@ import (
libio "github.com/fatedier/golib/io"
netpkg "github.com/fatedier/frp/pkg/util/net"
"github.com/fatedier/frp/pkg/util/util"
netpkg "kanhole/pkg/util/net"
"kanhole/pkg/util/util"
)
type listenerBundle struct {