Skip to content
This repository was archived by the owner on Jun 15, 2022. It is now read-only.

Commit 63952e0

Browse files
author
John Wineman
committed
v6.0.0
1 parent 49f588a commit 63952e0

File tree

2,177 files changed

+292990
-25310
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,177 files changed

+292990
-25310
lines changed

APIKey

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/local/cpanel/3rdparty/bin/perl
2+
3+
use strict;
4+
use Cpanel::AdminBin::Serializer ();
5+
use Cpanel::Logger ();
6+
use Cpanel::PwCache ();
7+
use Cpanel::LoadFile ();
8+
9+
my $HOST_API_KEY_FILE = "/root/.cpanel/datastore/cf_api";
10+
11+
my $stdin = <STDIN>;
12+
chomp $stdin;
13+
my ( $uid, $function, $data ) = split( / /, $stdin, 3 );
14+
15+
my $logger = Cpanel::Logger->new();
16+
17+
if ( $function eq 'get_host_api_key' ) {
18+
my $host_api_key = Cpanel::LoadFile::loadfile($HOST_API_KEY_FILE) or do {
19+
$logger->info("Failed to load Host API key: $!");
20+
};
21+
print $host_api_key;
22+
exit(0);
23+
}
24+
else {
25+
print "Invalid function specified to APIKey adminbin";
26+
exit(1);
27+
}
28+
29+
1; #Ah, perl

CHANGELOG.md

