config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Port        string
	Environment string
	BaseURL     string

	DatabaseURL string

	JWTSecret         string
	LicenseSigningKey string

	GitHubClientID     string
	GitHubClientSecret string
	GoogleClientID     string
	GoogleClientSecret string

	StripeSecretKey     string
	StripeWebhookSecret string

	PayPalClientID     string
	PayPalClientSecret string
	PayPalWebhookID    string
	PayPalSandbox      bool

	WebhookMaxAttempts    int
	WebhookRetryInterval  string
	WebhookHTTPTimeout    string
	QuotaWarningThreshold float64

	SMTPHost     string
	SMTPPort     string
	SMTPUsername string
	SMTPPassword string
	SMTPFrom     string

	RedisURL string

	RateLimitAPI   int
	RateLimitAdmin int

	AdminEmails []string
}

func Load

func Load() (*Config, error)

func (*Config) IsAdminEmail

func (c *Config) IsAdminEmail(email string) bool

IsAdminEmail checks if an email is in the ADMIN_EMAILS list. Used for backward compatibility and initial setup bootstrap. In normal operation, admin status is determined by the user's role in the database.

func (*Config) IsDevLoginAllowed

func (c *Config) IsDevLoginAllowed() bool

func (*Config) IsProduction

func (c *Config) IsProduction() bool

func (*Config) ValidateSecurityDefaults

func (c *Config) ValidateSecurityDefaults() (warnings []string, fatal []string)

ValidateSecurityDefaults checks for common misconfigurations that could lead to security vulnerabilities in production deployments. Returns a list of warnings (non-fatal) and errors (fatal).

Jump to

Keyboard shortcuts

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