From a7436dfcc01a599bbb99a810bd59e92b21252c78 Mon Sep 17 00:00:00 2001 From: Clawd Date: Sun, 15 Feb 2026 18:52:55 -0800 Subject: feat(v2): implement ship host init with JSON output - host_v2.go: full host initialization with JSON responses - Installs Caddy, Docker on Ubuntu/Debian - Creates /etc/ship/{env,ports,ttl} directories - Installs TTL cleanup timer (hourly systemd timer) - Cleanup script removes expired deploys completely - Preserves git deploy setup functionality (optional) - Added ErrInvalidArgs error code Critical 'host init' functionality preserved for v2 --- cmd/ship/root_v2.go | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) (limited to 'cmd/ship/root_v2.go') diff --git a/cmd/ship/root_v2.go b/cmd/ship/root_v2.go index dab63be..9900e83 100644 --- a/cmd/ship/root_v2.go +++ b/cmd/ship/root_v2.go @@ -52,6 +52,9 @@ func initV2() { rootV2Cmd.AddCommand(logsV2Cmd) rootV2Cmd.AddCommand(removeV2Cmd) rootV2Cmd.AddCommand(hostV2Cmd) + + // Initialize host subcommands (from host_v2.go) + initHostV2() } func runDeployV2(cmd *cobra.Command, args []string) error { @@ -132,27 +135,4 @@ var hostV2Cmd = &cobra.Command{ Short: "Manage VPS host", } -func init() { - hostV2Cmd.AddCommand(hostInitV2Cmd) - hostV2Cmd.AddCommand(hostStatusV2Cmd) -} - -var hostInitV2Cmd = &cobra.Command{ - Use: "init USER@HOST --domain DOMAIN", - Short: "Initialize a VPS for deployments", - RunE: func(cmd *cobra.Command, args []string) error { - // TODO: implement - this is critical functionality to preserve - output.PrintAndExit(output.Err(output.ErrNotFound, "not implemented")) - return nil - }, -} - -var hostStatusV2Cmd = &cobra.Command{ - Use: "status", - Short: "Check host status", - RunE: func(cmd *cobra.Command, args []string) error { - // TODO: implement - output.PrintAndExit(output.Err(output.ErrNotFound, "not implemented")) - return nil - }, -} +// hostInitV2Cmd, hostStatusV2Cmd, and initHostV2() are defined in host_v2.go -- cgit v1.2.3