+23-10
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,28 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5-
## [5.3.11](#5.3.11) - 2016-01-14
6-
### Fixed
7-
- Cpanel 11.54 RC broke JS in some .tmpl files, those files now use CloudFlare.$ instead of $ for Jquery [#75](https://github.com/cloudflare/CloudFlare-CPanel/pull/75)
8-
- Fixed an issue where a malicious symlink could allow changing permissions on arbitrary files. [#76](https://github.com/cloudflare/CloudFlare-CPanel/pull/76)
5+
## [6.0.0](#6.0.0) - 2016-03-29
6+
### Added
7+
- Added the ability to configure the IPV6 functionality on the Performance Page
8+
- Added the ability to configure the "Always Online" functionality on the Performance Page
9+
- Added the ability to provision domain names with CloudFlare's "full zone" setup.
10+
- Added a button to quickly toggle "I'm Under Attack" mode.
11+
- Added the ability to view requests, bandwidth, unique visitors, and threats blocked on the Analytics page.
12+
- Added the ability to configure the security level setting of your website on the Security page.
13+
- Added the ability to configure the challenge passage setting of your website on the Security page.
14+
- Added the ability to toggle the browser integrity check setting of your website on the Security page.
15+
- Added the ability to configure the cache level setting of your website on the Performance page.
16+
- Added the ability to configure the auto minify setting of your website on the Performance page.
17+
- Added the ability to toggle the development mode setting of your website on the Performance page.
18+
- Added the ability to configure the browser cache time to live setting on the Perfromance page.
19+
- Added the ability to purge your website's cache on the Performance page.
920

10-
## [5.3.10](#5.3.10) - 2016-01-06
11-
### Changed
12-
- Updated error messaging when plugin detects that a zone is already active on CloudFlare [#71](https://github.com/cloudflare/CloudFlare-CPanel/pull/71)
13-
- Plugin now supports v4 Client API. Security page now uses v4 zones/[identifier]/settings/security_level to set the the security level [#70](https://github.com/cloudflare/CloudFlare-CPanel/pull/70)
21+
### Removed
22+
- Removed the ability to toggle the always online setting of your website on the Performance page.
23+
- Removed the ability to toggle the IPv6 setting of your website on the Performance page.
24+
- Removed the header navigation link to http://cloudflarestatus.com/.
25+
- Removed support for the X3 theme because CPanel is deprecating it in [v11.60](https://blog.cpanel.com/its-time-to-say-goodbye-to-x3/).
1426

15-
### Fixed
16-
- Fixed a bug where activation failed when www is an A record. [#73](https://github.com/cloudflare/CloudFlare-CPanel/pull/73)
27+
### Updated
28+
- The plugin now runs on a React/Redux front end and PHP (with one Perl module) on the backend.
29+
- The structure of the YAML file has been changed and the data store code will automatically convert old YAML files to the new format.

CloudFlare.pm

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
package Cpanel::API::CloudFlare;
2+
3+
use strict;
4+
5+
6+
#Version of perl module NOT plugin.
7+
our $VERSION = '1.0';
8+
9+
# Your comments about this custom module.
10+
11+
# Cpanel Dependencies
12+
use Cpanel ();
13+
use Cpanel::API ();
14+
use Cpanel::Locale ();
15+
use Cpanel::Logger ();
16+
use Data::Dumper;
17+
18+
# Other dependencies go here.
19+
# Defaults go here.
20+
# Constants go here.
21+
22+
# Globals
23+
my $logger = Cpanel::Logger->new();;
24+
25+
# Caches go here.
26+
27+
# Functions go here.
28+
29+
#-------------------------------------------------------------------------------------------------
30+
# Name:
31+
# get_host_api_key - Gets the host API key as root
32+
# Desc:
33+
# Gets the host API key as root
34+
# Arguments:
35+
# n/a
36+
# Returns:
37+
# $result1 - string - The host API key
38+
#-------------------------------------------------------------------------------------------------
39+
sub get_host_api_key {
40+
41+
my ( $args, $result ) = @_;
42+
43+
# https://documentation.cpanel.net/display/SDK/Guide+to+API+Privilege+Escalation+-+Application+Files
44+
# Makes a call to /usr/local/cpanel/bin/admin/CloudFlare/APIKey which runs as root to obtain
45+
# the host API key stored at /root/.cpanel/datastore/cf_api.
46+
47+
my $admin_bin_call = Cpanel::Wrap::send_cpwrapd_request(
48+
'namespace' => 'CloudFlare',
49+
'module' => 'APIKey',
50+
'function' => 'get_host_api_key',
51+
);
52+
53+
my $host_api_key = $admin_bin_call->{'data'};
54+
$host_api_key =~ s/\n//; #string replace new line with nothing
55+
56+
if (defined $host_api_key) {
57+
$result->data($host_api_key);
58+
return 1;
59+
}
60+
else {
61+
$logger->warn("Failed to load Host API key.");
62+
return 0;
63+
}
64+
}
65+
66+
1; #Ah, perl

Gruntfile.js

-39
This file was deleted.

LICENSE.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Copyright (c) 2016, CloudFlare. All rights reserved.
2+
3+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4+
5+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6+
7+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8+
9+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10+
11+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
## CloudFlare cPanel Quick Installation Instructions
2+
3+
Using an SSH client such as Terminal or Putty:
4+
5+
Step 1. Access cPanel for the server using root user by:
6+
7+
`ssh root@SERVER IP ADDRESS or SERVER NAME`
8+
9+
Step 2. Download necessary files and run installation
10+
11+
`bash <(curl -s https://raw.githubusercontent.com/cloudflare/CloudFlare-CPanel/master/cloudflare.install.sh) -k [YOUR HOST KEY] -n '[YOUR_COMPANY_NAME]' `
12+
13+
NOTES:
14+
- Be sure to replace [HOST_API_KEY] and [YOUR_COMPANY_NAME] with the appropriate values
15+
16+
### Uninstalling the cPanel Plugin
17+
18+
An uninstall script has been provided to unregister the plugin with cPanel and remove all CloudFlare specific files from the server to deactivate the plugin.
19+
20+
NOTE: This will not remove zones or users from CloudFlare that have been registered through the plugin.
21+
22+
The following set of commands will download the necessary files, execute the uninstall script and ultimately remove the uninstall script as well:
23+
24+
`bash <(curl -s https://raw.githubusercontent.com/cloudflare/CloudFlare-CPanel/master/cloudflare.uninstall.sh) && rm -f cloudflare.uninstall.sh

assets/.DS_Store

8 KB
Binary file not shown.

assets/analytics-welcome.svg

+1
Loading

assets/details-arrows.png

210 Bytes
Loading

assets/hero-bg-clouds.png

3.02 KB
Loading

assets/icon-bolt.svg

+1
Loading

assets/icon-lock.svg

+1
Loading

assets/icon-pin.svg

+1
Loading

assets/icon-shield.svg

+1
Loading

assets/icons-seee324dde5.png

6.93 KB
Loading

assets/icons_2x-s6333fe7591.png

21.3 KB
Loading

assets/layers-2x.png

1.65 KB
Loading

assets/layers.png

1.04 KB
Loading

0 commit comments

Comments
 (0)