fix
This commit is contained in:
parent
5b91a8cf38
commit
19c4e5e024
4
bots.txt
4
bots.txt
@ -1886,3 +1886,7 @@
|
||||
172.183.154.242
|
||||
13.79.231.196
|
||||
202.112.238.240
|
||||
95.108.213.78
|
||||
173.252.87.113
|
||||
13.250.32.78
|
||||
199.45.154.157
|
||||
|
10
firewall2.sh
10
firewall2.sh
@ -498,13 +498,15 @@ watch() {
|
||||
}
|
||||
|
||||
module-nostr(){
|
||||
POLICY='/opt/strfry-policies/strfry-policy.ts'
|
||||
DATE="$(date +%d/%b/%Y:%H:%M -d '1 min ago')"
|
||||
IP=($(grep $DATE $NGINX_ACCESS | grep "/block=" | cut -d '=' -f2| cut -d ' ' -f1 | sed 's/"//'))
|
||||
for i in "${IP[@]}"; do
|
||||
CHECK=$(cat /opt/strfry-policies/strfry-policy.ts | grep $i)
|
||||
if [ "$CHECK" = "" ]; then
|
||||
echo "Blocking NPUB: $i"
|
||||
bash /opt/strfry-policies/block.sh $i
|
||||
if [[ "$i" == *"npub"* ]]; then
|
||||
HEX=$(nak decode $i | jq ".pubkey" | sed 's/"//i' | sed 's/"//i')
|
||||
echo "Adding $HEX to block list"
|
||||
sed -i "29i '$HEX'," $POLICY
|
||||
sed -i "s/\'\'//g" $POLICY
|
||||
else
|
||||
echo "No Npubs to block"
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user