jgm / gitit

A wiki using HAppS, pandoc, and git
GNU General Public License v2.0
2.15k stars 225 forks source link

Empty ident when REMOTE_USER is an E-mail address #612

Open candlerb opened 6 years ago

candlerb commented 6 years ago

I have gitit setup behind a reverse proxy, where REMOTE_USER is set to a full E-mail address, by authenticating from mod_auth_openidc and a Google account.

RequestHeader set REMOTE_USER %{OIDC_CLAIM_email}e

The setting of the header works fine, however when I try to commit I get this error:

Happstack 7.4.5

Something went wrong here
Internal server error
Everything has stopped

The error was "UnknownError: Could not git commit git.page *** Please tell me who you are. Run
git config --global user.email "you@example.com" git config --global user.name "Your Name"
to set your account's default identity. Omit --global to set the identity only in this repository.
fatal: empty ident name (for <gitit@git.example.net>) not allowed "

Running strace -f -p <pid> on the gitit process, I see:

[pid  5548] execve("/usr/bin/git", ["git", "commit", "--author", "brian@example.com <>", "-m", "test edit", "git.page"], [/* 8 vars */]) = 0

That is, the ident within <> is empty.

Workaround: if I actually set an identity as suggested in the error

git config --global user.email gitit@example.com
git config --global user.name gitit

...then the web interface commit succeeds, although the commit messages still have the strange format:

Author: brian@example.com <>