Incorrect paths in gitweb.cgi

When adding a Git repository to a domain, the image and stylesheet paths in gitweb.cgi are referencing a directory 'static' that doesn't exist, which breaks the design and layout when browsing the repository.

File: gitweb.cgi

our @stylesheets = ("static/gitweb.css");
our $logo = "static/git-logo.png";
our $favicon = "static/git-favicon.png";
our $javascript = "static/gitweb.js";

Removing 'static' fixes the problem. See below:

our @stylesheets = ("gitweb.css");
our $logo = "git-logo.png";
our $favicon = "git-favicon.png";
our $javascript = "gitweb.js";

-

Lewis

Status: 
Closed (fixed)

Comments

Do either of the files /var/www/git/gitweb.cgi or /usr/lib/cgi-bin/gitweb.cgi exist on your system? Virtualmin copies those files to each domain's git directory, if they exist ... so the incorrect static path could be coming from there.

Yes, I have /var/www/git/gitweb.cgi and there is also a /var/www/git/static directory. So in that context, the 'static' directory makes sense.

However, when copied to the virtual server, the contents of the 'static' directory (the images, css and js) are in the same directory as gitweb.cgi, with no 'static' folder.

Should I manually change the paths / create the static folder each time I create a new repository?

If you rename or delete that gitweb.cgi file and then disable and re-enable git for a domain, Virtualmin should fall back to using its own built-in copy of gitweb.cgi. Does that have the same problem on your system?

That is now working correctly.

1) I renamed /var/www/git/gitweb.cgi

2) I disabled and re-enabled git

3) The file created at /home/domain/public_html/git/gitweb.cgi seems to be a different version than I had previously, which I assume is the Virtualmin built-in copy that you mention.

Thanks for your help!

Great - I will have Virtualmin automatically avoid using the centos-supplied gitweb.cgi when it uses incorrect paths in future.