git/list[1] front-page[2] threads[3] people[4] search[5] about
 

gitosis question: identifying/logging remote user

From
Sitaram Chamarty <sitaramc@gmail.com>
Date
Jun 2, 2009, 04:02 UTC
Message-ID
<2e24e5b90906012102y4e1e6281p437e4d88da517c08@mail.gmail.com>
Hi,
Summary:

I want to be able to log the information that the post-receive hook receives, but I *also* want, along with that, the name of the pubkey that was used in this particular "push".

Detail:

gitosis uses lines in ~git/.ssh/authorized_keys that use ssh's "command=" feature. Specifically, the command is restricted to "gitosis-serve username". Internally, gitosis uses this name to decide if you're allowed to do what you're trying to do.

I'd like it to set an additional env var which will contain "username" so that hooks etc can get that info and use it as they they see fit.

Q1: are there any downsides to doing this?  I don't see any, you're
just creating and setting a new variable but...
Q2: if it's a good idea, can someone give me a hint about where to do
this?  I'm useless at python but I'm willing to try.
Thanks,
Sitaram
Next: Robin H. Johnson
Message 1 of 11 in “gitosis question: identifying/logging remote user”
  1. Sitaram ChamartyJun 2, 2009
  2. Robin H. JohnsonJun 2, 2009
  3. Sitaram ChamartyJun 2, 2009
  4. Robin H. JohnsonJun 2, 2009
  5. Sitaram ChamartyJun 3, 2009
  6. Add USER environment variable to executed git commands when servingHeiko Voigt, Jun 2, 2009
  7. Sitaram ChamartyJun 3, 2009
  8. Sitaram ChamartyJun 3, 2009
  9. Heiko VoigtJun 3, 2009
  10. Robin H. JohnsonJun 3, 2009
  11. Shawn O. PearceJun 3, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.