rebrand: frp -> kanhole (kanhole server, kanholec client)
golangci-lint / lint (push) Failing after 1m5s
golangci-lint / lint (push) Failing after 1m5s
This commit is contained in:
+6
-6
@@ -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")
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -20,7 +20,7 @@ import (
|
||||
|
||||
"gopkg.in/ini.v1"
|
||||
|
||||
"github.com/fatedier/frp/pkg/config/types"
|
||||
"kanhole/pkg/config/types"
|
||||
)
|
||||
|
||||
type ProxyType string
|
||||
|
||||
@@ -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"`
|
||||
|
||||
@@ -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
@@ -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))
|
||||
|
||||
@@ -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 = `
|
||||
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
"slices"
|
||||
"sync"
|
||||
|
||||
v1 "github.com/fatedier/frp/pkg/config/v1"
|
||||
v1 "kanhole/pkg/config/v1"
|
||||
)
|
||||
|
||||
type Aggregator struct {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -17,7 +17,7 @@ package source
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
v1 "github.com/fatedier/frp/pkg/config/v1"
|
||||
v1 "kanhole/pkg/config/v1"
|
||||
)
|
||||
|
||||
func cloneConfigurers(
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -17,7 +17,7 @@ package config
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/fatedier/frp/pkg/util/util"
|
||||
"kanhole/pkg/util/util"
|
||||
)
|
||||
|
||||
type NumberPair struct {
|
||||
|
||||
@@ -19,7 +19,7 @@ import (
|
||||
|
||||
"github.com/samber/lo"
|
||||
|
||||
"github.com/fatedier/frp/pkg/util/util"
|
||||
"kanhole/pkg/util/util"
|
||||
)
|
||||
|
||||
type ClientConfig struct {
|
||||
|
||||
@@ -17,7 +17,7 @@ package v1
|
||||
import (
|
||||
"maps"
|
||||
|
||||
"github.com/fatedier/frp/pkg/util/util"
|
||||
"kanhole/pkg/util/util"
|
||||
)
|
||||
|
||||
type AuthScope string
|
||||
|
||||
@@ -19,7 +19,7 @@ import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
|
||||
"github.com/fatedier/frp/pkg/util/jsonx"
|
||||
"kanhole/pkg/util/jsonx"
|
||||
)
|
||||
|
||||
type DecodeOptions struct {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -17,7 +17,7 @@ package v1
|
||||
import (
|
||||
"reflect"
|
||||
|
||||
"github.com/fatedier/frp/pkg/util/jsonx"
|
||||
"kanhole/pkg/util/jsonx"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
Reference in New Issue
Block a user