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 --- internal/output/output.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'internal') diff --git a/internal/output/output.go b/internal/output/output.go index 13e34a3..1e1e34e 100644 --- a/internal/output/output.go +++ b/internal/output/output.go @@ -107,6 +107,7 @@ func (r ErrorResponse) IsError() bool { return true } // Error codes const ( ErrInvalidPath = "INVALID_PATH" + ErrInvalidArgs = "INVALID_ARGS" ErrUnknownProjectType = "UNKNOWN_PROJECT_TYPE" ErrSSHConnectFailed = "SSH_CONNECT_FAILED" ErrSSHAuthFailed = "SSH_AUTH_FAILED" @@ -180,7 +181,7 @@ func exitCodeForError(code string) int { return ExitSSHFailed case ErrHealthCheckFailed, ErrHealthCheckTimeout: return ExitHealthFailed - case ErrInvalidPath, ErrInvalidTTL, ErrInvalidName, ErrHostNotConfigured: + case ErrInvalidPath, ErrInvalidTTL, ErrInvalidName, ErrHostNotConfigured, ErrInvalidArgs: return ExitInvalidArgs default: return ExitDeployFailed -- cgit v1.2.3