Documentation
¶
Index ¶
- Constants
- func AskApacheUseTLS() bool
- func AskDomain() string
- func AskEnvFile() string
- func AskEnvironmentVariables() map[string]string
- func AskGenerateCerts() bool
- func AskNumberOfRoutes() int
- func AskNumberOfServices() int
- func AskPorts() []string
- func AskTLS(domain, defaultCertPath string) (bool, string)
- func AskVolumes() []string
- func GenerateApacheConfig()
- func GenerateCaddyConfig()
- func GenerateCerts(domain, outDir string) error
- func GenerateDockerCompose()
- func GenerateNginxConfig()
- func GenerateWireGuardConfig(mode string)
- func HandleApache(command string)
- func HandleCaddy(command string)
- func HandleDocker(command string)
- func HandleNginx(command string)
- func HandleWireGuard(args []string)
- func NormalizeOutputPath(filename string) (string, error)
- func PrintApacheHelp()
- func PrintCaddyHelp()
- func PrintDockerHelp()
- func PrintNginxHelp()
- func PrintWireGuardHelp()
- func WriteApacheConfig(config Apache, filename string) error
- func WriteCaddyConfig(config CaddyfileConfig, filename string) error
- func WriteDockerCompose(config DockerComposeConfig, filename string) error
- func WriteNginxConfig(config NginxConfig, filename string) error
- func WriteWireGuardConfig(config WireGuardConfig) error
- type Apache
- type ApacheRoute
- type CaddyRoute
- type CaddyfileConfig
- type DockerComposeConfig
- type DockerService
- type NginxConfig
- type Route
- type WireGuardConfig
- type WireGuardPeer
Constants ¶
const WireguardTemplate = `` /* 418-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func AskApacheUseTLS ¶ added in v1.4.0
func AskApacheUseTLS() bool
func AskEnvironmentVariables ¶
AskEnvironmentVariables asks for environment variables
func AskGenerateCerts ¶ added in v1.2.0
func AskGenerateCerts() bool
AskGenerateCerts asks if we should generate certs with mkcert (shared)
func AskNumberOfRoutes ¶
func AskNumberOfRoutes() int
AskNumberOfRoutes asks how many routes to configure (shared)
func AskNumberOfServices ¶
func AskNumberOfServices() int
AskNumberOfServices asks how many services to configure
func AskTLS ¶ added in v1.3.0
AskTLS asks if using TLS and optionally where certs live. Returns (useTLS, certPath). Pass a sensible defaultCertPath (without suffix) like "/etc/nginx/certs/example.com".
func GenerateApacheConfig ¶ added in v1.4.0
func GenerateApacheConfig()
GenerateApacheConfig manages the entire Apache interactive flow
func GenerateCaddyConfig ¶ added in v1.3.0
func GenerateCaddyConfig()
GenerateCaddyConfig manages the interactive flow
func GenerateCerts ¶ added in v1.2.0
GenerateCerts runs mkcert to produce cert and key for domain into outDir (shared)
func GenerateDockerCompose ¶
func GenerateDockerCompose()
GenerateDockerCompose manages the entire Docker Compose interactive flow
func GenerateNginxConfig ¶
func GenerateNginxConfig()
GenerateNginxConfig manages the entire Nginx interactive flow
func GenerateWireGuardConfig ¶ added in v1.1.0
func GenerateWireGuardConfig(mode string)
func HandleApache ¶ added in v1.4.0
func HandleApache(command string)
func HandleCaddy ¶ added in v1.3.0
func HandleCaddy(command string)
HandleCaddy manages caddy commands
func HandleWireGuard ¶ added in v1.1.0
func HandleWireGuard(args []string)
HandleWireGuard manages all WireGuard commands
func NormalizeOutputPath ¶
NormalizeOutputPath normalizes an output filename provided by the user. - treats leading "/build/" as the repo-local "./build/" directory - expands leading ~ to the user's home directory - ensures parent directories exist
func PrintApacheHelp ¶ added in v1.4.0
func PrintApacheHelp()
func PrintWireGuardHelp ¶ added in v1.1.0
func PrintWireGuardHelp()
PrintWireGuardHelp shows help for WireGuard
func WriteApacheConfig ¶ added in v1.4.0
func WriteCaddyConfig ¶ added in v1.3.0
func WriteCaddyConfig(config CaddyfileConfig, filename string) error
WriteCaddyConfig writes the Caddyfile to a file
func WriteDockerCompose ¶
func WriteDockerCompose(config DockerComposeConfig, filename string) error
WriteDockerCompose writes the docker-compose configuration to a file
func WriteNginxConfig ¶
func WriteNginxConfig(config NginxConfig, filename string) error
WriteNginxConfig writes the configuration to a file
func WriteWireGuardConfig ¶ added in v1.1.0
func WriteWireGuardConfig(config WireGuardConfig) error
Types ¶
type Apache ¶ added in v1.4.0
type Apache struct {
Domain string
UseTLS bool
CertPath string
Routes []ApacheRoute
}
type ApacheRoute ¶ added in v1.4.0
func AskRouteApache ¶ added in v1.4.0
func AskRouteApache(routeNumber int) ApacheRoute
type CaddyRoute ¶ added in v1.3.0
type CaddyRoute struct {
Path string // "/" or "/api/*"
Type string // "proxy" or "static"
Proxy string // "localhost:3000"
Directory string // "/var/www/html"
Headers bool // Add standard headers
}
CaddyRoute represents a path in Caddy
func AskRouteCaddy ¶ added in v1.3.0
func AskRouteCaddy(routeNumber int) CaddyRoute
AskRouteCaddy asks for details of a single route
type CaddyfileConfig ¶ added in v1.3.0
type CaddyfileConfig struct {
Domain string
UseTLS bool
CertPath string
Routes []CaddyRoute
}
CaddyConfig is the complete Caddy configuration
type DockerComposeConfig ¶
type DockerComposeConfig struct {
Version string
Services []DockerService
}
DockerComposeConfig is the complete docker-compose configuration
type DockerService ¶
type DockerService struct {
Name string // "web", "db", "redis"
Image string // "nginx:latest", "postgres:15"
Ports []string // ["8080:80", "5432:5432"]
Volumes []string // ["/data:/var/lib/postgresql/data"]
Environment map[string]string // {"POSTGRES_PASSWORD": "secret"}
EnvFile string // ".env.db" or ".env"
}
DockerService represents a single Docker service
func AskService ¶
func AskService(serviceNumber int) DockerService
AskService asks for details of a single Docker service
type NginxConfig ¶
type NginxConfig struct {
Domain string
UseHTTPS bool
Routes []Route
// CertPath is the path (on the nginx host) without suffix; template will append .crt/.key
CertPath string
}
NginxConfig is the complete Nginx configuration
type Route ¶
type Route struct {
Path string // "/" or "/api"
Type string // "proxy" or "static"
Proxy string // "localhost:3000"
Directory string // "/var/www/html"
Headers bool // Add standard headers
WebSocket bool // Support WebSockets (for proxy)
}
Route represents a path in Nginx