2021-01-13 19:54:19 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#######################
|
|
|
|
# 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=(
|
2021-01-16 00:25:29 +00:00
|
|
|
|
|
|
|
"ivan_exlax@pod.dapor.net"
|
|
|
|
"zlax@%"
|
|
|
|
"zlaxy@%"
|
|
|
|
"zlaxyizlax@%"
|
|
|
|
"zalx@%"
|
|
|
|
"zlxa@%"
|
|
|
|
"zlax%@d.consumium.org"
|
|
|
|
|
|
|
|
"0mega@podbay.net"
|
|
|
|
"alien23@pod.tchncs.de"
|
|
|
|
"atomjack@diaspora.psyco.fr"
|
|
|
|
"atomjack@podbay.net"
|
|
|
|
"atomjack@pod.tchncs.de"
|
|
|
|
"christophs@nota.404.mn"
|
|
|
|
"christophs@pod.tchncs.de"
|
|
|
|
"christophs@podbay.net"
|
2021-01-14 21:02:50 +00:00
|
|
|
"clara_listensprechen@pod.tchncs.de"
|
2021-01-16 00:25:29 +00:00
|
|
|
"deusfigendi@neptune.jerrylumpkins.me"
|
|
|
|
"dg7bba@pod.tchncs.de"
|
|
|
|
"florida_ted@pod.dapor.net"
|
|
|
|
"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@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"
|
|
|
|
"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"
|
|
|
|
)
|
2021-01-13 19:54:19 +00:00
|
|
|
|
|
|
|
####################################
|
|
|
|
# Extermination of Zlaxes' actions #
|
|
|
|
####################################
|
|
|
|
|
|
|
|
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"
|
|
|
|
done
|
|
|
|
|
|
|
|
#################################################
|
|
|
|
# Finally remove all marked items from database #
|
|
|
|
#################################################
|
|
|
|
|
|
|
|
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()"
|
|
|
|
fi
|
|
|
|
|
|
|
|
########################
|
|
|
|
# Remove notifications #
|
|
|
|
########################
|
|
|
|
|
|
|
|
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()"
|
|
|
|
|
|
|
|
done
|
|
|
|
|
|
|
|
##############################################
|
|
|
|
# TBD #
|
|
|
|
##############################################
|
|
|
|
# Blocking further communication from Zlaxes #
|
|
|
|
##############################################
|
|
|
|
#
|
|
|
|
#HZ_BANLIST=$(mysql --user=$DB_USER \
|
|
|
|
# --password=$DB_PASS \
|
|
|
|
# --database=$DB_NAME \
|
|
|
|
# --host=$DB_HOST \
|
|
|
|
# --port=$DB_PORT \
|
|
|
|
# --silent \
|
|
|
|
# -e "SELECT v FROM config WHERE cat='system' AND k='blacklisted_channels';")
|