-
Notifications
You must be signed in to change notification settings - Fork 116
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
Predictable gitolite usernames #22
Comments
If you want to do that I would suggest you to use an other file to store Redmine repos in Gitolite and use includes.
|
Thanks for the tip, but thats not what i want to do. Take a look at this: http://gitolite.com/gitolite/wild.html |
This can not be done since a repo must be linked to a project. |
Ok, then is it possible to have a persistent user name? something like |
I hacked up a patch that makes usernames more predictable. I didn't test it thoroughly, but it seems to work for me. With that patch, keyfiles will be named e.g. "keydir/username@1376320733_603897.pub" |
Just wondering, why is there a need to have a timestamp on the identifier at all? I am not familiar with any way that there is an issue having static gitolite and keyfile names across the board. I've run a modified version of John Kubitron's plugin for years now with this exact thing done and have had no issues. For my own knowledge, I'd like to know what issue is trying to be resolved by adding those. |
On 30/08/13 15:06, Robert Chady wrote:
I don't see a reason either. You could probably just as well use the |
This is exactly what I had done in the past. In my version I had made it possible to configure a prefix and suffix to the identifier, but in my installation I left both blank and just ran it that way. In effect, it allowed me to use Redmine as the front-end for my users to manage their SSH keys. Was afraid I was missing some key reason for the current logic. Thanks! |
I think the timestamps are here to avoid conflicts with existing SSH keys, specially if you are in 'shared' configuration, for example if you store Gitlab projects and Redmine projects within the same Gitolite install. |
Because this plugin supports multiple keys per user http://gitolite.com/gitolite/users.html#multi-key |
After messing with this some more, my next question is... why use timestamps instead of using something like user@redmine_#{key.identifier}.pub ? Seems like that would be easier to deal with than long timestamps? |
To avoid key overwrite between users :) Try it, have fun! |
It would be great to have an option to remove the "redmine_" prefix. I use a construct like repo users/CREATOR/[a-zA-Z0-9].* where CREATOR gets replaced by the username. It would be much nicer if the username would be identical to the username of the redmine account. |
Uhm, no. Some people use multiple ssh private keys (one for every workstation/laptop, Windows/Linux etc). I've seen users with up to 4 keys in our gitolite installation. |
forouher, for what you want, I would suggest changing the keyfiles to be user@redmine_#{key.identifier}.pub. To make this work though, you have to make the configuration file entries be just user -- this will cause issues if you have the plugin trying to manage a single config file for all of the gitolite installation as it won't be able to tell which users are "its own". For me, this is a non-issue as I always put the managed configuration in a separate file so the plugin can own its own file and do whatever it wants with it and I can manage other files as I see fit. |
On 12/09/13 22:00, Robert Chady wrote:
Yeah, that might work. I think I'll do this and give n-rodriguez' thanks |
You're right and the plugin (both version) supports it :) |
I do the same, maybe this sould be the default configuration? |
Note that the new key format (redmine_nicolas@redmine_1378084302_740798.pub) is also the key identifier : redmine_nicolas@redmine_1378084302_740798 (without the .pub) |
Unfortunately, when you use the key identifier in the configuration file like that, you no longer can easily access it manually from other parts of the config. This is why I made the identifier become just the username in my installation. The keyfiles are all unique, but I can also use 'rchady' elsewhere in the system, for wildcard repos for example, and it all works. |
Can you show me an example please? because I don't really understand |
I store all of my redmine managed projects in "managed.conf". With the way the plugin is currently, if you look in there you will see entries like: repo /foo/bar With that form, it relates to a keyfile of the same name. Now, if you want to use that elsewhere in the system... for example "unmanaged.conf", you can't. With the changes I run locally, which now that I look back are similar to what is in forouher@9fb303 above, you can have: repo /foo/bar This relates to a keyfile of n-rodriguez@redmine_23423_234. Does that help? |
Ok! I have been misunderstood ^^
Is that good for you? |
Not really... there is another underlying issue here and that is redmine_git_hosting (RGH) expects to have full control over any keys in the configuration file that match its syntax. This means it is not possible to re-use the keys managed by RGH in any configuration file that RGH manages, period. If that is the case, then adding the extra redmine_ prefix buys you nothing other than the very limited case of you having extra keys that you add to the same managed configuration file. |
You mean 'that RGH does not manage'? |
Is there currently a fix for this? I'm looking to do precisely what @rchady was doing. |
@xSmurf yes : use a separate Gitolite config file for Redmine and set it in plugin settings. |
@n-rodriguez that still has the |
@xSmurf : can you be more specific? |
After I changed the gitolite config file and removed the |
Is is possible to have predictable (and probably friendly) users in gitolite being generated by this plugin? This will be useful for scenarios in which this plugin should be bypassed (Like user created repos in gitolite. )
The text was updated successfully, but these errors were encountered: