Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ type SystemConfiguration struct {
// ActivitySendCount is the number of activity events to send per batch.
ActivitySendCount int `default:"100" yaml:"activity_send_count"`

// Should send sftp.read to activity log
ActivitySendSftpRead bool `default:"false" yaml:"activity_send_sftp_read"`

// If set to true, file permissions for a server will be checked when the process is
// booted. This can cause boot delays if the server has a large amount of files. In most
// cases disabling this should not have any major impact unless external processes are
Expand Down
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
4 changes: 4 additions & 0 deletions sftp/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ func (h *Handler) Fileread(request *sftp.Request) (io.ReaderAt, error) {
}
return nil, sftp.ErrSSHFxNoSuchFile
}

if config.Get().System.ActivitySendSftpRead {
h.events.MustLog(server.ActivitySftpRead, FileAction{Entity: request.Filepath})
}
return f, nil
}

Expand Down
Loading