EventManager: allow to define the allowed system commands

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino 2024-11-01 11:37:33 +01:00
commit 88b1850b58
No known key found for this signature in database
GPG key ID: 935D2952DEC4EECF
10 changed files with 259 additions and 17 deletions

View file

@ -396,6 +396,18 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
</div>
</div>
{{ if .EnabledCommands}}
<div class="form-group row action-type action-cmd mt-10">
<label for="idCmdPath" data-i18n="actions.types.command" class="col-md-3 col-form-label">Command</label>
<div class="col-md-9">
<select id="idCmdPath" name="cmd_path" class="form-select" data-control="i18n-select2" data-hide-search="true">
{{- range .EnabledCommands}}
<option value="{{.}}" {{if eq $.Action.Options.CmdConfig.Cmd . }}selected{{end}}>{{.}}</option>
{{- end}}
</select>
</div>
</div>
{{- else}}
<div class="form-group row action-type action-cmd mt-10">
<label for="idCmdPath" data-i18n="actions.types.command" class="col-md-3 col-form-label">Command</label>
<div class="col-md-9">
@ -403,6 +415,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
<div id="idCmdPathHelp" class="form-text" data-i18n="actions.command_help"></div>
</div>
</div>
{{- end}}
<div class="form-group row action-type action-cmd mt-10">
<label for="idCommandArgs" data-i18n="actions.command_args" class="col-md-3 col-form-label">Arguments</label>