diff --git a/backend/app/service/website.go b/backend/app/service/website.go index cd0cd58d8..1159a5afc 100644 --- a/backend/app/service/website.go +++ b/backend/app/service/website.go @@ -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 diff --git a/backend/utils/docker/compose.go b/backend/utils/docker/compose.go index 96d875691..fea310e56 100644 --- a/backend/utils/docker/compose.go +++ b/backend/utils/docker/compose.go @@ -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