From d2706fa246b27168dc82de208ca3fef75e71267f Mon Sep 17 00:00:00 2001 From: Siddharth Asthana Date: Sat, 17 Apr 2021 16:05:25 +0530 Subject: [PATCH] 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. --- scripts/lib/install | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/lib/install b/scripts/lib/install index c1b721499b..1e4f84d55e 100755 --- a/scripts/lib/install +++ b/scripts/lib/install @@ -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 <