#2973 Support user-defined server-side hooks
Closed: Won't Fix by wombelix. Opened by praiskup.

It would be nice if we had a form in pagure web-ui to specify server-side hooks:

- pre-receive/update [executable scripts]
- update [executable script]
- user-scripts/pre-receive/{pre-receive,update,...}/01_script [executables?]
- system-scripts/pre-receive/{pre-receive,update,...}

From security POV, we would have to assure that the user-scripts had the
git repository in question in read-only access, and had no access to other
repositories at all. Otherwise, the system scripts and user scripts could have
the same API (env vars which are provided by git itself, plus additional
done by "library"... looks like Github Enterprise does something like this).


Considering this security aspect of this I cannot commit to this any time soon. It will require finishing some important refactoring and quite a bit of security aspect to solve.

If you need a specific git hook installed, I'd just open a ticket with the Fedora infrastructure to ask for it and we should be able to make it happen.

Metadata Update from @pingou:
- Issue tagged with: RFE, wishful

Note: I'm less against adding it to the software, as long as it's turned off for pagure.io/src.fp.o

Honestly, I think this is a really bad idea from a security point of view. If you want to perform anything on push or anything, note that you can use webhooks to run code on your own system, and if you give it a Deploy Key, it can even clone (and at your option push).

This requires implementation in a way that it is not a problem from security POV.
Server-side hooks bring valid use-cases on-top of user's hooks.. and it is pretty
powerful feature so, one day, the implementation should be worth it. (please mark with "hooks" tag, too).

IOW, implementing it so it can not be turned on for Fedora packages or pagure.io
is not what I'm asking for here.

This requires implementation in a way that it is not a problem from security POV.

Well that requirement is there regardless, on the one side it's on us to deal with all the (potentially dangerous) code uploaded by the users, while on the other side it's on the user running that code to be cautious.
The surface of attack seems much lower in the second case.

So while an interesting idea, it is clearly not a priority for me.

I have the feeling that the potential security risk is way to high and that already a lot could be achieved with webhooks. I'm also quite sure that there will be further work on a real plugin system for pagure in future, going to close this issue for now because of this reasons and the fact that there was no code contribution in 4 years.

Metadata Update from @wombelix:
- Issue close_status updated to: Won't Fix
- Issue status updated to: Closed (was: Open)

Metadata