add simple-view param and env (SIMPLE_VIEW) #474

This commit is contained in:
Umputun
2019-11-06 13:47:45 -06:00
parent 7536e265b2
commit 9269666931
3 changed files with 6 additions and 0 deletions
+1
View File
@@ -174,6 +174,7 @@ _this is the recommended way to run remark42_
| read-age | READONLY_AGE | | read-only age of comments, days |
| img-proxy | IMG_PROXY | `false` | enable http->https proxy for images |
| emoji | EMOJI | `false` | enable emoji support |
| simple-view | SIMPLE_VIEW | `false` | minimized UI with basic info only |
| port | REMARK_PORT | `8080` | web server port |
| web-root | REMARK_WEB_ROOT | `./web` | web server root directory |
| update-limit | UPDATE_LIMIT | `0.5` | updates/sec limit |
+2
View File
@@ -69,6 +69,7 @@ type ServerCommand struct {
UpdateLimit float64 `long:"update-limit" env:"UPDATE_LIMIT" default:"0.5" description:"updates/sec limit"`
RestrictedWords []string `long:"restricted-words" env:"RESTRICTED_WORDS" description:"words prohibited to use in comments" env-delim:","`
EnableEmoji bool `long:"emoji" env:"EMOJI" description:"enable emoji"`
SimpleView bool `long:"simpler-view" env:"SIMPLE_VIEW" description:"minimal comment editor mode"`
Auth struct {
TTL struct {
@@ -349,6 +350,7 @@ func (s *ServerCommand) newServerApp() (*serverApp, error) {
MaxActive: int32(s.Stream.MaxActive),
},
EmojiEnabled: s.EnableEmoji,
SimpleView: s.SimpleView,
}
srv.ScoreThresholds.Low, srv.ScoreThresholds.Critical = s.LowScore, s.CriticalScore
+3
View File
@@ -56,6 +56,7 @@ type Rest struct {
}
UpdateLimiter float64
EmojiEnabled bool
SimpleView bool
SSLConfig SSLConfig
httpsServer *http.Server
@@ -395,6 +396,7 @@ func (s *Rest) configCtrl(w http.ResponseWriter, r *http.Request) {
ReadOnlyAge int `json:"readonly_age"`
MaxImageSize int `json:"max_image_size"`
EmojiEnabled bool `json:"emoji_enabled"`
SimpleView bool `json:"simple_view"`
}{
Version: s.Version,
EditDuration: int(s.DataService.EditDuration.Seconds()),
@@ -407,6 +409,7 @@ func (s *Rest) configCtrl(w http.ResponseWriter, r *http.Request) {
ReadOnlyAge: s.ReadOnlyAge,
MaxImageSize: s.ImageService.Store.SizeLimit(),
EmojiEnabled: s.EmojiEnabled,
SimpleView: s.SimpleView,
}
cnf.Auth = []string{}