Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddressValid ¶
AddressValid reports whether addr is of the form "host:port". If host is missing, it might return true, but if ":port" is missing it will return false.
Types ¶
type Config ¶
type Config struct { IsDevelopment bool `yaml:"isDevelopment"` Addr string `yaml:"addr"` UIProxy string `yaml:"uiProxy"` 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"` MaxImagesPerPost int `yaml:"maxImagesPerPost"` // For the front-end: CaptchaSiteKey string `yaml:"captchaSiteKey"` EmailContact string `yaml:"emailContact"` FacebookURL string `yaml:"facebookURL"` TwitterURL string `yaml:"twitterURL"` InstagramURL string `yaml:"instagramURL"` DiscordURL string `yaml:"discordURL"` GithubURL string `yaml:"githubURL"` SubstackURL string `yaml:"substackURL"` }
Config holds all site-wide configuration.
Click to show internal directories.
Click to hide internal directories.