add crowdsec warning to installer

This commit is contained in:
miloschwartz 2025-03-19 21:16:53 -04:00
parent af68aa692c
commit 1c2ba4076a
No known key found for this signature in database

View file

@ -2,19 +2,19 @@ package main
import ( import (
"bufio" "bufio"
"bytes"
"embed" "embed"
"fmt" "fmt"
"io" "io"
"io/fs" "io/fs"
"os" "os"
"time"
"os/exec" "os/exec"
"path/filepath" "path/filepath"
"runtime" "runtime"
"strings" "strings"
"syscall" "syscall"
"bytes"
"text/template" "text/template"
"time"
"unicode" "unicode"
"golang.org/x/term" "golang.org/x/term"
@ -95,10 +95,11 @@ func main() {
} }
if !checkIsCrowdsecInstalledInCompose() { if !checkIsCrowdsecInstalledInCompose() {
fmt.Println("\n=== Crowdsec Install ===") fmt.Println("\n=== CrowdSec Install ===")
// check if crowdsec is installed // check if crowdsec is installed
if readBool(reader, "Would you like to install Crowdsec?", true) { if readBool(reader, "Would you like to install CrowdSec?", false) {
fmt.Println("This installer constitutes a minimal viable CrowdSec deployment. CrowdSec will add extra complexity to your Pangolin installation and may not work to the best of its abilities out of the box. Users are expected to implement configuration adjustments on their own to achieve the best security posture. Consult the CrowdSec documentation for detailed configuration instructions.")
if readBool(reader, "Are you willing to manage CrowdSec?", true) {
if config.DashboardDomain == "" { if config.DashboardDomain == "" {
traefikConfig, err := ReadTraefikConfig("config/traefik/traefik_config.yml", "config/traefik/dynamic_config.yml") traefikConfig, err := ReadTraefikConfig("config/traefik/traefik_config.yml", "config/traefik/dynamic_config.yml")
if err != nil { if err != nil {
@ -124,6 +125,7 @@ func main() {
installCrowdsec(config) installCrowdsec(config)
} }
} }
}
fmt.Println("Installation complete!") fmt.Println("Installation complete!")
} }
@ -376,7 +378,6 @@ func createConfigFiles(config Config) error {
return nil return nil
} }
func installDocker() error { func installDocker() error {
// Detect Linux distribution // Detect Linux distribution
cmd := exec.Command("cat", "/etc/os-release") cmd := exec.Command("cat", "/etc/os-release")