abrader / abrader-gms

Git management system types and providers for Puppet utilizing Github, Gitlab, Stash APIs
Apache License 2.0
26 stars 32 forks source link

Stash: external-hooks - 'safe_path' needs to be set #25

Open natemccurdy opened 8 years ago

natemccurdy commented 8 years ago

When using Stash (Bitbucket Server) and the External-Hooks add-on, the git_webhook type is unable to modify (create/change) the parameters for the external-hooks add-on because the safe_path attribute needs to be set when hitting the API.

-X PUT -d '{"exe":"debug.sh", "params":"-a foo", "safe_path":true}'

Specifically, if using a Stash user account that only has admin rights to a project/repo, then the exe executable must be in $STASH_HOME/external-hooks, and the path must be relative to that directory. When doing that, safe_path must be set to true or else the API will not allow the change.

If using a Stash user account that has global admin rights (like the default 'admin' user), then safe_path doesn't need to be managed and the exe does not have to be in the $STASH_HOME/external-hooks directory. In which case an absolute path to the exe should be used.