Dont run openai deny access shell script per default

This commit is contained in:
Marcus Kammer 2023-12-26 11:23:56 +01:00
parent 328ceaea9b
commit ab457d620b
Signed by: marcuskammer
GPG key ID: C374817BE285268F

View file

@ -858,21 +858,6 @@ runcmd:
- rm /etc/nginx/sites-enabled/default - rm /etc/nginx/sites-enabled/default
# Reload Nginx configuration # Reload Nginx configuration
- systemctl reload nginx - systemctl reload nginx
- |
#!/bin/bash
# Purpose: Block OpenAI ChatGPT bot CIDR
# Tested on: Debian and Ubuntu Linux
# Author: Vivek Gite {https://www.cyberciti.biz} under GPL v2.x+
# ------------------------------------------------------------------
file="/tmp/out.txt.$$"
wget -q -O "$file" https://openai.com/gptbot-ranges.txt 2>/dev/null
while IFS= read -r cidr
do
sudo ufw deny proto tcp from $cidr to any port 80
sudo ufw deny proto tcp from $cidr to any port 443
done < "$file"
[ -f "$file" ] && rm -f "$file"
# Allow Nginx Full (HTTP and HTTPS) through the firewall # Allow Nginx Full (HTTP and HTTPS) through the firewall
- ufw allow 'Nginx Full' - ufw allow 'Nginx Full'
# Set UFW firewall rules # Set UFW firewall rules