mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-31 22:18:07 +08:00
fix: 解决网站导入自签证书报错的问题 (#1278)
This commit is contained in:
parent
6b3093aa09
commit
b7495a63e9
@ -162,7 +162,13 @@ func (a AppService) GetAppDetail(appId uint, version, appType string) (response.
|
|||||||
return appDetailDTO, err
|
return appDetailDTO, err
|
||||||
}
|
}
|
||||||
fileOp := files.NewFileOp()
|
fileOp := files.NewFileOp()
|
||||||
buildPath := path.Join(constant.AppResourceDir, app.Key, "versions", detail.Version, "build")
|
versionPath := path.Join(constant.AppResourceDir, app.Resource, app.Key, detail.Version)
|
||||||
|
if !fileOp.Stat(versionPath) {
|
||||||
|
if err = downloadApp(app, detail, nil); err != nil {
|
||||||
|
return appDetailDTO, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
buildPath := path.Join(versionPath, "build")
|
||||||
paramsPath := path.Join(buildPath, "config.json")
|
paramsPath := path.Join(buildPath, "config.json")
|
||||||
if !fileOp.Stat(paramsPath) {
|
if !fileOp.Stat(paramsPath) {
|
||||||
return appDetailDTO, buserr.New(constant.ErrFileNotExist)
|
return appDetailDTO, buserr.New(constant.ErrFileNotExist)
|
||||||
|
@ -681,7 +681,11 @@ func (w WebsiteService) OpWebsiteHTTPS(ctx context.Context, req request.WebsiteH
|
|||||||
websiteSSL.ExpireDate = cert.NotAfter
|
websiteSSL.ExpireDate = cert.NotAfter
|
||||||
websiteSSL.StartDate = cert.NotBefore
|
websiteSSL.StartDate = cert.NotBefore
|
||||||
websiteSSL.Type = cert.Issuer.CommonName
|
websiteSSL.Type = cert.Issuer.CommonName
|
||||||
websiteSSL.Organization = cert.Issuer.Organization[0]
|
if len(cert.Issuer.Organization) > 0 {
|
||||||
|
websiteSSL.Organization = cert.Issuer.Organization[0]
|
||||||
|
} else {
|
||||||
|
websiteSSL.Organization = cert.Issuer.CommonName
|
||||||
|
}
|
||||||
if len(cert.DNSNames) > 0 {
|
if len(cert.DNSNames) > 0 {
|
||||||
websiteSSL.PrimaryDomain = cert.DNSNames[0]
|
websiteSSL.PrimaryDomain = cert.DNSNames[0]
|
||||||
websiteSSL.Domains = strings.Join(cert.DNSNames, ",")
|
websiteSSL.Domains = strings.Join(cert.DNSNames, ",")
|
||||||
|
@ -213,13 +213,18 @@ const changeApp = (appId: number) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const changeVersion = () => {
|
const changeVersion = () => {
|
||||||
|
loading.value = true;
|
||||||
initParam.value = false;
|
initParam.value = false;
|
||||||
GetAppDetail(runtime.value.appId, runtime.value.version, 'runtime').then((res) => {
|
GetAppDetail(runtime.value.appId, runtime.value.version, 'runtime')
|
||||||
runtime.value.appDetailId = res.data.id;
|
.then((res) => {
|
||||||
runtime.value.image = res.data.image + ':' + runtime.value.version;
|
runtime.value.appDetailId = res.data.id;
|
||||||
appParams.value = res.data.params;
|
runtime.value.image = res.data.image + ':' + runtime.value.version;
|
||||||
initParam.value = true;
|
appParams.value = res.data.params;
|
||||||
});
|
initParam.value = true;
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
loading.value = false;
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const getApp = (appkey: string, mode: string) => {
|
const getApp = (appkey: string, mode: string) => {
|
||||||
@ -228,12 +233,7 @@ const getApp = (appkey: string, mode: string) => {
|
|||||||
if (res.data.versions.length > 0) {
|
if (res.data.versions.length > 0) {
|
||||||
runtime.value.version = res.data.versions[0];
|
runtime.value.version = res.data.versions[0];
|
||||||
if (mode === 'create') {
|
if (mode === 'create') {
|
||||||
GetAppDetail(runtime.value.appId, runtime.value.version, 'runtime').then((res) => {
|
changeVersion();
|
||||||
runtime.value.appDetailId = res.data.id;
|
|
||||||
runtime.value.image = res.data.image + ':' + runtime.value.version;
|
|
||||||
appParams.value = res.data.params;
|
|
||||||
initParam.value = true;
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
initParam.value = true;
|
initParam.value = true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user