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

Add proxies to requests to varfish-docker-compose-ng container #10

Closed
gromdimon opened this issue Jul 19, 2023 · 1 comment · Fixed by #12
Closed

Add proxies to requests to varfish-docker-compose-ng container #10

gromdimon opened this issue Jul 19, 2023 · 1 comment · Fixed by #12
Assignees
Labels
enhancement New feature or request

Comments

@gromdimon
Copy link
Contributor

Allow Proxies for Requests to Docker Container

Problem:
There is an issue with sending requests to the Docker container (varfish-docker-compose-ng) hosting the REST APIs. The container can only be accessed through local network or through proxies due to network restrictions, making direct requests impossible.

Proposed Solution:
To address this problem, we would like to implement a feature that allows the usage of proxies for all requests made to the Docker container. To ensure flexibility, the proxy settings should be configurable and read from a .env file, as they might vary depending on the deployment environment.

Details:

  1. Proxy Settings: The application should read proxy settings from the .env file, providing the ability to change proxies without modifying the codebase. If no proxies are specified, the default value should be set to "localhost."

  2. Transparent Implementation: The addition of proxies should be handled transparently by the application when making requests to the Docker container. The user should not be required to manually include proxy information in each request.

@gromdimon gromdimon added the enhancement New feature or request label Jul 19, 2023
@gromdimon gromdimon self-assigned this Jul 19, 2023
@holtgrewe
Copy link
Member

Actually, I'd suggest to have them default to their names in the Docker Compose environment:

  • REEV_BACKEND_PREFIX_MEHARI=http://mehari
  • REEV_BACKEND_PREFIX_VIGUNO=http://viguno
  • REEV_BACKEND_PREFIX_ANNONARS=http://annonars

Users can then override it to http://localhost:3001 etc.

A good place to put the environment variables in the Python code is here

Development users would use source .env which has definitions with export REEV.... .env should go to .gitignore.

The front-end would make request to /proxy/mehari, /proxy/viguno, and /proxy/annonars.

This might be helpful for a reverse proxy implementation.

Ideally, we would have a test for this with stubbing out the actual request to httpx.AsyncClient.{build_request,send}.

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

Successfully merging a pull request may close this issue.

2 participants