diff --git a/CHANGES.md b/CHANGES.md index 16bf29ba..955b6d8c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,7 @@ +## 2023.3.2 +### Notices +- Due to the nature of QuickTunnels (https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/do-more-with-tunnels/trycloudflare/) and its intended usage for testing and experiment of Cloudflare Tunnels, starting from 2023.3.2, QuickTunnels only make a single connection to the edge. If users want to use Tunnels in a production enverionment, they should move to Named Tunnels instead. (https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/tunnel-guide/remote/#set-up-a-tunnel-remotely-dashboard-setup) + ## 2023.3.1 ### Breaking Change - Running a tunnel without ingress rules defined in configuration file nor from the CLI flags will no longer provide a default ingress rule to localhost:8080 and instead will return HTTP response code 503 for all incoming HTTP requests. diff --git a/cmd/cloudflared/tunnel/cmd.go b/cmd/cloudflared/tunnel/cmd.go index e9c372f5..8b2cf268 100644 --- a/cmd/cloudflared/tunnel/cmd.go +++ b/cmd/cloudflared/tunnel/cmd.go @@ -42,6 +42,9 @@ import ( const ( sentryDSN = "https://56a9c9fa5c364ab28f34b14f35ea0f1b:3e8827f6f9f740738eb11138f7bebb68@sentry.io/189878" + // ha-Connections specifies how many connections to make to the edge + haConnectionsFlag = "ha-connections" + // sshPortFlag is the port on localhost the cloudflared ssh server will run on sshPortFlag = "local-ssh-port" @@ -418,7 +421,7 @@ func StartServer( errC <- metrics.ServeMetrics(metricsListener, ctx, metricsConfig, log) }() - reconnectCh := make(chan supervisor.ReconnectSignal, c.Int("ha-connections")) + reconnectCh := make(chan supervisor.ReconnectSignal, c.Int(haConnectionsFlag)) if c.IsSet("stdin-control") { log.Info().Msg("Enabling control through stdin") go stdinControl(reconnectCh, log) @@ -655,7 +658,7 @@ func tunnelFlags(shouldHide bool) []cli.Flag { Hidden: shouldHide, }), altsrc.NewIntFlag(&cli.IntFlag{ - Name: "ha-connections", + Name: haConnectionsFlag, Value: 4, Hidden: true, }), diff --git a/cmd/cloudflared/tunnel/configuration.go b/cmd/cloudflared/tunnel/configuration.go index 7fa86273..8e58a12d 100644 --- a/cmd/cloudflared/tunnel/configuration.go +++ b/cmd/cloudflared/tunnel/configuration.go @@ -293,7 +293,7 @@ func prepareTunnelConfig( Region: c.String("region"), EdgeIPVersion: edgeIPVersion, EdgeBindAddr: edgeBindAddr, - HAConnections: c.Int("ha-connections"), + HAConnections: c.Int(haConnectionsFlag), IncidentLookup: supervisor.NewIncidentLookup(), IsAutoupdated: c.Bool("is-autoupdated"), LBPool: c.String("lb-pool"), diff --git a/cmd/cloudflared/tunnel/quick_tunnel.go b/cmd/cloudflared/tunnel/quick_tunnel.go index 51662b7a..da7d0a63 100644 --- a/cmd/cloudflared/tunnel/quick_tunnel.go +++ b/cmd/cloudflared/tunnel/quick_tunnel.go @@ -73,6 +73,9 @@ func RunQuickTunnel(sc *subcommandContext) error { sc.c.Set("protocol", "quic") } + // Override the number of connections used. Quick tunnels shouldn't be used for production usage, + // so, use a single connection instead. + sc.c.Set(haConnectionsFlag, "1") return StartServer( sc.c, buildInfo, diff --git a/component-tests/test_quicktunnels.py b/component-tests/test_quicktunnels.py index cb58cde4..17445a5b 100644 --- a/component-tests/test_quicktunnels.py +++ b/component-tests/test_quicktunnels.py @@ -8,7 +8,7 @@ class TestQuickTunnels: config = component_tests_config(cfd_mode=CfdModes.QUICK, run_proxy_dns=False) LOGGER.debug(config) with start_cloudflared(tmp_path, config, cfd_args=["--hello-world"], new_process=True): - wait_tunnel_ready(require_min_connections=4) + wait_tunnel_ready(require_min_connections=1) url = get_quicktunnel_url() send_requests(url, 3, True)