Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the option to change the default trusted proxy #5916

Closed
wants to merge 2 commits into from

Conversation

gafda
Copy link
Contributor

@gafda gafda commented Feb 17, 2025

Summary

This gives the ability to choose what proxy to use as trustworthy.
The changes are focused on the api/server/index.js file.

Change Type

Please delete any irrelevant options.

  • Bug fix (non-breaking change which fixes an issue)
  • This change requires a documentation update

Config Changes

There are two new environment variables:

Key Type Description Example
TRUST_PROXY numeric Instructs LibreChat to use the proxy no. # as it's a trustworthy one. 1

Checklist

Please delete any irrelevant options.

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented on any complex areas of my code
  • My changes do not introduce new warnings
  • Any changes dependent on mine have been merged and published in downstream modules.

@gafda gafda marked this pull request as ready for review February 17, 2025 11:54
@danny-avila
Copy link
Owner

Thanks! Can you also add a PR for the documentation for this new environment variable?

https://github.com/LibreChat-AI/librechat.ai/blob/main/pages/docs/configuration/dotenv.mdx

# req.socket.remoteAddress is the first hop, and the rest are looked for in the X-Forwarded-For header from right to left.
# A value of 0 means that the first untrusted address would be req.socket.remoteAddress, i.e. there is no reverse proxy.
# Defaulted to 1.
TRUST_PROXY=1
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also add a PR for the documentation for this new environment variable

https://github.com/LibreChat-AI/librechat.ai/blob/main/pages/docs/configuration/dotenv.mdx

Copy link
Contributor

@pedrojreis pedrojreis Feb 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here it is, please let us know if you need any change :)

@danny-avila
Copy link
Owner

Thanks, merging here: #5963

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants