Documentation
¶
Overview ¶
Package config holds and assists in the configuration of a writefreely instance.
Index ¶
Constants ¶
View Source
const (
// FileName is the default configuration file name
FileName = "config.ini"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AppCfg ¶
type AppCfg struct {
SiteName string `ini:"site_name"`
SiteDesc string `ini:"site_description"`
Host string `ini:"host"`
// Site appearance
Theme string `ini:"theme"`
JSDisabled bool `ini:"disable_js"`
WebFonts bool `ini:"webfonts"`
// Users
SingleUser bool `ini:"single_user"`
OpenRegistration bool `ini:"open_registration"`
MinUsernameLen int `ini:"min_username_len"`
MaxBlogs int `ini:"max_blogs"`
// Federation
Federation bool `ini:"federation"`
PublicStats bool `ini:"public_stats"`
Private bool `ini:"private"`
// Additional functions
LocalTimeline bool `ini:"local_timeline"`
}
AppCfg holds values that affect how the application functions
func (AppCfg) CanCreateBlogs ¶
func (AppCfg) FriendlyHost ¶
FriendlyHost returns the app's Host sans any schema
type Config ¶
type Config struct {
Server ServerCfg `ini:"server"`
Database DatabaseCfg `ini:"database"`
App AppCfg `ini:"app"`
}
Config holds the complete configuration for running a writefreely instance
func (*Config) IsSecureStandalone ¶ added in v0.4.0
IsSecureStandalone returns whether or not the application is running as a standalone server with TLS enabled.
type DatabaseCfg ¶
type DatabaseCfg struct {
Type string `ini:"type"`
FileName string `ini:"filename"`
User string `ini:"username"`
Password string `ini:"password"`
Database string `ini:"database"`
Host string `ini:"host"`
Port int `ini:"port"`
}
DatabaseCfg holds values that determine how the application connects to a datastore
type ServerCfg ¶
type ServerCfg struct {
HiddenHost string `ini:"hidden_host"`
Port int `ini:"port"`
Bind string `ini:"bind"`
TLSCertPath string `ini:"tls_cert_path"`
TLSKeyPath string `ini:"tls_key_path"`
Dev bool `ini:"-"`
}
ServerCfg holds values that affect how the HTTP server runs
type SetupData ¶
type SetupData struct {
User *UserCreation
Config *Config
}
type UserCreation ¶
Click to show internal directories.
Click to hide internal directories.