Browse Source

Moved list of spammers to seperate file, added optional config file, experimenting with hubloc table

master
crt0mega 1 year ago
parent
commit
a40dc8686f
  1. 1
      .gitignore
  2. 168
      byezlax
  3. 55
      spammers

1
.gitignore

@ -0,0 +1 @@
config

168
byezlax

@ -4,128 +4,116 @@
# Database connection #
#######################
declare DB_NAME="hubzilla"
declare DB_HOST="localhost"
declare DB_PORT="3306"
declare DB_USER="user"
declare DB_PASS="pass"
###################
# Array of Zlaxes #
###################
declare -a SPAMMERS=(
"ivan_exlax@pod.dapor.net"
"zlax@%"
"zlaxy@%"
"zlaxyizlax@%"
"zalx@%"
"zlxa@%"
"zlax%@d.consumium.org"
"0mega@podbay.net"
"4ept@diaspora.permutationsofchaos.com"
"alien23@pod.tchncs.de"
"amanda_gordon@diaspora.psyco.fr"
"atomjack@diaspora.psyco.fr"
"atomjack@podbay.net"
"atomjack@pod.tchncs.de"
"christophs@nota.404.mn"
"christophs@pod.tchncs.de"
"christophs@podbay.net"
"clara_listensprechen@pod.tchncs.de"
"deusfigendi@neptune.jerrylumpkins.me"
"dg7bba@pod.tchncs.de"
"florida_ted@pod.dapor.net"
"florida_ted@diaspora.psyco.fr"
"florida_ted@pod.jns.im"
"gander22h@diaspora.psyco.fr"
"hackbyte@pod.dapor.net"
"hackbyte@diaspora.club"
"hernan_labbe@pod.tchncs.de"
"heynicepod@pod.tchncs.de"
"jlumpkins@podbay.net"
"jlumpkins@pod.dapor.net"
"jlumpkins@spora.grin.hu"
"johnhummel@diaspora.psyco.fr"
"johnhummel@diasporing.ch"
"kennychaffin@pod.tchncs.de"
"mrd_ill_be_back@neptune.jerrylumpkins.me"
"mrd_ill_be_back@protagio.social"
"mrd_ill_be_back@pod.dapor.net"
"mrd_ill_be_back@pod.tchncs.de"
"owlmagic@pod.tchncs.de"
"pufcorn@podbay.net"
"privacymatters@diaspora.psyco.fr"
"skewsme@diaspora.psyco.fr"
"vm66%@diaspora.ruhrmail.de"
"vm66%@mondiaspora.net"
"vm66%@diaspora.club"
"vm66%@nerdpol.ch"
"vm66%@diasp.org"
"vm66%@diaspora.asrun.eu"
"vm66%@diaspora-fr.org"
"vm66%@diasporing.ch"
"vm66%@daspr.io"
"vm66%@pod.tchncs.de"
"wurstaufbrot@pod.dapor.net"
"wurstaufbrot@pod.tchncs.de"
)
if [ ! -f "$PWD/config" ]; then
declare DB_NAME="hubzilla"
declare DB_HOST="localhost"
declare DB_PORT="3306"
declare DB_USER="user"
declare DB_PASS="pass"
else
source $PWD/config > /dev/null
fi
#########################
# Read List of spammers #
#########################
mapfile -t SPAMMERS < $PWD/spammers
####################################
# Extermination of Zlaxes' actions #
####################################
QUERIES=$(mktemp)
for SPAM in "${SPAMMERS[@]}"
do
echo "Preparing to remove items from handle $SPAM ..."
mysql --user=$DB_USER \
--password=$DB_PASS \
--database=$DB_NAME \
--host=$DB_HOST \
--port=$DB_PORT \
--silent \
-e "UPDATE item SET item_pending_remove = '1' WHERE author_xchan LIKE '$SPAM'; SELECT ROW_COUNT()"
#TODO: Add handle to serialized array in config where cat="system" and k="blacklisted_channels"
echo "UPDATE item SET item_pending_remove = '1' WHERE author_xchan LIKE '$SPAM';" >> $QUERIES
done
mysql --user=$DB_USER \
--password=$DB_PASS \
--database=$DB_NAME \
--host=$DB_HOST \
--port=$DB_PORT \
--silent \
--compress \
-e "$(cat $QUERIES)"
rm $QUERIES
#################################################
# Finally remove all marked items from database #
#################################################
QUERIES=$(mktemp)
echo "All items have been marked for deletion and won't be visible anymore. If you wish to delete them permamently, type YES."
read REMOVAL
if [ "$REMOVAL" = "YES" ]; then
mysql --user=$DB_USER \
--password=$DB_PASS \
--database=$DB_NAME \
--host=$DB_HOST \
--port=$DB_PORT \
--silent \
-e "DELETE from item WHERE item_pending_remove = '1'; SELECT ROW_COUNT()"
echo "DELETE from item WHERE item_pending_remove = '1';" >> $QUERIES
fi
mysql --user=$DB_USER \
--password=$DB_PASS \
--database=$DB_NAME \
--host=$DB_HOST \
--port=$DB_PORT \
--silent \
-e "$(cat $QUERIES)"
rm $QUERIES
########################
# Remove notifications #
########################
QUERIES=$(mktemp)
for SPAM in "${SPAMMERS[@]}"
do
POD=$(echo -e "$SPAM" | cut -f2 -d"@")
USR=$(echo -e "$SPAM" | cut -f1 -d"@")
URL="htt%://$POD/u/$USR"
echo "Preparing to remove notifications from handle $SPAM ..."
mysql --user=$DB_USER \
--password=$DB_PASS \
--database=$DB_NAME \
--host=$DB_HOST \
--port=$DB_PORT \
--silent \
-e "DELETE FROM notify WHERE url LIKE '$URL'; SELECT ROW_COUNT()"
echo "Preparing to remove notifications from handle $SPAM ..."
echo "DELETE FROM notify WHERE url LIKE '$URL';" >> $QUERIES
done
mysql --user=$DB_USER \
--password=$DB_PASS \
--database=$DB_NAME \
--host=$DB_HOST \
--port=$DB_PORT \
--silent \
-e "$(cat $QUERIES)"
rm $QUERIES
#####################################
# Set hubloc entry to "deactivated" #
#####################################
QUERIES=$(mktemp)
for SPAM in "${SPAMMERS[@]}"
do
echo "Deactivating account $SPAM on this hub ..."
echo "UPDATE hubloc SET hubloc_deleted = '1' WHERE hubloc_addr LIKE '$SPAM';" >> $QUERIES
done
mysql --user=$DB_USER \
--password=$DB_PASS \
--database=$DB_NAME \
--host=$DB_HOST \
--port=$DB_PORT \
--silent \
-e "$(cat $QUERIES)"
rm $QUERIES
##############################################
# TBD #
##############################################

