blob: 1771d814d3aa983dbe76248e143373e9fb95039c [file] [log] [blame]
Nico Hubera1a296f2023-06-25 10:07:07 +00001#!/bin/sh
2
3set -e
4
Nico Huberf0201522023-07-21 13:59:04 +00005config=/var/gerrit/etc/gerrit.config
6
Nico Huberd9d54fe2023-07-21 04:07:05 +00007{
Nico Huberf0201522023-07-21 13:59:04 +00008 git config -f ${config} --unset-all auth.trustedOpenID || true
9 git config -f ${config} --add auth.trustedOpenID https://
10 git config -f ${config} --add auth.trustedOpenID imported:
Nico Huberd9d54fe2023-07-21 04:07:05 +000011}
12
Nico Huber54073102023-06-25 11:36:59 +000013if [ "${GITHUB_OAUTH_CLIENT_ID}" -a "${GITHUB_OAUTH_CLIENT_SECRET}" ]; then
Nico Huberf0201522023-07-21 13:59:04 +000014 git config -f ${config} \
Nico Huber54073102023-06-25 11:36:59 +000015 plugin.gerrit-oauth-provider-github-oauth.root-url "https://github.com/"
Nico Huberf0201522023-07-21 13:59:04 +000016 git config -f ${config} \
Nico Huber54073102023-06-25 11:36:59 +000017 plugin.gerrit-oauth-provider-github-oauth.client-id "${GITHUB_OAUTH_CLIENT_ID}"
Nico Huberf0201522023-07-21 13:59:04 +000018 git config -f ${config} \
Nico Huber54073102023-06-25 11:36:59 +000019 plugin.gerrit-oauth-provider-github-oauth.client-secret "${GITHUB_OAUTH_CLIENT_SECRET}"
Nico Huberf0201522023-07-21 13:59:04 +000020 git config -f ${config} --add auth.trustedOpenID github-oauth:
Nico Huber54073102023-06-25 11:36:59 +000021fi
22
Nico Huber177e6102023-07-25 13:39:16 +000023if [ "${GERRIT_USER_EMAIL}" -a "${GERRIT_MAIL_PASSWORD}" ]; then
Nico Huberf0201522023-07-21 13:59:04 +000024 git config -f ${config} user.email ${GERRIT_USER_EMAIL}
25 git config -f ${config} sendemail.smtpServer mail.${SA_PUBLIC_DOMAIN_NAME}
26 git config -f ${config} sendemail.smtpServerPort 465
27 git config -f ${config} sendemail.smtpEncryption ssl
28 git config -f ${config} sendemail.smtpUser ${GERRIT_USER_EMAIL}
Nico Huber177e6102023-07-25 13:39:16 +000029 git config -f ${config} sendemail.smtpPass ${GERRIT_MAIL_PASSWORD}
Nico Huberf0201522023-07-21 13:59:04 +000030 git config -f ${config} sendemail.html false
Nico Huberb650ed42023-07-20 17:08:54 +000031fi
32
Nico Hubera1a296f2023-06-25 10:07:07 +000033exec /entrypoint.sh "$@"