This repository has been archived on 2024-11-21. You can view files and clone it, but cannot push or open issues or pull requests.
server_config/sys/srv/forgejo.nix

64 lines
1.6 KiB
Nix
Raw Normal View History

2024-08-23 21:01:33 +02:00
{
2024-08-24 09:52:56 +02:00
config,
lib,
...
}:
with lib; {
2024-08-23 21:01:33 +02:00
config = {
environment.etc."fail2ban/filter.d/gitea.local".text = ''
[Definition]
failregex = .*(Failed authentication attempt|invalid credentials|Attempted access of unknown user).* from <HOST>
ignoreregex =
'';
services = {
nginx = {
virtualHosts."git.posixlycorrect.com" = {
enableACME = true;
forceSSL = true;
extraConfig = ''
proxy_headers_hash_max_size 512;
proxy_headers_hash_bucket_size 128;
2024-08-24 09:52:56 +02:00
'';
2024-08-23 21:01:33 +02:00
locations."/".proxyPass = "http://localhost:9170";
};
};
fail2ban.jails.gitea.settings = {
filter = "gitea";
logpath = "${config.services.gitea.stateDir}/log/gitea.log";
maxretry = "10";
findtime = "3600";
bantime = "900";
action = "iptables-allports";
};
forgejo = {
enable = true;
lfs.enable = true;
useWizard = false;
settings = {
general.APP_NAME = "posixlycorrect";
server = {
DOMAIN = "git.posixlycorrect.com";
ROOT_URL = "https://git.posixlycorrect.com";
HTTP_PORT = 9170;
LANDING_PAGE = "explore";
};
# You can temporarily allow registration to create an admin user.
service.DISABLE_REGISTRATION = true;
# ver https://github.com/nektos/act
actions = {
ENABLED = false;
};
mailer = {
ENABLED = false;
};
};
};
};
};
}