Fix installer

This commit is contained in:
Owen
2026-06-04 11:21:40 -07:00
parent 01361884eb
commit 2d78a4b628
4 changed files with 31 additions and 45 deletions

View File

@@ -38,7 +38,5 @@ flags:
disable_user_create_org: false disable_user_create_org: false
allow_raw_resources: true allow_raw_resources: true
{{if .IsPostgreSQL}} {{if .IsPostgreSQL}}postgres:
postgres: connection_string: postgresql://pangolin:{{.IsPostgreSQLPass}}@postgres:5432/pangolin{{end}}
connection_string: postgresql://pangolin:{{.IsPostgreSQLPass}}@postgres:5432/pangolin
{{end}}

View File

@@ -7,23 +7,17 @@ services:
deploy: deploy:
resources: resources:
limits: limits:
memory: 1g memory: 2g
reservations: reservations:
memory: 256m memory: 512m
{{if or .IsPostgreSQL .IsRedis}} {{if or .IsPostgreSQL .IsRedis}}depends_on:
depends_on: {{if .IsPostgreSQL}}postgres:
{{if .IsPostgreSQL}} condition: service_healthy{{end}}
postgres: {{if .IsRedis}}redis:
condition: service_healthy condition: service_healthy{{end}}
{{end}}
{{if .IsRedis}}
redis:
condition: service_healthy
{{end}}
networks: networks:
- default - default
- backend - backend{{end}}
{{end}}
volumes: volumes:
- ./config:/app/config - ./config:/app/config
healthcheck: healthcheck:
@@ -31,8 +25,8 @@ services:
interval: "10s" interval: "10s"
timeout: "10s" timeout: "10s"
retries: 15 retries: 15
{{if .InstallGerbil}}
gerbil: {{if .InstallGerbil}}gerbil:
image: docker.io/fosrl/gerbil:{{.GerbilVersion}} image: docker.io/fosrl/gerbil:{{.GerbilVersion}}
container_name: gerbil container_name: gerbil
restart: unless-stopped restart: unless-stopped
@@ -53,17 +47,16 @@ services:
- 21820:21820/udp - 21820:21820/udp
- 443:443 - 443:443
- 443:443/udp # For http3 QUIC if desired - 443:443/udp # For http3 QUIC if desired
- 80:80 - 80:80{{end}}
{{end}}
traefik: traefik:
image: docker.io/traefik:v3.6 image: docker.io/traefik:v3.6
container_name: traefik container_name: traefik
restart: unless-stopped restart: unless-stopped
{{if .InstallGerbil}} network_mode: service:gerbil # Ports appear on the gerbil service{{end}}{{if not .InstallGerbil}} {{if .InstallGerbil}}network_mode: service:gerbil # Ports appear on the gerbil service{{end}}{{if not .InstallGerbil}}
ports: ports:
- 443:443 - 443:443
- 80:80 - 80:80{{end}}
{{end}}
depends_on: depends_on:
pangolin: pangolin:
condition: service_healthy condition: service_healthy
@@ -74,8 +67,7 @@ services:
- ./config/letsencrypt:/letsencrypt # Volume to store the Let's Encrypt certificates - ./config/letsencrypt:/letsencrypt # Volume to store the Let's Encrypt certificates
- ./config/traefik/logs:/var/log/traefik # Volume to store Traefik logs - ./config/traefik/logs:/var/log/traefik # Volume to store Traefik logs
{{if .IsPostgreSQL}} {{if .IsPostgreSQL}}postgres:
postgres:
image: postgres:18 image: postgres:18
container_name: postgres container_name: postgres
restart: unless-stopped restart: unless-stopped
@@ -91,11 +83,9 @@ services:
timeout: 5s timeout: 5s
retries: 5 retries: 5
networks: networks:
- backend - backend{{end}}
{{end}}
{{if .IsRedis}} {{if .IsRedis}}redis:
redis:
image: redis:8-trixie image: redis:8-trixie
container_name: redis container_name: redis
restart: unless-stopped restart: unless-stopped
@@ -113,17 +103,14 @@ services:
retries: 3 retries: 3
start_period: 10s start_period: 10s
networks: networks:
- backend - backend{{end}}
{{end}}
networks: networks:
default: default:
driver: bridge driver: bridge
name: pangolin_frontend name: pangolin_frontend
{{if .EnableIPv6}} enable_ipv6: true{{end}} {{if .EnableIPv6}} enable_ipv6: true{{end}}
{{if or .IsPostgreSQL .IsRedis}} {{if or .IsPostgreSQL .IsRedis}} backend:
backend:
driver: bridge driver: bridge
name: pangolin_backend name: pangolin_backend
internal: true internal: true{{end}}
{{end}}

