Help us shape the future of Go! Take the 2026 Go Developer Survey

tunnel

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTunnelURL

func GetTunnelURL(cfg *config.Config) (string, error)

GetTunnelURL parses cloudflared logs to extract the quick tunnel URL.

func Login

func Login(cfg *config.Config, u *ui.UI, opts LoginOptions) error

Login provisions a locally-managed tunnel using `cloudflared tunnel login` (browser auth), then writes the required credentials/config into Kubernetes and upgrades the cloudflared Helm release so the in-cluster connector runs the locally-managed tunnel.

Docs: - Create a locally-managed tunnel: https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/do-more-with-tunnels/local-management/create-local-tunnel/ - Configuration file for published apps: https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/do-more-with-tunnels/local-management/configuration-file/ - `origincert` run parameter (locally-managed tunnels): https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/configure-tunnels/cloudflared-parameters/run-parameters/

func Logs

func Logs(cfg *config.Config, follow bool) error

Logs displays cloudflared logs.

func Provision

func Provision(cfg *config.Config, u *ui.UI, opts ProvisionOptions) error

Provision provisions a persistent Cloudflare Tunnel routed via a proxied DNS record.

Based on Cloudflare's "Create a tunnel (API)" guide: - POST /accounts/$ACCOUNT_ID/cfd_tunnel - PUT /accounts/$ACCOUNT_ID/cfd_tunnel/$TUNNEL_ID/configurations - POST /zones/$ZONE_ID/dns_records (proxied CNAME to <tunnel-id>.cfargotunnel.com)

func Restart

func Restart(cfg *config.Config, u *ui.UI) error

Restart restarts the cloudflared deployment.

func Status

func Status(cfg *config.Config, u *ui.UI) error

Status displays the current tunnel status and URL.

func SyncAgentBaseURL added in v0.5.0

func SyncAgentBaseURL(cfg *config.Config, tunnelURL string) error

SyncAgentBaseURL patches AGENT_BASE_URL in the obol-agent's values-obol.yaml and runs helmfile sync to apply the change. It is a no-op if the obol-agent deployment directory does not exist (agent not yet initialized).

Types

type LoginOptions

type LoginOptions struct {
	Hostname string
}

type ProvisionOptions

type ProvisionOptions struct {
	Hostname  string
	AccountID string
	ZoneID    string
	APIToken  string
}

ProvisionOptions configures `obol tunnel provision`.

type TunnelState added in v0.5.0

type TunnelState = tunnelState

TunnelState is an exported alias so other packages (agent, openclaw) can read tunnel state without reaching into unexported types.

func LoadTunnelState added in v0.5.0

func LoadTunnelState(cfg *config.Config) (*TunnelState, error)

LoadTunnelState reads the persisted tunnel state from disk. Returns (nil, nil) if no state file exists.

Jump to

Keyboard shortcuts

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