gitea: setup mail

This commit is contained in:
h7x4
2024-05-12 01:46:18 +02:00
parent 1df959136d
commit f2caf60f62
2 changed files with 19 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
{ config, values, pkgs, ... }:
{ config, values, pkgs, lib, ... }:
let
cfg = config.services.gitea;
domain = "git.pvv.ntnu.no";
@@ -13,6 +13,11 @@ in {
owner = "gitea";
group = "gitea";
};
# (kerberos password for SMTP and IMAP)
"gitea/passwd-password" = {
owner = "gitea";
group = "gitea";
};
"gitea/passwd-ssh-key" = { };
"gitea/ssh-known-hosts" = { };
"gitea/import-user-env" = { };
@@ -31,6 +36,8 @@ in {
createDatabase = false;
};
mailerPasswordFile = config.sops.secrets."gitea/passwd-password".path;
settings = {
server = {
DOMAIN = domain;
@@ -39,6 +46,14 @@ in {
SSH_PORT = sshPort;
START_SSH_SERVER = true;
};
mailer = lib.mkIf config.services.postfix.enable {
ENABLED = true;
FROM = "gitea@pvv.ntnu.no";
PROTOCOL = "smtp";
SMTP_ADDR = "mail.pvv.ntnu.no";
SMTP_PORT = 587;
USER = "gitea@pvv.ntnu.no";
};
indexer.REPO_INDEXER_ENABLED = true;
service.DISABLE_REGISTRATION = true;
session.COOKIE_SECURE = true;