feat: logrotate cron task for docker users #255

This commit is contained in:
Jacky 2024-02-25 20:45:45 +08:00
parent b7f50f0053
commit 0fa98703cd
26 changed files with 663 additions and 119 deletions

13
settings/logrotate.go Normal file
View file

@ -0,0 +1,13 @@
package settings
type Logrotate struct {
Enabled bool `json:"enabled"`
CMD string `json:"cmd" protect:"true"`
Interval int `json:"interval"`
}
var LogrotateSettings = Logrotate{
Enabled: false,
CMD: "logrotate /etc/logrotate.d/nginx",
Interval: 1440, // 24 hours
}

View file

@ -18,10 +18,11 @@ var (
var ConfPath string
var sections = map[string]interface{}{
"server": &ServerSettings,
"nginx": &NginxSettings,
"openai": &OpenAISettings,
"casdoor": &CasdoorSettings,
"server": &ServerSettings,
"nginx": &NginxSettings,
"openai": &OpenAISettings,
"casdoor": &CasdoorSettings,
"logrotate": &LogrotateSettings,
}
func init() {