Add optional ip_filter to hook config

In order to allow or deny sources of requests the possibility to
configure a list of allowed or denied IP addresses was added as
described by the readme.

Closes #3
This commit is contained in:
finga 2021-04-02 00:25:39 +02:00
parent 8099bf773f
commit 8314214e06
5 changed files with 239 additions and 96 deletions

View file

@ -2,6 +2,10 @@
hooks:
hook1:
command: /usr/bin/local/script_xy.sh {{ /field2/foo }} asdfasdf
signature: X-Gitea-Signature
ip_filter:
allow:
- 127.0.0.1/31
secrets:
- secret_key_01
- secret_key_02
@ -11,6 +15,10 @@ hooks:
regex: refs/heads/master
hook2:
command: /usr/bin/local/script_xy.sh asdfasdf
signature: X-Gitea-Signature
ip_filter:
deny:
- 10.10.10.0/22
secrets:
- secret_key_01
- secret_key_02
@ -20,6 +28,7 @@ hooks:
regex: refs/heads/master
hook3:
command: /usr/bin/local/script_xyz.sh
signature: X-Gitea-Signature
secrets:
- secret_key03
filters: