From 470a85e65d514c39d2ed893b57d06a3cc24fb547 Mon Sep 17 00:00:00 2001 From: Sudarsan Reddy Date: Mon, 27 Sep 2021 14:12:11 +0100 Subject: [PATCH 01/85] TUN-5160: Set request.ContentLength when this value is in request header --- connection/quic.go | 14 ++++++ connection/quic_test.go | 102 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 116 insertions(+) diff --git a/connection/quic.go b/connection/quic.go index c4f7e0ae..fa5136d9 100644 --- a/connection/quic.go +++ b/connection/quic.go @@ -180,6 +180,20 @@ func buildHTTPRequest(connectRequest *quicpogs.ConnectRequest, body io.Reader) ( req.Header.Add(httpHeaderKey[1], metadata.Val) } } + // Go's http.Client automatically sends chunked request body if this value is not set on the + // *http.Request struct regardless of header: + // https://go.googlesource.com/go/+/go1.8rc2/src/net/http/transfer.go#154. + if err := setContentLength(req); err != nil { + return nil, fmt.Errorf("Error setting content-length: %w", err) + } stripWebsocketUpgradeHeader(req) return req, err } + +func setContentLength(req *http.Request) error { + var err error + if contentLengthStr := req.Header.Get("Content-Length"); contentLengthStr != "" { + req.ContentLength, err = strconv.ParseInt(contentLengthStr, 10, 64) + } + return err +} diff --git a/connection/quic_test.go b/connection/quic_test.go index 332eb987..60040cb2 100644 --- a/connection/quic_test.go +++ b/connection/quic_test.go @@ -13,6 +13,7 @@ import ( "math/big" "net" "net/http" + "net/url" "os" "sync" "testing" @@ -292,6 +293,107 @@ func (moc *mockOriginProxyWithRequest) ProxyHTTP(w ResponseWriter, r *http.Reque return nil } +func TestBuildHTTPRequest(t *testing.T) { + var tests = []struct { + name string + connectRequest *quicpogs.ConnectRequest + req *http.Request + }{ + { + name: "check if http.Request is built correctly with content length", + connectRequest: &quicpogs.ConnectRequest{ + Dest: "http://test.com", + Metadata: []quicpogs.Metadata{ + quicpogs.Metadata{ + Key: "HttpHeader:Cf-Cloudflared-Proxy-Connection-Upgrade", + Val: "Websocket", + }, + quicpogs.Metadata{ + Key: "HttpHeader:Content-Length", + Val: "514", + }, + quicpogs.Metadata{ + Key: "HttpHeader:Another-Header", + Val: "Misc", + }, + quicpogs.Metadata{ + Key: "HttpHost", + Val: "cf.host", + }, + quicpogs.Metadata{ + Key: "HttpMethod", + Val: "get", + }, + }, + }, + req: &http.Request{ + Method: "get", + URL: &url.URL{ + Scheme: "http", + Host: "test.com", + }, + Proto: "HTTP/1.1", + ProtoMajor: 1, + ProtoMinor: 1, + Header: http.Header{ + "Another-Header": []string{"Misc"}, + "Content-Length": []string{"514"}, + }, + ContentLength: 514, + Host: "cf.host", + }, + }, + { + name: "if content length isn't part of request headers, then it's not set", + connectRequest: &quicpogs.ConnectRequest{ + Dest: "http://test.com", + Metadata: []quicpogs.Metadata{ + quicpogs.Metadata{ + Key: "HttpHeader:Cf-Cloudflared-Proxy-Connection-Upgrade", + Val: "Websocket", + }, + quicpogs.Metadata{ + Key: "HttpHeader:Another-Header", + Val: "Misc", + }, + quicpogs.Metadata{ + Key: "HttpHost", + Val: "cf.host", + }, + quicpogs.Metadata{ + Key: "HttpMethod", + Val: "get", + }, + }, + }, + req: &http.Request{ + Method: "get", + URL: &url.URL{ + Scheme: "http", + Host: "test.com", + }, + Proto: "HTTP/1.1", + ProtoMajor: 1, + ProtoMinor: 1, + Header: http.Header{ + "Another-Header": []string{"Misc"}, + }, + ContentLength: 0, + Host: "cf.host", + }, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + req, err := buildHTTPRequest(test.connectRequest, nil) + assert.NoError(t, err) + test.req = test.req.WithContext(req.Context()) + assert.Equal(t, test.req, req) + }) + } +} + func (moc *mockOriginProxyWithRequest) ProxyTCP(ctx context.Context, rwa ReadWriteAcker, tcpRequest *TCPRequest) error { rwa.AckConnection() io.Copy(rwa, rwa) From 5a5e49179a46704695a5ca1307e3bc0995d1f168 Mon Sep 17 00:00:00 2001 From: Sudarsan Reddy Date: Tue, 28 Sep 2021 13:03:04 +0100 Subject: [PATCH 02/85] Release 2021.9.2 --- RELEASE_NOTES | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/RELEASE_NOTES b/RELEASE_NOTES index 397ce952..4863f68d 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -1,3 +1,11 @@ +2021.9.2 +- 2021-09-21 TUN-5129: Use go 1.17 and copy .git folder to docker build to compute version +- 2021-09-21 TUN-5128: Enforce maximum grace period +- 2021-09-22 TUN-5141: Make sure websocket pinger returns before streaming returns +- 2021-09-24 TUN-5142: Add asynchronous servecontrolstream for QUIC +- 2021-09-24 TUN-5142: defer close rpcconn inside unregister instead of ServeControlStream +- 2021-09-27 TUN-5160: Set request.ContentLength when this value is in request header + 2021.9.1 - 2021-09-21 TUN-5118: Quic connection now detects duplicate connections similar to http2 - 2021-09-15 Fix TryCloudflare link From 79ebfa8304fd51b18d09b5220db2cbff7eb0583e Mon Sep 17 00:00:00 2001 From: Sudarsan Reddy Date: Tue, 28 Sep 2021 15:46:01 +0100 Subject: [PATCH 03/85] TUN-5169: Release 2021.9.2 CHANGES.md --- CHANGES.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 20ab8b55..7a2942fb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,18 @@ **Experimental**: This is a new format for release notes. The format and availability is subject to change. +## 2021.9.2 + +### New features +- `cloudflared` can now run with `quic` as the underlying tunnel transport protocol. To try it, change or add "protocol: quic" to your config.yml file or +run cloudflared with the `--protocol quic` flag. e.g: + `cloudflared tunnel --protocol quic run ` + +### Bug Fixes +- Fixed some generic transport bugs in `quic` mode. It's advised to upgrade to at least this version (2021.9.2) when running `cloudflared` +with `quic` protocol. +- `cloudflared` docker images will now show version. + + ## 2021.8.4 ### Improvements - Temporary tunnels (those hosted on trycloudflare.com that do not require a Cloudflare login) now run as Named Tunnels From cbdf88ea285886bf32104fbdb367a81bffa25b72 Mon Sep 17 00:00:00 2001 From: Nuno Diegues Date: Tue, 28 Sep 2021 08:39:40 +0100 Subject: [PATCH 04/85] TUN-5164: Update README and clean up references to Argo Tunnel (using Cloudflare Tunnel instead) --- .teamcity/update-homebrew.sh | 6 ++-- Makefile | 2 +- README.md | 35 +++++++++++++++----- cmd/cloudflared/cliutil/deprecated.go | 2 +- cmd/cloudflared/linux_service.go | 18 +++++----- cmd/cloudflared/macos_service.go | 22 ++++++------ cmd/cloudflared/main.go | 4 +-- cmd/cloudflared/tunnel/cmd.go | 8 ++--- cmd/cloudflared/tunnel/subcommand_context.go | 2 +- cmd/cloudflared/updater/update.go | 2 +- cmd/cloudflared/windows_service.go | 18 +++++----- hello/hello.go | 10 +++--- jet.yaml | 2 +- validation/validation.go | 2 +- validation/validation_test.go | 2 +- 15 files changed, 77 insertions(+), 58 deletions(-) diff --git a/.teamcity/update-homebrew.sh b/.teamcity/update-homebrew.sh index 250e00e3..6450f0ef 100755 --- a/.teamcity/update-homebrew.sh +++ b/.teamcity/update-homebrew.sh @@ -46,8 +46,8 @@ git reset --hard origin/master URL="https://packages.argotunnel.com/dl/cloudflared-$VERSION-darwin-amd64.tgz" tee cloudflared.rb < $(PACKAGE_DIR)/cloudflared.1 fakeroot fpm -C $(PACKAGE_DIR) -s dir -t $(1) \ - --description 'Cloudflare Argo tunnel daemon' \ + --description 'Cloudflare Tunnel daemon' \ --vendor 'Cloudflare' \ --license 'Cloudflare Service Agreement' \ --url 'https://github.com/cloudflare/cloudflared' \ diff --git a/README.md b/README.md index 17b45e93..134e7cc9 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,28 @@ -# Argo Tunnel client +# Cloudflare Tunnel client + +Contains the command-line client for Cloudflare Tunnel, a tunneling daemon that proxies traffic from the Cloudflare network to your origins. +This daemon sits between Cloudflare network and your origin (e.g. a webserver). Cloudflare attracts client requests and sends them to you +via this daemon, without requiring you to poke holes on your firewall --- your origin can remain as closed as possible. +Extensive documentation can be found in the [Cloudflare Tunnel section](https://developers.cloudflare.com/cloudflare-one/connections/connect-apps) of the Cloudflare Docs. +All usages related with proxying to your origins are available under `cloudflared tunnel help`. + +You can also use `cloudflared` to access Tunnel origins (that are protected with `cloudflared tunnel`) for TCP traffic +at Layer 4 (i.e., not HTTP/websocket), which is relevant for use cases such as SSH, RDP, etc. +Such usages are available under `cloudflared access help`. + +You can instead use [WARP client](https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/configuration/private-networks) +to access private origins behind Tunnels for Layer 4 traffic without requiring `cloudflared access` commands on the client side. -Contains the command-line client for Argo Tunnel, a tunneling daemon that proxies any local webserver through the Cloudflare network. Extensive documentation can be found in the [Argo Tunnel section](https://developers.cloudflare.com/cloudflare-one/connections/connect-apps) of the Cloudflare Docs. ## Before you get started -Before you use Argo Tunnel, you'll need to complete a few steps in the Cloudflare dashboard. The website you add to Cloudflare will be used to route traffic to your Tunnel. - +Before you use Cloudflare Tunnel, you'll need to complete a few steps in the Cloudflare dashboard: you need to add a +website to your Cloudflare account. Note that today it is possible to use Tunnel without a website (e.g. for private +routing), but for legacy reasons this requirement is still necessary: 1. [Add a website to Cloudflare](https://support.cloudflare.com/hc/en-us/articles/201720164-Creating-a-Cloudflare-account-and-adding-a-website) 2. [Change your domain nameservers to Cloudflare](https://support.cloudflare.com/hc/en-us/articles/205195708) + ## Installing `cloudflared` Downloads are available as standalone binaries, a Docker image, and Debian, RPM, and Homebrew packages. You can also find releases here on the `cloudflared` GitHub repository. @@ -18,18 +32,23 @@ Downloads are available as standalone binaries, a Docker image, and Debian, RPM, * A Docker image of `cloudflared` is [available on DockerHub](https://hub.docker.com/r/cloudflare/cloudflared) * You can install on Windows machines with the [steps here](https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/installation#windows) -User documentation for Argo Tunnel can be found at https://developers.cloudflare.com/cloudflare-one/connections/connect-apps +User documentation for Cloudflare Tunnel can be found at https://developers.cloudflare.com/cloudflare-one/connections/connect-apps + ## Creating Tunnels and routing traffic -Once installed, you can authenticate `cloudflared` into your Cloudflare account and begin creating Tunnels that serve traffic for hostnames in your account. +Once installed, you can authenticate `cloudflared` into your Cloudflare account and begin creating Tunnels to serve traffic to your origins. * Create a Tunnel with [these instructions](https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/create-tunnel) -* Route traffic to that Tunnel with [DNS records in Cloudflare](https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/routing-to-tunnel/dns) or with a [Cloudflare Load Balancer](https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/routing-to-tunnel/lb) +* Route traffic to that Tunnel: + * Via public [DNS records in Cloudflare](https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/routing-to-tunnel/dns) + * Or via a public hostname guided by a [Cloudflare Load Balancer](https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/routing-to-tunnel/lb) + * Or from [WARP client private traffic](https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/configuration/private-networks) + ## TryCloudflare -Want to test Argo Tunnel before adding a website to Cloudflare? You can do so with TryCloudflare using the documentation [available here](https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/run-tunnel/trycloudflare). +Want to test Cloudflare Tunnel before adding a website to Cloudflare? You can do so with TryCloudflare using the documentation [available here](https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/run-tunnel/trycloudflare). ## Deprecated versions diff --git a/cmd/cloudflared/cliutil/deprecated.go b/cmd/cloudflared/cliutil/deprecated.go index c151378e..c49d47c8 100644 --- a/cmd/cloudflared/cliutil/deprecated.go +++ b/cmd/cloudflared/cliutil/deprecated.go @@ -11,7 +11,7 @@ func RemovedCommand(name string) *cli.Command { Name: name, Action: func(context *cli.Context) error { return cli.Exit( - fmt.Sprintf("%s command is no longer supported by cloudflared. Consult Argo Tunnel documentation for possible alternative solutions.", name), + fmt.Sprintf("%s command is no longer supported by cloudflared. Consult Cloudflare Tunnel documentation for possible alternative solutions.", name), -1, ) }, diff --git a/cmd/cloudflared/linux_service.go b/cmd/cloudflared/linux_service.go index d70c42ba..32314092 100644 --- a/cmd/cloudflared/linux_service.go +++ b/cmd/cloudflared/linux_service.go @@ -19,11 +19,11 @@ import ( func runApp(app *cli.App, graceShutdownC chan struct{}) { app.Commands = append(app.Commands, &cli.Command{ Name: "service", - Usage: "Manages the Argo Tunnel system service", + Usage: "Manages the Cloudflare Tunnel system service", Subcommands: []*cli.Command{ { Name: "install", - Usage: "Install Argo Tunnel as a system service", + Usage: "Install Cloudflare Tunnel as a system service", Action: cliutil.ConfiguredAction(installLinuxService), Flags: []cli.Flag{ &cli.BoolFlag{ @@ -34,7 +34,7 @@ func runApp(app *cli.App, graceShutdownC chan struct{}) { }, { Name: "uninstall", - Usage: "Uninstall the Argo Tunnel service", + Usage: "Uninstall the Cloudflare Tunnel service", Action: cliutil.ConfiguredAction(uninstallLinuxService), }, }, @@ -55,7 +55,7 @@ var systemdTemplates = []ServiceTemplate{ { Path: "/etc/systemd/system/cloudflared.service", Content: `[Unit] -Description=Argo Tunnel +Description=Cloudflare Tunnel After=network.target [Service] @@ -72,7 +72,7 @@ WantedBy=multi-user.target { Path: "/etc/systemd/system/cloudflared-update.service", Content: `[Unit] -Description=Update Argo Tunnel +Description=Update Cloudflare Tunnel After=network.target [Service] @@ -82,7 +82,7 @@ ExecStart=/bin/bash -c '{{ .Path }} update; code=$?; if [ $code -eq 11 ]; then s { Path: "/etc/systemd/system/cloudflared-update.timer", Content: `[Unit] -Description=Update Argo Tunnel +Description=Update Cloudflare Tunnel [Timer] OnCalendar=daily @@ -99,7 +99,7 @@ var sysvTemplate = ServiceTemplate{ Content: `#!/bin/sh # For RedHat and cousins: # chkconfig: 2345 99 01 -# description: Argo Tunnel agent +# description: Cloudflare Tunnel agent # processname: {{.Path}} ### BEGIN INIT INFO # Provides: {{.Path}} @@ -107,8 +107,8 @@ var sysvTemplate = ServiceTemplate{ # Required-Stop: # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 -# Short-Description: Argo Tunnel -# Description: Argo Tunnel agent +# Short-Description: Cloudflare Tunnel +# Description: Cloudflare Tunnel agent ### END INIT INFO name=$(basename $(readlink -f $0)) cmd="{{.Path}} --config /etc/cloudflared/config.yml --pidfile /var/run/$name.pid --autoupdate-freq 24h0m0s{{ range .ExtraArgs }} {{ . }}{{ end }}" diff --git a/cmd/cloudflared/macos_service.go b/cmd/cloudflared/macos_service.go index f28396c6..31bfb3bd 100644 --- a/cmd/cloudflared/macos_service.go +++ b/cmd/cloudflared/macos_service.go @@ -20,16 +20,16 @@ const ( func runApp(app *cli.App, graceShutdownC chan struct{}) { app.Commands = append(app.Commands, &cli.Command{ Name: "service", - Usage: "Manages the Argo Tunnel launch agent", + Usage: "Manages the Cloudflare Tunnel launch agent", Subcommands: []*cli.Command{ { Name: "install", - Usage: "Install Argo Tunnel as an user launch agent", + Usage: "Install Cloudflare Tunnel as an user launch agent", Action: cliutil.ConfiguredAction(installLaunchd), }, { Name: "uninstall", - Usage: "Uninstall the Argo Tunnel launch agent", + Usage: "Uninstall the Cloudflare Tunnel launch agent", Action: cliutil.ConfiguredAction(uninstallLaunchd), }, }, @@ -110,13 +110,13 @@ func installLaunchd(c *cli.Context) error { log := logger.CreateLoggerFromContext(c, logger.EnableTerminalLog) if isRootUser() { - log.Info().Msg("Installing Argo Tunnel client as a system launch daemon. " + - "Argo Tunnel client will run at boot") + log.Info().Msg("Installing Cloudflare Tunnel client as a system launch daemon. " + + "Cloudflare Tunnel client will run at boot") } else { - log.Info().Msg("Installing Argo Tunnel client as an user launch agent. " + - "Note that Argo Tunnel client will only run when the user is logged in. " + - "If you want to run Argo Tunnel client at boot, install with root permission. " + - "For more information, visit https://developers.cloudflare.com/argo-tunnel/reference/service/") + log.Info().Msg("Installing Cloudflare Tunnel client as an user launch agent. " + + "Note that Cloudflare Tunnel client will only run when the user is logged in. " + + "If you want to run Cloudflare Tunnel client at boot, install with root permission. " + + "For more information, visit https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/run-tunnel/run-as-service") } etPath, err := os.Executable() if err != nil { @@ -159,9 +159,9 @@ func uninstallLaunchd(c *cli.Context) error { log := logger.CreateLoggerFromContext(c, logger.EnableTerminalLog) if isRootUser() { - log.Info().Msg("Uninstalling Argo Tunnel as a system launch daemon") + log.Info().Msg("Uninstalling Cloudflare Tunnel as a system launch daemon") } else { - log.Info().Msg("Uninstalling Argo Tunnel as an user launch agent") + log.Info().Msg("Uninstalling Cloudflare Tunnel as an user launch agent") } installPath, err := installPath() if err != nil { diff --git a/cmd/cloudflared/main.go b/cmd/cloudflared/main.go index d5b26955..8ebf90af 100644 --- a/cmd/cloudflared/main.go +++ b/cmd/cloudflared/main.go @@ -67,7 +67,7 @@ func main() { app.Copyright = fmt.Sprintf( `(c) %d Cloudflare Inc. Your installation of cloudflared software constitutes a symbol of your signature indicating that you accept - the terms of the Cloudflare License (https://developers.cloudflare.com/argo-tunnel/license/), + the terms of the Cloudflare License (https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/license), Terms (https://www.cloudflare.com/terms/) and Privacy Policy (https://www.cloudflare.com/privacypolicy/).`, time.Now().Year(), ) @@ -76,7 +76,7 @@ func main() { You can use it to authenticate a session to reach an API behind Access, route web traffic to this machine, and configure access control. - See https://developers.cloudflare.com/argo-tunnel/ for more in-depth documentation.` + See https://developers.cloudflare.com/cloudflare-one/connections/connect-apps for more in-depth documentation.` app.Flags = flags() app.Action = action(graceShutdownC) app.Commands = commands(cli.ShowVersion) diff --git a/cmd/cloudflared/tunnel/cmd.go b/cmd/cloudflared/tunnel/cmd.go index 5afd801f..f5e13ac0 100644 --- a/cmd/cloudflared/tunnel/cmd.go +++ b/cmd/cloudflared/tunnel/cmd.go @@ -126,14 +126,14 @@ func buildTunnelCommand(subcommands []*cli.Command) *cli.Command { Name: "tunnel", Action: cliutil.ConfiguredAction(TunnelCommand), Category: "Tunnel", - Usage: "Make a locally-running web service accessible over the internet using Argo Tunnel.", + Usage: "Make a locally-running web service accessible over the internet using Cloudflare Tunnel.", ArgsUsage: " ", - Description: `Argo Tunnel asks you to specify a hostname on a Cloudflare-powered + Description: `Cloudflare Tunnel asks you to specify a hostname on a Cloudflare-powered domain you control and a local address. Traffic from that hostname is routed (optionally via a Cloudflare Load Balancer) to this machine and appears on the specified port where it can be served. - This feature requires your Cloudflare account be subscribed to the Argo Smart Routing feature. + This feature requires your Cloudflare account be subscribed to the Cloudflare Smart Routing feature. To use, begin by calling login to download a certificate: @@ -488,7 +488,7 @@ func tunnelFlags(shouldHide bool) []cli.Flag { credentialsFileFlag, altsrc.NewBoolFlag(&cli.BoolFlag{ Name: "is-autoupdated", - Usage: "Signal the new process that Argo Tunnel connector has been autoupdated", + Usage: "Signal the new process that Cloudflare Tunnel connector has been autoupdated", Value: false, Hidden: true, }), diff --git a/cmd/cloudflared/tunnel/subcommand_context.go b/cmd/cloudflared/tunnel/subcommand_context.go index 4450cf3c..35ae3285 100644 --- a/cmd/cloudflared/tunnel/subcommand_context.go +++ b/cmd/cloudflared/tunnel/subcommand_context.go @@ -151,7 +151,7 @@ func (sc *subcommandContext) readTunnelCredentials(credFinder CredFinder) (conne func (sc *subcommandContext) create(name string, credentialsFilePath string) (*tunnelstore.Tunnel, error) { client, err := sc.client() if err != nil { - return nil, errors.Wrap(err, "couldn't create client to talk to Argo Tunnel backend") + return nil, errors.Wrap(err, "couldn't create client to talk to Cloudflare Tunnel backend") } tunnelSecret, err := generateTunnelSecret() diff --git a/cmd/cloudflared/updater/update.go b/cmd/cloudflared/updater/update.go index b93d84e5..c385cf04 100644 --- a/cmd/cloudflared/updater/update.go +++ b/cmd/cloudflared/updater/update.go @@ -19,7 +19,7 @@ import ( const ( DefaultCheckUpdateFreq = time.Hour * 24 - noUpdateInShellMessage = "cloudflared will not automatically update when run from the shell. To enable auto-updates, run cloudflared as a service: https://developers.cloudflare.com/argo-tunnel/reference/service/" + noUpdateInShellMessage = "cloudflared will not automatically update when run from the shell. To enable auto-updates, run cloudflared as a service: https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/run-tunnel/run-as-service" noUpdateOnWindowsMessage = "cloudflared will not automatically update on Windows systems." noUpdateManagedPackageMessage = "cloudflared will not automatically update if installed by a package manager." isManagedInstallFile = ".installedFromPackageManager" diff --git a/cmd/cloudflared/windows_service.go b/cmd/cloudflared/windows_service.go index cc0b0a3c..87602c42 100644 --- a/cmd/cloudflared/windows_service.go +++ b/cmd/cloudflared/windows_service.go @@ -25,8 +25,8 @@ import ( const ( windowsServiceName = "Cloudflared" - windowsServiceDescription = "Argo Tunnel agent" - windowsServiceUrl = "https://developers.cloudflare.com/argo-tunnel/reference/service/" + windowsServiceDescription = "Cloudflare Tunnel agent" + windowsServiceUrl = "https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/run-tunnel/run-as-service#windows" recoverActionDelay = time.Second * 20 failureCountResetPeriod = time.Hour * 24 @@ -45,16 +45,16 @@ const ( func runApp(app *cli.App, graceShutdownC chan struct{}) { app.Commands = append(app.Commands, &cli.Command{ Name: "service", - Usage: "Manages the Argo Tunnel Windows service", + Usage: "Manages the Cloudflare Tunnel Windows service", Subcommands: []*cli.Command{ { Name: "install", - Usage: "Install Argo Tunnel as a Windows service", + Usage: "Install Cloudflare Tunnel as a Windows service", Action: cliutil.ConfiguredAction(installWindowsService), }, { Name: "uninstall", - Usage: "Uninstall the Argo Tunnel service", + Usage: "Uninstall the Cloudflare Tunnel service", Action: cliutil.ConfiguredAction(uninstallWindowsService), }, }, @@ -176,7 +176,7 @@ func (s *windowsService) Execute(serviceArgs []string, r <-chan svc.ChangeReques func installWindowsService(c *cli.Context) error { zeroLogger := logger.CreateLoggerFromContext(c, logger.EnableTerminalLog) - zeroLogger.Info().Msg("Installing Argo Tunnel Windows service") + zeroLogger.Info().Msg("Installing Cloudflare Tunnel Windows service") exepath, err := os.Executable() if err != nil { return errors.Wrap(err, "Cannot find path name that start the process") @@ -198,7 +198,7 @@ func installWindowsService(c *cli.Context) error { return errors.Wrap(err, "Cannot install service") } defer s.Close() - log.Info().Msg("Argo Tunnel agent service is installed") + log.Info().Msg("Cloudflare Tunnel agent service is installed") err = eventlog.InstallAsEventCreate(windowsServiceName, eventlog.Error|eventlog.Warning|eventlog.Info) if err != nil { s.Delete() @@ -217,7 +217,7 @@ func uninstallWindowsService(c *cli.Context) error { With(). Str(LogFieldWindowsServiceName, windowsServiceName).Logger() - log.Info().Msg("Uninstalling Argo Tunnel Windows Service") + log.Info().Msg("Uninstalling Cloudflare Tunnel Windows Service") m, err := mgr.Connect() if err != nil { return errors.Wrap(err, "Cannot establish a connection to the service control manager") @@ -232,7 +232,7 @@ func uninstallWindowsService(c *cli.Context) error { if err != nil { return errors.Wrap(err, "Cannot delete service") } - log.Info().Msg("Argo Tunnel agent service is uninstalled") + log.Info().Msg("Cloudflare Tunnel agent service is uninstalled") err = eventlog.Remove(windowsServiceName) if err != nil { return errors.Wrap(err, "Cannot remove event logger") diff --git a/hello/hello.go b/hello/hello.go index 419040fa..785b341a 100644 --- a/hello/hello.go +++ b/hello/hello.go @@ -37,7 +37,7 @@ type OriginUpTime struct { UpTime string `json:"uptime"` } -const defaultServerName = "the Argo Tunnel test server" +const defaultServerName = "the Cloudflare Tunnel test server" const indexTemplate = ` @@ -45,10 +45,10 @@ const indexTemplate = ` - Argo Tunnel Connection + Cloudflare Tunnel Connection - +