diff --git a/apps/minio/versions/RELEASE.2022-08-13T21-54-44Z/config.json b/apps/minio/versions/RELEASE.2022-08-13T21-54-44Z/config.json
index 7477d3066..be09e7ed9 100644
--- a/apps/minio/versions/RELEASE.2022-08-13T21-54-44Z/config.json
+++ b/apps/minio/versions/RELEASE.2022-08-13T21-54-44Z/config.json
@@ -30,7 +30,7 @@
"labelEn": "Port",
"required": true,
"default": 9001,
- "envKey": "API_ROOT"
+ "envKey": "PORT_API"
}
]
}
\ No newline at end of file
diff --git a/apps/minio/versions/RELEASE.2022-08-13T21-54-44Z/docker-compose.yml b/apps/minio/versions/RELEASE.2022-08-13T21-54-44Z/docker-compose.yml
index 2b1609739..e2c0194da 100644
--- a/apps/minio/versions/RELEASE.2022-08-13T21-54-44Z/docker-compose.yml
+++ b/apps/minio/versions/RELEASE.2022-08-13T21-54-44Z/docker-compose.yml
@@ -5,9 +5,9 @@ services:
container_name: 1panel_minio
ports:
- ${PANEL_APP_PORT_HTTP}:9000
- - ${API_ROOT}:9001
+ - ${PORT_API}:9001
restart: always
- command: server /data --console-address ":9001"
+ command: server /data --console-address :9000 --address :9001
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD}
diff --git a/backend/app/dto/request/website.go b/backend/app/dto/request/website.go
index 37ba55532..fff1310f3 100644
--- a/backend/app/dto/request/website.go
+++ b/backend/app/dto/request/website.go
@@ -96,13 +96,15 @@ type WebsiteDomainDelete struct {
}
type WebsiteHTTPSOp struct {
- WebsiteID uint `json:"websiteId" validate:"required"`
- Enable bool `json:"enable" validate:"required"`
- WebsiteSSLID uint `json:"websiteSSLId"`
- Type string `json:"type" validate:"oneof=existed auto manual"`
- PrivateKey string `json:"privateKey"`
- Certificate string `json:"certificate"`
- HttpConfig string `json:"HttpConfig" validate:"oneof=HTTPSOnly HTTPAlso HTTPToHTTPS"`
+ WebsiteID uint `json:"websiteId" validate:"required"`
+ Enable bool `json:"enable" validate:"required"`
+ WebsiteSSLID uint `json:"websiteSSLId"`
+ Type string `json:"type" validate:"oneof=existed auto manual"`
+ PrivateKey string `json:"privateKey"`
+ Certificate string `json:"certificate"`
+ HttpConfig string `json:"HttpConfig" validate:"oneof=HTTPSOnly HTTPAlso HTTPToHTTPS"`
+ SSLProtocol []string `json:"SSLProtocol"`
+ Algorithm string `json:"algorithm"`
}
type WebsiteNginxUpdate struct {
diff --git a/backend/app/dto/response/website.go b/backend/app/dto/response/website.go
index 5580e7ea3..a56ac3fc1 100644
--- a/backend/app/dto/response/website.go
+++ b/backend/app/dto/response/website.go
@@ -30,7 +30,9 @@ type WebsiteWafConfig struct {
}
type WebsiteHTTPS struct {
- Enable bool `json:"enable"`
- HttpConfig string `json:"httpConfig"`
- SSL model.WebsiteSSL `json:"SSL"`
+ Enable bool `json:"enable"`
+ HttpConfig string `json:"httpConfig"`
+ SSL model.WebsiteSSL `json:"SSL"`
+ SSLProtocol []string `json:"SSLProtocol"`
+ Algorithm string `json:"algorithm"`
}
diff --git a/backend/app/service/website.go b/backend/app/service/website.go
index fa42735db..76e67554f 100644
--- a/backend/app/service/website.go
+++ b/backend/app/service/website.go
@@ -477,6 +477,18 @@ func (w WebsiteService) GetWebsiteHTTPS(websiteId uint) (response.WebsiteHTTPS,
} else {
res.HttpConfig = constant.HTTPToHTTPS
}
+ params, err := getNginxParamsByKeys(constant.NginxScopeServer, []string{"ssl_protocols", "ssl_ciphers"}, &website)
+ if err != nil {
+ return res, err
+ }
+ for _, p := range params {
+ if p.Name == "ssl_protocols" {
+ res.SSLProtocol = p.Params
+ }
+ if p.Name == "ssl_ciphers" {
+ res.Algorithm = p.Params[0]
+ }
+ }
return res, nil
}
@@ -490,7 +502,8 @@ func (w WebsiteService) OpWebsiteHTTPS(ctx context.Context, req request.WebsiteH
websiteSSL model.WebsiteSSL
)
res.Enable = req.Enable
-
+ res.SSLProtocol = req.SSLProtocol
+ res.Algorithm = req.Algorithm
if !req.Enable {
website.Protocol = constant.ProtocolHTTP
website.WebsiteSSLID = 0
@@ -544,7 +557,7 @@ func (w WebsiteService) OpWebsiteHTTPS(ctx context.Context, req request.WebsiteH
res.SSL = websiteSSL
}
website.Protocol = constant.ProtocolHTTPS
- if err := applySSL(website, websiteSSL, req.HttpConfig); err != nil {
+ if err := applySSL(website, websiteSSL, req); err != nil {
return response.WebsiteHTTPS{}, err
}
website.HttpConfig = req.HttpConfig
diff --git a/backend/app/service/website_utils.go b/backend/app/service/website_utils.go
index a806bc890..5e21422ee 100644
--- a/backend/app/service/website_utils.go
+++ b/backend/app/service/website_utils.go
@@ -4,6 +4,7 @@ import (
"bufio"
"encoding/json"
"fmt"
+ "github.com/1Panel-dev/1Panel/backend/app/dto/request"
"os"
"os/exec"
"path"
@@ -298,7 +299,7 @@ func createPemFile(website model.Website, websiteSSL model.WebsiteSSL) error {
return nil
}
-func applySSL(website model.Website, websiteSSL model.WebsiteSSL, httpConfig string) error {
+func applySSL(website model.Website, websiteSSL model.WebsiteSSL, req request.WebsiteHTTPSOp) error {
nginxFull, err := getNginxFull(&website)
if err != nil {
return nil
@@ -307,7 +308,7 @@ func applySSL(website model.Website, websiteSSL model.WebsiteSSL, httpConfig str
server := config.FindServers()[0]
server.UpdateListen("443", false, "ssl")
- switch httpConfig {
+ switch req.HttpConfig {
case constant.HTTPSOnly:
server.RemoveListenByBind("80")
server.RemoveDirective("if", []string{"($scheme"})
@@ -333,6 +334,12 @@ func applySSL(website model.Website, websiteSSL model.WebsiteSSL, httpConfig str
if param.Name == "ssl_certificate_key" {
nginxParams[i].Params = []string{path.Join("/www", "sites", website.Alias, "ssl", "privkey.pem")}
}
+ if param.Name == "ssl_protocols" {
+ nginxParams[i].Params = req.SSLProtocol
+ }
+ if param.Name == "ssl_ciphers" {
+ nginxParams[i].Params = []string{req.Algorithm}
+ }
}
if err := updateNginxConfig(constant.NginxScopeServer, nginxParams, &website); err != nil {
return err
diff --git a/frontend/src/api/interface/website.ts b/frontend/src/api/interface/website.ts
index 59655e7d3..8d641f252 100644
--- a/frontend/src/api/interface/website.ts
+++ b/frontend/src/api/interface/website.ts
@@ -205,12 +205,16 @@ export namespace Website {
certificate?: string;
privateKey?: string;
httpConfig: string;
+ SSLProtocol: string[];
+ algorithm: string;
}
export interface HTTPSConfig {
enable: boolean;
SSL: SSL;
httpConfig: string;
+ SSLProtocol: string[];
+ algorithm: string;
}
export interface CheckReq {
diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts
index 4e73b89be..b96300122 100644
--- a/frontend/src/lang/modules/zh.ts
+++ b/frontend/src/lang/modules/zh.ts
@@ -864,7 +864,7 @@ export default {
renewHelper: '确定续签证书?',
renewSuccess: '续签证书',
config: '配置',
- enableHTTPS: '启用HTTPS',
+ enableHTTPS: '启用 HTTPS',
aliasHelper: '代号是网站目录的文件夹名称',
lastBackupAt: '上次备份时间',
null: '无',
@@ -927,13 +927,19 @@ export default {
selectSSL: '选择证书',
privateKey: '密钥(KEY)',
certificate: '证书(PEM格式)',
- HTTPConfig: 'HTTP选项',
- HTTPSOnly: '禁止HTTTP',
+ HTTPConfig: 'HTTP 选项',
+ HTTPSOnly: '禁止 HTTTP',
HTTPToHTTPS: '访问HTTP自动跳转到HTTPS',
HTTPAlso: 'HTTP可直接访问',
sslConfig: 'SSL 选项',
disbaleHTTTPS: '禁用 HTTPS',
disbaleHTTTPSHelper: '禁用 HTTPS会删除证书相关配置,是否继续',
+ SSLHelper: '注意:请勿将SSL证书用于非法网站 \n 如开启后无法使用HTTPS访问,请检查安全组是否正确放行443端口',
+ SSLConfig: '证书设置',
+ SSLProConfig: 'SSL 协议设置',
+ supportProtocol: '支持的协议版本',
+ encryptionAlgorithm: '加密算法',
+ notSecurity: ' 不安全',
},
nginx: {
serverNamesHashBucketSizeHelper: '服务器名字的hash表大小',
diff --git a/frontend/src/views/website/website/config/basic/https/index.vue b/frontend/src/views/website/website/config/basic/https/index.vue
index 4bc19b1d0..f8d506145 100644
--- a/frontend/src/views/website/website/config/basic/https/index.vue
+++ b/frontend/src/views/website/website/config/basic/https/index.vue
@@ -13,6 +13,7 @@