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
Giteabot ca4418eff1
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>
1 year ago
..
actions Fix pull request check list is limited (#26179) (#26245) 2 years ago
agit Use the type RefName for all the needed places and fix pull mirror sync bugs (#24634) 2 years ago
asymkey Add context cache as a request level cache (#22294) 2 years ago
attachment Preserve file size when creating attachments (#23406) 2 years ago
auth Fix attachment download bug (#27486) (#27570) 1 year ago
automerge Improve queue and logger context (#24924) 2 years ago
context Replace `interface{}` with `any` (#25686) (#25687) 2 years ago
convert Fix attachment download bug (#27486) (#27570) 1 year ago
cron Replace `interface{}` with `any` (#25686) (#25687) 2 years ago
externalaccount Replace `interface{}` with `any` (#25686) (#25687) 2 years ago
forms check blocklist for emails when adding them to account (#26812) (#26831) 1 year ago
gitdiff Fix successful return value for `SyncAndGetUserSpecificDiff` (#27152) (#27156) 1 year ago
issue Avoid run change title process when the title is same (#27467) (#27557) 1 year ago
lfs Replace `interface{}` with `any` (#25686) (#25687) 2 years ago
mailer Replace `interface{}` with `any` (#25686) (#25687) 2 years ago
markup Decouple the different contexts from each other (#24786) 2 years ago
migrations Replace `interface{}` with `any` (#25686) (#25687) 2 years ago
mirror Replace `interface{}` with `any` (#25686) (#25687) 2 years ago
org Refactor rename user and rename organization (#24052) 2 years ago
packages Prevent newline errors with Debian packages (#26332) (#26342) 2 years ago
pull Fix poster is not loaded in get default merge message (#27657) (#27665) 1 year ago
release Use the type RefName for all the needed places and fix pull mirror sync bugs (#24634) 2 years ago
repository Sync tags when adopting repos (#26816) (#26834) 1 year ago
task Replace `interface{}` with `any` (#25686) (#25687) 2 years ago
user fix incorrect repo url when changed the case of ownername (#25733) (#25881) 2 years ago
webhook Support allowed hosts for webhook to work with proxy (#27655) (#27674) 1 year ago
wiki services/wiki: Close() after error handling (#27129) (#27137) 1 year ago