From 8a3cff0dd7eb88cadb73a6df4e14f85450d63317 Mon Sep 17 00:00:00 2001 From: bndw Date: Sat, 24 Jan 2026 16:55:52 -0800 Subject: Add auto-generated subdomain feature When a base domain is configured on a host (e.g., apps.example.com), deployments automatically get a subdomain ({name}.apps.example.com). Custom --domain can still be provided to route both domains. - Add BaseDomain field to Host state - Add --base-domain flag to host init - Add 'ship host set-domain' command to update base domain - Update deploy flow to auto-generate subdomains - Fix error display (errors were being silently swallowed) - Remove placeholder email from Caddyfile template --- cmd/ship/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cmd/ship/main.go') diff --git a/cmd/ship/main.go b/cmd/ship/main.go index 27fe8b7..a6984ec 100644 --- a/cmd/ship/main.go +++ b/cmd/ship/main.go @@ -1,6 +1,7 @@ package main import ( + "fmt" "os" "github.com/bdw/ship/cmd/ship/env" @@ -57,7 +58,7 @@ func init() { rootCmd.Flags().String("binary", "", "Path to Go binary (for app deployment)") rootCmd.Flags().Bool("static", false, "Deploy as static site") rootCmd.Flags().String("dir", ".", "Directory to deploy (for static sites)") - rootCmd.Flags().String("domain", "", "Domain name (required)") + rootCmd.Flags().String("domain", "", "Custom domain (optional if base domain configured)") rootCmd.Flags().String("name", "", "App name (default: inferred from binary or directory)") rootCmd.Flags().Int("port", 0, "Port override (default: auto-allocate)") rootCmd.Flags().StringArray("env", nil, "Environment variable (KEY=VALUE, can be specified multiple times)") @@ -79,6 +80,7 @@ func init() { func main() { if err := rootCmd.Execute(); err != nil { + fmt.Fprintf(os.Stderr, "Error: %v\n", err) os.Exit(1) } } -- cgit v1.2.3