gitblit icon indicating copy to clipboard operation
gitblit copied to clipboard

Graph image using image link without added context

Open gitblit opened this issue 9 years ago • 5 comments

Originally reported on Google Code with ID 569

What steps will reproduce the problem?
1. Use a context path for gitblit (apache proxy) and set the `server.contextPath =
/gitblit`
2. When looking at the commit log of a repo, the graph to the left will show a broken
image link
3. Image link will say 'server-name/graph' instead of the desired 'server-name/gitblit/graph'


What is the expected output? What do you see instead?
I should see a working branch graph instead of a broken link.

What version of the product are you using? On what operating system?
I believe it's 1.6.2

Please provide any additional information below.
All the other links work fine, so I think it's just the graph that's broken.

Reported by eResonance on 2015-03-05 17:04:49

gitblit avatar Aug 12 '15 12:08 gitblit

Same issue running the WAR file in a root context.

I have an Apache VirtualHost pointing to gitblit running on the ROOT Context of a Tomcat
VirtualHost. 

Everything works fine, except for the graph image.

It appears to be fetching the image using the request hostname, instead of being relative
to the context.  If I inspect the broken image in Chrome, the image url is in fact
the proxied hostname, which is unreachable.

Reported by magno32 on 2015-05-21 22:32:50

gitblit avatar Aug 12 '15 12:08 gitblit

I'm seeing this problem in a slightly different way. In my case the context path is
being respected, but `web.canonicalUrl` is *not* being used. I'm getting broken links
because it's using the loopback adapter for some reason.

    http://127.0.0.1:8000/gitblit/graph/?r=training/foo.git&h=cd0364f7e95f0af8771f0df8dfb68643286e4d17&l=32

If there's a workaround, I'd be interested in hearing about it.

Reported by [email protected] on 2015-05-27 20:24:21


  • Attachment: Screen Shot 2015-05-27 at 4.19.14 PM.png
    Screen Shot 2015-05-27 at 4.19.14 PM.png

gitblit avatar Aug 12 '15 12:08 gitblit

PS: Using version 1.6.2 from the `jmoger/gitblit` Docker image.

Reported by [email protected] on 2015-05-27 20:25:49

gitblit avatar Aug 12 '15 12:08 gitblit

dear, [email protected] there is not bug for localhost. I have the same problem like you, I have google for solve it. So, you can see this post: https://github.com/gitblit/gitblit/blob/master/src/site/setup_proxy.mkd

So, if you have proxy (apache), you can use the following conf:

<VirtualHost *:80>
        ServerName git.company.ru
        ServerAlias www.git.company.ru
        Redirect / https://git.company.ru
</VirtualHost>



<VirtualHost git.company.ru:443>
        ServerName git.company.ru
        ServerAlias www.git.company.ru
        SSLEngine On
        SSLCertificateFile /etc/ssl/certs/git.company.ru.crt
        SSLCertificateKeyFile /etc/ssl/private/private.key
        SSLCACertificateFile /etc/ssl/intermediate-startssl.pem
        ServerAdmin [email protected]
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        <Location />
          ProxyPass http://git.company.ru:8080/
          ProxyPassReverse http://git.company.ru:8080/
          RequestHeader set X-Forwarded-Proto https
          RequestHeader set X-Forwarded-Port 443
        </Location>
</VirtualHost>

GusevVictor avatar Nov 18 '15 13:11 GusevVictor

Sounds like a duplicate of issue #855.

flaix avatar Dec 17 '16 20:12 flaix