mirror of
https://github.com/fosrl/pangolin.git
synced 2026-01-28 22:00:51 +00:00
Merge branch 'dev' of https://github.com/fosrl/pangolin into dev
This commit is contained in:
@@ -2,11 +2,13 @@
|
||||
all: build
|
||||
|
||||
build:
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o installer
|
||||
CGO_ENABLED=0 go build -o bin/installer
|
||||
|
||||
build-release:
|
||||
release:
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/installer_linux_amd64
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o bin/installer_linux_arm64
|
||||
|
||||
clean:
|
||||
rm installer
|
||||
rm bin/installer
|
||||
rm bin/installer_linux_amd64
|
||||
rm bin/installer_linux_arm64
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -23,8 +23,9 @@ gerbil:
|
||||
start_port: 51820
|
||||
base_endpoint: {{.Domain}}
|
||||
use_subdomain: false
|
||||
block_size: 16
|
||||
subnet_group: 10.0.0.0/8
|
||||
block_size: 24
|
||||
site_block_size: 30
|
||||
subnet_group: 100.89.137.0/20
|
||||
|
||||
rate_limits:
|
||||
global:
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user