summaryrefslogtreecommitdiffstats
path: root/cmd/ship/host/init.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/ship/host/init.go')
-rw-r--r--cmd/ship/host/init.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/cmd/ship/host/init.go b/cmd/ship/host/init.go
index ea25922..27f67af 100644
--- a/cmd/ship/host/init.go
+++ b/cmd/ship/host/init.go
@@ -26,6 +26,7 @@ func runInit(cmd *cobra.Command, args []string) error {
26 if host == "" { 26 if host == "" {
27 host = st.GetDefaultHost() 27 host = st.GetDefaultHost()
28 } 28 }
29 baseDomain, _ := cmd.Flags().GetString("base-domain")
29 30
30 if host == "" { 31 if host == "" {
31 return fmt.Errorf("--host is required") 32 return fmt.Errorf("--host is required")
@@ -64,7 +65,6 @@ func runInit(cmd *cobra.Command, args []string) error {
64 65
65 fmt.Println("-> Configuring Caddy...") 66 fmt.Println("-> Configuring Caddy...")
66 caddyfile := `{ 67 caddyfile := `{
67 email admin@example.com
68} 68}
69 69
70import /etc/caddy/sites-enabled/* 70import /etc/caddy/sites-enabled/*
@@ -100,7 +100,11 @@ import /etc/caddy/sites-enabled/*
100 fmt.Println(" Caddy is active") 100 fmt.Println(" Caddy is active")
101 } 101 }
102 102
103 st.GetHost(host) 103 hostState := st.GetHost(host)
104 if baseDomain != "" {
105 hostState.BaseDomain = baseDomain
106 fmt.Printf(" Base domain: %s\n", baseDomain)
107 }
104 if st.GetDefaultHost() == "" { 108 if st.GetDefaultHost() == "" {
105 st.SetDefaultHost(host) 109 st.SetDefaultHost(host)
106 fmt.Printf(" Set %s as default host\n", host) 110 fmt.Printf(" Set %s as default host\n", host)