Vote #64456
未完了Redmine management of Git repositories
80%
説明
This patch introduces Redmine management of Git repositories.
The design is based on the Gitosis tool.
- To enable the feature check 'Serve Git repositories using Redmine's SSH account' in global Settings/Repositories.
- Then each user can specify its public SSH key in the My Account page
- Redmine is configuring '~/.ssh/authorized_keys' file to allow SSH for Redmine users authorized by SSH public key. The shell is restricted to Redmine's GitManager:serve function.
- This function then checks the corresponding rights of the user who logs in to the repository he wants to access. Also it rewrites the URL to the repository, so the user can specify simpler version: 'redmine_user@server_name:redmine_project_identifier'.
- If the repository does not exists, it is created on the fly
- Redmine also installs own hooks which further check the correctness of the commits pushed to the repo, ex: ** Is the commiter of the commit equal to the user which pushes to the repository ** Is the push fast-forward ** Are the referenced issues correct
The patch is probably still very buggy. No localization. No much tests. Nevertheless it works for me on my Linux machine. I'm posting for wider review. Comments welcomed.
journals
--------------------------------------------------------------------------------
Sentinel T wrote:
> This patch introduces Redmine management of Git repositories.
> The design is based on the Gitosis tool.
> * To enable the feature check 'Serve Git repositories using Redmine's SSH account'
> in global Settings/Repositories.
> * Then each user can specify its public SSH key in the My Account page
> * Redmine is configuring '~/.ssh/authorized_keys' file to allow SSH for Redmine users
> authorized by SSH public key. The shell is restricted to Redmine's GitManager:serve function.
> * This function then checks the corresponding rights of the user who logs in
> to the repository he wants to access. Also it rewrites the URL to the repository,
> so the user can specify simpler version: 'redmine_user@server_name:redmine_project_identifier'.
> * If the repository does not exists, it is created on the fly
> * Redmine also installs own hooks which further check the correctness of the commits
> pushed to the repo, ex:
> ** Is the commiter of the commit equal to the user which pushes to the repository
> ** Is the push fast-forward
> ** Are the referenced issues correct
>
> The patch is probably still very buggy. No localization. No much tests. Nevertheless it works for me on my Linux machine. I'm posting for wider review. Comments welcomed.
I really like what you've done here I hope you keep up on it and it becomes an addition to redmine officially
--------------------------------------------------------------------------------
*Sentinel T*, your patch works great on my server. It makes dealing with git repos just as easy as github, great work!
I did have a problem with the changeset.rb file through, when I do a new comment that closed a ticket, it crashes repository page. Reverting back to the unpatched changeset.rb file fixed this.
Also it would be very cool to have support for multiple ssh keys per account. I normally use the same account on my laptop, and it's easier to just generate a second key instead of copying my private key.
Thanks for the patch!
--------------------------------------------------------------------------------
Isaiah DeRose-Wilson wrote:
> I did have a problem with the changeset.rb file through, when I do a new comment that closed a ticket, it crashes repository page. Reverting back to the unpatched changeset.rb file fixed this.
I will look into this.
> Also it would be very cool to have support for multiple ssh keys per account. I normally use the same account on my laptop, and it's easier to just generate a second key instead of copying my private key.
This is doable. I only need to figure out how to design the GUI to allow entering unlimited number of keys.
--------------------------------------------------------------------------------
Thanks for the reply *Sentinel T*, I think this patch would be a great addition to the redmine core once it's tested a bit more.
--------------------------------------------------------------------------------
Any update on this patch?
If needed, I can help in bug fixing it. Great way to serve Git without relying on WebDav.
--------------------------------------------------------------------------------
I've rewritten bunch of code, added support for multiple SSH keys per account and SSHV1 keys - previously AuthorizedKeysEntry model crashed on SSHV1 keys. I've also changed the UI on 'My Account' page. The patch still needs a lot of polishing when it comes to UI, i18n support and tests.
Applicable against 0.8.2
--------------------------------------------------------------------------------
Forgot some files too ;p
--------------------------------------------------------------------------------
Had a bad day obviously... this one is good xD
--------------------------------------------------------------------------------
Is there any way this could go to a plugin, instead of a patch?
I'm using github's master branch right now, and still wishing to use some plugins and ScrumAlliance stuff.
That said, I don't think it's trivial to apply this patch to this already "random" version.
Anyway, if it's not possible or not viable, I think I can try to downgrade my version. I just need to be sure before :)
Oh, and thanks for the great work.
--------------------------------------------------------------------------------
I'll try to look into it if I'll have some free time next week
--------------------------------------------------------------------------------
Which version of redmine is the 04 patch made for? I've tried with the 0.8.3 release but it dosen't work (the pub key form in account.rhtml is rejected and repository auto-creation is not working).
--------------------------------------------------------------------------------
I would also love to see this as a plugin
great work though, this patch is the reason I decided to use redmine for my work
--------------------------------------------------------------------------------
Lorenzo Pisani wrote:
> I would also love to see this as a plugin
> great work though, this patch is the reason I decided to use redmine for my work
I totally agree, this patch makes git+redmine a great experience.
--------------------------------------------------------------------------------
Isaiah DeRose-Wilson wrote:
> Lorenzo Pisani wrote:
> > I would also love to see this as a plugin
> > great work though, this patch is the reason I decided to use redmine for my work
>
> I totally agree, this patch makes git+redmine a great experience.
Please keep me informed. After Googling, I've come to the conclusion that Redmine/Git is the ideal environment for our development team. I'm about to install, but I was wondering if instead of messing with patches (which I don't know how to handle yet), it wouldn't be better to hang on for the plugin. Advice is warmly welcomed
--------------------------------------------------------------------------------
Tomek Piotrowski wrote:
> Had a bad day obviously... this one is good xD
Before I proceed to apply the patch (fingers crossed. I've never done this before), I'd like to ask if the patch is against any particular version/tag of Redmine.
Thanks
--------------------------------------------------------------------------------
Yitzhak Bar Geva wrote:
> Tomek Piotrowski wrote:
> > Had a bad day obviously... this one is good xD
>
> Before I proceed to apply the patch (fingers crossed. I've never done this before), I'd like to ask if the patch is against any particular version/tag of Redmine.
> Thanks
I think the patch was made for 8.2, hopefully someone that is better at ruby than me will update this patch to work with the latest version of redmine.
--------------------------------------------------------------------------------
Isaiah DeRose-Wilson wrote:
> Lorenzo Pisani wrote:
> > I would also love to see this as a plugin
> > great work though, this patch is the reason I decided to use redmine for my work
>
> I totally agree, this patch makes git+redmine a great experience.
+1. Are there plans to include this in 0.9?
--------------------------------------------------------------------------------
+1. I will need this because maintaining Gitosis with a lot of users/repos does not scale very well.
--------------------------------------------------------------------------------
I've fixed some issues with multiple keys per account. There is still known problem with uploading the same key multiple times.
To help you avoid any issues with applying the patch I've uploaded the changes to git-hub:
http://github.com/sentinelt/redmine/commits/gitmanagement
Here is the link for the ZIP file with the entire Redmine 0.8.4 with the patch applied:
http://github.com/sentinelt/redmine/zipball/gitmanagement
> Is there any way this could go to a plugin, instead of a patch?
I don't think it is possible to write the entire patch as plugin. On the other hand I'm not Ruby/Rails guru...
--------------------------------------------------------------------------------
Hi, what is the status of this patch regarding redmine developpement? I mean, do you plan to include it in next redmine releases, or will it be updated to match current redmine release?
And last question, you updated progress to 80%, could you explain you you consider as being 100%, please?
Nevertheless, thanks a lot for this really usefull patch.
--------------------------------------------------------------------------------
+ 1
I'm looking forward to this.
--------------------------------------------------------------------------------
Matthieu Codron wrote:
> Hi, what is the status of this patch regarding redmine developpement?
I haven't contacted anyone from Redmine team regarding this patch yet. We are using Redmine heavily at Atteo.com. And this is one of the patches which we felt might be useful for the general consumption. If I get the approval from Redmine, I'm willing to invest some time to upgrade this patch into latest trunk.
> you updated progress to 80%, could you explain you you consider as being 100%, please?
It WorksForMe(tm). The last 20% is just to remind anyone that I haven't tested it a lot. Also I'm not regular Ruby/Rails/Redmine developer, so the code might need some rework before being included in the mainline.
--------------------------------------------------------------------------------
The settings file says "Serve GIT repositories using Redmine's SSH account." For those of us using Passenger, will this cause Git to be run using @www-data@?
Important question I have to ask.
--------------------------------------------------------------------------------
Sentinel T wrote:
> I haven't contacted anyone from Redmine team regarding this patch yet. We are using Redmine heavily at Atteo.com. And this is one of the patches which we felt might be useful for the general consumption. If I get the approval from Redmine, I'm willing to invest some time to upgrade this patch into latest trunk.
It would be very interseting, I think, for redmine users like my team :) What do Redmine team think about it?
> > you updated progress to 80%, could you explain you you consider as being 100%, please?
>
> It WorksForMe(tm). The last 20% is just to remind anyone that I haven't tested it a lot. Also I'm not regular Ruby/Rails/Redmine developer, so the code might need some rework before being included in the mainline.
If only I was a ruby developer, I'd like to help you reviewing thix code... but I have no knowledge in this area. I can only hope you'll find time, energy, and help from community to accomplish this.
--------------------------------------------------------------------------------
+1 for inclusion into 0.9 :-)
--------------------------------------------------------------------------------
Markus May wrote:
> +1 for inclusion into 0.9 :-)
0.9 has gone under feature freeze. Maybe if it's cleaned up in time for 1.0?
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
I think that this kind of functionality should be developed as a plugin, probably using some pre-existing tool like GitAuth. This would leave the code of Redmine free of such VCS-specific code. Furthermore since this is basically a kind of "Security-related" issue, I definitly would vote for using something like GitAuth, since they know their stuff and are doing this for more then Redmine.
Still +1 for soon implementation of this feature.
--------------------------------------------------------------------------------
Yes, it would better be a plugin.
I was thinking it could not be a plugin, but after thinking about it, it appears irt would be much more powerfull and secure to have a plugin that links redmine with gitolite.
Maybe refer to this forum thread on this idea: http://www.redmine.org/boards/1/topics/9909
--------------------------------------------------------------------------------
>Yes, it would better be a plugin.
What differs GIT from SVN and CVS (which are supported out of the box)?
--------------------------------------------------------------------------------
We're using a Gitosis-based approach for "Planio":http://plan.io. You can check out our plugin on "Github":http://github.com/rocket-rentals/redmine-gitosis. It works perfectly for us, however, I would love to see a GitAuth-based plugin evolving from this as it would help avoid a couple of shellouts and SSH hacks :)
--------------------------------------------------------------------------------
Any progress on this?
--------------------------------------------------------------------------------
Jan from www.plan.io wrote:
> We're using a Gitosis-based approach for "Planio":http://plan.io. You can check out our plugin on "Github":http://github.com/rocket-rentals/redmine-gitosis. It works perfectly for us, however, I would love to see a GitAuth-based plugin evolving from this as it would help avoid a couple of shellouts and SSH hacks :)
I tried to use your plugin, but I could not get it to work. I downloaded it, and put it in the redmine plugins directory. I did the migration. I then restarted apache and then found (through trial and error) that I needed the following ruby libraries installed: libnet-ssh2-ruby, liblockfile-ruby (these are the debian packages) and the gem 'inifile'. Once I figured that out, I tried to go use it, but I could not figure out how. There were no settings in the Admin interface, nor in the inidividual projects that I could find... I ended up disabling it, I sure would like it though.
--------------------------------------------------------------------------------
Ben Langfeld wrote:
> Any progress on this?
I've started some new work on the patch a few days ago.
Git recently added a way to push through HTTP (http://www.kernel.org/pub/software/scm/git/docs/howto/setup-git-server-over-http.txt). And I plan to add a support for that, so that during the push Git will ask for a Redmine's login and password. I'm also researching a bit for a way to authenticate the user password-less with SSL user certificates when serving using HTTPS.
I will also update the patch for the latest version of Redmine.
But it's not my goal to convert the patch to a plugin.
--------------------------------------------------------------------------------
Are there any plans on supporting gitolite since gitosis is deprecated?
--------------------------------------------------------------------------------
Very interesting functionality. Is it possible to apply this patch to redmine 1.x?
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
All, I've abandon this patch. In my own deployments I use Gerrit now configured to authenticate with Redmine. This solution provides all the functionality I wanted this patch to have.
--------------------------------------------------------------------------------
Hi, Sentinel,
How did you configure gerrit for redmine? Could you share your expirience? :)
--------------------------------------------------------------------------------
Hi Nicholas,
I tried to write another authorization method for Gerrit which used Redmine's user database. But it is still not in any usable state.
For the time being I've configured both Gerrit and Redmine to use common OpenID server for authorization.
Also I have 'change-merged' hook in Gerrit that triggers fetching of Git changes into Redmine.
--------------------------------------------------------------------------------
Thanks for information!
--------------------------------------------------------------------------------
The gitosis plugin is broken under 1.2.1. When Repository.fetch_changesets() is called from redmine, gitosis goes into what seems like an infinite loop of cloning gitosis-admin.git over and over and over again. The result is that the machines gets swamped and no changesets get fetched. Please see http://www.redmine.org/boards/2/topics/25785 and issues #8973 and #8857 for more information. The gitosis plugin is currently unusable under redmine 1.2.1, since the only way to get fetch_changesets to work is by uninstalling the gitosis plugin.
--------------------------------------------------------------------------------
Since your using 1.2.1 you might wanna consider upgrading to "gitolite":https://github.com/sitaramc/gitolite + "red mine_git_hosting":https://github.com/sitaramc/gitolite . The combination is more powerful and faster, plus it works with 1.2.x.
--------------------------------------------------------------------------------
Sorry, I double stuffed the links. Here is the "redmine_git_hosting":https://github.com/ericpaulbishop/redmine_git_hosting link.
--------------------------------------------------------------------------------
Thank you! We have been planning to switch to gitolite anyway, since it's far superior to gitosis.
--------------------------------------------------------------------------------
The redmine_git_hosting plugin doesn't look actively maintained...... and doesn't support redmine 2.x. There is a 2.0-migration branch but it hasn't been touched in the last ~4 months.
--------------------------------------------------------------------------------
William Van Hevelingen wrote:
> The redmine_git_hosting plugin doesn't look actively maintained...... and doesn't support redmine 2.x. There is a 2.0-migration branch but it hasn't been touched in the last ~4 months.
try this - https://github.com/jbox-web/redmine_git_hosting
it works fine with redmine 2.2.4, would be good if it's functionality could be bundled with redmine because its very essential to have working GIT management system with extended capabilities.
--------------------------------------------------------------------------------
related_issues
relates,New,7747,Add capability to ask\accept\reject review of patches (flag support on attachments)