diff options
| author | Clawd <ai@clawd.bot> | 2026-02-15 18:55:50 -0800 |
|---|---|---|
| committer | Clawd <ai@clawd.bot> | 2026-02-15 18:55:50 -0800 |
| commit | 14703575578221ad40547147618354503e3005ae (patch) | |
| tree | 2c6a5e6a17fed52934b3ecd160df7429af7e70c8 /cmd/ship/host_v2.go | |
| parent | a5edd07980009df28c3ed7f4cb49c934198ec60d (diff) | |
fix: resolve build errors with v1 code
- Rename validateName to validateNameV2 to avoid conflict
- Fix host status to print JSON directly (remove unused resp)
Builds successfully now
Diffstat (limited to 'cmd/ship/host_v2.go')
| -rw-r--r-- | cmd/ship/host_v2.go | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/cmd/ship/host_v2.go b/cmd/ship/host_v2.go index 0d70f5d..dec8b59 100644 --- a/cmd/ship/host_v2.go +++ b/cmd/ship/host_v2.go | |||
| @@ -272,16 +272,13 @@ var hostStatusV2Cmd = &cobra.Command{ | |||
| 272 | caddyStatus, _ := client.RunSudo("systemctl is-active caddy") | 272 | caddyStatus, _ := client.RunSudo("systemctl is-active caddy") |
| 273 | dockerStatus, _ := client.RunSudo("systemctl is-active docker") | 273 | dockerStatus, _ := client.RunSudo("systemctl is-active docker") |
| 274 | 274 | ||
| 275 | resp := map[string]interface{}{ | 275 | // Print as JSON directly (custom response type) |
| 276 | "status": "ok", | 276 | fmt.Printf(`{"status":"ok","host":%q,"domain":%q,"caddy":%t,"docker":%t}`+"\n", |
| 277 | "host": hostName, | 277 | hostName, |
| 278 | "domain": hostConfig.BaseDomain, | 278 | hostConfig.BaseDomain, |
| 279 | "caddy": strings.TrimSpace(caddyStatus) == "active", | 279 | strings.TrimSpace(caddyStatus) == "active", |
| 280 | "docker": strings.TrimSpace(dockerStatus) == "active", | 280 | strings.TrimSpace(dockerStatus) == "active", |
| 281 | } | 281 | ) |
| 282 | |||
| 283 | // Use JSON encoder directly since this is a custom response | ||
| 284 | output.Print(&output.ListResponse{Status: "ok"}) // Placeholder | ||
| 285 | return nil | 282 | return nil |
| 286 | }, | 283 | }, |
| 287 | } | 284 | } |
