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

TUN-3715: Only read config file once, right before invoking the command

This commit is contained in:
Igor Postelnik
2021-02-04 19:44:03 -06:00
parent 2c746b3361
commit 8c5498fad1
18 changed files with 125 additions and 114 deletions

View File

@@ -25,7 +25,7 @@ Cloudflare WARP client. You can also build rules to determine who can reach cert
Subcommands: []*cli.Command{
{
Name: "add",
Action: cliutil.ErrorHandler(addRouteCommand),
Action: cliutil.Action(addRouteCommand),
Usage: "Add any new network to the routing table reachable via the tunnel",
UsageText: "cloudflared tunnel [--config FILEPATH] route ip add [CIDR] [TUNNEL] [COMMENT?]",
Description: `Adds any network route space (represented as a CIDR) to your routing table.
@@ -38,23 +38,23 @@ reachable from the tunnel.`,
{
Name: "show",
Aliases: []string{"list"},
Action: cliutil.ErrorHandler(showRoutesCommand),
Action: cliutil.Action(showRoutesCommand),
Usage: "Show the routing table",
UsageText: "cloudflared tunnel [--config FILEPATH] route ip show [flags]",
Description: `Shows your organization private routing table. You can use flags to filter the results.`,
Flags: showRoutesFlags(),
},
{
Name: "delete",
Action: cliutil.ErrorHandler(deleteRouteCommand),
Usage: "Delete a row from your organization's private routing table",
UsageText: "cloudflared tunnel [--config FILEPATH] route ip delete [CIDR]",
Name: "delete",
Action: cliutil.Action(deleteRouteCommand),
Usage: "Delete a row from your organization's private routing table",
UsageText: "cloudflared tunnel [--config FILEPATH] route ip delete [CIDR]",
Description: `Deletes the row for a given CIDR from your routing table. That portion
of your network will no longer be reachable by the WARP clients.`,
},
{
Name: "get",
Action: cliutil.ErrorHandler(getRouteByIPCommand),
Action: cliutil.Action(getRouteByIPCommand),
Usage: "Check which row of the routing table matches a given IP.",
UsageText: "cloudflared tunnel [--config FILEPATH] route ip get [IP]",
Description: `Checks which row of the routing table will be used to proxy a given IP.