From df770460d6bd37130e27ed2e66a4ecb64e2273c7 Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Thu, 3 Aug 2023 15:25:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BA=94=E7=94=A8=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E9=80=82=E9=85=8D=20sftpgo=20pgadmin4=20(#1819)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/app_utils.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/backend/app/service/app_utils.go b/backend/app/service/app_utils.go index 30253d7d7..f45b65469 100644 --- a/backend/app/service/app_utils.go +++ b/backend/app/service/app_utils.go @@ -530,11 +530,15 @@ func copyData(app model.App, appDetail model.AppDetail, appInstall *model.AppIns // 处理文件夹权限等问题 func upAppPre(app model.App, appInstall *model.AppInstall) error { - if app.Key == "nexus" { - dataPath := path.Join(appInstall.GetPath(), "data") - if err := files.NewFileOp().Chown(dataPath, 200, 0); err != nil { - return err - } + dataPath := path.Join(appInstall.GetPath(), "data") + fileOp := files.NewFileOp() + switch app.Key { + case "nexus": + return fileOp.Chown(dataPath, 200, 0) + case "sftpgo": + return files.NewFileOp().Chown(dataPath, 1000, 1000) + case "pgadmin4": + return files.NewFileOp().Chown(dataPath, 5050, 5050) } return nil }