yatwiki/ServerOptions.go

48 lines
1.2 KiB
Go
Raw Normal View History

2017-07-12 06:43:11 +00:00
package yatwiki
2017-07-08 23:13:36 +00:00
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
2017-08-13 05:32:54 +00:00
TrustXForwardedFor bool // Introduced in 3.0.1 - default false
2017-07-08 23:13:36 +00:00
RecentChanges int
2017-07-11 07:08:22 +00:00
RecentChangesRSS int
2017-07-08 23:13:36 +00:00
GzipCompressionLevel int
BannedUserIPRegexes []string
2017-07-11 07:08:22 +00:00
ExternalBaseURL string
DeclareRSSLanguage string
DeclareRSSEmail string
2017-10-08 04:08:26 +00:00
ContentedServer string
2017-07-08 23:13:36 +00:00
}
func DefaultOptions() *ServerOptions {
return &ServerOptions{
PageTitle: "YATWiki",
ExpectBaseURL: "/",
DefaultPage: "home",
Timezone: "UTC",
2017-07-09 05:20:21 +00:00
DateFormat: time.RFC3339,
2017-07-08 23:13:36 +00:00
DBFilePath: "wiki.db",
2017-07-09 00:14:28 +00:00
FaviconFilePath: "", // no favicon
2017-07-08 23:13:36 +00:00
AllowDBDownload: true,
2017-08-13 05:32:54 +00:00
TrustXForwardedFor: false,
2017-07-08 23:13:36 +00:00
RecentChanges: 20,
2017-07-11 07:08:22 +00:00
RecentChangesRSS: 10,
2017-07-08 23:13:36 +00:00
GzipCompressionLevel: 9,
BannedUserIPRegexes: make([]string, 0),
ExternalBaseURL: "http://127.0.0.1/",
2017-07-11 07:08:22 +00:00
DeclareRSSLanguage: "en-GB",
DeclareRSSEmail: `nobody@example.com`,
2017-10-08 04:08:26 +00:00
ContentedServer: "",
2017-07-08 23:13:36 +00:00
}
}