fix: Fix the issue where some applications fail to execute scripts (#9508)

This commit is contained in:
CityFun 2025-07-14 12:21:51 +08:00 committed by GitHub
parent e5263d6c05
commit 765add6184
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 11 deletions

View file

@ -170,7 +170,7 @@ func createLink(ctx context.Context, installTask *task.Task, app model.App, appI
}
switch app.Key {
case constant.AppMysql, constant.AppMariaDB, constant.AppPostgresql, constant.AppMongodb:
case constant.AppMysql, constant.AppMariaDB, constant.AppPostgresql, constant.AppMongodb, constant.AppMysqlCluster, constant.AppPostgresqlCluster:
if password, ok := params["PANEL_DB_ROOT_PASSWORD"]; ok {
if password != "" {
database.Password = password.(string)
@ -192,7 +192,7 @@ func createLink(ctx context.Context, installTask *task.Task, app model.App, appI
}
}
case constant.AppRedis:
case constant.AppRedis, constant.AppRedisCluster:
if password, ok := params["PANEL_REDIS_ROOT_PASSWORD"]; ok {
authParam := dto.RedisAuthParam{
RootPassword: "",
@ -968,9 +968,11 @@ func runScript(task *task.Task, appInstall *model.AppInstall, operate string) er
case "uninstall":
scriptPath = path.Join(workDir, "scripts", "uninstall.sh")
}
if !files.NewFileOp().Stat(scriptPath) {
fileOp := files.NewFileOp()
if !fileOp.Stat(scriptPath) {
return nil
}
_ = fileOp.ChmodR(scriptPath, constant.DirPerm, false)
logStr := i18n.GetWithName("ExecShell", operate)
task.LogStart(logStr)

View file

@ -6,14 +6,17 @@ const (
AppNormal = "Normal"
AppTakeDown = "TakeDown"
AppOpenresty = "openresty"
AppMysql = "mysql"
AppMariaDB = "mariadb"
AppPostgresql = "postgresql"
AppRedis = "redis"
AppPostgres = "postgres"
AppMongodb = "mongodb"
AppMemcached = "memcached"
AppOpenresty = "openresty"
AppMysql = "mysql"
AppMariaDB = "mariadb"
AppPostgresql = "postgresql"
AppRedis = "redis"
AppPostgres = "postgres"
AppMongodb = "mongodb"
AppMemcached = "memcached"
AppMysqlCluster = "mysql-cluster"
AppPostgresqlCluster = "postgresql-cluster"
AppRedisCluster = "redis-cluster"
AppResourceLocal = "local"
AppResourceRemote = "remote"