blob: 5af70c9e1e45c9f2cc434c1cb173e402e3811c53 [file] [log] [blame]
#!/bin/sh
set -e
if [ "${GITHUB_OAUTH_CLIENT_ID}" -a "${GITHUB_OAUTH_CLIENT_SECRET}" ]; then
git config -f /var/gerrit/etc/gerrit.config \
plugin.gerrit-oauth-provider-github-oauth.root-url "https://github.com/"
git config -f /var/gerrit/etc/gerrit.config \
plugin.gerrit-oauth-provider-github-oauth.client-id "${GITHUB_OAUTH_CLIENT_ID}"
git config -f /var/gerrit/etc/gerrit.config \
plugin.gerrit-oauth-provider-github-oauth.client-secret "${GITHUB_OAUTH_CLIENT_SECRET}"
fi
secret=/var/gerrit/passwd/secret
{
if [ ! -f ${secret} ]; then
echo $(mktemp -u XXXXXXXXXXXXXXXX) >${secret}
fi
chmod 400 ${secret}
}
if [ "${GERRIT_USER_EMAIL}" ]; then
passwd=$(cat ${secret})
git config -f /etc/gerrit/gerrit.config user.email ${GERRIT_USER_EMAIL}
git config -f /etc/gerrit/gerrit.config sendemail.smtpServer mail.${SA_PUBLIC_DOMAIN_NAME}
git config -f /etc/gerrit/gerrit.config sendemail.smtpServerPort 465
git config -f /etc/gerrit/gerrit.config sendemail.smtpEncryption ssl
git config -f /etc/gerrit/gerrit.config sendemail.smtpUser ${GERRIT_USER_EMAIL}
git config -f /etc/gerrit/gerrit.config sendemail.smtpPass ${passwd}
git config -f /etc/gerrit/gerrit.config sendemail.html false
fi
exec /entrypoint.sh "$@"