MCPcopy
hub / github.com/cloudflare/cloudflared / configureCloudflaredFlags

Function configureCloudflaredFlags

cmd/cloudflared/tunnel/cmd.go:903–958  ·  view source on GitHub ↗

Flags in tunnel command that is relevant to run subcommand

(shouldHide bool)

Source from the content-addressed store, hash-verified

901
902// Flags in tunnel command that is relevant to run subcommand
903func configureCloudflaredFlags(shouldHide bool) []cli.Flag {
904 return []cli.Flag{
905 &cli.StringFlag{
906 Name: "config",
907 Usage: "Specifies a config file in YAML format.",
908 Value: config.FindDefaultConfigPath(),
909 Hidden: shouldHide,
910 },
911 altsrc.NewStringFlag(&cli.StringFlag{
912 Name: cfdflags.OriginCert,
913 Usage: "Path to the certificate generated for your origin when you run cloudflared login.",
914 EnvVars: []string{"TUNNEL_ORIGIN_CERT"},
915 Value: credentials.FindDefaultOriginCertPath(),
916 Hidden: shouldHide,
917 }),
918 altsrc.NewDurationFlag(&cli.DurationFlag{
919 Name: cfdflags.AutoUpdateFreq,
920 Usage: fmt.Sprintf("Autoupdate frequency. Default is %v.", updater.DefaultCheckUpdateFreq),
921 Value: updater.DefaultCheckUpdateFreq,
922 Hidden: shouldHide,
923 }),
924 altsrc.NewBoolFlag(&cli.BoolFlag{
925 Name: cfdflags.NoAutoUpdate,
926 Usage: "Disable periodic check for updates, restarting the server with the new version.",
927 EnvVars: []string{"NO_AUTOUPDATE"},
928 Value: false,
929 Hidden: shouldHide,
930 }),
931 altsrc.NewBoolFlag(&cli.BoolFlag{
932 Name: cfdflags.NoPrechecks,
933 Usage: "Skip connectivity pre-checks at startup.",
934 EnvVars: []string{"TUNNEL_NO_PRECHECKS"},
935 Value: false,
936 Hidden: shouldHide,
937 }),
938 altsrc.NewStringFlag(&cli.StringFlag{
939 Name: cfdflags.Metrics,
940 Value: metrics.GetMetricsDefaultAddress(metrics.Runtime),
941 Usage: fmt.Sprintf(
942 `Listen address for metrics reporting. If no address is passed cloudflared will try to bind to %v.
943If all are unavailable, a random port will be used. Note that when running cloudflared from an virtual
944environment the default address binds to all interfaces, hence, it is important to isolate the host
945and virtualized host network stacks from each other`,
946 metrics.GetMetricsKnownAddresses(metrics.Runtime),
947 ),
948 EnvVars: []string{"TUNNEL_METRICS"},
949 Hidden: shouldHide,
950 }),
951 altsrc.NewStringFlag(&cli.StringFlag{
952 Name: "pidfile",
953 Usage: "Write the application's PID to this file after first successful connection.",
954 EnvVars: []string{"TUNNEL_PIDFILE"},
955 Hidden: shouldHide,
956 }),
957 }
958}
959
960func configureProxyFlags(shouldHide bool) []cli.Flag {

Callers 2

tunnelFlagsFunction · 0.85
commandHelpTemplateFunction · 0.85

Calls 4

FindDefaultConfigPathFunction · 0.92
GetMetricsDefaultAddressFunction · 0.92
GetMetricsKnownAddressesFunction · 0.92

Tested by

no test coverage detected