354 Commits

Author SHA1 Message Date
Paul Payne
acd4d29f3e Fix kubeconfig regeneration: use VIP as server URL and force overwrite
The cluster's API server may advertise a different address than the VIP
(e.g. a node IP on another network interface). After retrieving the
kubeconfig from talosctl, patch the server URL to use the configured VIP
so it remains reachable from the management network.

Also add --force to talosctl kubeconfig to avoid context merging issues
when regenerating into an existing file.
2026-10-26 16:12:04 +00:00
Paul Payne
c8d2503f0f fix: Apply Central URL changes without requiring daemon restart
The Central client's URL is now updated in-place when global config
is saved, and the pending-restart banner uses the last config apply
time as its baseline so it clears correctly.
2026-08-05 15:25:34 +00:00
Paul Payne
8afa162090 feat: Persist Wild Central URL in global config
The sidebar link to Wild Central was broken because the URL had no
proper home — the API read it from an env var, the web app guessed
with a hardcoded fallback. Now cloud.central.url in config.yaml is
the single source of truth.

- Add cloud.central.url to GlobalConfig (replaces unused domain field)
- API reads Central URL from env var, then config, then default
- Sidebar reads URL from global config, falls back to current hostname
- CentralComponent: editable Wild Central URL field (same pattern as operator email)
- Setup wizard central phase requires URL to be configured
2026-08-04 23:59:53 +00:00
Paul Payne
f3524210db feat: Add portable backup export/import for cross-cluster restore
Adds `wildcloud backup export` and `wildcloud backup import` commands
that create self-contained .tar.gz archives portable across clusters.
Export packages postgres dumps, mysql dumps, config, and PVC contents
(via temporary pods) into a single file. Import extracts data into the
target's backup destination and uses the existing restore flow for
databases/config, with direct PVC restoration via temporary pods.

Tested end-to-end on test-cloud: sentinel data in both postgres and
PVC survived export, deletion, and import.
2026-08-04 21:10:06 +00:00
Paul Payne
2fa8673524 fix: Wild Central integration - fix link, setup wizard, health check
- Fix sidebar fallback port (15055 -> 5055) for Wild Central link
- Fix setup wizard "central" phase route (was broken, pointed to non-existent route)
- Add Central health check to setup phase (Ping via /api/v1/health)
- Update setup wizard text: "Connect to Wild Central" with clearer guidance
- Fix CentralComponent naming: "Wild Cloud Settings" with accurate descriptions
- Export DetermineCurrentPhase for handler-level phase recalculation
2026-08-01 23:25:28 +00:00
Paul Payne
21944d8c9e Consolidate cluster health into a single endpoint with runtime checks
Merge utilities/health into cluster/health. The cluster health endpoint
now checks live cluster state: node readiness, Flannel, CoreDNS,
kube-proxy, MetalLB, Traefik, and Longhorn — in addition to the
existing kubeconfig and certificate expiry checks.

Remove the unused utilities/health endpoint and cert-manager check
(moved to Wild Central).
2026-08-01 23:24:01 +00:00
Paul Payne
72e041e9e6 Rename CLI from wild to wildcloud, sync with API
Rename the CLI binary and all references from `wild` to `wildcloud`
across Go source, packaging scripts, docs, and e2e tests.

Add missing CLI commands: app restart, operation cancel.
2026-08-01 23:00:37 +00:00
Paul Payne
01a688a70c refactor: rename buildDesiredServices to buildDesiredDomains in tests 2026-08-01 20:49:55 +00:00
Paul Payne
dbd502578c Agent file standard. 2026-08-01 20:47:26 +00:00
Paul Payne
4c266e454d Remove unused dependencies from CLI go.mod 2026-08-01 20:35:49 +00:00
Paul Payne
77c393bf44 Streamline CLI: remove Wild Central commands, merge overlapping features
Remove commands that belong to Wild Central (dns, proxy, firewall,
ddns, crowdsec, secret central) since those APIs live on Central now.

