kubitron / redmine_git_hosting

A ChiliProject/Redmine plugin which makes configuring your own git hosting easy.
78 stars 15 forks source link

Plugin doesn't delete repositories with "daemon" access #35

Closed Lncn closed 12 years ago

Lncn commented 12 years ago

This might actually be a pull request of sorts, but the other day I simply noticed the plugin would give access to the git daemon in the gitolite config, yet when I tried to delete the project (and thus the repo from gitolite) it wouldn't delete the repositories as it didn't recognize the user "daemon" as a redmine user.

I'm not sure if this is intended or if there was some other way to do this, but I had to do add this patch to get this plugin to delete any repos at all:

diff --git a/vendor/plugins/redmine_git_hosting/lib/gitolite_conf.rb b/vendor/plugins/redmine_git_hosting/lib/gitolite_conf.rb
index dd2e23b..97c3cd2 100755
--- a/vendor/plugins/redmine_git_hosting/lib/gitolite_conf.rb
+++ b/vendor/plugins/redmine_git_hosting/lib/gitolite_conf.rb
@@ -65,7 +65,7 @@ module GitHosting
                end

                def is_redmine_key? keyname
-                       (GitolitePublicKey::ident_to_user_token(keyname) || keyname == DUMMY_REDMINE_KEY) ? true : false
+                       (GitolitePublicKey::ident_to_user_token(keyname) || keyname == DUMMY_REDMINE_KEY || keyname == "daemon") ? true : false
                end

               def changed?
kubitron commented 12 years ago

Actually -- fixing this already. Will have a test release up shortly.

kubitron commented 12 years ago

(don't want to quite do what you did, since do not want to remove "daemon" if not a redmine repo). Also, I'm fixing a couple of other bugs related to git daemon...

kubitron commented 12 years ago

Try the testing branch. This should fix the problem.

Also, I am going to close this complaint as a duplicate of #31. Please put further comments there.

Lncn commented 12 years ago

Okay thanks! I'll check it out

kubitron commented 12 years ago

This fix now moved to master branch.