2024-04-13 13:38:30 +00:00
|
|
|
{ config, pkgs, lib, publog, self, ... }:
|
2024-04-12 15:35:56 +00:00
|
|
|
|
2024-04-13 13:38:30 +00:00
|
|
|
let
|
|
|
|
# make the logs for this host "public" so that they show up in e.g. metrics
|
|
|
|
publog = vhost: lib.attrsets.unionOfDisjoint vhost {
|
|
|
|
extraConfig = (vhost.extraConfig or "") + ''
|
2024-04-14 17:18:40 +00:00
|
|
|
access_log /var/log/nginx/public.log vcombined;
|
2024-04-13 13:38:30 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
in
|
2024-04-12 15:35:56 +00:00
|
|
|
{
|
2023-07-04 17:56:58 +00:00
|
|
|
|
2023-07-13 09:05:07 +00:00
|
|
|
imports = [
|
|
|
|
./postgresql.nix
|
|
|
|
./actions-runner.nix
|
|
|
|
];
|
2023-07-04 17:56:58 +00:00
|
|
|
|
|
|
|
services.gitea = {
|
|
|
|
enable = true;
|
|
|
|
database = {
|
|
|
|
type = "postgres";
|
|
|
|
host = "/run/postgresql";
|
|
|
|
port = 5432;
|
|
|
|
};
|
2024-03-18 16:34:37 +00:00
|
|
|
lfs.enable = true;
|
2023-07-13 09:05:07 +00:00
|
|
|
package = self.packages.${pkgs.hostPlatform.system}.gitea;
|
|
|
|
|
|
|
|
settings.actions.ENABLED = true;
|
2024-06-10 09:21:00 +00:00
|
|
|
|
|
|
|
mailerPasswordFile = config.clanCore.facts.services.gitea-mail.secret.gitea-password.path;
|
|
|
|
|
2023-07-04 17:56:58 +00:00
|
|
|
settings.mailer = {
|
|
|
|
ENABLED = true;
|
|
|
|
FROM = "gitea@clan.lol";
|
2024-06-10 09:21:00 +00:00
|
|
|
USER = "gitea@clan.lol";
|
2024-06-10 09:52:34 +00:00
|
|
|
SMTP_ADDR = "mail.clan.lol";
|
|
|
|
SMTP_PORT = "587";
|
2023-07-04 17:56:58 +00:00
|
|
|
};
|
2024-06-10 09:21:00 +00:00
|
|
|
|
2023-07-04 17:56:58 +00:00
|
|
|
settings.log.LEVEL = "Error";
|
2023-07-05 13:22:57 +00:00
|
|
|
settings.service.DISABLE_REGISTRATION = false;
|
2023-07-04 17:56:58 +00:00
|
|
|
settings.metrics.ENABLED = true;
|
|
|
|
settings.server = {
|
2023-07-13 09:17:56 +00:00
|
|
|
APP_DATA_PATH = "/var/lib/gitea/data";
|
2023-07-04 17:56:58 +00:00
|
|
|
DISABLE_ROUTER_LOG = true;
|
|
|
|
ROOT_URL = "https://git.clan.lol";
|
|
|
|
HTTP_PORT = 3002;
|
|
|
|
DOMAIN = "git.clan.lol";
|
2023-10-24 16:13:48 +00:00
|
|
|
LANDING_PAGE = "explore";
|
2023-07-04 17:56:58 +00:00
|
|
|
};
|
2024-03-18 09:15:47 +00:00
|
|
|
settings.session.COOKIE_SECURE = true;
|
2023-07-04 17:56:58 +00:00
|
|
|
};
|
|
|
|
|
2024-06-10 09:21:00 +00:00
|
|
|
sops.secrets.web01-gitea-password.owner = config.systemd.services.gitea.serviceConfig.User;
|
|
|
|
|
2024-04-13 13:38:30 +00:00
|
|
|
services.nginx.virtualHosts."git.clan.lol" = publog {
|
2023-07-04 17:56:58 +00:00
|
|
|
forceSSL = true;
|
|
|
|
enableACME = true;
|
|
|
|
locations."/".extraConfig = ''
|
|
|
|
proxy_pass http://localhost:3002;
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|