nixify some more bots

This commit is contained in:
Rouven Seifert 2023-09-12 11:09:32 +02:00
parent 970ddcdacb
commit 5cbf915808
Signed by: rouven.seifert
GPG key ID: B95E8FE6B11C4D09
7 changed files with 120 additions and 39 deletions

View file

@ -212,6 +212,55 @@ in
enable = true;
postfix.enable = true;
locals = {
"neural.conf".text = ''
servers = "127.0.0.1:6379";
enabled = true
rules {
"LONG" {
train {
max_trains = 5000;
max_usages = 200;
max_iterations = 25;
learning_rate = 0.01,
}
symbol_spam = "NEURAL_SPAM_LONG";
symbol_ham = "NEURAL_HAM_LONG";
ann_expire = 100d;
}
"SHORT" {
train {
max_trains = 100;
max_usages = 2;
max_iterations = 25;
learning_rate = 0.01,
}
symbol_spam = "NEURAL_SPAM_SHORT";
symbol_ham = "NEURAL_HAM_SHORT";
ann_expire = 1d;
}
}
'';
"neural_group.conf".text = ''
symbols = {
"NEURAL_SPAM_LONG" {
weight = 1.0; # sample weight
description = "Neural network spam (long)";
}
"NEURAL_HAM_LONG" {
weight = -1.0; # sample weight
description = "Neural network ham (long)";
}
"NEURAL_SPAM_SHORT" {
weight = 1.0; # sample weight
description = "Neural network spam (short)";
}
"NEURAL_HAM_SHORT" {
weight = -0.5; # sample weight
description = "Neural network ham (short)";
}
}
'';
"worker-controller.inc".text = ''
password = "$2$g1jh7t5cxschj11set5wksd656ixd5ie$cgwrj53hfb87xndqbh5r3ow9qfi1ejii8dxok1ihbnhamccn1rxy";
'';
@ -219,6 +268,16 @@ in
read_servers = "127.0.0.1";
write_servers = "127.0.0.1";
'';
"dmarc.conf".text = ''
reporting {
# Required attributes
enabled = true; # Enable reports in general
email = 'reports@rfive.de'; # Source of DMARC reports
domain = 'rfive.de'; # Domain to serve
org_name = 'rfive.de'; # Organisation
from_name = 'DMARC Aggregate Report';
}
'';
};
};
redis = {

View file

@ -1,12 +1,10 @@
{ ... }:
{ config, ... }:
{
# currently quite ugly and stateful. #todo nixify
systemd.services.pfersel = {
after = [ "network-online.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
WorkingDirectory = "/root/Pfersel";
ExecStart = "/root/Pfersel/venv/bin/python3 bot.py";
sops.secrets."pfersel/token".owner = "pfersel";
services.pfersel = {
enable = true;
discord = {
tokenFile = config.sops.secrets."pfersel/token".path;
};
};
}