forked from DGNum/infrastructure
Compare commits
No commits in common. "595407c13bc16e3932e8d04823291d514ccfe5d6" and "78854423814aed8b227898690419a251e64697f2" have entirely different histories.
595407c13b
...
7885442381
3 changed files with 1 additions and 58 deletions
|
@ -10,7 +10,6 @@ lib.extra.mkConfig {
|
||||||
"k-radius"
|
"k-radius"
|
||||||
"networking"
|
"networking"
|
||||||
"ups"
|
"ups"
|
||||||
"ulogd"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
extraConfig = {
|
extraConfig = {
|
||||||
|
|
|
@ -238,7 +238,7 @@ in
|
||||||
content = ''
|
content = ''
|
||||||
chain postrouting {
|
chain postrouting {
|
||||||
type nat hook postrouting priority 100;
|
type nat hook postrouting priority 100;
|
||||||
ip saddr 10.0.0.0/16 ether saddr 5c:64:8e:f4:09:06 snat ip to 129.199.195.130-129.199.195.158
|
ip saddr 10.0.0.0/16 snat ip to 129.199.195.130-129.199.195.158
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,56 +0,0 @@
|
||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
services = {
|
|
||||||
ulogd = {
|
|
||||||
enable = true;
|
|
||||||
logLevel = 5;
|
|
||||||
settings = {
|
|
||||||
global = {
|
|
||||||
logfile = "/var/log/ulogd.log";
|
|
||||||
stack = [ "ct1:NFCT,ip2str1:IP2STR,pgsql1:PGSQL" ];
|
|
||||||
};
|
|
||||||
ct1 = { };
|
|
||||||
pgsql1 = {
|
|
||||||
db = "ulogd";
|
|
||||||
user = "ulogd";
|
|
||||||
table = "ulog2_ct";
|
|
||||||
procedure = "INSERT_CT";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
postgresql = {
|
|
||||||
enable = true;
|
|
||||||
identMap = ''
|
|
||||||
ulogd-map root ulogd
|
|
||||||
'';
|
|
||||||
authentication = ''
|
|
||||||
local ulogd ulogd peer map=ulogd-map
|
|
||||||
'';
|
|
||||||
|
|
||||||
ensureUsers = [
|
|
||||||
{
|
|
||||||
name = "ulogd";
|
|
||||||
ensureDBOwnership = true;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
ensureDatabases = [ "ulogd" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
systemd.services.ulogd = {
|
|
||||||
serviceConfig.StateDirectory = "ulogd";
|
|
||||||
requires = [ "postgresql.service" ];
|
|
||||||
after = [ "postgresql.service" ];
|
|
||||||
path = [ config.services.postgresql.package ];
|
|
||||||
preStart = lib.mkAfter ''
|
|
||||||
if ! test -e "/var/lib/ulogd/.initialized"; then
|
|
||||||
psql -f "${pkgs.ulogd.doc}/share/doc/ulogd-pgsql/pgsql-ulogd2.sql" -d ulogd -U ulogd
|
|
||||||
touch "/var/lib/ulogd/.initialized"
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Reference in a new issue