tunnel

package
v2.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cli.Command{
	Name:  "tunnel",
	Usage: "Manage Cloudflare tunnels",
	Flags: []cli.Flag{
		&cli.BoolFlag{
			Name:  dryRunFlag,
			Value: false,
			Usage: "Simulate actions without making any changes",
		},
		&cli.StringFlag{
			Name:  configPathFlag,
			Value: "moley.yml",
			Usage: "Path to the tunnel configuration file",
		},
	},
	Commands: []*cli.Command{
		runCmd,
		stopCmd,
		{
			Name:  "init",
			Usage: "Initialize a new tunnel configuration file",
			Action: func(ctx context.Context, cmd *cli.Command) error {

				mgr, err := config.NewTunnelManager("moley.yml")
				if err != nil {
					return shared.WrapError(err, "initialize tunnel config failed")
				}

				example, err := config.ExampleTunnelConfig()
				if err != nil {
					return shared.WrapError(err, "create example tunnel config failed")
				}

				if err := mgr.Override(example); err != nil {
					return shared.WrapError(err, "override tunnel config failed")
				}

				logger.Info("Initialized tunnel configuration at ./moley.yml")
				return nil
			},
		},
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL