config

package
v0.0.0-...-db3ccfa Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: AGPL-3.0 Imports: 4 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 {
	IsDevelopment bool `yaml:"isDevelopment"`

	Addr string `yaml:"addr"`

	SiteName        string `yaml:"siteName"`
	SiteDescription string `yaml:"siteDescription"` // Used for meta tags.

	// Primary DB credentials.
	DBAddr     string `yaml:"dbAddr"`
	DBUser     string `yaml:"dbUser"`
	DBPassword string `yaml:"dbPassword"`
	DBName     string `yaml:"dbName"`

	SessionCookieName string `yaml:"sessionCookieName"`

	RedisAddress string `yaml:"redisAddress"`

	HMACSecret string `yaml:"hmacSecret"`

	CSRFOff bool `yaml:"csrfOff"`

	NoLogToFile bool `yaml:"noLogToFile"`

	PaginationLimit    int           `yaml:"paginationLimit"`
	PaginationLimitMax int           `yaml:"paginationLimitMax"`
	DefaultFeedSort    core.FeedSort `yaml:"defaultFeedSort"`

	// Captcha verification is skipped if empty.
	CaptchaSecret string `yaml:"captchaSecret"`

	CertFile string `yaml:"certFile"`
	KeyFile  string `yaml:"keyFile"`

	DisableRateLimits bool `yaml:"disableRateLimits"`
	MaxImageSize      int  `yaml:"maxImageSize"`

	// If API requests have a URL query parameter of the form 'adminKey=value',
	// where value is AdminApiKey, rate limits are disabled.
	AdminApiKey string `yaml:"adminAPIKey"`

	DisableImagePosts bool `yaml:"disableImagePosts"`

	DisableForumCreation   bool `yaml:"disableForumCreation"`   // If true, only admins can create communities.
	ForumCreationReqPoints int  `yaml:"forumCreationReqPoints"` // Minimum points required for non-admins to create community, Required non-empty config field.
	MaxForumsPerUser       int  `yaml:"maxForumsPerUser"`       // Max forums one user can moderate, Required non-empty config field.

	// The location where images are saved on disk.
	ImagesFolderPath string `yaml:"imagesFolderPath"`
}

Config holds all site-wide configuration.

func Parse

func Parse(path string) (*Config, error)

Parse parses the yaml file at path and returns a Config.

Jump to

Keyboard shortcuts

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