mirror of
https://gitee.com/fit2cloud-feizhiyun/1Panel.git
synced 2024-12-04 21:09:31 +08:00
fix: 解决 nexus 安装失败的问题 (#461)
This commit is contained in:
parent
4ad3b82c84
commit
3457b99df6
@ -257,6 +257,9 @@ func (a AppService) Install(ctx context.Context, req request.AppInstallCreate) (
|
||||
if err := createLink(ctx, app, &appInstall, req.Params); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := upAppPre(app, appInstall); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
go upApp(appInstall.GetComposePath(), appInstall)
|
||||
go updateToolApp(appInstall)
|
||||
return &appInstall, nil
|
||||
|
@ -339,6 +339,17 @@ func copyAppData(key, version, installName string, params map[string]interface{}
|
||||
return
|
||||
}
|
||||
|
||||
// 处理文件夹权限等问题
|
||||
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
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func upApp(composeFilePath string, appInstall model.AppInstall) {
|
||||
out, err := compose.Up(composeFilePath)
|
||||
if err != nil {
|
||||
|
@ -106,6 +106,10 @@ func (f FileOp) Chmod(dst string, mode fs.FileMode) error {
|
||||
return f.Fs.Chmod(dst, mode)
|
||||
}
|
||||
|
||||
func (f FileOp) Chown(dst string, uid int, gid int) error {
|
||||
return f.Fs.Chown(dst, uid, gid)
|
||||
}
|
||||
|
||||
func (f FileOp) Rename(oldName string, newName string) error {
|
||||
return f.Fs.Rename(oldName, newName)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user