From cbdf88ea285886bf32104fbdb367a81bffa25b72 Mon Sep 17 00:00:00 2001 From: Nuno Diegues Date: Tue, 28 Sep 2021 08:39:40 +0100 Subject: [PATCH] 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 - +