mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-08 07:10:56 +03:00
file actions: add bucket and endpoint to notifications
The HTTP notifications are now invoked as POST and the notification is a JSON inside the POST body. This is a backward incompatible change but this way the actions can be extended more easily, sorry for the trouble Fixes #101
This commit is contained in:
@@ -335,7 +335,7 @@ func (c Connection) handleSFTPRename(sourcePath string, targetPath string, reque
|
||||
return vfs.GetSFTPError(c.fs, err)
|
||||
}
|
||||
logger.CommandLog(renameLogSender, sourcePath, targetPath, c.User.Username, "", c.ID, c.protocol, -1, -1, "", "", "")
|
||||
go executeAction(operationRename, c.User.Username, sourcePath, targetPath, "", 0, vfs.IsLocalOsFs(c.fs))
|
||||
go executeAction(newActionNotification(c.User, operationRename, sourcePath, targetPath, "", 0))
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -443,7 +443,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, "", "", fi.Size(), vfs.IsLocalOsFs(c.fs))
|
||||
go executeAction(newActionNotification(c.User, operationDelete, filePath, "", "", fi.Size()))
|
||||
|
||||
return sftp.ErrSSHFxOk
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user