Files
enwikuna 4d0dcb92b6 Add support for custom Nginx maintenance templates (NGINX_UI_NGINX_MAINTENANCE_TEMPLATE / Settings > Nginx) (#1416)
* Add MaintenanceTemplate field to Nginx settings

* Add optional maintenance_template to NginxSettings

* Implement custom maintenance template handling

Add support for custom maintenance HTML template.

* Add maintenance template path input to Nginx settings

* Update maintenance template input in NginxSettings

* Refactor maintenance template file handling

* Add filepath import to maintenance.go

* Update placeholder for maintenance template input
2026-05-13 08:39:48 +08:00

31 lines
1.2 KiB
Go

package settings
type Nginx struct {
AccessLogPath string `json:"access_log_path" protected:"true"`
ErrorLogPath string `json:"error_log_path" protected:"true"`
LogDirWhiteList []string `json:"log_dir_white_list" protected:"true"`
ConfigDir string `json:"config_dir" protected:"true"`
ConfigPath string `json:"config_path" protected:"true"`
PIDPath string `json:"pid_path" protected:"true"`
SbinPath string `json:"sbin_path" protected:"true"`
TestConfigCmd string `json:"test_config_cmd" protected:"true"`
ReloadCmd string `json:"reload_cmd" protected:"true"`
RestartCmd string `json:"restart_cmd" protected:"true"`
StubStatusPort uint `json:"stub_status_port" binding:"omitempty,min=1,max=65535"`
ContainerName string `json:"container_name" protected:"true"`
MaintenanceTemplate string `json:"maintenance_template"`
}
var NginxSettings = &Nginx{}
func (n *Nginx) GetStubStatusPort() uint {
if n.StubStatusPort == 0 {
return 51820
}
return n.StubStatusPort
}
func (n *Nginx) RunningInAnotherContainer() bool {
return n.ContainerName != ""
}