The root disk hit 100%, so Forgejo could no longer write to its DB and murmur failed its -supw pre-start step after the last deploy. Nightly full-copy backups (30-day retention) included data/repo-archive, a download cache inflated to 7G by crawlers. - backup: exclude repo-archive; hardlink unchanged files against the previous snapshot via --link-dest; write SQLite DBs fresh with sqlite3 .backup instead of into hardlinked files - forgejo: clean the archive cache hourly and on start - nginx: serve robots.txt disallowing archive/commit/blame/compare paths - journald: cap at SystemMaxUse=1G Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
53 lines
971 B
Nix
53 lines
971 B
Nix
{ ... }:
|
|
|
|
{
|
|
nix = {
|
|
settings.experimental-features = "nix-command flakes";
|
|
gc = {
|
|
automatic = true;
|
|
dates = "weekly";
|
|
options = "--delete-older-than 14d";
|
|
};
|
|
optimise.automatic = true;
|
|
};
|
|
|
|
networking = {
|
|
useDHCP = true;
|
|
firewall.allowedTCPPorts = [
|
|
22
|
|
2222
|
|
80
|
|
443
|
|
];
|
|
};
|
|
|
|
time.timeZone = "Europe/Berlin";
|
|
|
|
boot.tmp.cleanOnBoot = true;
|
|
|
|
services.journald.extraConfig = "SystemMaxUse=1G";
|
|
|
|
services = {
|
|
openssh = {
|
|
enable = true;
|
|
ports = [ 2222 ];
|
|
settings = {
|
|
PasswordAuthentication = false;
|
|
KbdInteractiveAuthentication = false;
|
|
PermitRootLogin = "prohibit-password";
|
|
};
|
|
};
|
|
|
|
fail2ban = {
|
|
enable = true;
|
|
maxretry = 5;
|
|
bantime = "1h";
|
|
jails.nginx-botsearch.settings = {
|
|
enabled = true;
|
|
backend = "systemd";
|
|
filter = "nginx-botsearch";
|
|
maxretry = 3;
|
|
};
|
|
};
|
|
};
|
|
}
|