allow to execute actions for file operations and SSH commands synchronously

The actions to run synchronously can be configured via the `execute_sync`
configuration key.

Executing an action synchronously means that SFTPGo will not return a result
code to the client until your hook have completed its execution.

Fixes #409
This commit is contained in:
Nicola Murino
2021-05-11 12:45:14 +02:00
parent b67cd0d3df
commit fa45c9c138
11 changed files with 103 additions and 47 deletions

View File

@@ -110,7 +110,7 @@ func TestActionCMD(t *testing.T) {
err = actionHandler.Handle(a)
assert.NoError(t, err)
SSHCommandActionNotification(user, "path", "target", "sha1sum", nil)
ExecuteActionNotification(user, operationSSHCmd, "path", "target", "sha1sum", ProtocolSSH, 0, nil)
Config.Actions = actionsCopy
}