summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatarJanik Kleinhoff <ilbelkyr@shalture.org>2017-02-12 13:52:23 +0000
committerLibravatarJanik Kleinhoff <ilbelkyr@shalture.org>2017-02-12 13:52:23 +0000
commite763ec8c425f73eb96adc5265ae1258b697a3ea6 (patch)
treef9fdc671993f324e7d3f3233cade0e31bfb9beb2
parent27099e37b01af3c7d976aa8e2c97c3361969c6cc (diff)
downloadantispammeta-e763ec8c425f73eb96adc5265ae1258b697a3ea6.tar.bz2
antispammeta-e763ec8c425f73eb96adc5265ae1258b697a3ea6.tar.xz
antispammeta-e763ec8c425f73eb96adc5265ae1258b697a3ea6.tar.zst
Make wordlist.txt, proxy.txt, nick_blacklist.txt optional
wordlist is used exclusively by garbagemeter which has been disabled for quite a while. We'd probably be better off using a config-defined path anyway so people can point the bot at /usr/share/dict/words or the local equivalent. The proxy list is most likely completely out of date. We have DNSBLs for this anyway. The nick blacklist is inflexible; nick blacklisting with an added reason can already be done via the rules file. Note that the functionality is not removed for now to avoid breaking compatibility.
-rwxr-xr-xmeta.pl30
1 files changed, 18 insertions, 12 deletions
diff --git a/meta.pl b/meta.pl
index abdd76d..1e0af85 100755
--- a/meta.pl
+++ b/meta.pl
@@ -188,21 +188,27 @@ sub init {
ASM::Statsp->new($conn);
$::classes = ASM::Classes->new();
ASM::Fifo->new($irc, $conn);
- my @nickbl = io('nick_blacklist.txt')->getlines;
- chomp @nickbl;
- @::nick_blacklist = @nickbl;
+ if (-e 'nick_blacklist.txt') {
+ my @nickbl = io('nick_blacklist.txt')->getlines;
+ chomp @nickbl;
+ @::nick_blacklist = @nickbl;
+ }
%::proxies = ();
- my @proxy = io('proxy.txt')->getlines;
- chomp @proxy;
- foreach my $line (@proxy) {
- if ($line =~ /(\d+\.\d+\.\d+\.\d+):\d+/) {
- $::proxies{$1} = 1;
+ if (-e 'proxy.txt') {
+ my @proxy = io('proxy.txt')->getlines;
+ chomp @proxy;
+ foreach my $line (@proxy) {
+ if ($line =~ /(\d+\.\d+\.\d+\.\d+):\d+/) {
+ $::proxies{$1} = 1;
+ }
}
}
- my @wl=io('wordlist.txt')->getlines;
- chomp @wl;
- foreach my $item (@wl) {
- $::wordlist{lc $item} = 1;
+ if (-e 'wordlist.txt') {
+ my @wl=io('wordlist.txt')->getlines;
+ chomp @wl;
+ foreach my $item (@wl) {
+ $::wordlist{lc $item} = 1;
+ }
}
$::fm = File::Monitor->new();
foreach my $file ("channels", "dnsbl", "mysql", "restrictions", "rules", "settings", "users", "blacklist") {