]> git.pld-linux.org Git - packages/apache-mod_cloudflare.git/commitdiff
new, version 1.2.0
authorElan Ruusamäe <glen@delfi.ee>
Fri, 25 Oct 2013 09:33:53 +0000 (12:33 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Fri, 25 Oct 2013 09:34:06 +0000 (12:34 +0300)
does not build, symbol errors

apache-mod_cloudflare.spec [new file with mode: 0644]
apache.conf [new file with mode: 0644]

diff --git a/apache-mod_cloudflare.spec b/apache-mod_cloudflare.spec
new file mode 100644 (file)
index 0000000..b264675
--- /dev/null
@@ -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 (file)
index 0000000..5d1e90b
--- /dev/null
@@ -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>
This page took 0.091445 seconds and 4 git commands to generate.