mirror of
https://gitee.com/fit2cloud-feizhiyun/1Panel.git
synced 2024-12-05 05:19:08 +08:00
fix: 解决已安装应用包含大写字母,启动失败的BUG (#559)
This commit is contained in:
parent
4a4c2b24dd
commit
47d090d481
@ -185,8 +185,8 @@ func (w WebsiteService) CreateWebsite(ctx context.Context, create request.Websit
|
||||
}
|
||||
if runtime.Resource == constant.ResourceAppstore {
|
||||
var req request.AppInstallCreate
|
||||
reg, _ := regexp.Compile("[^a-z0-9_\\-]+")
|
||||
req.Name = reg.ReplaceAllString(create.PrimaryDomain, "")
|
||||
reg, _ := regexp.Compile(`[^a-z0-9_-]+`)
|
||||
req.Name = reg.ReplaceAllString(strings.ToLower(create.PrimaryDomain), "")
|
||||
req.AppDetailId = create.AppInstall.AppDetailId
|
||||
req.Params = create.AppInstall.Params
|
||||
req.Params["IMAGE_NAME"] = runtime.Image
|
||||
|
@ -11,6 +11,7 @@ import (
|
||||
"github.com/docker/docker/client"
|
||||
"github.com/joho/godotenv"
|
||||
"path"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
@ -103,6 +104,9 @@ func GetComposeProject(projectName, workDir string, yml []byte, env []byte, skip
|
||||
ConfigFiles: configFiles,
|
||||
Environment: envMap,
|
||||
}
|
||||
projectName = strings.ToLower(projectName)
|
||||
reg, _ := regexp.Compile(`[^a-z0-9_-]+`)
|
||||
projectName = reg.ReplaceAllString(projectName, "")
|
||||
project, err := loader.Load(details, func(options *loader.Options) {
|
||||
options.SetProjectName(projectName, true)
|
||||
options.ResolvePaths = true
|
||||
|
Loading…
Reference in New Issue
Block a user