Skip to content

Can I use separate Redmine and Gitolite servers? #330

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

Closed
ndarilek opened this issue Jan 26, 2015 · 7 comments
Closed

Can I use separate Redmine and Gitolite servers? #330

ndarilek opened this issue Jan 26, 2015 · 7 comments
Assignees
Labels

Comments

@ndarilek
Copy link

Apologies if there's a better forum for these types of questions, but the docs aren't too clear.

I'm hosting my environment in Docker containers. Redmine runs in one, and Gitolite runs in another. The installation instructions look fine until I reach the sudo step. At that point, it occurs to me that the expectation might be that Gitolite and Redmine are running on the same server. In my setup, it doesn't make sense to configure sudo because Redmine is accessing Gitolite remotely. I thought it just modified the gitolite-admin repository and maybe ran the occasional gitolite subcommand via SSH.

Is this supported? What happens if I don't configure sudo? I'm mainly interested in creating repositories from Redmine and managing user SSH keys.

@n-rodriguez n-rodriguez self-assigned this Jan 26, 2015
@n-rodriguez
Copy link
Contributor

Is this supported?

Nope.

What happens if I don't configure sudo?

It won't work.

This is a recurring question so I'm gonna update the doc : Redmine and Gitolite must be on the same server as Redmine needs to access to repository files (through sudo) to display them within the interface. On the top of that, think about the latency you could have when you browse your repository ;)

@n-rodriguez
Copy link
Contributor

#278

@n-rodriguez
Copy link
Contributor

#182

@carukc
Copy link

carukc commented Feb 13, 2015

Hi ndarilek,

I'm just looking at how I might deal with the same configuration (redmine in a docker container with the git repositories outside). If git/gitolite needs to be on the same machine I'm thinking that the way to go is to create a git user with matching userID in the container and then map the git account repositories directory within the container onto the same directory on the host server.

Have you otherwise made progress or thought of another way to get this working?

@carukc
Copy link

carukc commented Feb 21, 2015

Hello,

I've managed to get this plugin working with docker on ubuntu (with an ubuntu image) and phusion using a modified version of sameersbn's setup, install and init scripts. The tricks are to:

  • create a user in the container with the same user name and ID (git in my case) and map to the git user on the host server. For some reason I was unable to get ssh to connect to this user until I had first set a password for the git user in the container.. not sure why... it's quite bizarre.
  • create a host entry for the host server using it's fully qualified name and the containers gateway address (the host's docker address)
  • make sure that the app has all Redmine file ownerships sets correctly. in my case this was app:app.
  • make sure that all the keys are correct and that the container can get to the hose using git@localhost and/or [email protected]

Of course this is not particularly portable. A better solution would be to put git and gitolite in their own container (perhaps a data container), sync user name and ID and them map volumes between the two but I've not yet tried to do this because I do not yet need the portability.

I also got this working with postfix, redis and memcached on the host server by configuring both, on the host, to listen to the docker interface and the pass the addresses of these to the container as environment variables.

Caches, files, etc are all mapped onto a volume within a particular user's home directory as per sameersbn's setup.

Next I'm going to try to move the git repo directories into this same directory so that I can isolate all aspects of the install. I might try a data container for git/gitolite as well, next month.

I've not yet tested hooks but everything else seems to work and with the exception of redmine_git_hosting not being able to tell what version of gitolite is in use, everything seems to work.

@carukc
Copy link

carukc commented Feb 23, 2015

looks like I spoke too soon. When I go to a user page I get the following error:

Started GET "/users/8" for 90.155.11.150 at 2015-02-23 17:55:16 +0000
Processing by UsersController#show as HTML
Parameters: {"id"=>"8"}
Current user: quicksilver (id=6)
Rendered plugins/redmine_git_hosting/app/views/users/show.api.rsb within layouts/base (4.9ms)
Completed 500 Internal Server Error in 133.2ms

ActionView::Template::Error (No builder for format ):
1: api.user do
2: api.id @user.id
3: api.login @user.login if User.current.admin? || (User.current == @user)
4: api.firstname @user.firstname
lib/redmine/views/builders.rb:28:in for' app/controllers/users_controller.rb:76:inblock (2 levels) in show'
app/controllers/users_controller.rb:75:in `show'

so something is not quite right... or it's possible that my install is itself broken and docker has noting to do with this.

so close and yet so far!

@carukc
Copy link

carukc commented Feb 25, 2015

This turned out to be a bug and has been resolved. redmine_git_hosting now works fine now in docker if installed as noted above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants