Update Sails.js configuration to fix TRUST_PROXY flag #223

Closed
opened 2026-02-04 17:55:44 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @StevenJCorreia on GitHub (Aug 31, 2022).

After my I implemented #283, I finally got around to integrating it into my production server and noticed that the remote (client) IP address was not being correctly forwarded through the proxy.

I realized that this is due to Sails.js requiring that http.trustProxy be a boolean, not a number like we are currently passing it. I assumed that Sails.js would just boolean-wrap the given value but it seems that is not the case here...

With that being said, the intended fix here would be to simply boolean-wrap the value as, for some reason, the application breaks on initialization if TRUST_PROXY is set to a boolean over a number within the docker-compose file.

Note: Funny enough, if you run this in development with TRUST_PROXY=true in the .env file, everything works - so maybe a docker-compose issue?

Either way, let me know if I can go ahead and implement the fix.

Originally created by @StevenJCorreia on GitHub (Aug 31, 2022). After my I implemented #283, I finally got around to integrating it into my production server and noticed that the remote (client) IP address was not being correctly forwarded through the proxy. I realized that this is due to Sails.js requiring that `http.trustProxy` be a `boolean`, not a `number` like we are currently passing it. I assumed that Sails.js would just boolean-wrap the given value but it seems that is not the case here... With that being said, the intended fix here would be to simply boolean-wrap the value as, for some reason, the application breaks on initialization if `TRUST_PROXY` is set to a boolean over a number within the `docker-compose` file. Note: Funny enough, if you run this in development with `TRUST_PROXY=true` in the `.env` file, everything works - so maybe a docker-compose issue? Either way, let me know if I can go ahead and implement the fix.
Author
Owner

@meltyshev commented on GitHub (Sep 2, 2022):

Sure! Please make a PR with a fix 🙏

@meltyshev commented on GitHub (Sep 2, 2022): Sure! Please make a PR with a fix 🙏
Author
Owner

@meltyshev commented on GitHub (Sep 3, 2022):

Fixed by https://github.com/plankanban/planka/pull/295. Thank you!

@meltyshev commented on GitHub (Sep 3, 2022): Fixed by https://github.com/plankanban/planka/pull/295. Thank you!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/planka#223