mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 23:00:55 +03:00
custom actions: add env vars
action parameters can now be readed from env vars too. Added a timeout for the command execution
This commit is contained in:
@@ -324,7 +324,7 @@ func (c Connection) handleSFTPRename(sourcePath string, targetPath string, reque
|
||||
return getSFTPErrorFromOSError(err)
|
||||
}
|
||||
logger.CommandLog(renameLogSender, sourcePath, targetPath, c.User.Username, "", c.ID, c.protocol, -1, -1, "", "", "")
|
||||
go executeAction(operationRename, c.User.Username, sourcePath, targetPath, "")
|
||||
go executeAction(operationRename, c.User.Username, sourcePath, targetPath, "", 0)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -414,7 +414,7 @@ func (c Connection) handleSFTPRemove(filePath string, request *sftp.Request) err
|
||||
if fi.Mode()&os.ModeSymlink != os.ModeSymlink {
|
||||
dataprovider.UpdateUserQuota(dataProvider, c.User, -1, -size, false)
|
||||
}
|
||||
go executeAction(operationDelete, c.User.Username, filePath, "", "")
|
||||
go executeAction(operationDelete, c.User.Username, filePath, "", "", fi.Size())
|
||||
|
||||
return sftp.ErrSSHFxOk
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user