Skip to content

Commit

Permalink
Add sftp.read to activity log
Browse files Browse the repository at this point in the history
  • Loading branch information
EpicPlayerA10 committed Jul 1, 2024
1 parent 1d8b383 commit bac8ad3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions server/activity.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 2 additions & 0 deletions sftp/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit bac8ad3

Please sign in to comment.