Removes Wild Cloud cruft.

This commit is contained in:
2026-07-11 23:05:17 +00:00
parent f9d87ff975
commit ac66ba653d
26 changed files with 745 additions and 1410 deletions

View File

@@ -15,12 +15,13 @@ import (
"github.com/wild-cloud/wild-central/internal/domains"
)
// InstanceRoute represents a Wild Cloud instance's ingress routing configuration
// InstanceRoute represents an L4 TCP passthrough route (k8s instance).
type InstanceRoute struct {
// L4Route represents an L4 TCP passthrough route.
// HAProxy inspects the SNI header and forwards the entire TCP connection
// to the backend, which handles its own TLS.
type L4Route struct {
Name string `json:"name"` // identifier for backend naming
Domain string `json:"domain"` // e.g. "cloud.payne.io"
BackendIP string `json:"backendIP"` // k8s load balancer IP
BackendIP string `json:"backendIP"` // backend server IP
Subdomains bool `json:"subdomains"` // if true, also match *.domain
}
@@ -87,12 +88,12 @@ type GenerateOpts struct {
// and optional config. Uses L4 TCP mode with SNI inspection for HTTPS —
// TLS terminates at each k8s cluster's traefik. HTTP routes add an L7 frontend
// where Central terminates TLS with a wildcard cert and reverse-proxies by Host header.
func (m *Manager) Generate(instances []InstanceRoute, custom []CustomRoute, centralDomain ...string) string {
func (m *Manager) Generate(instances []L4Route, custom []CustomRoute, centralDomain ...string) string {
return m.GenerateWithOpts(instances, custom, GenerateOpts{})
}
// GenerateWithOpts creates a complete HAProxy configuration with full options.
func (m *Manager) GenerateWithOpts(instances []InstanceRoute, custom []CustomRoute, opts GenerateOpts) string {
func (m *Manager) GenerateWithOpts(instances []L4Route, custom []CustomRoute, opts GenerateOpts) string {
var sb strings.Builder
sb.WriteString(`# Wild Cloud HAProxy Configuration
@@ -433,7 +434,7 @@ func sanitizeName(name string) string {
// GetListenPorts returns all TCP/HTTP ports HAProxy is configured to listen on.
// Used to keep nftables rules in sync.
func (m *Manager) GetListenPorts(instances []InstanceRoute, custom []CustomRoute) []int {
func (m *Manager) GetListenPorts(custom []CustomRoute) []int {
ports := []int{80, 443, 8404}
for _, route := range custom {
ports = append(ports, route.Port)