1
0
mirror of https://github.com/fumiama/terasu-cloudflared.git synced 2026-06-12 06:00:25 +08:00

TUN-3998: Allow to cleanup the connections of a tunnel limited to a single client

This commit is contained in:
Nuno Diegues
2021-03-19 23:26:51 +00:00
parent 9767ba1853
commit 4a7763e497
5 changed files with 52 additions and 7 deletions

View File

@@ -126,6 +126,12 @@ var (
Usage: "Inverts the sort order of the tunnel info.",
EnvVars: []string{"TUNNEL_INFO_INVERT_SORT"},
}
cleanupClientFlag = &cli.StringFlag{
Name: "connector-id",
Aliases: []string{"c"},
Usage: `Constraints the cleanup to stop the connections of a single Connector (by its ID). You can find the various Connectors (and their IDs) currently connected to your tunnel via 'cloudflared tunnel info <name>'.`,
EnvVars: []string{"TUNNEL_CLEANUP_CONNECTOR"},
}
)
func buildCreateCommand() *cli.Command {
@@ -600,6 +606,7 @@ func buildCleanupCommand() *cli.Command {
Usage: "Cleanup tunnel connections",
UsageText: "cloudflared tunnel [tunnel command options] cleanup [subcommand options] TUNNEL",
Description: "Delete connections for tunnels with the given UUIDs or names.",
Flags: []cli.Flag{cleanupClientFlag},
CustomHelpTemplate: commandHelpTemplate(),
}
}