feat: add new logic for rule based bans
All checks were successful
CI.yml / build (push) Successful in 1m51s

This commit is contained in:
d3m0k1d
2026-01-13 18:02:22 +03:00
parent 9767bb70f1
commit 5362761b82
3 changed files with 49 additions and 0 deletions

View File

@@ -46,6 +46,20 @@ func CreateConf() error {
return fmt.Errorf("failed to write config file: %w", err)
}
fmt.Printf(" Config file created: %s\n", configPath)
file, err = os.Create("/etc/banforge/rules.toml")
if err != nil {
return fmt.Errorf("failed to create rules file: %w", err)
}
defer func() {
err = file.Close()
if err != nil {
fmt.Println(err)
}
}()
if err := os.Chmod(configPath, 0600); err != nil {
return fmt.Errorf("failed to set permissions: %w", err)
}
fmt.Printf(" Rules file created: %s\n", configPath)
return nil
}