mirror of
https://github.com/fatedier/frp.git
synced 2025-06-05 15:18:22 +00:00
Compare commits
6 Commits
078ee4dbab
...
3aeaeccfa5
Author | SHA1 | Date | |
---|---|---|---|
|
3aeaeccfa5 | ||
|
7418ae098d | ||
|
7999791708 | ||
|
f7efbfeec5 | ||
|
1e8806d26b | ||
|
d01f4a3ec1 |
10
.github/workflows/stale.yml
vendored
10
.github/workflows/stale.yml
vendored
@ -18,17 +18,17 @@ jobs:
|
|||||||
pull-requests: write # for actions/stale to close stale PRs
|
pull-requests: write # for actions/stale to close stale PRs
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/stale@v8
|
- uses: actions/stale@v9
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
stale-issue-message: 'Issues go stale after 21d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.'
|
||||||
stale-issue-message: 'Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.'
|
stale-pr-message: "PRs go stale after 21d of inactivity. Stale PRs rot after an additional 7d of inactivity and eventually close."
|
||||||
stale-pr-message: "PRs go stale after 30d of inactivity. Stale PRs rot after an additional 7d of inactivity and eventually close."
|
|
||||||
stale-issue-label: 'lifecycle/stale'
|
stale-issue-label: 'lifecycle/stale'
|
||||||
exempt-issue-labels: 'bug,doc,enhancement,future,proposal,question,testing,todo,easy,help wanted,assigned'
|
exempt-issue-labels: 'bug,doc,enhancement,future,proposal,question,testing,todo,easy,help wanted,assigned'
|
||||||
stale-pr-label: 'lifecycle/stale'
|
stale-pr-label: 'lifecycle/stale'
|
||||||
exempt-pr-labels: 'bug,doc,enhancement,future,proposal,question,testing,todo,easy,help wanted,assigned'
|
exempt-pr-labels: 'bug,doc,enhancement,future,proposal,question,testing,todo,easy,help wanted,assigned'
|
||||||
days-before-stale: 30
|
days-before-stale: 21
|
||||||
days-before-close: 7
|
days-before-close: 7
|
||||||
debug-only: ${{ github.event.inputs.debug-only }}
|
debug-only: ${{ github.event.inputs.debug-only }}
|
||||||
exempt-all-pr-milestones: true
|
exempt-all-pr-milestones: true
|
||||||
exempt-all-pr-assignees: true
|
exempt-all-pr-assignees: true
|
||||||
|
operations-per-run: 200
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
### Fixes
|
### Deprecation Notices
|
||||||
|
|
||||||
* frpc has a certain chance to panic when login: close of closed channel.
|
* Using an underscore in a flag name is deprecated and has been replaced by a hyphen. The underscore format will remain compatible for some time, until it is completely removed in a future version. For example, `--remote_port` is replaced with `--remote-port`.
|
||||||
|
@ -97,6 +97,7 @@ func runMultipleClients(cfgDir string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Execute() {
|
func Execute() {
|
||||||
|
rootCmd.SetGlobalNormalizationFunc(config.WordSepNormalizeFunc)
|
||||||
if err := rootCmd.Execute(); err != nil {
|
if err := rootCmd.Execute(); err != nil {
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
@ -92,6 +92,7 @@ var rootCmd = &cobra.Command{
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Execute() {
|
func Execute() {
|
||||||
|
rootCmd.SetGlobalNormalizationFunc(config.WordSepNormalizeFunc)
|
||||||
if err := rootCmd.Execute(); err != nil {
|
if err := rootCmd.Execute(); err != nil {
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ transport.maxPoolCount = 5
|
|||||||
# transport.tcpKeepalive = 7200
|
# transport.tcpKeepalive = 7200
|
||||||
|
|
||||||
# transport.tls.force specifies whether to only accept TLS-encrypted connections. By default, the value is false.
|
# transport.tls.force specifies whether to only accept TLS-encrypted connections. By default, the value is false.
|
||||||
tls.force = false
|
transport.tls.force = false
|
||||||
|
|
||||||
# transport.tls.certFile = "server.crt"
|
# transport.tls.certFile = "server.crt"
|
||||||
# transport.tls.keyFile = "server.key"
|
# transport.tls.keyFile = "server.key"
|
||||||
@ -129,7 +129,7 @@ allowPorts = [
|
|||||||
maxPortsPerClient = 0
|
maxPortsPerClient = 0
|
||||||
|
|
||||||
# If subDomainHost is not empty, you can set subdomain when type is http or https in frpc's configure file
|
# If subDomainHost is not empty, you can set subdomain when type is http or https in frpc's configure file
|
||||||
# When subdomain is est, the host used by routing is test.frps.com
|
# When subdomain is test, the host used by routing is test.frps.com
|
||||||
subDomainHost = "frps.com"
|
subDomainHost = "frps.com"
|
||||||
|
|
||||||
# custom 404 page for HTTP requests
|
# custom 404 page for HTTP requests
|
||||||
|
@ -17,14 +17,24 @@ package config
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
"github.com/spf13/pflag"
|
||||||
|
|
||||||
"github.com/fatedier/frp/pkg/config/types"
|
"github.com/fatedier/frp/pkg/config/types"
|
||||||
v1 "github.com/fatedier/frp/pkg/config/v1"
|
v1 "github.com/fatedier/frp/pkg/config/v1"
|
||||||
"github.com/fatedier/frp/pkg/config/v1/validation"
|
"github.com/fatedier/frp/pkg/config/v1/validation"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// WordSepNormalizeFunc changes all flags that contain "_" separators
|
||||||
|
func WordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName {
|
||||||
|
if strings.Contains(name, "_") {
|
||||||
|
return pflag.NormalizedName(strings.ReplaceAll(name, "_", "-"))
|
||||||
|
}
|
||||||
|
return pflag.NormalizedName(name)
|
||||||
|
}
|
||||||
|
|
||||||
type RegisterFlagOption func(*registerFlagOptions)
|
type RegisterFlagOption func(*registerFlagOptions)
|
||||||
|
|
||||||
type registerFlagOptions struct {
|
type registerFlagOptions struct {
|
||||||
|
@ -254,6 +254,8 @@ func (s *TunnelServer) parseClientAndProxyConfigurer(_ *tcpipForward, extraPaylo
|
|||||||
Short: "ssh v0@{address} [command]",
|
Short: "ssh v0@{address} [command]",
|
||||||
Run: func(*cobra.Command, []string) {},
|
Run: func(*cobra.Command, []string) {},
|
||||||
}
|
}
|
||||||
|
cmd.SetGlobalNormalizationFunc(config.WordSepNormalizeFunc)
|
||||||
|
|
||||||
args := strings.Split(extraPayload, " ")
|
args := strings.Split(extraPayload, " ")
|
||||||
if len(args) < 1 {
|
if len(args) < 1 {
|
||||||
return nil, nil, helpMessage, fmt.Errorf("invalid extra payload")
|
return nil, nil, helpMessage, fmt.Errorf("invalid extra payload")
|
||||||
|
@ -90,12 +90,12 @@ var _ = ginkgo.Describe("[Feature: Cmd]", func() {
|
|||||||
ginkgo.It("HTTP", func() {
|
ginkgo.It("HTTP", func() {
|
||||||
serverPort := f.AllocPort()
|
serverPort := f.AllocPort()
|
||||||
vhostHTTPPort := f.AllocPort()
|
vhostHTTPPort := f.AllocPort()
|
||||||
_, _, err := f.RunFrps("-t", "123", "-p", strconv.Itoa(serverPort), "--vhost_http_port", strconv.Itoa(vhostHTTPPort))
|
_, _, err := f.RunFrps("-t", "123", "-p", strconv.Itoa(serverPort), "--vhost-http-port", strconv.Itoa(vhostHTTPPort))
|
||||||
framework.ExpectNoError(err)
|
framework.ExpectNoError(err)
|
||||||
|
|
||||||
_, _, err = f.RunFrpc("http", "-s", "127.0.0.1", "-P", strconv.Itoa(serverPort), "-t", "123", "-u", "test",
|
_, _, err = f.RunFrpc("http", "-s", "127.0.0.1", "-P", strconv.Itoa(serverPort), "-t", "123", "-u", "test",
|
||||||
"-n", "udp_test", "-l", strconv.Itoa(f.PortByName(framework.HTTPSimpleServerPort)),
|
"-n", "udp_test", "-l", strconv.Itoa(f.PortByName(framework.HTTPSimpleServerPort)),
|
||||||
"--custom_domain", "test.example.com")
|
"--custom-domain", "test.example.com")
|
||||||
framework.ExpectNoError(err)
|
framework.ExpectNoError(err)
|
||||||
|
|
||||||
framework.NewRequestExpect(f).Port(vhostHTTPPort).
|
framework.NewRequestExpect(f).Port(vhostHTTPPort).
|
||||||
|
@ -32,7 +32,7 @@ var _ = ginkgo.Describe("[Feature: SSH Tunnel]", func() {
|
|||||||
tc := ssh.NewTunnelClient(
|
tc := ssh.NewTunnelClient(
|
||||||
fmt.Sprintf("127.0.0.1:%d", localPort),
|
fmt.Sprintf("127.0.0.1:%d", localPort),
|
||||||
fmt.Sprintf("127.0.0.1:%d", sshPort),
|
fmt.Sprintf("127.0.0.1:%d", sshPort),
|
||||||
fmt.Sprintf("tcp --remote_port %d", remotePort),
|
fmt.Sprintf("tcp --remote-port %d", remotePort),
|
||||||
)
|
)
|
||||||
framework.ExpectNoError(tc.Start())
|
framework.ExpectNoError(tc.Start())
|
||||||
defer tc.Close()
|
defer tc.Close()
|
||||||
@ -55,7 +55,7 @@ var _ = ginkgo.Describe("[Feature: SSH Tunnel]", func() {
|
|||||||
tc := ssh.NewTunnelClient(
|
tc := ssh.NewTunnelClient(
|
||||||
fmt.Sprintf("127.0.0.1:%d", localPort),
|
fmt.Sprintf("127.0.0.1:%d", localPort),
|
||||||
fmt.Sprintf("127.0.0.1:%d", sshPort),
|
fmt.Sprintf("127.0.0.1:%d", sshPort),
|
||||||
"http --custom_domain test.example.com",
|
"http --custom-domain test.example.com",
|
||||||
)
|
)
|
||||||
framework.ExpectNoError(tc.Start())
|
framework.ExpectNoError(tc.Start())
|
||||||
defer tc.Close()
|
defer tc.Close()
|
||||||
@ -83,7 +83,7 @@ var _ = ginkgo.Describe("[Feature: SSH Tunnel]", func() {
|
|||||||
tc := ssh.NewTunnelClient(
|
tc := ssh.NewTunnelClient(
|
||||||
fmt.Sprintf("127.0.0.1:%d", localPort),
|
fmt.Sprintf("127.0.0.1:%d", localPort),
|
||||||
fmt.Sprintf("127.0.0.1:%d", sshPort),
|
fmt.Sprintf("127.0.0.1:%d", sshPort),
|
||||||
fmt.Sprintf("https --custom_domain %s", testDomain),
|
fmt.Sprintf("https --custom-domain %s", testDomain),
|
||||||
)
|
)
|
||||||
framework.ExpectNoError(tc.Start())
|
framework.ExpectNoError(tc.Start())
|
||||||
defer tc.Close()
|
defer tc.Close()
|
||||||
@ -125,7 +125,7 @@ var _ = ginkgo.Describe("[Feature: SSH Tunnel]", func() {
|
|||||||
tc := ssh.NewTunnelClient(
|
tc := ssh.NewTunnelClient(
|
||||||
fmt.Sprintf("127.0.0.1:%d", localPort),
|
fmt.Sprintf("127.0.0.1:%d", localPort),
|
||||||
fmt.Sprintf("127.0.0.1:%d", sshPort),
|
fmt.Sprintf("127.0.0.1:%d", sshPort),
|
||||||
fmt.Sprintf("tcpmux --mux=httpconnect --custom_domain %s", testDomain),
|
fmt.Sprintf("tcpmux --mux=httpconnect --custom-domain %s", testDomain),
|
||||||
)
|
)
|
||||||
framework.ExpectNoError(tc.Start())
|
framework.ExpectNoError(tc.Start())
|
||||||
defer tc.Close()
|
defer tc.Close()
|
||||||
@ -179,7 +179,7 @@ var _ = ginkgo.Describe("[Feature: SSH Tunnel]", func() {
|
|||||||
tc := ssh.NewTunnelClient(
|
tc := ssh.NewTunnelClient(
|
||||||
fmt.Sprintf("127.0.0.1:%d", localPort),
|
fmt.Sprintf("127.0.0.1:%d", localPort),
|
||||||
fmt.Sprintf("127.0.0.1:%d", sshPort),
|
fmt.Sprintf("127.0.0.1:%d", sshPort),
|
||||||
"stcp -n stcp-test --sk=abcdefg --allow_users=\"*\"",
|
"stcp -n stcp-test --sk=abcdefg --allow-users=\"*\"",
|
||||||
)
|
)
|
||||||
framework.ExpectNoError(tc.Start())
|
framework.ExpectNoError(tc.Start())
|
||||||
defer tc.Close()
|
defer tc.Close()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user