My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 628: Welcome email contains intermal server IP address.
1 person starred this issue and may be notified of changes. Back to list
Status:  Invalid
Owner:  ----
Closed:  Jul 2010


Sign in to add a comment
 
Reported by eihena...@googlemail.com, Jul 19, 2010
Affected Version: 2.1.3

What steps will reproduce the problem?
1. Setup Gerrit to use HTTP
2. setup APACHE to redirect from https://foo.com/gerrit/ to -> http://internal:8080/gerrit/ using ProxyPass and ProxyPassReverse
3. Login and Register an email address

What is the expected output? What do you see instead?
Expect the welcome email to contain links to the gerrit installation @ https://foo.com/gerrit/.  

Email reads:

Welcome to Gerrit Code Review at internal-ip.

To add a verified email address to your user account, please click on the following link:

http://internal-ip:port/#VE,mericZaqLCOPbejjMUUHgqRj1oZHPZfWd2x+Rs1A==$ZW1tYW51ZWwuaWhlbmFjaG9AYWNjZW50dXJlLmNvbQ==

If you have received this mail in error, you do not need to take any action to cancel the account. The account will not be activated, and you will not receive any further emails.

If clicking the link above does not work, copy and paste the URL in a new browser window instead.

This is a send-only email address.  Replies to this message will not be read or answered.


Please provide any additional information below.

Is there like a self variable that can be set?

Jul 19, 2010
#1 sop@google.com
You probably need to change the httpd.listenUrl parameter
to be proxy-http:// rather than http://  This will modify
how the server reads the HTTP request to pay attention to
the proxy headers inserted by Apache, allowing it to use
the URL Apache is serving.

You can also set the gerrit.canonicalWebUrl parameter
to be the URL you want Gerrit accessed as.  Setting this
will help to ensure that Gerrit always knows its address,
even if its not currently handling a web request.

Both variables are in site_path/etc/gerrit.config.
Status: Invalid
Jul 19, 2010
#2 eihena...@googlemail.com
Hi,
Hi,

Thanks,

That almost worked.  I think you are right in that it is related to one of those parameters.  

http.listenrUrl now point to proxt-http and this now resolves correctly.. However there is another problem.  My APACHE server ProxyPass rules are something like:

ProxyPass /gerrit/ http://internal-ip:8080/
ProxyPassReverse /gerrit/ http://internal-ip:8080/

However the link that is created is omitting the gerrit/

e.g:
https://externalservername.com/#VE,q4FLRKTBuympzCOiQuoq04J/t1v3srz26DDxvQ==$ZW1tYW51ZWwuaWhlbmFjaG9AYWNjZW50dXJlLmNvbQ== 

Could those rules cause this problem?  

Regards,

EI
Jul 19, 2010
#3 sop@google.com
Yes.  If your Apache server has /gerrit/ as the URL
then you actually need to do:

  ProxyPass /gerrit/ http://internal-ip:8080/gerrit/

and setup the same thing in listenUrl:

  [http]
    listenUrl = proxy-http://internal-ip:8080/gerrit/

Jul 19, 2010
#4 eihena...@googlemail.com
|The question is how do I get gerrit to server from here?  http://internal-ip:8080/gerrit/ Jetty config or Apache?  Can I do that with just starting the gerrit.sh at command line?
Jul 19, 2010
#5 sop@google.com
The path portion of the URL in the apache
configuration must match the path portion
of the URL in gerrit.config's own http
listenUrl variable.

So if Apache has /gerrit/, you need to also
put that into the URL in gerrit.config.
Jul 20, 2010
#6 eihena...@googlemail.com
I overlooked that.  Thanks mate.. SOLVED
Sign in to add a comment

Powered by Google Project Hosting