55
spammers

@ -0,0 +1,55 @@
ivan_exlax@pod.dapor.net
zlax@%
zlaxy@%
zlaxyizlax@%
zalx@%
zlxa@%
zlax%@d.consumium.org
0mega@podbay.net
4ept@diaspora.permutationsofchaos.com
alien23@pod.tchncs.de
amanda_gordon@diaspora.psyco.fr
atomjack@diaspora.psyco.fr
atomjack@podbay.net
atomjack@pod.tchncs.de
christophs@nota.404.mn
christophs@pod.tchncs.de
christophs@podbay.net
clara_listensprechen@pod.tchncs.de
deusfigendi@neptune.jerrylumpkins.me
dg7bba@pod.tchncs.de
dredmorbius@mondiaspora.net
florida_ted@pod.dapor.net
florida_ted@diaspora.psyco.fr
florida_ted@pod.jns.im
gander22h@diaspora.psyco.fr
hackbyte@pod.dapor.net
hackbyte@diaspora.club
hernan_labbe@pod.tchncs.de
heynicepod@pod.tchncs.de
jlumpkins@podbay.net
jlumpkins@pod.dapor.net
jlumpkins@spora.grin.hu
johnhummel@diaspora.psyco.fr
johnhummel@diasporing.ch
kennychaffin@pod.tchncs.de
mrd_ill_be_back@neptune.jerrylumpkins.me
mrd_ill_be_back@protagio.social
mrd_ill_be_back@pod.dapor.net
mrd_ill_be_back@pod.tchncs.de
owlmagic@pod.tchncs.de
pufcorn@podbay.net
privacymatters@diaspora.psyco.fr
skewsme@diaspora.psyco.fr
vm66%@diaspora.ruhrmail.de
vm66%@mondiaspora.net
vm66%@diaspora.club
vm66%@nerdpol.ch
vm66%@diasp.org
vm66%@diaspora.asrun.eu
vm66%@diaspora-fr.org
vm66%@diasporing.ch
vm66%@daspr.io
vm66%@pod.tchncs.de
wurstaufbrot@pod.dapor.net
wurstaufbrot@pod.tchncs.de
Loading…
Cancel
Save