You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/services/webhook
Giteabot dab40cd5f4
Support allowed hosts for webhook to work with proxy (#27655) (#27675)
Backport #27655 by @wolfogre

When `webhook.PROXY_URL` has been set, the old code will check if the
proxy host is in `ALLOWED_HOST_LIST` or reject requests through the
proxy. It requires users to add the proxy host to `ALLOWED_HOST_LIST`.
However, it actually allows all requests to any port on the host, when
the proxy host is probably an internal address.

But things may be even worse. `ALLOWED_HOST_LIST` doesn't really work
when requests are sent to the allowed proxy, and the proxy could forward
them to any hosts.

This PR fixes it by:

- If the proxy has been set, always allow connectioins to the host and
port.
- Check `ALLOWED_HOST_LIST` before forwarding.

Co-authored-by: Jason Song <i@wolfogre.com>
1 year ago
..
deliver.go Support allowed hosts for webhook to work with proxy (#27655) (#27675) 1 year ago
deliver_test.go Support allowed hosts for webhook to work with proxy (#27655) (#27675) 1 year ago
dingtalk.go Fix release URL in webhooks (#27182) (#27185) 1 year ago
dingtalk_test.go Fix release URL in webhooks (#27182) (#27185) 1 year ago
discord.go Fix release URL in webhooks (#27182) (#27185) 1 year ago
discord_test.go Fix release URL in webhooks (#27182) (#27185) 1 year ago
feishu.go Modify the content format of the Feishu webhook (#25106) 1 year ago
feishu_test.go Modify the content format of the Feishu webhook (#25106) 1 year ago
general.go Modify the content format of the Feishu webhook (#25106) 1 year ago
general_test.go Fix release URL in webhooks (#27182) (#27185) 1 year ago
main_test.go move repository deletion to service layer (#26948) 1 year ago
matrix.go Fix release URL in webhooks (#27182) (#27185) 1 year ago
matrix_test.go Restructure `webhook` module (#22256) 2 years ago
msteams.go Fix release URL in webhooks (#27182) (#27185) 1 year ago
msteams_test.go Fix release URL in webhooks (#27182) (#27185) 1 year ago
notifier.go Move notification interface to services layer (#26915) 1 year ago
packagist.go Restructure `webhook` module (#22256) 2 years ago
packagist_test.go Restructure `webhook` module (#22256) 2 years ago
payloader.go New webhook trigger for receiving Pull Request review requests (#24481) 2 years ago
slack.go Fix release URL in webhooks (#27182) (#27185) 1 year ago
slack_test.go Restructure `webhook` module (#22256) 2 years ago
telegram.go Add ThreadID parameter for Telegram webhooks (#25996) 1 year ago
telegram_test.go Restructure `webhook` module (#22256) 2 years ago
webhook.go Warn instead of reporting an error when a webhook cannot be found (#26039) 2 years ago
webhook_test.go Restructure `webhook` module (#22256) 2 years ago
wechatwork.go Use the type RefName for all the needed places and fix pull mirror sync bugs (#24634) 2 years ago