Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 'service install' on Mac OS #1335

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions cmd/cloudflared/common_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ func getServiceExtraArgsFromCliArgs(c *cli.Context, log *zerolog.Logger) ([]stri
// currently, we only support extra args for token
return buildArgsForToken(c, log)
} else {
// empty extra args
return make([]string, 0), nil
return []string{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of limiting this to only be able to run with tunnel parameters, could we improve this to allow any tunnel sub-commands to be passed in?
For example, if someone wanted to run cloudflared access tcp as a service, we should allow them to also setup using this command similar to the following:

cloudflared service install -- access tcp --hostname test.example.com --url localhost:8080

We would still like to allow a user to provide just their tunnel token, so we can still leave and try and parse that first to insert the tunnel run --token <TOKEN> command, but if that fails, we should just provide whatever the user provides as a subcommand to cloudflared.

I think that solves the problem you are trying to solve here while also expanding the functionality to be expressive for other folks that might try something similar. What do you think?

"tunnel", "run",
}, nil
}
}