2017-07-08 23:13:36 +00:00
|
|
|
package yatwiki3
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
type ServerOptions struct {
|
|
|
|
PageTitle string
|
|
|
|
ExpectBaseURL string
|
|
|
|
DefaultPage string
|
|
|
|
Timezone string
|
|
|
|
DateFormat string
|
|
|
|
DBFilePath string
|
2017-07-09 00:14:28 +00:00
|
|
|
FaviconFilePath string
|
2017-07-08 23:13:36 +00:00
|
|
|
AllowDBDownload bool
|
|
|
|
RecentChanges int
|
|
|
|
GzipCompressionLevel int
|
2017-07-09 00:15:30 +00:00
|
|
|
BannedUserIPRegexes []string
|
2017-07-08 23:13:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func DefaultOptions() *ServerOptions {
|
|
|
|
return &ServerOptions{
|
|
|
|
PageTitle: "YATWiki",
|
|
|
|
ExpectBaseURL: "/",
|
|
|
|
DefaultPage: "home",
|
|
|
|
Timezone: "UTC",
|
|
|
|
DateFormat: time.RFC822Z,
|
|
|
|
DBFilePath: "wiki.db",
|
2017-07-09 00:14:28 +00:00
|
|
|
FaviconFilePath: "", // no favicon
|
2017-07-08 23:13:36 +00:00
|
|
|
AllowDBDownload: true,
|
|
|
|
RecentChanges: 20,
|
|
|
|
GzipCompressionLevel: 9,
|
2017-07-09 00:15:30 +00:00
|
|
|
BannedUserIPRegexes: make([]string, 0),
|
2017-07-08 23:13:36 +00:00
|
|
|
}
|
|
|
|
}
|