gopasspw / gopass

The slightly more awesome standard unix password manager for teams
https://www.gopass.pw/
MIT License
5.83k stars 485 forks source link

Hooks not firing #2887

Open rexi1e opened 3 months ago

rexi1e commented 3 months ago

Summary

Cannot get any hooks to fire.

Steps To Reproduce

  1. Build/install gopass.
  2. Run gopass setup.
  3. Add a secret.
  4. Add a hook action to ~/.config/gopass/config, such as core.post-hook: /full/path/to/script.sh
  5. Run a gopass command like gopass show...the command works but the specified script is never run.

Expected behavior

When the config specifies a script for a particular function, that script should run every time that function runs.

Environment

Additional context

Tried variants of the key/hook and property such as:

core.post-hook: /full/path/to/script.sh core.post-hook: bash /full/path/to/script.sh core.post-hook: <command> show.post-hook: ...

Also tried:

I know config file was being read because:

  1. Logs show that gopass recognizes the hook config when run with GOPASS_DEBUG=true
  2. Other config settings took effect (e.g. core.cliptimeout = 30)
dominikschulz commented 2 months ago

Yes, that was me: https://github.com/gopasspw/gopass/blob/master/internal/hook/hook.go#L37

I have disable global hooks since I wasn't sure about potential attack vectors.