pushbits / server

A simple server for push notifications via Matrix (and a minimalistic alternative to Pushover and Gotify) 🚀📯
https://www.pushbits.io
ISC License
305 stars 18 forks source link

Add support for setting trusted proxies #54

Closed eikendev closed 2 years ago

eikendev commented 2 years ago

This patch closes #53, addressing a warning by the Gin framework not to trust all proxies.

@CubicrootXYZ, in its current state the changes would break existing configurations where PushBits runs behind a proxy. One can make the case to force breaking these configurations for the sake of the user's security, so I'd like to have your input on this :)

eikendev commented 2 years ago

I added the -x,--proxy flag to pbcli to make debugging easier.

CubicrootXYZ commented 2 years ago

Does this really break the application? As far as I can see this only affects how the client IP is read. Do not see where we even use that?

eikendev commented 2 years ago

Ah, you're actually right! Only thing that would change is the IP address shown in the log output: it would always show the IP of your proxy if that proxy is not configured as trusted.