install: Create a .gitconfig file for the zulip user.

For installs which use the `upgrade-zulip-from-git` process, the
deployment directory is a git checkout. This means that an
administrator can, as an emergency tool, run `git revert` and similar
commands -- assuming there is a `~/.gitconfig` set up for the zulip
user.

Add commands to `scripts/lib/install` to create a `~/.gitconfig` file
at installation time.  The `user.name` and `user.email` fields are set
to the hostname and passed-in `--email` value, respectively.

Fixes #18039.
This commit is contained in:
Siddharth Asthana 2021-04-17 16:05:25 +05:30 committed by Alex Vandiver
parent a6d950f73e
commit d2706fa246
1 changed files with 4 additions and 0 deletions

View File

@ -521,6 +521,10 @@ if has_class "zulip::app_frontend_base"; then
fi
fi
# Set up a basic .gitconfig for the 'zulip' user
su zulip -c "git config --global user.email $ZULIP_ADMINISTRATOR"
su zulip -c "git config --global user.name 'Zulip Server ($EXTERNAL_HOST)'"
if [ -n "$NO_INIT_DB" ]; then
set +x
cat <<EOF