From de4f540ed108996e82cf687c29aacf520dda7d11 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 12 Jun 2020 23:19:34 +0100 Subject: feat(monorepo-gerrit): Configure outbound emails for reviews Configures Gerrit send emails from tvlbot@tazj.in for outgoing review notifications. Emails are always plain-text and can contain diffs (up to a maximum size of 256KiB). The configuration options for this are documented at: https://gerrit-review.googlesource.com/Documentation/config-gerrit.html#sendemail Note: The password for this user is stored on the host, in a file that is not part of version-control and is only readable by the 'git' user. We should probably figure out a way to do secrets management ... Change-Id: I2f99b34b1a774c28d814b0aba1f1b78fd512854e Reviewed-on: https://cl.tvl.fyi/c/depot/+/92 Reviewed-by: riking --- ops/nixos/modules/monorepo-gerrit.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'ops') diff --git a/ops/nixos/modules/monorepo-gerrit.nix b/ops/nixos/modules/monorepo-gerrit.nix index b51a6d8b294c..174c59948e29 100644 --- a/ops/nixos/modules/monorepo-gerrit.nix +++ b/ops/nixos/modules/monorepo-gerrit.nix @@ -45,6 +45,25 @@ in { # TODO(tazjin): Assuming this is what we'll be doing ... groupMemberPattern = "(&(objectClass=group)(member=\${dn}))"; }; + + # Email sending (emails are relayed via the tazj.in domain's + # GSuite currently). + # + # Note that sendemail.smtpPass is stored in + # $site_path/etc/secure.config and is *not* controlled by Nix. + # + # Receiving email is not currently supported. + sendemail = { + enable = true; + html = false; + connectTimeout = "30sec"; + from = "TVL Code Review "; + includeDiff = true; + smtpEncryption = "tls"; + smtpServer = "smtp.gmail.com"; + smtpServerPort = 587; + smtpUser = "tvlbot@tazj.in"; + }; }; }; -- cgit 1.4.1