git repository browsing impossible with passenger/modrails

Added by Raphaël Bauduin 125 days ago

Hi,

I have installed redmine to hangle a git project. I have alredy deployed several redmines in this config, but ran the app with mongrel or even webrick.
Now I try to run it with passenger/mod_rails and encounter a problem: the url /repositories/show/myproject lists the last commits, but doesn't show the repository browser.
Running the same installation with webrick, under the user redmine used by passenger to run the app, I get the repository browser displayed.

Looking at the template, there's this code:


  <% if !@entries.nil? && authorize_for('repositories', 'browse') %>
  <h3><%= l(:label_browse) %></h3>
  <%= render :partial => 'dir_list' %>
  <% end %>

And with passenger @entries is nil. It is set like this in the controller: @entries = @repository.entries('', @rev)

Does any one have a hint on how to correct this problem?

Thanks

Raph




Replies

RE: git repository browsing impossible with passenger/modrails - Added by Jim Mulholland 124 days ago

I'm not sure what this exact problem is, but I can verify that repository browsing does work with Passenger. I am running a Redmine instance through Passenger now and and browse a few git repos.

RE: git repository browsing impossible with passenger/modrails - Added by Raphaël Bauduin 124 days ago

Hey Jim,

Thanks for the info already! It means I have to search further :-)

What are the user rights and apache config in your setup?
I run redmine under the redmine user, the git repo is a shared repository owned by user git:git at /var/lib/git/myrepo , and redmine is in the group git.

HEre's my apache config:

DocumentRoot /usr/local/railsapps/redmine/public
RailsEnv development

User redmine can clone the git repo. And the application run with webrick shows the repository browser.

Any hint welcome!

Raph

RE: git repository browsing impossible with passenger/modrails - Added by Raphaël Bauduin 112 days ago

FYI, this was due to Redmine not finding the git executable when run with passenger.
I solved it by editing lib/redmine/scm/adapters/git_adapter.rb and changing the value of GIT_BIN to /usr/local/git/bin/git

Raph

RE: git repository browsing impossible with passenger/modrails - Added by Calvin Cheng 112 days ago

Does this have to do with the fact that your should be pointing to /var/lib/git/myrepo/.git instead of /var/lib/git/myrepo as indicated by you above?

If this is the case, then there shouldn't be a need for you to modify git_adapter.rb file.

Regards,
Calvin