mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-11-28 16:46:56 +08:00
* feat(website): add custom HTTPS redirect port option Allow HTTP-to-HTTPS redirects to omit the local HTTPS port for Cloudflare or other reverse-proxy deployments terminating at 443. Apply the setting to existing websites and update HTTPS settings labels. (cherry picked from commit27c1468405) * feat(website): configure HTTPS redirect port per site Add a per-site HTTPS redirect port policy next to the HTTP-to-HTTPS option. Sites can inherit the global setting, use the Nginx HTTPS port, or force standard port 443, defaulting existing sites to inheritance. This supports reverse-proxied sites that need 443 and directly exposed sites that need 8443 on the same host. Global changes now update only inheriting sites, so adjusting one website does not rewrite other sites' redirect rules. Hide the global custom-port switch when Nginx uses standard port 443. (cherry picked from commit301dc15d9d) * Revert "feat(website): configure HTTPS redirect port per site" This reverts commit83d94f6cf9. The per-site database strategy will be replaced by a config-driven design. * feat(website): make HTTPS redirect port config-driven Read the site redirect port from managed nginx rules instead of storing per-site policy in the database. Only update rules matching the old global port, preserve manual configurations, and avoid rewriting sites when the global redirect setting is unchanged. --------- Co-authored-by: BOX <no@mail.com>
143 lines
4.4 KiB
Go
143 lines
4.4 KiB
Go
package response
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/1Panel-dev/1Panel/agent/app/dto"
|
|
"github.com/1Panel-dev/1Panel/agent/app/model"
|
|
)
|
|
|
|
type WebsiteDTO struct {
|
|
model.Website
|
|
ErrorLogPath string `json:"errorLogPath"`
|
|
AccessLogPath string `json:"accessLogPath"`
|
|
SitePath string `json:"sitePath"`
|
|
AppName string `json:"appName"`
|
|
RuntimeName string `json:"runtimeName"`
|
|
RuntimeType string `json:"runtimeType"`
|
|
SiteDir string `json:"siteDir"`
|
|
OpenBaseDir bool `json:"openBaseDir"`
|
|
Algorithm string `json:"algorithm"`
|
|
UDP bool `json:"udp"`
|
|
|
|
Servers []dto.NginxUpstreamServer `json:"servers"`
|
|
}
|
|
|
|
type WebsiteRes struct {
|
|
SSLDomainMismatch bool `json:"sslDomainMismatch"`
|
|
ID uint `json:"id"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
Protocol string `json:"protocol"`
|
|
PrimaryDomain string `json:"primaryDomain"`
|
|
Type string `json:"type"`
|
|
Alias string `json:"alias"`
|
|
Remark string `json:"remark"`
|
|
Status string `json:"status"`
|
|
ExpireDate time.Time `json:"expireDate"`
|
|
SitePath string `json:"sitePath"`
|
|
AppName string `json:"appName"`
|
|
RuntimeName string `json:"runtimeName"`
|
|
SSLExpireDate time.Time `json:"sslExpireDate"`
|
|
SSLStatus string `json:"sslStatus"`
|
|
AppInstallID uint `json:"appInstallId"`
|
|
ChildSites []string `json:"childSites"`
|
|
ParentSite string `json:"parentSite"`
|
|
RuntimeType string `json:"runtimeType"`
|
|
Favorite bool `json:"favorite"`
|
|
IPV6 bool `json:"IPV6"`
|
|
}
|
|
|
|
type WebsiteOption struct {
|
|
WebsiteGroupID uint `json:"webSiteGroupId"`
|
|
ID uint `json:"id"`
|
|
PrimaryDomain string `json:"primaryDomain"`
|
|
Alias string `json:"alias"`
|
|
}
|
|
|
|
type WebsitePreInstallCheck struct {
|
|
Name string `json:"name"`
|
|
Status string `json:"status"`
|
|
Version string `json:"version"`
|
|
AppName string `json:"appName"`
|
|
}
|
|
|
|
type WebsiteNginxConfig struct {
|
|
Enable bool `json:"enable"`
|
|
Params []NginxParam `json:"params"`
|
|
}
|
|
|
|
type WebsiteHTTPS struct {
|
|
Enable bool `json:"enable"`
|
|
HttpConfig string `json:"httpConfig"`
|
|
GlobalRedirectPort int `json:"globalRedirectPort"`
|
|
SiteRedirectPort *int `json:"siteRedirectPort"`
|
|
RedirectPortManaged bool `json:"redirectPortManaged"`
|
|
SSL model.WebsiteSSL `json:"SSL"`
|
|
SSLProtocol []string `json:"SSLProtocol"`
|
|
Algorithm string `json:"algorithm"`
|
|
Hsts bool `json:"hsts"`
|
|
HstsIncludeSubDomains bool `json:"hstsIncludeSubDomains"`
|
|
HttpsPorts []int `json:"httpsPorts"`
|
|
HttpsPort string `json:"httpsPort"`
|
|
Http3 bool `json:"http3"`
|
|
}
|
|
|
|
type WebsiteLog struct {
|
|
Enable bool `json:"enable"`
|
|
Content string `json:"content"`
|
|
End bool `json:"end"`
|
|
Path string `json:"path"`
|
|
}
|
|
|
|
type PHPConfig struct {
|
|
Params map[string]string `json:"params"`
|
|
DisableFunctions []string `json:"disableFunctions"`
|
|
UploadMaxSize string `json:"uploadMaxSize"`
|
|
MaxExecutionTime string `json:"maxExecutionTime"`
|
|
}
|
|
|
|
type NginxRewriteRes struct {
|
|
Content string `json:"content"`
|
|
}
|
|
|
|
type WebsiteDirConfig struct {
|
|
Dirs []string `json:"dirs"`
|
|
User string `json:"user"`
|
|
UserGroup string `json:"userGroup"`
|
|
Msg string `json:"msg"`
|
|
}
|
|
|
|
type WebsiteHtmlRes struct {
|
|
Content string `json:"content"`
|
|
}
|
|
|
|
type WebsiteRealIP struct {
|
|
WebsiteID uint `json:"websiteID" validate:"required"`
|
|
Open bool `json:"open"`
|
|
IPFrom string `json:"ipFrom"`
|
|
IPHeader string `json:"ipHeader"`
|
|
IPOther string `json:"ipOther"`
|
|
}
|
|
|
|
type Resource struct {
|
|
Name string `json:"name"`
|
|
Type string `json:"type"`
|
|
ResourceID uint `json:"resourceID"`
|
|
Detail interface{} `json:"detail"`
|
|
}
|
|
|
|
type Database struct {
|
|
Name string `json:"name"`
|
|
DatabaseName string `json:"databaseName"`
|
|
Type string `json:"type"`
|
|
From string `json:"from"`
|
|
ID uint `json:"id"`
|
|
}
|
|
|
|
type WebsiteBatchPHPVersionResult struct {
|
|
ID uint `json:"id"`
|
|
Domain string `json:"domain"`
|
|
Status string `json:"status"`
|
|
Message string `json:"message"`
|
|
}
|