diff --git a/install/fs/config.yml b/install/fs/config.yml index 2ad323f0..7145ccb4 100644 --- a/install/fs/config.yml +++ b/install/fs/config.yml @@ -1,6 +1,6 @@ app: - dashboard_url: https://{{.Domain}} - base_domain: {{.Domain}} + dashboard_url: https://{{.DashboardDomain}} + base_domain: {{.BaseDomain}} log_level: info save_logs: false diff --git a/install/main.go b/install/main.go index 897b4741..e1a363a9 100644 --- a/install/main.go +++ b/install/main.go @@ -18,7 +18,8 @@ import ( var configFiles embed.FS type Config struct { - Domain string `yaml:"domain"` + BaseDomain string `yaml:"baseDomain"` + DashboardDomain string `yaml:"dashboardUrl"` LetsEncryptEmail string `yaml:"letsEncryptEmail"` AdminUserEmail string `yaml:"adminUserEmail"` AdminUserPassword string `yaml:"adminUserPassword"` @@ -102,12 +103,13 @@ func collectUserInput(reader *bufio.Reader) Config { // Basic configuration fmt.Println("\n=== Basic Configuration ===") - config.Domain = readString(reader, "Enter your domain name", "") + config.BaseDomain = readString(reader, "Enter your base domain (no subdomain e.g. example.com)", "") + config.DashboardDomain = readString(reader, "Enter the domain for the Pangolin dashboard (e.g. example.com OR proxy.example.com)", config.BaseDomain) config.LetsEncryptEmail = readString(reader, "Enter email for Let's Encrypt certificates", "") // Admin user configuration fmt.Println("\n=== Admin User Configuration ===") - config.AdminUserEmail = readString(reader, "Enter admin user email", "admin@"+config.Domain) + config.AdminUserEmail = readString(reader, "Enter admin user email", "admin@"+config.BaseDomain) for { config.AdminUserPassword = readString(reader, "Enter admin user password", "") if valid, message := validatePassword(config.AdminUserPassword); valid { @@ -140,10 +142,14 @@ func collectUserInput(reader *bufio.Reader) Config { } // Validate required fields - if config.Domain == "" { + if config.BaseDomain == "" { fmt.Println("Error: Domain name is required") os.Exit(1) } + if config.DashboardDomain == "" { + fmt.Println("Error: Dashboard Domain name is required") + os.Exit(1) + } if config.LetsEncryptEmail == "" { fmt.Println("Error: Let's Encrypt email is required") os.Exit(1)