Merge service into app (install, logs, config), merge iso into asset
(delete), move orphan commands (health, node-ip) under cluster.

Clean up redundant commands (backup start, node cancel-discovery)
and standardize deletion confirmation on --yes/-y across all commands.
2026-08-01 20:34:49 +00:00
Paul Payne
6b760072d2 Dev env setup. 2026-08-01 20:33:58 +00:00
Paul Payne
92002d0962 style: update favicon color and design 2026-08-01 20:33:26 +00:00
Paul Payne
07addb0884 Move Wild Cloud web to port 5174 (Central gets default 5173) 2026-07-14 15:49:44 +00:00
Paul Payne
bc2bf5dae1 Update .envrc.example, fix CLI default API port to 5056
- api/.envrc.example: document all env vars (data dir, Central URL/token,
  Cloud domain, directory path)
- cli: fix default WILD_API_URI from localhost:5055 (Central) to
  localhost:5056 (Cloud) — the CLI talks to Cloud, not Central
2026-07-14 15:13:57 +00:00
Paul Payne
77931e2e00 Add bearer token support for Wild Central API authentication
Central client (api/internal/central/client.go):
- NewClient now accepts a token parameter
- All HTTP requests include Authorization: Bearer header when token is set
- Centralized auth via do() helper method
- Token read from WILD_CENTRAL_TOKEN environment variable

CLI client (cli/internal/client/client.go):
- Add SetToken method and token field
- doRequest includes Authorization header when token is set
- CLI reads token from WILD_CENTRAL_TOKEN env var in root command

Web app (web/src/services/api/client.ts):
- Add setToken/clearToken/hasToken methods matching Wild Central's pattern
- Token persisted in localStorage under 'wild-cloud:token'
- Authorization header included on all API requests
2026-07-14 13:35:27 +00:00
Paul Payne
931f354622 fix: update APT repository URLs and signing key references 2026-07-13 00:24:35 +00:00
Paul Payne
585d49d64b Rewords dist for Central dependency. 2026-07-12 21:39:00 +00:00
Paul Payne
13510b7474 Central -> Cloud 2026-07-10 22:56:03 +00:00
Paul Payne
92ce21920a Wild Central services -> domains. 2026-07-10 20:45:46 +00:00
Paul Payne
231359d713 Refactor: simplify secrets and remove deprecated config handlers 2026-07-10 06:11:07 +00:00
Paul Payne
e5e933a46b feat: Refactor service model to support multiple routes per domain 2026-07-10 05:15:19 +00:00
Paul Payne
ef7203933f Long live Wild Central! Adds watcher. 2026-07-10 04:35:13 +00:00
Paul Payne
28c1d93b17 refactor: Replace reach string with public bool in Central client
Simplifies the service registration contract — reach was only ever
"internal" or "public", so a boolean is clearer for consumers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-07-10 02:18:02 +00:00
Paul Payne
db26b42a31 feat: Domain-keyed registrations, one per domain
Update Wild Cloud to match Central's new domain-keyed service model:

Client changes:
- Removed Name, ExtraDomains, SourceNode from Service struct
- Added Subdomains bool field
- Added DeregisterBySource(source, backend) for batch cleanup
- DeregisterService uses domain in URL

Registration changes:
- RegisterInstanceWithCentral → RegisterInstanceDomains
- Now makes separate registrations per domain:
  * Primary domain (subdomains:true, reach:public)
  * Internal domain (subdomains:true, reach:internal)
  * Each discovered extra domain (subdomains:false, reach:public)
- Calls DeregisterBySource before re-registering (cleanup)

Handler changes:
- CentralDeregisterInstance uses DeregisterBySource for batch cleanup
- CentralRegistrationStatus queries by domain, not name
- RegisterAppWithCentral uses domain-only Service

All tests pass.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-07-09 20:35:13 +00:00
Paul Payne
735b4bf03c feat: Discover extra domains from deployed app ingress manifests
When registering an instance with Central, scan deployed app manifests
for ingress hostnames outside the instance's primary domain. These get
added as extraDomains so HAProxy routes them correctly.

