add smtp settings to gitea

This commit is contained in:
Vivian 2022-09-25 16:42:18 +02:00
parent 6e729ee58b
commit f61d27d774
2 changed files with 25 additions and 0 deletions

View file

@ -3,6 +3,9 @@
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ lib, config, pkgs, ... }: { lib, config, pkgs, ... }:
let
vs = config.vault-secrets.secrets;
in
{ {
imports = [ ]; imports = [ ];
@ -28,6 +31,11 @@
maxretry = 3; maxretry = 3;
}; };
vault-secrets.secrets.gitea = {
user = "gitea";
group = "gitea";
};
system.activationScripts.gitea-theme = system.activationScripts.gitea-theme =
let let
target_dir = "${config.services.gitea.stateDir}/custom/public/css/"; target_dir = "${config.services.gitea.stateDir}/custom/public/css/";
@ -44,6 +52,7 @@
lfs.enable = true; lfs.enable = true;
dump.type = "tar.gz"; dump.type = "tar.gz";
database.type = "postgres"; database.type = "postgres";
mailerPasswordFile = "${vs.gitea}/mailPassword";
settings = { settings = {
repository = { repository = {
@ -74,6 +83,19 @@
"PROVIDER" = "db"; "PROVIDER" = "db";
"COOKIE_SECURE" = true; "COOKIE_SECURE" = true;
}; };
mailer = {
"ENABLED" = true;
"IS_TLS_ENABLED" = true;
"HOST" = "mail.0x76.dev:465";
"FROM" = "gitea@0x76.dev";
"MAILER_TYPE" = "smtp";
"USER" = "gitea@0x76.dev";
# Below is prep for 1.18
"PROTOCOL" = "smtps";
"SMTP_ADDR" = "mail.0x76.dev";
"SMTP_PORT" = 465;
};
}; };
}; };
} }

View file

@ -42,6 +42,9 @@ let vs = config.vault-secrets.secrets; in
"keycloak@0x76.dev" = { "keycloak@0x76.dev" = {
hashedPasswordFile = "${vs.mailserver}/keycloak@0x76.dev"; hashedPasswordFile = "${vs.mailserver}/keycloak@0x76.dev";
}; };
"gitea@0x76.dev" = {
hashedPasswordFile = "${vs.mailserver}/gitea@0x76.dev";
};
}; };
indexDir = "/var/lib/dovecot/indices"; indexDir = "/var/lib/dovecot/indices";