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

Customizable URL for the info page #55

Closed
hho opened this issue Mar 1, 2018 · 2 comments
Closed

Customizable URL for the info page #55

hho opened this issue Mar 1, 2018 · 2 comments

Comments

@hho
Copy link

hho commented Mar 1, 2018

I'm using chartmuseum in a Docker container behind a reverse proxy.

I've set the --chart-url option, so the generated URLs in the index.yaml are correct.

However, the info page (when accessing the domain with a browser) shows the client IP instead:

To add this as a local chart repository, please run the following command:
helm repo add chartmuseum https://10.11.12.13

It would be nice to have the URL in there also customizable.

Thanks!

@jdolitsky
Copy link
Contributor

@hho We are using the github.com/gin-contrib/location lib to determine this

Could you try setting the X-Host header on your requests passed to upstreams?

I'm seeing this in the code: https://github.com/gin-contrib/location/blob/911ef8299476b8a48e11ec0c26f2a0810345b690/config.go#L64

@hho
Copy link
Author

hho commented Mar 1, 2018

That changed nothing. Again, the client's IP is shown.

My Go skills are nonexistent, but I think I figured out, what happens:

We're not even getting to Line 64, because the header is already set and it returns a line earlier. That field is set in Line 32, but it's using the X-Forwarded-For header (which is the client's IP!) and not the X-Forwarded-Host header, which would be correct.

So I think it's a bug in that library, and I wanted to open an issue – but it turns out, it has already been open for more than half a year: gin-contrib/location#15 😞

Closing, as this has to be fixed upstream.

EDIT: Wow, the fix was proposed even earlier and rejected because "it would be a breaking change": gin-contrib/location#13 😠

EDIT2: So yeah, the info page gets rendered correctly if I remove the X-Forwarded-For header. However, then the clientIP in the logs is of course no longer correct...

@hho hho closed this as completed Mar 1, 2018
@jdolitsky jdolitsky added this to the Performance milestone Mar 8, 2018
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

No branches or pull requests

2 participants