View File

@@ -1,6 +1,4 @@
{{if .IsRedis}} {{if .IsRedis}}redis:
redis:
host: "redis" host: "redis"
port: 6379 port: 6379
password: "{{.IsRedisPass}}" password: "{{.IsRedisPass}}"{{end}}
{{end}}

View File

@@ -71,9 +71,12 @@ const (
Undefined SupportedContainer = "undefined" Undefined SupportedContainer = "undefined"
) )
var redisFlag *bool
func main() { func main() {
crowdsecFlag := flag.Bool("crowdsec", false, "Enable the CrowdSec installation prompt") crowdsecFlag := flag.Bool("crowdsec", false, "Enable the CrowdSec installation prompt")
redisFlag = flag.Bool("redis", false, "Install Redis as cacheing solution. Required for HA. Not required for the Enterprise version.")
flag.Parse() flag.Parse()
// print a banner about prerequisites - opening port 80, 443, 51820, and 21820 on the VPS and firewall and pointing your domain to the VPS IP with a records. Docs are at http://localhost:3000/Getting%20Started/dns-networking // print a banner about prerequisites - opening port 80, 443, 51820, and 21820 on the VPS and firewall and pointing your domain to the VPS IP with a records. Docs are at http://localhost:3000/Getting%20Started/dns-networking
@@ -491,13 +494,13 @@ func collectUserInput() Config {
config.IsEnterprise = readBoolNoDefault("Do you want to install the Enterprise version of Pangolin? The EE is free for personal use or for businesses making less than 100k USD annually.") config.IsEnterprise = readBoolNoDefault("Do you want to install the Enterprise version of Pangolin? The EE is free for personal use or for businesses making less than 100k USD annually.")
if config.IsEnterprise { if config.IsEnterprise {
config.IsRedis = readBool("Do you want to run the Redis containers locally? Required for HA.") if *redisFlag {
if config.IsRedis { config.IsRedis = true
config.IsRedisPass = readPassword("Enter a unique password for the Redis service.") config.IsRedisPass = readPassword("Enter a unique password for the Redis service.")
} }
} }
config.IsPostgreSQL = readBool("Do you want to run the PostgreSQL containers locally? Otherwise, default to the local SQLite database only.", false) config.IsPostgreSQL = readBool("Do you want to use PostgreSQL (not recommended for most users)?", false)
if config.IsPostgreSQL { if config.IsPostgreSQL {
config.IsPostgreSQLPass = readPassword("Enter a unique password for the PostgreSQL pangolin user.") config.IsPostgreSQLPass = readPassword("Enter a unique password for the PostgreSQL pangolin user.")
} }
@@ -544,7 +547,7 @@ func collectUserInput() Config {
fmt.Println("\n=== Advanced Configuration ===") fmt.Println("\n=== Advanced Configuration ===")
config.EnableIPv6 = readBool("Is your server IPv6 capable?", true) config.EnableIPv6 = readBool("Is your server IPv6 capable?", true)
config.EnableMaxMind = readBool("Do you want to download the MaxMind GeoLite2 Country and ADN databases for blocking functionality?", true) config.EnableMaxMind = readBool("Do you want to download the MaxMind GeoLite2 Country and ASN databases for blocking functionality?", true)
if config.DashboardDomain == "" { if config.DashboardDomain == "" {
fmt.Println("Error: Dashboard Domain name is required") fmt.Println("Error: Dashboard Domain name is required")