forgejo/services
Giteabot d6798ae015
Support allowed hosts for webhook to work with proxy (#27655) (#27674)
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>
(cherry picked from commit ca4418eff1)
2023-11-14 13:17:11 +01:00
..
actions Fix pull request check list is limited (#26179) (#26245) 2023-08-21 07:22:15 +02:00
agit
asymkey
attachment
auth Fix attachment download bug (#27486) (#27570) 2023-11-14 13:17:11 +01:00
automerge
context
convert Fix attachment download bug (#27486) (#27570) 2023-11-14 13:17:11 +01:00
cron [GITEA] Show manual cron run's last time 2023-07-31 18:34:14 +00:00
externalaccount
forgejo [UPGRADE] add sanity checks for [storage*] 2023-08-21 07:22:19 +02:00
forms check blocklist for emails when adding them to account (#26812) (#26831) 2023-09-08 08:09:18 +02:00
gitdiff Fix successful return value for SyncAndGetUserSpecificDiff (#27152) (#27156) 2023-10-03 14:48:08 +02:00
issue Avoid run change title process when the title is same (#27467) (#27557) 2023-11-14 13:17:11 +01:00
lfs
mailer
markup
migrations
mirror
org
packages Prevent newline errors with Debian packages (#26332) (#26342) 2023-08-21 07:22:16 +02:00
pull Fix poster is not loaded in get default merge message (#27657) (#27665) 2023-11-14 13:17:11 +01:00
release
repository Sync tags when adopting repos (#26816) (#26834) 2023-09-08 08:09:18 +02:00
task
user
webhook Support allowed hosts for webhook to work with proxy (#27655) (#27674) 2023-11-14 13:17:11 +01:00
wiki services/wiki: Close() after error handling (#27129) (#27137) 2023-09-20 12:50:46 +02:00