mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-10 18:05:48 +02:00
feat: logrotate cron task for docker users #255
This commit is contained in:
parent
b7f50f0053
commit
0fa98703cd
26 changed files with 663 additions and 119 deletions
13
settings/logrotate.go
Normal file
13
settings/logrotate.go
Normal 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
|
||||
}
|
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue