New creates a new Config with sane defaults
()
| 200 | |
| 201 | // New creates a new Config with sane defaults |
| 202 | func New() *Config { |
| 203 | c := &Config{ |
| 204 | Server: ServerCfg{ |
| 205 | Port: 8080, |
| 206 | Bind: "localhost", /* IPV6 support when not using localhost? */ |
| 207 | }, |
| 208 | App: AppCfg{ |
| 209 | Host: "http://localhost:8080", |
| 210 | Theme: "write", |
| 211 | WebFonts: true, |
| 212 | SingleUser: true, |
| 213 | MinUsernameLen: 3, |
| 214 | MaxBlogs: 1, |
| 215 | Federation: true, |
| 216 | PublicStats: true, |
| 217 | }, |
| 218 | } |
| 219 | c.UseMySQL(true) |
| 220 | return c |
| 221 | } |
| 222 | |
| 223 | // UseMySQL resets the Config's Database to use default values for a MySQL setup. |
| 224 | func (cfg *Config) UseMySQL(fresh bool) { |