Documentation
¶
Index ¶
- func CreateStorefront(cfg *config.Config, tunnelURL string) error
- func DeleteStorefront(cfg *config.Config) error
- func EnsureRunning(cfg *config.Config, u *ui.UI) (string, error)
- func EnsureTunnelForSell(cfg *config.Config, u *ui.UI) (string, error)
- func GetTunnelURL(cfg *config.Config) (string, error)
- func InjectBaseURL(cfg *config.Config, tunnelURL string) error
- func Login(cfg *config.Config, u *ui.UI, opts LoginOptions) error
- func Logs(cfg *config.Config, follow bool) error
- func Provision(cfg *config.Config, u *ui.UI, opts ProvisionOptions) error
- func Restart(cfg *config.Config, u *ui.UI) error
- func Status(cfg *config.Config, u *ui.UI) error
- func Stop(cfg *config.Config, u *ui.UI) error
- func SyncAgentBaseURL(cfg *config.Config, tunnelURL string) error
- func SyncTunnelConfigMap(cfg *config.Config, tunnelURL string) error
- type LoginOptions
- type ProvisionOptions
- type TunnelState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateStorefront ¶ added in v0.8.1
CreateStorefront creates (or updates) a simple HTML landing page served at the tunnel hostname's root path. This uses the same busybox-httpd + ConfigMap pattern as the .well-known registration in monetize.py.
func DeleteStorefront ¶ added in v0.8.1
DeleteStorefront removes the storefront landing page resources.
func EnsureRunning ¶ added in v0.8.1
EnsureRunning scales the cloudflared deployment to 1 replica if it's at 0, waits for the pod to be ready, and returns the tunnel URL once available. If the tunnel is already running, it returns the current URL immediately.
func EnsureTunnelForSell ¶ added in v0.8.1
EnsureTunnelForSell ensures the tunnel is running and propagates the URL to the public service discovery surfaces needed by seller flows. It updates the frontend ConfigMap and storefront, but deliberately avoids syncing the obol-agent overlay. The agent overlay should be updated by explicit tunnel provisioning/login flows, not every ServiceOffer mutation.
func GetTunnelURL ¶
GetTunnelURL parses cloudflared logs to extract the quick tunnel URL.
func InjectBaseURL ¶ added in v0.8.1
InjectBaseURL sets AGENT_BASE_URL on the default OpenClaw deployment so that monetize.py uses the tunnel URL in registration JSON.
func Login ¶
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 Provision ¶
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 SyncAgentBaseURL ¶ added in v0.8.1
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).
func SyncTunnelConfigMap ¶ added in v0.8.1
SyncTunnelConfigMap creates or patches the obol-stack-config ConfigMap in the obol-frontend namespace with the current tunnel URL. The frontend reads this ConfigMap to construct the correct dashboard URL.
Types ¶
type LoginOptions ¶
type LoginOptions struct {
Hostname string
}
type ProvisionOptions ¶
ProvisionOptions configures `obol tunnel provision`.
type TunnelState ¶ added in v0.8.1
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.8.1
func LoadTunnelState(cfg *config.Config) (*TunnelState, error)
LoadTunnelState reads the persisted tunnel state from disk. Returns (nil, nil) if no state file exists.