For payne-cloud this discovers: payne.io, civilsociety.dev,
mywildcloud.org — domains that apps are actually serving.

Ported discoverExtraDomains, ingressHosts, ingressBaseDomain from the
old handlers_haproxy.go. Removed incorrect baseDomain auto-add that
was causing both instances to claim payne.io.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-07-09 15:52:03 +00:00
Paul Payne
ecb3741c2b feat: Auto-register all instances with Central on startup
On startup, Wild Cloud iterates all existing instances and registers
each with Central (DNS, HAProxy SNI routes, split DNS). Idempotent —
safe on every restart.

Also exports RegisterInstanceWithCentral for use from main.go.

This ensures all instances are routable even if Central was restarted
and lost registrations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-07-09 15:46:51 +00:00
Paul Payne
97f4be3714 fix: Use Central domain from config for sidebar link
The Wild Central link in the sidebar used VITE_CENTRAL_URL which
defaults to http://localhost:15055 — unreachable from other machines
on the LAN. Now reads cloud.central.domain from the API config and
links to https://<central-domain> instead. Falls back to the env var
for dev when no domain is configured.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-07-09 13:56:59 +00:00
Paul Payne
ab2a44c1f2 fix: Read MetalLB LB IP from per-app config file
The load balancer IP is stored in config/apps/metallb/config.yaml
(per-app config), not in the main instance.yaml. The registration
helpers now check all three locations:
1. cluster.loadBalancerIp (main config)
2. apps.metallb.loadBalancerIp (main config apps section)
3. config/apps/metallb/config.yaml (per-app file)

This fixes "Cannot register: LB IP must be configured" when MetalLB
was deployed through the normal app install flow.

Verified: payne-cloud now registers with backendIP=192.168.8.240.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-07-09 13:50:33 +00:00
Paul Payne
6539702faa feat: Add Central Registration UI to instance domain config
Add a "Central Registration" card to the CloudComponent page showing
whether the instance is registered with Wild Central for DNS/proxy/TLS.

- Status polling via GET /instances/{id}/central/status
- Register button (disabled when domain or LB IP missing)
- Unregister button (shown when registered)
- Clear messaging for missing prerequisites
- New hook: useCentralRegistration
- New API service: centralApi

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-07-09 05:50:35 +00:00
Paul Payne
c2a7d95b9f feat: Add explicit Central registration for instances and app
Instance registration with Central is now explicit and user-controlled:

API endpoints:
- POST   /instances/{name}/central/register  — register instance
- DELETE /instances/{name}/central/register  — deregister
- GET    /instances/{name}/central/status    — check registration

Startup self-registration:
- Wild Cloud registers its own app domain (WILD_CLOUD_DOMAIN env var)
  with Central on startup, idempotently

Changes:
- Removed auto-register from CreateInstance (domain/LB not set yet)
- Added handlers_central.go with register/deregister/status/app-register
- Added ProxyGET to Central client for status checks
- Added WILD_CLOUD_DOMAIN to .envrc

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-07-09 05:46:53 +00:00
Paul Payne
1de7ff2c4e feat: Add Domain Config nav item to sidebar
Add explicit sidebar link to /instances/:id/cloud for instance domain
configuration (public domain, internal domain, DNS test). Shows in
both expanded and collapsed sidebar modes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-07-09 05:15:40 +00:00
Paul Payne
75d0e4e4e7 fix: Restore instance domain config page at /instances/:id/cloud
The CloudComponent (public domain, internal domain, DNS test buttons)
was incorrectly deleted during Central extraction. This is instance-
scoped config, not Central config.

Restored CloudComponent and CloudPage, routed at
/instances/:instanceId/cloud.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-07-09 05:01:48 +00:00
Paul Payne
95bab1a1e8 fix: Restore CentralLayout wrapper for /cloud routes
The Overview page crashed because CentralPage uses usePageHelp which
requires HelpProvider. CentralLayout provides this context.

