From 79402b233604615eb3b281dc2b787448977bb582 Mon Sep 17 00:00:00 2001 From: myvesta <38690722+myvesta@users.noreply.github.com> Date: Sat, 17 Apr 2021 18:46:49 +0200 Subject: [PATCH] Updating CloudFlare IP addresses --- src/deb/vesta/postinst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/deb/vesta/postinst b/src/deb/vesta/postinst index acf137098..c9154edcb 100755 --- a/src/deb/vesta/postinst +++ b/src/deb/vesta/postinst @@ -23,6 +23,16 @@ fi echo "1" > /usr/local/vesta/data/upgrades/show_changelog chmod a=rw /usr/local/vesta/data/upgrades/show_changelog +# Updating CloudFlare IP addresses +if [ ! -f "/usr/local/vesta/data/upgrades/update-cloudflare-ips" ]; then + if [ -f "/etc/nginx/nginx.conf" ]; then + touch /usr/local/vesta/data/upgrades/update-cloudflare-ips + echo "== Updating CloudFlare IP addresses" + sed -i 's/ set_real_ip_from 104.16.0.0/12;/ set_real_ip_from 104.16.0.0/13;\n set_real_ip_from 104.24.0.0/14;/g' /etc/nginx/nginx.conf + systemctl restart nginx + fi +fi + # Tuning of php-fpm pool.d config files (perfomances and limits) if [ ! -f "/usr/local/vesta/data/upgrades/tune-fpm-config-files-v2" ]; then touch /usr/local/vesta/data/upgrades/tune-fpm-config-files-v2