mirror of
https://git.sr.ht/~rouven/nixos-config
synced 2025-04-25 08:06:19 +02:00
nixify some more bots
This commit is contained in:
parent
970ddcdacb
commit
5cbf915808
7 changed files with 120 additions and 39 deletions
|
@ -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 = {
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue