Working postgresql crowdsec config + remove fail2ban
Some checks are pending
/ Build Nix targets (push) Waiting to run

This commit is contained in:
Théo Barnouin 2025-04-14 15:28:01 +02:00
parent fd8349cf91
commit d6eb45c45a
4 changed files with 42 additions and 40 deletions

View file

@ -189,7 +189,7 @@ in {
job_name = "jellyfin";
static_configs = [
{
targets = ["192.168.1.42:9100"];
targets = ["192.168.1.42:9002"];
}
];
}
@ -256,6 +256,15 @@ in {
}
];
}
{
job_name = "crowdsec_postgresql";
metrics_path = "/metrics";
static_configs = [
{
targets = ["192.168.1.13:6060"];
}
];
}
];
};
loki = {

View file

@ -45,9 +45,8 @@ in {
localConfig = {
acquisitions = [
{
filenames = [
"/var/log/postgresql/*.log"
];
source = "journalctl";
journalctl_filter = [ "_SYSTEMD_UNIT=postgresql.service" ];
labels = {
type = "syslog";
};
@ -89,6 +88,7 @@ in {
GRANT ALL PRIVILEGES ON DATABASE onlyoffice TO onlyoffice;
'';
};
};
# Stolen from https://discourse.nixos.org/t/assign-password-to-postgres-user-declaratively/9726/3
# This is an awful situation
systemd.services.postgresql.postStart = let
@ -119,7 +119,6 @@ in {
END $$;
EOF
'';
};
networking.firewall.allowedTCPPorts = [5432];
};
}

View file

@ -112,9 +112,6 @@
}
];
};
fail2ban = {
enable = true;
};
crowdsec = {
enable = true;
package = pkgs.crowdsec;

View file

@ -99,9 +99,6 @@
}
];
};
fail2ban = {
enable = true;
};
crowdsec = {
enable = true;
package = pkgs.crowdsec;