summaryrefslogtreecommitdiff
path: root/www-apache/mod_rpaf
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /www-apache/mod_rpaf
reinit the tree, so we can have metadata
Diffstat (limited to 'www-apache/mod_rpaf')
-rw-r--r--www-apache/mod_rpaf/Manifest10
-rw-r--r--www-apache/mod_rpaf/files/003_ipv6.patch31
-rw-r--r--www-apache/mod_rpaf/files/010_multiple_proxies.patch37
-rw-r--r--www-apache/mod_rpaf/files/011_apache2.4.patch51
-rw-r--r--www-apache/mod_rpaf/files/012_Add-missing-header-for-inet_addr.patch17
-rw-r--r--www-apache/mod_rpaf/files/10_mod_rpaf.conf6
-rw-r--r--www-apache/mod_rpaf/metadata.xml5
-rw-r--r--www-apache/mod_rpaf/mod_rpaf-0.6-r1.ebuild28
8 files changed, 185 insertions, 0 deletions
diff --git a/www-apache/mod_rpaf/Manifest b/www-apache/mod_rpaf/Manifest
new file mode 100644
index 000000000000..4b4911310a53
--- /dev/null
+++ b/www-apache/mod_rpaf/Manifest
@@ -0,0 +1,10 @@
+AUX 003_ipv6.patch 1261 SHA256 d5023fdaa08ceace05bae15953f07b028eac8a2c6805ddb09d290a8703078b16 SHA512 e1192403b39e442465f3c024e108014bf0045ea15800175f313acf045d817ea59e9b7e88b0c0177a6dd8069b12bd5c3a036528e7fd85cf74a4e3ad2285f36597 WHIRLPOOL bbcc0961d049e0c5ed69c377f57c7ba0debf9faeab29af41cbeca152565690324a468bd8a49e094e4d5ddaa3af1049cd225648502919622512136bf1880ae00f
+AUX 010_multiple_proxies.patch 1611 SHA256 3076ffa6dc38a9912db24e76a9e8a666257248980198f81ad9be5e5ee9430d28 SHA512 6c78bfa0129fcfd464e19ec4d28fb6960bf4ee662cde1207eeb49461e8a3cae0887b4680388167b97374eeaade0627db43ff5837efa259e5497846993bba232f WHIRLPOOL 55d610b9380cf42d87df1339423ece307ad046a8915a3d8d8c3f26ae6d4081c1f6b22a237c8a57d3edd6ba1bda7952514e16bf47d018ac73906cf2a08072671e
+AUX 011_apache2.4.patch 2833 SHA256 f48cf7c04bee38581c5a828a0660817a8c1de55fb00af4369a128e7a1b78bbb6 SHA512 a1e0805fe36f50b2f45e58c66fa9afc2f4583a563808560415c63dd46b92b9bcd885f4bd53c6cdad547c6db62d2bd5ee5c219beec123ade37afeb5eb9310607f WHIRLPOOL ce767242b9900845e93037f3623b6e2d1497736ad1a02d1afa418e386ba07c6f3c0c5a5afb8de43cf8fc9519035a16bc4d8b13e65d8908e0852c91a221ac8b58
+AUX 012_Add-missing-header-for-inet_addr.patch 326 SHA256 c057cecb720afca1275b2366bdb554b980d51a6c03120cb990d205af2c48f6fc SHA512 ca0153d63ca08a0504313da135c4ef7060f30144d2cf5a6a74ee19be05bfc6a914d50da319f66048cabc88bfdef098730c20bccf45df219bb6629bbae67edb94 WHIRLPOOL 8b327aea48697bb840fcfae811cd33cba41cc7269ca8c11d8cfe1b50993af8d7cc7dabcd5a64dcda776fb5528352d1f1c103334682aaa8d6626b47bfe8f7ed72
+AUX 10_mod_rpaf.conf 114 SHA256 36d2c4fbfc288d8a0ff78631aa1acd5e4b0d2bf3e737653332c45725051d6e7d SHA512 33c7f44fa372644ee8654778a4fac5056830a11c90b4ef8aaac17df1e34644fa07cef7f6db2135dcf047dafb99f302c19e288653028811f4f4306aa53f7c58ec WHIRLPOOL 9437acce17e839c737f513cc643c1d0e4b13b0c46970fafa9c60da44f350175fcf3f22ec938782594ae46ef71ed15f68be08a18e3dafa3387f88a794418d5e23
+DIST mod_rpaf-0.6.tar.gz 7695 SHA256 80f9dd1b0574747ef2c399335a88cf562491a7f0b940f26c684d065fe6c4c27d SHA512 1ad5af69cfe0e72cc609c081388e20e6a40cff1af7b47581b3d6958e5c7badf6580b2e14e5bd86482fe7cc7b60ca5045a2486c6f3f6e8ece7c142d38df990b4c WHIRLPOOL c0f9a8d9a561e963bf043efb64f99a8e87a7d1c704c78580c467321044abd9adda9b2c13437a4bbec8508920a18da801e1e6f4e19d03453aaf277215c074fb5a
+EBUILD mod_rpaf-0.6-r1.ebuild 540 SHA256 b7fb8ea6ba5ade6756429403486dfeedfb4f3d5cbc2b77b997d23e2de50706a5 SHA512 c526354b7f3829e875030a4f817ec9124b1b5e57d83477876116ef3d3140351da1522a2332273c90b90d9201ebd1e943338db46eb80de16251dcc0b7e1c84bca WHIRLPOOL c67d2c70fc8a41719b23a05d17bc4aac8d72223aa6c1c3f104aa40408c82d1631eef01554d17924d3542feb6969dfe30c410b908fcb3e6c3e78276439a0bb112
+MISC ChangeLog 3240 SHA256 83598a2ae27c09a908b5beb0a14bf005165cf7e22b4d7a2826fee1cecda58e9c SHA512 7a68684d2ab711209f436512759b57283f9a35cfa661daee108d4fbc1c777a4e804a985357baeaf01bdcf8b2c7dbcac5a63100b8812d88ee36344b83eb448e64 WHIRLPOOL 570953f8598abc97d3b6be8c8832d79a616aeb17beb511657cae3596e45563dd0537d81c94ccc8583ea03231a6a5a39f0afc9dff5a9e3da81f2c164c49ed3e1d
+MISC ChangeLog-2015 1413 SHA256 c731424a89b6c278fb39b2c363a0fe81eccfd48ec6fba139f93b648187b7b81d SHA512 add3640ec342d7881ff8eb42cca1489a37af56040facf6f620178fdb6bd36b10b9ee73f88e89e06df316104041d70335c1f34ada009f4c9b1a63b9a263022be8 WHIRLPOOL f36dd2d0c964f0d5795ae6236366e4b0d680cc5bb1ed397727b5a61255c5822eee3ff6e1817e6d71ed73477597c6e7e1377efc1fdb3aa73ac36d793e91dee058
+MISC metadata.xml 166 SHA256 2caff447f5bd2701d8456ada5cc633c41ef4373fa4bfeabeb73599d40bcc941b SHA512 a56648c974a1d14dd4c18237532773c72057a13ab90c58b5da04f185e3c12a8bd8d5c21fb06053507f31766291a82dc7d87b34cd65fd94cfe2af7295c813ef84 WHIRLPOOL 1ff70497eca6531f0e0614c72a19f4b8e5ff486a58d369f4f0b36308d1d6b01168f9da887740e3b9f536236be251d3fe05f904d27a9233a7cf613416ba882968
diff --git a/www-apache/mod_rpaf/files/003_ipv6.patch b/www-apache/mod_rpaf/files/003_ipv6.patch
new file mode 100644
index 000000000000..49554efe459a
--- /dev/null
+++ b/www-apache/mod_rpaf/files/003_ipv6.patch
@@ -0,0 +1,31 @@
+Description: ipv6 fixes
+Author: Piotr Roszatycki <dexter@debian.org>
+Reviewed-by: Sergey B Kirpichev <skirpichev@gmail.com>
+Bug-Debian: http://bugs.debian.org/726529
+
+---
+ mod_rpaf-2.0.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/mod_rpaf-2.0.c
++++ b/mod_rpaf-2.0.c
+@@ -72,6 +72,8 @@
+ #include "http_vhost.h"
+ #include "apr_strings.h"
+
++#include <arpa/inet.h>
++
+ module AP_MODULE_DECLARE_DATA rpaf_module;
+
+ typedef struct {
+@@ -185,6 +187,10 @@
+ apr_pool_cleanup_register(r->pool, (void *)rcr, rpaf_cleanup, apr_pool_cleanup_null);
+ r->connection->remote_ip = apr_pstrdup(r->connection->pool, ((char **)arr->elts)[((arr->nelts)-1)]);
+ r->connection->remote_addr->sa.sin.sin_addr.s_addr = apr_inet_addr(r->connection->remote_ip);
++ apr_sockaddr_t *tmpsa;
++ int ret = apr_sockaddr_info_get(&tmpsa, r->connection->remote_ip, APR_UNSPEC, r->connection->remote_addr->port, 0, r->connection->remote_addr->pool);
++ if (ret == APR_SUCCESS)
++ memcpy(r->connection->remote_addr, tmpsa, sizeof(apr_sockaddr_t));
+ if (cfg->sethostname) {
+ const char *hostvalue;
+ if (hostvalue = apr_table_get(r->headers_in, "X-Forwarded-Host")) {
diff --git a/www-apache/mod_rpaf/files/010_multiple_proxies.patch b/www-apache/mod_rpaf/files/010_multiple_proxies.patch
new file mode 100644
index 000000000000..2c9fae01bbe3
--- /dev/null
+++ b/www-apache/mod_rpaf/files/010_multiple_proxies.patch
@@ -0,0 +1,37 @@
+Description: Use the last value from the X-Forwarded-For header, which
+ is not in RPAFproxy_ips as the client IP, falling back to the first one
+ if they are all known proxies.
+Author: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
+
+---
+ mod_rpaf-2.0.c | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+--- a/mod_rpaf-2.0.c
++++ b/mod_rpaf-2.0.c
+@@ -154,6 +154,16 @@
+ return APR_SUCCESS;
+ }
+
++static char* last_not_in_array(apr_array_header_t *forwarded_for,
++ apr_array_header_t *proxy_ips) {
++ int i;
++ for (i = (forwarded_for->nelts)-1; i > 0; i--) {
++ if (!is_in_array(((char **)forwarded_for->elts)[i], proxy_ips))
++ break;
++ }
++ return ((char **)forwarded_for->elts)[i];
++}
++
+ static int change_remote_ip(request_rec *r) {
+ const char *fwdvalue;
+ char *val;
+@@ -185,7 +195,7 @@
+ rcr->old_ip = apr_pstrdup(r->connection->pool, r->connection->remote_ip);
+ rcr->r = r;
+ apr_pool_cleanup_register(r->pool, (void *)rcr, rpaf_cleanup, apr_pool_cleanup_null);
+- r->connection->remote_ip = apr_pstrdup(r->connection->pool, ((char **)arr->elts)[((arr->nelts)-1)]);
++ r->connection->remote_ip = apr_pstrdup(r->connection->pool, last_not_in_array(arr, cfg->proxy_ips));
+ r->connection->remote_addr->sa.sin.sin_addr.s_addr = apr_inet_addr(r->connection->remote_ip);
+ apr_sockaddr_t *tmpsa;
+ int ret = apr_sockaddr_info_get(&tmpsa, r->connection->remote_ip, APR_UNSPEC, r->connection->remote_addr->port, 0, r->connection->remote_addr->pool);
diff --git a/www-apache/mod_rpaf/files/011_apache2.4.patch b/www-apache/mod_rpaf/files/011_apache2.4.patch
new file mode 100644
index 000000000000..1757e9f30a5a
--- /dev/null
+++ b/www-apache/mod_rpaf/files/011_apache2.4.patch
@@ -0,0 +1,51 @@
+Description: Apache 2.4 compatibility patch
+Author: Sergey B Kirpichev <skirpichev@gmail.com>
+Bug-Debian: http://bugs.debian.org/666792
+
+---
+ mod_rpaf-2.0.c | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+--- a/mod_rpaf-2.0.c
++++ b/mod_rpaf-2.0.c
+@@ -149,8 +149,8 @@
+
+ static apr_status_t rpaf_cleanup(void *data) {
+ rpaf_cleanup_rec *rcr = (rpaf_cleanup_rec *)data;
+- rcr->r->connection->remote_ip = apr_pstrdup(rcr->r->connection->pool, rcr->old_ip);
+- rcr->r->connection->remote_addr->sa.sin.sin_addr.s_addr = apr_inet_addr(rcr->r->connection->remote_ip);
++ rcr->r->connection->client_ip = apr_pstrdup(rcr->r->connection->pool, rcr->old_ip);
++ rcr->r->connection->client_addr->sa.sin.sin_addr.s_addr = apr_inet_addr(rcr->r->connection->client_ip);
+ return APR_SUCCESS;
+ }
+
+@@ -173,7 +173,7 @@
+ if (!cfg->enable)
+ return DECLINED;
+
+- if (is_in_array(r->connection->remote_ip, cfg->proxy_ips) == 1) {
++ if (is_in_array(r->connection->client_ip, cfg->proxy_ips) == 1) {
+ /* check if cfg->headername is set and if it is use
+ that instead of X-Forwarded-For by default */
+ if (cfg->headername && (fwdvalue = apr_table_get(r->headers_in, cfg->headername))) {
+@@ -192,15 +192,15 @@
+ if (*fwdvalue != '\0')
+ ++fwdvalue;
+ }
+- rcr->old_ip = apr_pstrdup(r->connection->pool, r->connection->remote_ip);
++ rcr->old_ip = apr_pstrdup(r->connection->pool, r->connection->client_ip);
+ rcr->r = r;
+ apr_pool_cleanup_register(r->pool, (void *)rcr, rpaf_cleanup, apr_pool_cleanup_null);
+- r->connection->remote_ip = apr_pstrdup(r->connection->pool, last_not_in_array(arr, cfg->proxy_ips));
+- r->connection->remote_addr->sa.sin.sin_addr.s_addr = apr_inet_addr(r->connection->remote_ip);
++ r->connection->client_ip = apr_pstrdup(r->connection->pool, last_not_in_array(arr, cfg->proxy_ips));
++ r->connection->client_addr->sa.sin.sin_addr.s_addr = apr_inet_addr(r->connection->client_ip);
+ apr_sockaddr_t *tmpsa;
+- int ret = apr_sockaddr_info_get(&tmpsa, r->connection->remote_ip, APR_UNSPEC, r->connection->remote_addr->port, 0, r->connection->remote_addr->pool);
++ int ret = apr_sockaddr_info_get(&tmpsa, r->connection->client_ip, APR_UNSPEC, r->connection->client_addr->port, 0, r->connection->client_addr->pool);
+ if (ret == APR_SUCCESS)
+- memcpy(r->connection->remote_addr, tmpsa, sizeof(apr_sockaddr_t));
++ memcpy(r->connection->client_addr, tmpsa, sizeof(apr_sockaddr_t));
+ if (cfg->sethostname) {
+ const char *hostvalue;
+ if (hostvalue = apr_table_get(r->headers_in, "X-Forwarded-Host")) {
diff --git a/www-apache/mod_rpaf/files/012_Add-missing-header-for-inet_addr.patch b/www-apache/mod_rpaf/files/012_Add-missing-header-for-inet_addr.patch
new file mode 100644
index 000000000000..b31f91db29af
--- /dev/null
+++ b/www-apache/mod_rpaf/files/012_Add-missing-header-for-inet_addr.patch
@@ -0,0 +1,17 @@
+Description: Add missing header for inet_addr
+Author: Sergey B Kirpichev <skirpichev@gmail.com>
+
+---
+ mod_rpaf-2.0.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/mod_rpaf-2.0.c
++++ b/mod_rpaf-2.0.c
+@@ -64,6 +64,7 @@
+ *
+ */
+
++#include <arpa/inet.h>
+ #include "httpd.h"
+ #include "http_config.h"
+ #include "http_core.h"
diff --git a/www-apache/mod_rpaf/files/10_mod_rpaf.conf b/www-apache/mod_rpaf/files/10_mod_rpaf.conf
new file mode 100644
index 000000000000..56c952ffaeb6
--- /dev/null
+++ b/www-apache/mod_rpaf/files/10_mod_rpaf.conf
@@ -0,0 +1,6 @@
+<IfDefine RPAF>
+LoadModule rpaf_module modules/mod_rpaf.so
+RPAFenable on
+</IfDefine>
+
+# vim: ts=4 filetype=apache
diff --git a/www-apache/mod_rpaf/metadata.xml b/www-apache/mod_rpaf/metadata.xml
new file mode 100644
index 000000000000..6f49eba8f496
--- /dev/null
+++ b/www-apache/mod_rpaf/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<!-- maintainer-needed -->
+</pkgmetadata>
diff --git a/www-apache/mod_rpaf/mod_rpaf-0.6-r1.ebuild b/www-apache/mod_rpaf/mod_rpaf-0.6-r1.ebuild
new file mode 100644
index 000000000000..703c870f07a4
--- /dev/null
+++ b/www-apache/mod_rpaf/mod_rpaf-0.6-r1.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit apache-module eutils
+
+DESCRIPTION="Reverse proxy add forward module"
+HOMEPAGE="http://stderr.net/apache/rpaf/"
+SRC_URI="http://stderr.net/apache/rpaf/download/${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+
+APACHE2_MOD_CONF="10_${PN}"
+APACHE2_MOD_DEFINE="RPAF"
+
+need_apache2_4
+
+src_prepare() {
+ # Debian patches
+ epatch "${FILESDIR}"/0*.patch
+ mv ${PN}-2.0.c ${PN}.c
+}