feat: Extract Wild Central as standalone Go service
Extract the Central networking functionality from wild-cloud/api into a standalone service. Wild Central manages DNS (dnsmasq), gateway (HAProxy), firewall (nftables), VPN (WireGuard), TLS (certbot), security (CrowdSec), and DDNS — all the network appliance concerns. All Cloud-specific code (instances, clusters, nodes, apps, backups, operations, kubectl/talosctl tooling) has been removed. The API struct and route registration contain only Central endpoints. Tests updated to match the new API signature. Builds and all tests pass. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
29
internal/api/v1/handlers_ddns.go
Normal file
29
internal/api/v1/handlers_ddns.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// DDNSStatus returns the current DDNS status (last IP, last update, last error)
|
||||
func (api *API) DDNSStatus(w http.ResponseWriter, r *http.Request) {
|
||||
if api.ddns == nil {
|
||||
respondJSON(w, http.StatusOK, map[string]any{
|
||||
"enabled": false,
|
||||
"message": "DDNS not configured",
|
||||
})
|
||||
return
|
||||
}
|
||||
respondJSON(w, http.StatusOK, api.ddns.GetStatus())
|
||||
}
|
||||
|
||||
// DDNSTrigger forces an immediate DDNS IP check and update
|
||||
func (api *API) DDNSTrigger(w http.ResponseWriter, r *http.Request) {
|
||||
if api.ddns == nil {
|
||||
respondError(w, http.StatusServiceUnavailable, "DDNS not configured")
|
||||
return
|
||||
}
|
||||
api.ddns.Trigger()
|
||||
respondJSON(w, http.StatusOK, map[string]string{
|
||||
"message": "DDNS update triggered",
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user