feat: add configuration option to completely disable the exec tool
- Add Disabled boolean field to ExecConfig struct - Update IsToolEnabled to return false when exec.disabled is true Fixes issue #1621
This commit is contained in:
parent
15772c4e6a
commit
526d9de619
1 changed files with 2 additions and 1 deletions
|
|
@ -703,6 +703,7 @@ type CronToolsConfig struct {
|
|||
|
||||
type ExecConfig struct {
|
||||
ToolConfig ` envPrefix:"PICOCLAW_TOOLS_EXEC_"`
|
||||
Disabled bool ` env:"PICOCLAW_TOOLS_EXEC_DISABLED" json:"disabled"`
|
||||
EnableDenyPatterns bool ` env:"PICOCLAW_TOOLS_EXEC_ENABLE_DENY_PATTERNS" json:"enable_deny_patterns"`
|
||||
AllowRemote bool ` env:"PICOCLAW_TOOLS_EXEC_ALLOW_REMOTE" json:"allow_remote"`
|
||||
CustomDenyPatterns []string ` env:"PICOCLAW_TOOLS_EXEC_CUSTOM_DENY_PATTERNS" json:"custom_deny_patterns"`
|
||||
|
|
@ -1020,7 +1021,7 @@ func (t *ToolsConfig) IsToolEnabled(name string) bool {
|
|||
case "cron":
|
||||
return t.Cron.Enabled
|
||||
case "exec":
|
||||
return t.Exec.Enabled
|
||||
return t.Exec.Enabled && !t.Exec.Disabled
|
||||
case "skills":
|
||||
return t.Skills.Enabled
|
||||
case "media_cleanup":
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue