BotaxWebshell
Server IP : 68.178.172.28  /  Your IP : 216.73.216.32
Web Server : Apache
System : Linux 28.172.178.68.host.secureserver.net 4.18.0-553.89.1.el8_10.x86_64 #1 SMP Mon Dec 8 03:53:08 EST 2025 x86_64
User : kiskarnal ( 1003)
PHP Version : 8.0.30
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : ON |  Sudo : ON |  Pkexec : ON
Directory :  /etc/nginx/ea-nginx/config-scripts/global/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /etc/nginx/ea-nginx/config-scripts/global/config-scripts-global-cloudflare
#!/usr/local/cpanel/3rdparty/bin/perl
# cpanel - config-scripts/global/cloudflare        Copyright 2021 cPanel, L.L.C.
#                                                           All rights Reserved.
# copyright@cpanel.net                                         http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited

use strict;
use warnings;

use Cpanel::HTTP::Client ();
use Cpanel::JSON         ();

my ( $ipv4_conf, $ipv6_conf ) = ( "", "" );

my $res = Cpanel::HTTP::Client->new()->get("https://api.cloudflare.com/client/v4/ips");
if ( !$res->{success} ) {
    die "Could not GET cloudflare IPs ($res->{status} $res->{reason})\n";
}

my $data = Cpanel::JSON::Load( $res->{content} );

my $etag = $data->{result}{etag} || "none";
my $time = localtime();

for my $ipv4 ( @{ $data->{result}{ipv4_cidrs} } ) {
    $ipv4_conf .= "set_real_ip_from $ipv4;\n";
}
chomp $ipv4_conf;

for my $ipv6 ( @{ $data->{result}{ipv6_cidrs} } ) {
    $ipv6_conf .= "set_real_ip_from $ipv6;\n";
}
chomp $ipv6_conf;

open( my $fh, ">", "/etc/nginx/conf.d/includes-optional/cloudflare.conf" ) || die "Could not write /etc/nginx/conf.d/includes-optional/cloudflare.conf: $!\n";
print {$fh} <<"END_CLCONF";
# Cloudflare IPs (https://api.cloudflare.com/client/v4/ips etag: $etag)
# Auto Generated
#   by $0
#   at $time

# IPv4:
$ipv4_conf

# IPv6:
$ipv6_conf

real_ip_header CF-Connecting-IP;
END_CLCONF

close($fh);

print "Updated /etc/nginx/conf.d/includes-optional/cloudflare.conf OK\n";
exit(0);

Youez - 2016 - github.com/yon3zu
LinuXploit