commit b4ff000f4e0d7116eaa66be677d78830032afa52
Author: Elan Ruusamäe <[email protected]>
Date:   Fri Oct 25 12:33:53 2013 +0300

    new, version 1.2.0
    
    does not build, symbol errors

 apache-mod_cloudflare.spec | 60 ++++++++++++++++++++++++++++++++++++++++++++++
 apache.conf                | 10 ++++++++
 2 files changed, 70 insertions(+)
---
diff --git a/apache-mod_cloudflare.spec b/apache-mod_cloudflare.spec
new file mode 100644
index 0000000..b264675
--- /dev/null
+++ b/apache-mod_cloudflare.spec
@@ -0,0 +1,60 @@
+%define                mod_name        cloudflare
+%define        apxs            %{_sbindir}/apxs
+Summary:       Apache module to show true visitor IPs in logs for domains 
using CloudFlare
+Name:          apache-mod_%{mod_name}
+Version:       1.2.0
+Release:       1
+License:       Apache v2.0
+Group:         Networking/Daemons/HTTP
+Source0:       
https://github.com/cloudflare/mod_cloudflare/archive/master/mod_%{mod_name}-%{version}.tar.gz
+# Source0-md5: d87e1c38dba2c282bfae9341e0f3c3e7
+Source1:       apache.conf
+BuildRequires: apache-devel >= 2.2
+BuildRequires: rpmbuild(macros) >= 1.268
+Requires:      apache(modules-api) = %apache_modules_api
+BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%define                _pkglibdir      %(%{apxs} -q LIBEXECDIR 2>/dev/null)
+%define                _sysconfdir     %(%{apxs} -q SYSCONFDIR 
2>/dev/null)/conf.d
+
+%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. Based on mod_remoteip.c, this
+apache extension will replace the remote_ip variable in user's logs
+with the correct remote_ip sent from CloudFlare. This also does
+authentication, only performing the switch for requests originating
+from CloudFlare IPs.
+
+%prep
+%setup -qc
+mv mod_cloudflare-*/* .
+
+%build
+%{apxs} -c mod_%{mod_name}.c -o mod_%{mod_name}.so
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}}
+install -p mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
+cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/90_mod_%{mod_name}.conf
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post
+%service -q httpd restart
+
+%postun
+if [ "$1" = "0" ]; then
+       %service -q httpd restart
+fi
+
+%files
+%defattr(644,root,root,755)
+%doc README.md
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) 
%{_sysconfdir}/*_mod_%{mod_name}.conf
+%attr(755,root,root) %{_pkglibdir}/mod_%{mod_name}.so
diff --git a/apache.conf b/apache.conf
new file mode 100644
index 0000000..5d1e90b
--- /dev/null
+++ b/apache.conf
@@ -0,0 +1,10 @@
+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.21.244.0/22 103.22.200.0/22 103.31.4.0/22 
141.101.64.0/18 108.162.192.0/18 190.93.240.0/20 188.114.96.0/20 
197.234.240.0/22 198.41.128.0/17 162.158.0.0/15
+
+       # Uncomment DenyAllButCloudFlare to return a 403 status to all requests
+       # that do not originate from an IP defined in 
CloudFlareRemoteIPTrustedProxy
+       #DenyAllButCloudFlare
+</IfModule>
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/apache-mod_cloudflare.git/commitdiff/b4ff000f4e0d7116eaa66be677d78830032afa52

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to