Project

General

Profile

Actions

Feature #6619

closed

[Deployment] [Documentation] Install system-wide git credential helper for arvados-hosted https git-urls

Added by Tom Clegg almost 9 years ago. Updated over 8 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
Deployment
Target version:
Story points:
-

Description

Git can be configured to use the ARVADOS_API_TOKEN environment variable to authenticate to gitolite. A single-user setup would look like this:
  • git config 'credential.https://git.zzzzz.arvadosapi.com/.username' none
    git config 'credential.https://git.zzzzz.arvadosapi.com/.helper' \
     '!cred(){ cat >/dev/null; if [ "$1" = get ]; then echo password=$ARVADOS_API_TOKEN; fi; };cred'
    
  • See source:services/arv-git-httpd/server_test.go#L77 for a working example used in the test suite.

(The literal username "none" is for real. It's just a placeholder; the arv-git-httpd server ignores it.)

This should be enabled by default on all shell VMs by running git config --system ..., installing a /etc/gitconfig with puppet, or [...].

This setup should also be documented at http://doc.arvados.org/install/install-shell-server.html


Subtasks 1 (0 open1 closed)

Task #6671: Review branch: 6619-doc-updateResolvedRadhika Chippada07/20/2015Actions

Related issues

Blocks Arvados - Idea #6617: [Workbench] [Documentation] Display https url in repositories panel in manage_account page. Update documentation as needed.ResolvedRadhika Chippada07/17/2015Actions
Actions #1

Updated by Nico César almost 9 years ago

Personally I don't like doing --system level configurations because we could be using git clone for other stuff, with unwanted consecuences. Correct me if I'm wrong the "git config" could be done when the user is created and only once. sound like a job for /usr/local/arvados/install-arvados-tokens.rb or /usr/local/arvados/update-shell-accounts.rb.

Actions #2

Updated by Tom Clegg almost 9 years ago

Nico Cesar wrote:

Personally I don't like doing --system level configurations because we could be using git clone for other stuff

This config only applies to urls with the given form, and only if not overridden in --global or per-repo configs or on the command line. It looks like this in .gitconfig:

[credential "https://git.zzzzz.arvadosapi.com/"]
    username = none
    helper = "!cred(){ cat >/dev/null; if [ \"$1\" = get ]; then echo password=$ARVADOS_API_TOKEN; fi; };cred" 

Using "git clone for other stuff" wouldn't be affected unless it was cloning from https://git.zzzzz.arvadosapi.com/ (and didn't want to specify/override). And Arvados tokens are the only way to authenticate to those URLs. Using "your token" automatically for arvados git urls seems no more intrusive than defaulting to ~/.ssh/id authentication for SSH git urls...?

I figured using system level config would make it easier for us to update the default/automatic config without mucking with users' own configs. But I suppose that only holds for shared shell VMs, so maybe it's no big win.

Anyway, if it makes more sense to put it in each user's ~/.gitconfig that's totally fine. As long as it's enabled by default for all logins, it's all the same to me...

Actions #3

Updated by Tom Clegg almost 9 years ago

  • Description updated (diff)
Actions #4

Updated by Nico César almost 9 years ago

(.. I agree on all the stuff cutted here...)

Tom Clegg wrote:

I figured using system level config would make it easier for us to update the default/automatic config without mucking with users' own configs. But I suppose that only holds for shared shell VMs, so maybe it's no big win.

Anyway, if it makes more sense to put it in each user's ~/.gitconfig that's totally fine. As long as it's enabled by default for all logins, it's all the same to me...

it's almost the same effort for the current state of the art. one is a global file provided by puppet, the other one is modifing the create_user script.

I have no strong preferences here. I think the user modification will keep it more aisolated. proabably is better down the road... but again. no particular preference.

any comment on thiss ward?

Actions #5

Updated by Ward Vandewege almost 9 years ago

Nico Cesar wrote:

(.. I agree on all the stuff cutted here...)

Tom Clegg wrote:

I figured using system level config would make it easier for us to update the default/automatic config without mucking with users' own configs. But I suppose that only holds for shared shell VMs, so maybe it's no big win.

Anyway, if it makes more sense to put it in each user's ~/.gitconfig that's totally fine. As long as it's enabled by default for all logins, it's all the same to me...

it's almost the same effort for the current state of the art. one is a global file provided by puppet, the other one is modifing the create_user script.

I have no strong preferences here. I think the user modification will keep it more aisolated. proabably is better down the road... but again. no particular preference.

any comment on this ward?

Systemwide seems fine since it's pretty narrow. Agree on the potential pitfalls of doing this systemwide by default, but it's only for the local git repo and users can still override this locally.

Actions #6

Updated by Tom Clegg almost 9 years ago

  • Target version set to Arvados Future Sprints
Actions #7

Updated by Tom Clegg almost 9 years ago

  • Target version changed from Arvados Future Sprints to 2015-08-05 sprint
Actions #8

Updated by Radhika Chippada almost 9 years ago

  • Assigned To set to Nico César
  • Target version changed from 2015-08-05 sprint to 2015-07-22 sprint
Actions #9

Updated by Nico César almost 9 years ago

  • Status changed from New to Resolved
Actions #10

Updated by Peter Amstutz almost 9 years ago

"Configure git to use the ARVADOS_API_TOKEN environment variable to authenticate to gitolite."

That's not quite right, it uses the ARVADOS_API_TOKEN to talk to arv-git-httpd, not gitolite. This should say:

"Configure git to use the ARVADOS_API_TOKEN environment variable to authenticate to arv-git-httpd."

Actions

Also available in: Atom PDF