mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-19 08:19:15 +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
|
||||
}
|
||||
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")
|
||||
if !fileOp.Stat(paramsPath) {
|
||||
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.StartDate = cert.NotBefore
|
||||
websiteSSL.Type = cert.Issuer.CommonName
|
||||
if len(cert.Issuer.Organization) > 0 {
|
||||
websiteSSL.Organization = cert.Issuer.Organization[0]
|
||||
} else {
|
||||
websiteSSL.Organization = cert.Issuer.CommonName
|
||||
}
|
||||
if len(cert.DNSNames) > 0 {
|
||||
websiteSSL.PrimaryDomain = cert.DNSNames[0]
|
||||
websiteSSL.Domains = strings.Join(cert.DNSNames, ",")
|
||||
|
@ -213,12 +213,17 @@ const changeApp = (appId: number) => {
|
||||
};
|
||||
|
||||
const changeVersion = () => {
|
||||
loading.value = true;
|
||||
initParam.value = false;
|
||||
GetAppDetail(runtime.value.appId, runtime.value.version, 'runtime').then((res) => {
|
||||
GetAppDetail(runtime.value.appId, runtime.value.version, 'runtime')
|
||||
.then((res) => {
|
||||
runtime.value.appDetailId = res.data.id;
|
||||
runtime.value.image = res.data.image + ':' + runtime.value.version;
|
||||
appParams.value = res.data.params;
|
||||
initParam.value = true;
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
@ -228,12 +233,7 @@ const getApp = (appkey: string, mode: string) => {
|
||||
if (res.data.versions.length > 0) {
|
||||
runtime.value.version = res.data.versions[0];
|
||||
if (mode === 'create') {
|
||||
GetAppDetail(runtime.value.appId, runtime.value.version, 'runtime').then((res) => {
|
||||
runtime.value.appDetailId = res.data.id;
|
||||
runtime.value.image = res.data.image + ':' + runtime.value.version;
|
||||
appParams.value = res.data.params;
|
||||
initParam.value = true;
|
||||
});
|
||||
changeVersion();
|
||||
} else {
|
||||
initParam.value = true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user