Hive
feat(server): enable the Kura cache surface by default on self-hosted, and fix self-hosting docs
GitHub issue · Closed
Purpose
Fixes the self-hosting guides where they were inaccurate/out-of-date, and removes the setup friction that surfaced while helping a customer stand up a standalone node: on a self-hosted server the Cache page was hidden behind a feature flag they couldn’t easily reach.
Behavior change: Kura on by default for self-hosted
On a self-hosted Tuist server, cache routing is driven by the operator’s global TUIST_CACHE_ENDPOINTS, not by the per-account :kura rollout flag. Gating the Cache page (plus the sidebar entry, Usage page, and settings section) behind :kura was therefore pure friction: an operator had to reach /ops/flags to flip a flag before they could generate the control-plane credential, even though the deployment already grants the self-hosted-cache entitlement unconditionally.
FeatureFlags.kura_enabled?/1now returns true on any non-hosted deployment (not tuist_hosted?()), mirroringBilling.Entitlementswhere the deployment’s license is the entitlement. The hosted server stays gated behind the:kuratoggle.- The inline duplicates in
cache_liveandaccount_settings_livenow delegate to that helper so the sidebar, LiveView guards, and settings page can’t drift. - The managed cache-server provisioning UI (inert on self-hosted: no managed regions, no Tuist-managed Kubernetes) is hidden when there are no servers and no available regions, so a self-hoster sees only credential generation and the registered-nodes list.
Docs corrections
Tracing the CLI endpoint resolution (Accounts.get_cache_endpoints_for_handle/2) showed it branches on tuist_hosted?:
- Hosted tuist.dev: per-account resolution routes the CLI to self-hosted nodes from their registration heartbeats.
- Self-hosted server: that branch is never reached; it returns the global
TUIST_CACHE_ENDPOINTS.
The docs instead told self-hosters to set TUIST_KURA_ENDPOINTS / server.kuraEndpointUrls, which has no consumer (Environment.kura_endpoints/2 is never called), so that guidance was a no-op. Corrected across all three guides, plus:
- Registration is clarified as dashboard-only on a self-hosted server (routing is
TUIST_CACHE_ENDPOINTS). - Peer mTLS (
KURA_INTERNAL_TLS_*) is documented as multi-node-only; a single node uses anhttp://KURA_NODE_URLwith peer TLS off. - The Cache page is documented as available by default on a self-hosted server.
Scope / follow-ups
The dead TUIST_KURA_ENDPOINTS / Environment.kura_endpoints/2 code and the kuraEndpointUrls Helm value (whose comment still says “point this at Kura instances”) are left for a separate cleanup.
Validation
mix compile --warnings-as-errorspasses (confirms the removedEnvironmentaliases and the delegations).- New tests in
cache_live_test: self-hosted default-on, and the managed-section hide when no regions are available.disable_cache/disable_kurahelpers now stubtuist_hosted? -> true(the only case the surface stays hidden). Full suite runs in CI.
Investigate, reproduce, or fix this item in an isolated repository. Each Flight preserves its outcome and agent session.
Start a Flight and preserve its objective, outcome, and session here.
No GitHub comments yet.