config

package
v0.0.0-...-f2a0a00 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License: GPL-3.0 Imports: 3 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 {
	// Version of the server
	Version string `mapstructure:"VERSION"`
	// Accessible server address
	CdnURL string `mapstructure:"CDN_URL"`
	// The port to run the server on
	ServerPort int `mapstructure:"SERVER_PORT"`
	// This enables extra logging, INCLUDING SENSETIVE INFORMATION like BLUESKY TOKENS. Useful for debugging with tools like insomnia. DO NOT USE ON PUBLIC SERVERS
	// Also requires all passwords start with "dev_" to work
	DeveloperMode bool `mapstructure:"DEVELOPER_MODE"`
	// Collects analytics on users.
	TrackAnalytics bool `mapstructure:"TRACK_ANALYTICS"`
	// Database type (mysql, postgres, sqlite)
	DatabaseType string `mapstructure:"DATABASE_TYPE"`
	// Database path
	DatabasePath string `mapstructure:"DATABASE_PATH"`

	UseXForwardedFor bool `mapstructure:"USE_X_FORWARDED_FOR"`

	ImgDisplayText string `mapstructure:"IMG_DISPLAY_TEXT"`
	ImgURLText     string `mapstructure:"IMG_URL_TEXT"`
	VidDisplayText string `mapstructure:"VID_DISPLAY_TEXT"`
	VidURLText     string `mapstructure:"VID_URL_TEXT"`

	GifDisplayText string `mapstructure:"GIF_DISPLAY_TEXT"`
	GifURLText     string `mapstructure:"GIF_URL_TEXT"`

	// Secret key used for JWT. Must be at least 32 bytes long. Keep this secret!
	SecretKey string `mapstructure:"SECRET_KEY"`
	// The security key but in bytes.
	SecretKeyBytes []byte
	// Min Version token version the server will accept
	MinTokenVersion int `mapstructure:"MIN_TOKEN_VERSION"`
	// Server Identifier, used for knowing what server a token belongs to.
	ServerIdentifier string `mapstructure:"SERVER_IDENTIFIER"`
	// Server URLs used for contacting the server
	ServerURLs []string `mapstructure:"SERVER_URLS"`

	//notifications
	NotificationTrustedServer        string `mapstructure:"NOTIFICATION_TRUSTED_SERVER"`
	NotificationFeedbackSecretString string `mapstructure:"NOTIFICATION_FEEDBACK_SECRET"`
	NotificationFeedbackSecret       []byte
}

func LoadConfig

func LoadConfig() (*Config, error)

Loads our config files.

Jump to

Keyboard shortcuts

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