From 6b2c04728cd914f27ae62c1df0bf5df24ac9a628 Mon Sep 17 00:00:00 2001 From: Clawd Date: Tue, 17 Feb 2026 07:54:26 -0800 Subject: Remove v1 code, simplify state to just base_domain - Delete all v1 commands (deploy, init, list, status, remove, etc.) - Delete v1 env/ and host/ subcommand directories - Simplify state.go: remove NextPort, Apps, AllocatePort, etc. - Local state now only tracks default_host + base_domain per host - Ports and deploys are tracked on the server (/etc/ship/ports/) - host init now creates minimal state.json --- cmd/ship/env/list.go | 72 ---------------------------------------------------- 1 file changed, 72 deletions(-) delete mode 100644 cmd/ship/env/list.go (limited to 'cmd/ship/env/list.go') diff --git a/cmd/ship/env/list.go b/cmd/ship/env/list.go deleted file mode 100644 index e94b83a..0000000 --- a/cmd/ship/env/list.go +++ /dev/null @@ -1,72 +0,0 @@ -package env - -import ( - "fmt" - "strings" - - "github.com/bdw/ship/internal/state" - "github.com/spf13/cobra" -) - -var listCmd = &cobra.Command{ - Use: "list ", - Short: "List environment variables for an app", - Args: cobra.ExactArgs(1), - RunE: runList, -} - -func runList(cmd *cobra.Command, args []string) error { - name := args[0] - if err := state.ValidateName(name); err != nil { - return err - } - - st, err := state.Load() - if err != nil { - return fmt.Errorf("error loading state: %w", err) - } - - host, _ := cmd.Flags().GetString("host") - if host == "" { - host = st.GetDefaultHost() - } - - if host == "" { - return fmt.Errorf("--host is required") - } - - app, err := st.GetApp(host, name) - if err != nil { - return err - } - - if app.Type != "app" { - return fmt.Errorf("env is only available for apps, not static sites") - } - - fmt.Printf("Environment variables for %s:\n\n", name) - if len(app.Env) == 0 { - fmt.Println(" (none)") - } else { - for k, v := range app.Env { - display := v - if isSensitive(k) { - display = "***" - } - fmt.Printf(" %s=%s\n", k, display) - } - } - - return nil -} - -func isSensitive(key string) bool { - key = strings.ToLower(key) - sensitiveWords := []string{"key", "secret", "password", "token", "api"} - for _, word := range sensitiveWords { - if strings.Contains(key, word) { - return true - } - } - return false -} -- cgit v1.2.3