-
Notifications
You must be signed in to change notification settings - Fork 38
/
mod_cloudflare.spec
67 lines (52 loc) · 2.07 KB
/
mod_cloudflare.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
Name: mod_cloudflare
Version: 1.0.2
Release: 4%{?dist}
Summary: Cloudflare Apache Module
Group: System Environment/Daemons
License: ASL-2.0
URL: http://www.cloudflare.com/
Source0: https://raw.github.com/cloudflare/CloudFlare-Tools/master/mod_cloudflare.c
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: httpd-devel
Requires: httpd
%description
CloudFlare acts as a proxy, which means that your visitors are routed through
the CloudFlare network and you do not see their original IP address. This
module uses HTTP headers provided by the CloudFlare proxy to log the real IP
address of the visitor.
%prep
%setup -c -T
cp %{SOURCE0} .
cat > cloudflare.conf <<EOF
LoadModule cloudflare_module modules/mod_cloudflare.so
<IfModule mod_cloudflare.c>
#CloudFlareRemoteIPHeader CF-Connecting-IP
#CloudFlareRemoteIPTrustedProxy 204.93.240.0/24 204.93.177.0/24 199.27.128.0/21 173.245.48.0/20 103.22.200.0/22 141.101.64.0/18 108.162.192.0/18 190.93.240.0/20
#DenyAllButCloudFlare
</IfModule>
EOF
%build
apxs -c mod_cloudflare.c
%install
rm -rf %{buildroot}
install -d %{buildroot}%{_libdir}/httpd/modules
install -m 755 .libs/mod_cloudflare.so %{buildroot}%{_libdir}/httpd/modules/mod_cloudflare.so
install -d %{buildroot}%{_sysconfdir}/httpd/conf.d
install -m 644 cloudflare.conf %{buildroot}%{_sysconfdir}/httpd/conf.d/cloudflare.conf
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%{_libdir}/httpd/modules/mod_cloudflare.so
%config(noreplace) %{_sysconfdir}/httpd/conf.d/cloudflare.conf
%changelog
* Tue Mar 20 2012 Shaun Ladewig <shaun@r6an.com> [1.0.2-4]
* updated cloudflare.conf for new ip range (190.93.240.0/20).
* Mon Feb 27 2012 Alex Headley <aheadley@nexcess.net> [1.0.2-3]
- use _sysconfdir instead of /etc
- add config directive examples to config file and change config file generation
* Thu Jan 26 2012 Corey Henderson <corman@cormander.com> [1.0.2-2.el6]
- use _libdir macro instead of /usr/lib
- cloudflare.conf is small enough to not need a source file
* Wed Jan 18 2012 Corey Henderson <corman@cormander.com> [1.0.2-1.el6]
- Initial build.