Restored CentralLayout.tsx and wrapped /cloud routes in it, matching
the original route structure from main.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-07-09 04:59:39 +00:00
Paul Payne
86c117e2dc fix: Restore Overview page with correct component
The /cloud Overview page should show CentralComponent (operator email,
daemon status, Talos client) — not CloudComponent (instance domain
config). CentralComponent is a Cloud meta-config page despite its name.

Removed CloudPage/CloudComponent (instance-scoped, accessible via
Dashboard) and restored CentralPage/CentralComponent at /cloud.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-07-09 04:56:56 +00:00
Paul Payne
3f135c9b89 fix: Restore original sidebar layout with Central link
Restore the sidebar from main and make the minimal change: replace
the Central section's individual nav items with a single "Wild Central"
external link. The layout now matches the original:

  Central → Wild Central (external link)
  Wild Cloud → Overview, Node USB Installer
  Instance Selector
  Dashboard, Cloud (Nodes, Services), Apps, Backups, Advanced

Restored /cloud routes for Overview and ISO pages.
Removed /central/* routes (served by Wild Central's own UI).
Removed Central page imports and redirect children.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-07-09 04:53:49 +00:00
Paul Payne
0b2907128b fix: Restore Overview and Node USB Installer pages
The Central page cleanup incorrectly removed CloudPage/CloudComponent
(instance-level domain/network config) and the Node USB Installer
sidebar link. These are Cloud-specific features, not Central.

- Restored CloudComponent and CloudPage from main
- Added Overview nav item in sidebar
- Added Node USB Installer nav item under Cloud section

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-07-09 04:49:58 +00:00
Paul Payne
94576dd0d8 refactor: Remove Central API proxy from Wild Cloud
Central pages are now served by Wild Central's own UI — no need to
proxy Central API calls through Wild Cloud. The sidebar links to
Wild Central directly via VITE_CENTRAL_URL.

Removed: reverse proxy handler, ReverseProxy method, ProxyRequest
method, unused httputil/url imports.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-07-09 04:34:15 +00:00
Paul Payne
05618dc9f1 feat: Remove Central pages from Wild Cloud web app
Central pages (DNS, DHCP, Firewall, VPN, Ingress, CrowdSec) are now
served by the standalone Wild Central web app. Wild Cloud's sidebar
links to Central via VITE_CENTRAL_URL.

Removed: 12 Central pages, 12 Central components, 8 Central hooks,
4 Central API services, CentralLayout router
Added: "Wild Central" external link in sidebar

TypeScript type-check and production build pass.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-07-09 04:11:02 +00:00
Paul Payne
70b6755318 fix: Correct Central proxy path matching for bare paths
PathPrefix("/api/v1/services/") doesn't match "/api/v1/services"
(no trailing slash). Remove trailing slashes from proxy prefixes so
both /api/v1/services and /api/v1/services/foo are forwarded.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-07-09 03:42:12 +00:00
Paul Payne
8f4c8ba477 feat: Add reverse proxy to forward Central API calls to Wild Central
Wild Cloud's web UI still calls Central-namespaced endpoints (dnsmasq,
vpn, firewall, etc.). Instead of dropping those calls, forward them to
the Wild Central service via a reverse proxy.

Central paths (/api/v1/dnsmasq/*, /api/v1/vpn/*, etc.) are proxied
transparently to WILD_CENTRAL_URL (default http://localhost:5055).

This lets the existing UI work unchanged while Central runs as a
separate service. Set WILD_CENTRAL_URL to point at Central's address.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-07-09 03:29:55 +00:00
Paul Payne
0f98163e98 feat: Extract Central networking from Wild Cloud
Remove all Central-specific code from Wild Cloud. Networking concerns
(DNS, HAProxy, nftables, WireGuard, certbot, CrowdSec, DDNS) are now
managed by the standalone Wild Central service.

Wild Cloud now uses a Central client (internal/central/client.go) to
register instance services with Central via HTTP API. When an instance
is created or its domain/LB IP changes, Cloud calls Central's service
registration API instead of managing dnsmasq/HAProxy directly.

Removed: 8 Central handler files, 8 internal packages (~6500 LOC)
Added: Central API client for service registration
Modified: Instance creation and config updates use Central client

All 17 test packages pass.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-07-09 00:00:48 +00:00
Paul Payne
43f4d6d306 style: Make instance selector look like a section heading
Remove border, background, and shadow from the instance selector
dropdown so it visually matches the sidebar group labels. Keeps the
chevron as the only hint it's interactive.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-07-08 23:30:30 +00:00
Paul Payne
7c651bc992 fix: Remove excess padding around instance selector in sidebar
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-07-08 23:27:39 +00:00
Paul Payne
97da18dc8c chore: Remove legacy ddns.cloudflare.apiToken fallback
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-07-08 23:26:18 +00:00
Paul Payne
382947eb3a feat: Add Cloudflare integration page and restructure sidebar
Add a dedicated Cloudflare page under Central for API token management
with live verification against the Cloudflare API (token validity, zone
access). Migrate the token secret path from ddns.cloudflare.apiToken to
cloudflare.apiToken with backward-compatible fallback.

Restructure sidebar into two groups: Central (networking platform
services) and Wild Cloud (overview, instance management). The instance
selector now sits inside the Wild Cloud section as a natural divider
between meta and instance-scoped items.

Move Central Domain & TLS config from Overview to the Cloudflare page.
Move Node USB Installer route to /cloud/iso (not instance-scoped).
Fix FirewallComponent Lucide icon title prop type error.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-07-08 23:24:20 +00:00
Paul Payne
dcbcbe16fa Use warning variant for service badges that indicate a problem
Distinguish between "disabled" (opt-in feature intentionally off, gray)
and "stopped" (expected service not running, yellow warning). Core
services like DNS, HAProxy, CrowdSec show warning when stopped. Opt-in
features like VPN and firewall show warning only when enabled in config
but not actually running. Opt-in features that are simply disabled stay
gray (secondary).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-07-08 22:49:08 +00:00
Paul Payne
3ade65f39a fix: Use success variant for all service status badges
Service status badges (Running, Active, Enabled) now consistently use
variant="success" (green bg, white text) instead of variant="default"
(primary color). Fixes visual inconsistency where some status badges
appeared dark/primary while others were green. Also standardizes icon
size to h-3 w-3, removes XCircle from inactive states, and cleans up
bg-green-600 hacks in CloudflareComponent that were working around
the wrong variant choice.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-07-08 22:44:57 +00:00
Paul Payne
d203969a2f Standardize status badges across all Central pages
Consistent pattern: active state uses variant="default" with CheckCircle
h-3 w-3 icon and gap-1; inactive state uses variant="secondary" with no
icon. Standardize inactive text to "Stopped"/"Disabled" (not "Not running").
Central overview keeps variant="success" as the top-level system health
indicator. Remove unused XCircle import from Ingress.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-07-08 22:38:25 +00:00
Paul Payne
d236b36819 Align Central pages UX: consistent feedback, Advanced views, auto VPN firewall port
- Firewall: unified port list showing auto-managed (locked) and user ports,
  raw nftables rules moved to Advanced collapsible, success/error alerts
- Ingress: Advanced collapsible showing generated haproxy.cfg, success/error
  alerts on custom route add/delete
- VPN: auto-apply after config save, Advanced collapsible showing wg status,
  consistent alert styling
- DHCP: success/error alerts on config save and static lease operations
- Central: success/error alerts on operator email and domain saves
- Firewall auto-includes WireGuard listen port when VPN is enabled (backend
  and frontend), VPN config save triggers nftables resync
- Fix HAProxy stats socket path: make it configurable on Manager so tests
  don't hit the real HAProxy on the host
- Fix DDNS checkAndUpdate to skip Cloudflare calls when IP is unchanged

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-07-08 21:23:37 +00:00