2022-11-07 16:19:05 +08:00
|
|
|
package dto
|
|
|
|
|
2022-12-01 00:41:50 +08:00
|
|
|
import (
|
|
|
|
"github.com/1Panel-dev/1Panel/backend/app/model"
|
|
|
|
"github.com/1Panel-dev/1Panel/backend/utils/nginx/components"
|
|
|
|
)
|
|
|
|
|
|
|
|
type NginxFull struct {
|
|
|
|
Install model.AppInstall
|
2022-12-13 17:20:13 +08:00
|
|
|
Website model.Website
|
2022-12-01 00:41:50 +08:00
|
|
|
ConfigDir string
|
|
|
|
ConfigFile string
|
|
|
|
SiteDir string
|
|
|
|
Dir string
|
|
|
|
RootConfig NginxConfig
|
|
|
|
SiteConfig NginxConfig
|
|
|
|
}
|
2022-11-07 16:19:05 +08:00
|
|
|
|
|
|
|
type NginxConfig struct {
|
2022-12-13 18:54:46 +08:00
|
|
|
FilePath string
|
|
|
|
Config *components.Config
|
|
|
|
OldContent string
|
2022-11-07 16:19:05 +08:00
|
|
|
}
|
|
|
|
|
2022-12-13 18:54:46 +08:00
|
|
|
type NginxParam struct {
|
|
|
|
UpdateScope string
|
|
|
|
Name string
|
|
|
|
Params []string
|
2022-11-24 16:06:18 +08:00
|
|
|
}
|
|
|
|
|
2022-11-24 10:28:39 +08:00
|
|
|
type NginxKey string
|
2022-11-07 16:19:05 +08:00
|
|
|
|
|
|
|
const (
|
2023-04-23 18:15:38 +08:00
|
|
|
Index NginxKey = "index"
|
|
|
|
LimitConn NginxKey = "limit-conn"
|
|
|
|
SSL NginxKey = "ssl"
|
|
|
|
CACHE NginxKey = "cache"
|
|
|
|
HttpPer NginxKey = "http-per"
|
|
|
|
ProxyCache NginxKey = "proxy-cache"
|
2022-11-08 15:42:31 +08:00
|
|
|
)
|
|
|
|
|
2022-11-24 10:28:39 +08:00
|
|
|
var ScopeKeyMap = map[NginxKey][]string{
|
2022-11-08 15:42:31 +08:00
|
|
|
Index: {"index"},
|
|
|
|
LimitConn: {"limit_conn", "limit_rate", "limit_conn_zone"},
|
2022-11-16 10:31:35 +08:00
|
|
|
SSL: {"ssl_certificate", "ssl_certificate_key"},
|
2022-11-24 10:28:39 +08:00
|
|
|
HttpPer: {"server_names_hash_bucket_size", "client_header_buffer_size", "client_max_body_size", "keepalive_timeout", "gzip", "gzip_min_length", "gzip_comp_level"},
|
2022-11-08 15:42:31 +08:00
|
|
|
}
|
|
|
|
|
2022-12-01 00:41:50 +08:00
|
|
|
var StaticFileKeyMap = map[NginxKey]struct {
|
2022-11-08 15:42:31 +08:00
|
|
|
}{
|
2023-04-23 18:15:38 +08:00
|
|
|
SSL: {},
|
|
|
|
CACHE: {},
|
|
|
|
ProxyCache: {},
|
2022-11-08 15:42:31 +08:00
|
|
|
}
|