mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-31 14:08:06 +08:00
fix: 解决申请证书超时导致的脏数据 (#604)
This commit is contained in:
parent
4c276ff383
commit
0356bdbf54
@ -83,6 +83,8 @@ func (w WebsiteSSLService) Create(create request.WebsiteSSLCreate) (request.Webs
|
|||||||
return res, err
|
return res, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var websiteSSL model.WebsiteSSL
|
||||||
|
|
||||||
switch create.Provider {
|
switch create.Provider {
|
||||||
case constant.DNSAccount:
|
case constant.DNSAccount:
|
||||||
dnsAccount, err := websiteDnsRepo.GetFirst(commonRepo.WithByID(create.DnsAccountID))
|
dnsAccount, err := websiteDnsRepo.GetFirst(commonRepo.WithByID(create.DnsAccountID))
|
||||||
@ -92,6 +94,7 @@ func (w WebsiteSSLService) Create(create request.WebsiteSSLCreate) (request.Webs
|
|||||||
if err := client.UseDns(ssl.DnsType(dnsAccount.Type), dnsAccount.Authorization); err != nil {
|
if err := client.UseDns(ssl.DnsType(dnsAccount.Type), dnsAccount.Authorization); err != nil {
|
||||||
return res, err
|
return res, err
|
||||||
}
|
}
|
||||||
|
websiteSSL.AutoRenew = create.AutoRenew
|
||||||
case constant.Http:
|
case constant.Http:
|
||||||
appInstall, err := getAppInstallByKey(constant.AppOpenresty)
|
appInstall, err := getAppInstallByKey(constant.AppOpenresty)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -100,6 +103,7 @@ func (w WebsiteSSLService) Create(create request.WebsiteSSLCreate) (request.Webs
|
|||||||
if err := client.UseHTTP(path.Join(constant.AppInstallDir, constant.AppOpenresty, appInstall.Name, "root")); err != nil {
|
if err := client.UseHTTP(path.Join(constant.AppInstallDir, constant.AppOpenresty, appInstall.Name, "root")); err != nil {
|
||||||
return res, err
|
return res, err
|
||||||
}
|
}
|
||||||
|
websiteSSL.AutoRenew = create.AutoRenew
|
||||||
case constant.DnsManual:
|
case constant.DnsManual:
|
||||||
if err := client.UseManualDns(); err != nil {
|
if err := client.UseManualDns(); err != nil {
|
||||||
return res, err
|
return res, err
|
||||||
@ -115,7 +119,7 @@ func (w WebsiteSSLService) Create(create request.WebsiteSSLCreate) (request.Webs
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return res, err
|
return res, err
|
||||||
}
|
}
|
||||||
var websiteSSL model.WebsiteSSL
|
|
||||||
websiteSSL.DnsAccountID = create.DnsAccountID
|
websiteSSL.DnsAccountID = create.DnsAccountID
|
||||||
websiteSSL.AcmeAccountID = acmeAccount.ID
|
websiteSSL.AcmeAccountID = acmeAccount.ID
|
||||||
websiteSSL.Provider = create.Provider
|
websiteSSL.Provider = create.Provider
|
||||||
@ -133,7 +137,6 @@ func (w WebsiteSSLService) Create(create request.WebsiteSSLCreate) (request.Webs
|
|||||||
websiteSSL.StartDate = cert.NotBefore
|
websiteSSL.StartDate = cert.NotBefore
|
||||||
websiteSSL.Type = cert.Issuer.CommonName
|
websiteSSL.Type = cert.Issuer.CommonName
|
||||||
websiteSSL.Organization = cert.Issuer.Organization[0]
|
websiteSSL.Organization = cert.Issuer.Organization[0]
|
||||||
websiteSSL.AutoRenew = create.AutoRenew
|
|
||||||
|
|
||||||
if err := websiteSSLRepo.Create(context.TODO(), &websiteSSL); err != nil {
|
if err := websiteSSLRepo.Create(context.TODO(), &websiteSSL); err != nil {
|
||||||
return res, err
|
return res, err
|
||||||
|
@ -100,7 +100,7 @@ export const ListSSL = (req: Website.SSLReq) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const CreateSSL = (req: Website.SSLCreate) => {
|
export const CreateSSL = (req: Website.SSLCreate) => {
|
||||||
return http.post<Website.SSLCreate>(`/websites/ssl`, req);
|
return http.post<Website.SSLCreate>(`/websites/ssl`, req, 60000);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const DeleteSSL = (req: Website.DelReq) => {
|
export const DeleteSSL = (req: Website.DelReq) => {
|
||||||
@ -128,7 +128,7 @@ export const UpdateSSL = (req: Website.SSLUpdate) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const GetDnsResolve = (req: Website.DNSResolveReq) => {
|
export const GetDnsResolve = (req: Website.DNSResolveReq) => {
|
||||||
return http.post<Website.DNSResolve[]>(`/websites/ssl/resolve`, req);
|
return http.post<Website.DNSResolve[]>(`/websites/ssl/resolve`, req, 60000);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const GetHTTPSConfig = (id: number) => {
|
export const GetHTTPSConfig = (id: number) => {
|
||||||
|
@ -1110,7 +1110,7 @@ const message = {
|
|||||||
primaryPath: 'Main directory',
|
primaryPath: 'Main directory',
|
||||||
folderTitle: 'The main directory of the website mainly contains four folders',
|
folderTitle: 'The main directory of the website mainly contains four folders',
|
||||||
wafFolder: 'Firewall Rules',
|
wafFolder: 'Firewall Rules',
|
||||||
indexFolder: 'Static website root directory',
|
indexFolder: 'Website root directory',
|
||||||
logFoler: 'website log',
|
logFoler: 'website log',
|
||||||
sslFolder: 'Website certificate',
|
sslFolder: 'Website certificate',
|
||||||
enableOrNot: 'Enable',
|
enableOrNot: 'Enable',
|
||||||
|
@ -1106,7 +1106,7 @@ const message = {
|
|||||||
primaryPath: '主目录',
|
primaryPath: '主目录',
|
||||||
folderTitle: '网站主目录主要包含四个文件夹',
|
folderTitle: '网站主目录主要包含四个文件夹',
|
||||||
wafFolder: '防火墙规则',
|
wafFolder: '防火墙规则',
|
||||||
indexFolder: '静态网站root目录',
|
indexFolder: '网站root目录',
|
||||||
logFoler: '网站日志',
|
logFoler: '网站日志',
|
||||||
sslFolder: '网站证书',
|
sslFolder: '网站证书',
|
||||||
enableOrNot: '是否启用',
|
enableOrNot: '是否启用',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user