cfg

package
v0.0.0-...-1c7d376 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Config = &Configuration{}

Config holds the global configuration loaded from environment variables.

Functions

func LoadConfiguration

func LoadConfiguration(config *Configuration)

LoadConfiguration populates the Config struct with values from environment variables.

Types

type Configuration

type Configuration struct {
	// General application settings
	Debug bool   `env:"DEBUG"` // Debug mode toggle
	Port  string `env:"PORT"`  // Application port

	// URLs for various services
	Domain    string `env:"DOMAIN"`     // Domain of the application
	APIURL    string `env:"API_URL"`    // API endpoint URL
	PublicURL string `env:"PUBLIC_URL"` // Public facing URL

	// Pterodactyl game server panel URLs and API keys
	PterodactylURL          string `env:"PTERODACTYL_URL"`
	PterodactylAdminAPIKey  string `env:"PTERODACTYL_ADMIN_API_KEY"`
	PterodactylClientAPIKey string `env:"PTERODACTYL_CLIENT_API_KEY"`

	// Database connection details
	DBHost     string `env:"DB_HOST"`     // Database host
	DBPort     string `env:"DB_PORT"`     // Database port
	DBUsername string `env:"DB_USERNAME"` // Database username
	DBPassword string `env:"DB_PASSWORD"` // Database password
	DBName     string `env:"DB_DATABASE"` // Database name

	// Mail server configurations, required if not in debug mode
	MailHost     string `env:"MAIL_HOST"`          // Mail server host
	MailPort     string `env:"MAIL_PORT"`          // Mail server port
	MailSecure   bool   `env:"MAIL_SECURE"`        // Use secure connection
	MailUsername string `env:"MAIL_AUTH_USERNAME"` // Mail server authentication username
	MailPassword string `env:"MAIL_AUTH_PASSWORD"` // Mail server authentication password
	MailSender   string `env:"MAIL_SENDER"`        // Email sender address
	MailReply    string `env:"MAIL_REPLY"`         // Email reply-to address

	// reCAPTCHA keys
	CaptchaPublic string `env:"CAPTCHA_PUBLIC"` // Public key for reCAPTCHA
	CaptchaSecret string `env:"CAPTCHA_SECRET"` // Secret key for reCAPTCHA

	// OAuth's providers' credentials
	GoogleClient string `env:"GOOGLE_CLIENT_ID"`     // Google OAuth Client ID
	GoogleSecret string `env:"GOOGLE_CLIENT_SECRET"` // Google OAuth Secret

	DiscordClient  string `env:"DISCORD_CLIENT_ID"`     // Discord OAuth Client ID
	DiscordSecret  string `env:"DISCORD_CLIENT_SECRET"` // Discord OAuth Secret
	DiscordWebhook string `env:"DISCORD_WEBHOOK_URL"`   // Discord webhook URL

	// Sentry error reporting DSN
	SentryDSN string `env:"SENTRY_DSN"` // Data Source Name for Sentry

	// imgproxy
	ImgproxyURL  string `env:"IMGPROXY_URL"`  // imgproxy url
	ImgproxyKey  string `env:"IMGPROXY_KEY"`  // imgproxy key
	ImgproxySalt string `env:"IMGPROXY_SALT"` // imgproxy salt

	// R2 Cloudflare Storage
	R2BucketName      string `env:"R2_BUCKET_NAME"`
	R2AccountID       string `env:"R2_ACCOUNT_ID"`
	R2AccessKeyID     string `env:"R2_ACCESS_KEY_ID"`
	R2AccessKeySecret string `env:"R2_ACCESS_KEY_SECRET"`
}

Configuration struct to hold all environment variables.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL