Add sftp.read to activity log

This commit is contained in:
EpicPlayerA10 2024-07-01 22:14:50 +02:00
parent 1d8b383682
commit bac8ad302d
No known key found for this signature in database
GPG Key ID: F3110BF7F9F1AB74
2 changed files with 3 additions and 0 deletions

View File

@ -15,6 +15,7 @@ const ActivityPowerPrefix = "server:power."
const (
ActivityConsoleCommand = models.Event("server:console.command")
ActivitySftpWrite = models.Event("server:sftp.write")
ActivitySftpRead = models.Event("server:sftp.read")
ActivitySftpCreate = models.Event("server:sftp.create")
ActivitySftpCreateDirectory = models.Event("server:sftp.create-directory")
ActivitySftpRename = models.Event("server:sftp.rename")

View File

@ -87,6 +87,8 @@ func (h *Handler) Fileread(request *sftp.Request) (io.ReaderAt, error) {
}
return nil, sftp.ErrSSHFxNoSuchFile
}
h.events.MustLog(server.ActivitySftpRead, FileAction{Entity: request.Filepath})
return f, nil
}