Add ee install option

This commit is contained in:
Owen
2025-12-20 17:28:07 -05:00
parent 4a98061a62
commit e477a5a1b5
3 changed files with 26 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
name: pangolin name: pangolin
services: services:
pangolin: pangolin:
image: docker.io/fosrl/pangolin:{{.PangolinVersion}} image: docker.io/fosrl/pangolin:{{if .IsEnterprise}}ee-{{end}}{{.PangolinVersion}}
container_name: pangolin container_name: pangolin
restart: unless-stopped restart: unless-stopped
volumes: volumes:

View File

@@ -54,13 +54,31 @@ func readBool(reader *bufio.Reader, prompt string, defaultValue bool) bool {
if defaultValue { if defaultValue {
defaultStr = "yes" defaultStr = "yes"
} }
input := readString(reader, prompt+" (yes/no)", defaultStr) for {
return strings.ToLower(input) == "yes" input := readString(reader, prompt+" (yes/no)", defaultStr)
lower := strings.ToLower(input)
if lower == "yes" {
return true
} else if lower == "no" {
return false
} else {
fmt.Println("Please enter 'yes' or 'no'.")
}
}
} }
func readBoolNoDefault(reader *bufio.Reader, prompt string) bool { func readBoolNoDefault(reader *bufio.Reader, prompt string) bool {
input := readStringNoDefault(reader, prompt+" (yes/no)") for {
return strings.ToLower(input) == "yes" input := readStringNoDefault(reader, prompt+" (yes/no)")
lower := strings.ToLower(input)
if lower == "yes" {
return true
} else if lower == "no" {
return false
} else {
fmt.Println("Please enter 'yes' or 'no'.")
}
}
} }
func readInt(reader *bufio.Reader, prompt string, defaultValue int) int { func readInt(reader *bufio.Reader, prompt string, defaultValue int) int {

View File

@@ -49,6 +49,7 @@ type Config struct {
DoCrowdsecInstall bool DoCrowdsecInstall bool
EnableGeoblocking bool EnableGeoblocking bool
Secret string Secret string
IsEnterprise bool
} }
type SupportedContainer string type SupportedContainer string
@@ -339,6 +340,8 @@ func collectUserInput(reader *bufio.Reader) Config {
// Basic configuration // Basic configuration
fmt.Println("\n=== Basic Configuration ===") fmt.Println("\n=== Basic Configuration ===")
config.IsEnterprise = readBoolNoDefault(reader, "Do you want to install the Enterprise version of Pangolin? The EE is free for persoal use or for businesses making less than 100k USD annually.")
config.BaseDomain = readString(reader, "Enter your base domain (no subdomain e.g. example.com)", "") config.BaseDomain = readString(reader, "Enter your base domain (no subdomain e.g. example.com)", "")
// Set default dashboard domain after base domain is collected // Set default dashboard domain after base domain is collected