mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-09-12 17:46:20 +08:00
fix: Fix the issue where some applications fail to execute scripts (#9508)
This commit is contained in:
parent
e5263d6c05
commit
765add6184
2 changed files with 16 additions and 11 deletions
|
@ -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)
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Add table
Reference in a new issue