Documentation
¶
Index ¶
- func ConfirmQuickTunnelLoss(cfg *config.Config, u *ui.UI, currentURL, action string) bool
- 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 IsQuickTunnelHealthy(cfg *config.Config) bool
- 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, opts RestartOptions) error
- func RestorePersistentResources(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
- func WaitReady(cfg *config.Config, u *ui.UI) (string, error)
- type CloudflareRegistrarDomainAlias
- type CloudflareRegistrarWorkflowAlias
- type DomainCheckOptions
- type DomainCheckResult
- type DomainRegisterOptions
- type DomainRegisterResult
- type DomainSearchOptions
- type DomainSearchResult
- type LoginOptions
- type ProvisionOptions
- type RestartOptions
- type SetupOptions
- type SetupResult
- type TunnelState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfirmQuickTunnelLoss ¶ added in v0.9.0
ConfirmQuickTunnelLoss warns the user when a destructive action is about to invalidate an active quick tunnel URL, and asks whether to proceed. Returns true when the caller should continue.
Quick tunnels get a fresh *.trycloudflare.com URL on every cluster recreate or `obol tunnel restart`, so anyone who bookmarked or registered the old URL will see 530 errors until they re-discover via /skill.md. Persistent (DNS) tunnels are stable across these events and skip the warning.
Pass currentURL as discovered from the running cloudflared pod (or "" when none). In non-interactive sessions, Confirm returns its default (true), so automation and CI flows print the warning but do not block.
func CreateStorefront ¶ added in v0.7.0
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.7.0
DeleteStorefront removes the storefront landing page resources.
func EnsureRunning ¶ added in v0.7.0
EnsureRunning is the historical alias for WaitReady. New callers should prefer WaitReady directly; this is kept so existing call sites compile unchanged.
func EnsureTunnelForSell ¶ added in v0.7.0
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.7.0
InjectBaseURL sets AGENT_BASE_URL on the default Hermes deployment so that monetize.py uses the tunnel URL in registration JSON.
func IsQuickTunnelHealthy ¶ added in v0.9.0
IsQuickTunnelHealthy reports whether a quick (anonymous *.trycloudflare.com) tunnel is currently serving — pod is Running and a URL has been captured from its logs. Returns false for persistent (DNS) tunnels and for any failure mode (no kubeconfig, no pod, no URL).
Used by `obol stack up` to skip the cloudflared chart sync when the URL would otherwise be invalidated. Persistent tunnels survive helmfile sync because the chart renders replicas: 1 for them; quick tunnels do not, so re-syncing the chart kills the running pod and rotates the URL.
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 remotely managed persistent Cloudflare Tunnel routed via a proxied DNS record.
func Restart ¶
Restart restarts the cloudflared deployment and propagates the new tunnel URL to dependent resources (obol-stack-config ConfigMap, agent overlay, storefront HTTPRoute hostname pin). Quick tunnels get a new URL on every restart, so dependents must be refreshed or sell flows break:
- skill.md / services.json embed the stale base URL until the controller observes the ConfigMap change
- the storefront HTTPRoute is hostname-pinned; without an update it points at the old tunnel hostname and traffic to the new hostname's `/` falls through to the frontend catch-all
func RestorePersistentResources ¶ added in v0.10.0
RestorePersistentResources rehydrates the in-cluster cloudflared resources from local state so persistent tunnels survive stack recreation.
func SyncAgentBaseURL ¶ added in v0.5.0
SyncAgentBaseURL patches AGENT_BASE_URL in the default Hermes deployment 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.7.0
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.
func WaitReady ¶ added in v0.9.0
WaitReady scales the cloudflared deployment to the desired replica count, waits for the deployment rollout, and returns the active public tunnel URL.
For quick tunnels this polls pod logs for a public *.trycloudflare.com URL. For persistent tunnels this returns the configured hostname after rollout.
Side effects on success: injects AGENT_BASE_URL into the agent deployment, writes the tunnel URL to the obol-frontend ConfigMap, and refreshes the storefront landing page for the public tunnel hostname.
Types ¶
type CloudflareRegistrarDomainAlias ¶ added in v0.10.0
type CloudflareRegistrarDomainAlias = cloudflareRegistrarDomain
Exported aliases for CLI and JSON presentation helpers.
type CloudflareRegistrarWorkflowAlias ¶ added in v0.10.0
type CloudflareRegistrarWorkflowAlias = cloudflareRegistrarWorkflow
type DomainCheckOptions ¶ added in v0.10.0
type DomainCheckResult ¶ added in v0.10.0
type DomainCheckResult struct {
AccountID string `json:"account_id"`
Domains []cloudflareRegistrarDomain `json:"domains"`
}
func CheckDomains ¶ added in v0.10.0
func CheckDomains(opts DomainCheckOptions) (*DomainCheckResult, error)
type DomainRegisterOptions ¶ added in v0.10.0
type DomainRegisterResult ¶ added in v0.10.0
type DomainRegisterResult struct {
AccountID string `json:"account_id"`
Availability cloudflareRegistrarDomain `json:"availability"`
Workflow *cloudflareRegistrarWorkflow `json:"workflow,omitempty"`
}
func RegisterDomain ¶ added in v0.10.0
func RegisterDomain(u *ui.UI, opts DomainRegisterOptions) (*DomainRegisterResult, error)
type DomainSearchOptions ¶ added in v0.10.0
type DomainSearchResult ¶ added in v0.10.0
type DomainSearchResult struct {
AccountID string `json:"account_id"`
Domains []cloudflareRegistrarDomain `json:"domains"`
}
func SearchDomains ¶ added in v0.10.0
func SearchDomains(opts DomainSearchOptions) (*DomainSearchResult, error)
type LoginOptions ¶
type ProvisionOptions ¶
type ProvisionOptions struct {
Hostname string
AccountID string
ZoneID string
APIToken string
TransportProtocol string
}
ProvisionOptions configures `obol tunnel provision`.
type RestartOptions ¶ added in v0.10.0
type RestartOptions struct {
TransportProtocol string
}
type SetupOptions ¶ added in v0.10.0
type SetupResult ¶ added in v0.10.0
type SetupResult struct {
Hostname string `json:"hostname"`
URL string `json:"url"`
Mode string `json:"mode"`
ManagementMode string `json:"management_mode"`
TransportProtocol string `json:"transport_protocol,omitempty"`
AccountID string `json:"account_id,omitempty"`
ZoneID string `json:"zone_id,omitempty"`
RegistrationStatus *cloudflareRegistrarWorkflow `json:"registration_status,omitempty"`
}
func Setup ¶ added in v0.10.0
func Setup(cfg *config.Config, u *ui.UI, opts SetupOptions) (*SetupResult, error)
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.