Add headers_more subpackage to nginx

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Add headers_more subpackage to nginx

Jeremy Evans-5
This adds the headers-more module as an nginx subpackage. This module
extends nginx's default http headers module by allowing headers to be
set and cleared instead of just added.

Homepage for this module is:
https://github.com/openresty/headers-more-nginx-module

Among other things, it appears this module is necessary to correctly
proxy HTTP traffic for Microsoft Exchange.

Tested on amd64 making sure setting/clearing of request/response headers
works as advertised when proxying.

While here, bump the passenger subpackage and make sure it is buildable
after the default ruby version change.

OK?

Thanks,
Jeremy

Index: Makefile
===================================================================
RCS file: /cvs/ports/www/nginx/Makefile,v
retrieving revision 1.113
diff -u -p -u -p -r1.113 Makefile
--- Makefile 27 Jul 2017 22:01:58 -0000 1.113
+++ Makefile 2 Nov 2017 11:40:36 -0000
@@ -11,6 +11,7 @@ COMMENT-mailproxy= nginx mail proxy modu
 COMMENT-stream= nginx TCP/UDP proxy module
 COMMENT-naxsi= nginx web application firewall module
 COMMENT-lua= nginx lua scripting module
+COMMENT-headers_more= nginx module for setting/adding/clearing headers
 COMMENT-perl= nginx perl scripting module
 COMMENT-passenger= nginx passenger (ruby/python/nodejs) integration module
 
@@ -26,19 +27,24 @@ PKGNAME-mailproxy= nginx-mailproxy-${VE
 PKGNAME-stream= nginx-stream-${VERSION}
 PKGNAME-naxsi= nginx-naxsi-${VERSION}
 PKGNAME-lua= nginx-lua-${VERSION}
+PKGNAME-headers_more= nginx-headers-more-${VERSION}
 PKGNAME-perl= nginx-perl-${VERSION}
 PKGNAME-passenger= nginx-passenger-${VERSION}
 
+REVISION-passenger= 0
+
 MASTER_SITES= https://nginx.org/download/
 MASTER_SITES0= https://github.com/simpl/ngx_devel_kit/archive/
 MASTER_SITES1= https://github.com/nbs-system/naxsi/archive/
 MASTER_SITES2= https://github.com/openresty/lua-nginx-module/archive/
 MASTER_SITES3= https://raw.githubusercontent.com/rnagy/nginx_chroot_patch/master/
+MASTER_SITES4= https://github.com/openresty/headers-more-nginx-module/archive/
 
 DISTFILES= ${DISTNAME}${EXTRACT_SUFX} \
  ngx_devel_kit-v0.3.0.tar.gz{v0.3.0.tar.gz}:0 \
  naxsi-0.55.1.tar.gz{0.55.1.tar.gz}:1 \
- lua-nginx-module-v0.10.6.tar.gz{v0.10.6.tar.gz}:2
+ lua-nginx-module-v0.10.6.tar.gz{v0.10.6.tar.gz}:2 \
+ headers-more-nginx-module-v0.32.tar.gz{v0.32.tar.gz}:4
 
 HOMEPAGE= http://nginx.org/
 
@@ -50,7 +56,8 @@ PERMIT_PACKAGE_CDROM= yes
 
 # XXX -lua removed following libressl api change; re-add to
 # MULTI_PACKAGES when this is worked-around
-MULTI_PACKAGES = -main -image_filter -geoip -xslt -mailproxy -stream -naxsi -perl -passenger # -lua
+MULTI_PACKAGES = -main -image_filter -geoip -xslt -mailproxy -stream \
+ -naxsi -perl -passenger -headers_more # -lua
 
 FLAVOR ?=
 PSEUDO_FLAVORS = no_lua
@@ -65,6 +72,7 @@ WANTLIB-geoip= GeoIP
 WANTLIB-xslt= exslt xml2 xslt
 WANTLIB-naxsi=
 WANTLIB-lua= ${MODLUA_WANTLIB} m
+WANTLIB-headers_more=
 WANTLIB-perl= c m perl
 WANTLIB-passenger= m pthread ${COMPILER_LIBCXX}
 
@@ -84,9 +92,10 @@ RUN_DEPENDS-geoip= www/nginx,-main=${VER
 RUN_DEPENDS-xslt= www/nginx,-main=${VERSION}
 RUN_DEPENDS-naxsi= www/nginx,-main=${VERSION}
 RUN_DEPENDS-lua= www/nginx,-main=${VERSION}
+RUN_DEPENDS-headers_more=www/nginx,-main=${VERSION}
 RUN_DEPENDS-perl= www/nginx,-main=${VERSION}
 RUN_DEPENDS-passenger= www/nginx,-main=${VERSION} \
- ruby-passenger-*|ruby21-passenger-*|ruby22-passenger-*|ruby23-passenger-*:www/ruby-passenger
+ ruby23-passenger-*|ruby24-passenger-*:www/ruby-passenger
 
 NGINX_DIR= /var/www
 SUBST_VARS= NGINX_DIR
@@ -98,6 +107,7 @@ PREFIX-image_filter= ${NGINX_MODULES_DIR
 PREFIX-geoip= ${NGINX_MODULES_DIR}
 PREFIX-xslt= ${NGINX_MODULES_DIR}
 PREFIX-lua= ${NGINX_MODULES_DIR}
+PREFIX-headers_more= ${NGINX_MODULES_DIR}
 PREFIX-passenger= ${NGINX_MODULES_DIR}
 
 CFLAGS+= -Wall -Wpointer-arith \
@@ -151,6 +161,7 @@ CONFIGURE_ARGS+= --prefix=${NGINX_DIR} \
  --with-stream=dynamic \
  --add-dynamic-module=${WRKSRC}/naxsi/naxsi_src/ \
  --add-dynamic-module=${WRKSRC}/ngx_devel_kit \
+ --add-dynamic-module=${WRKSRC}/headers-more-nginx-module \
  --add-dynamic-module=${LOCALBASE}/lib/phusion-passenger${GEM_BIN_SUFFIX}/src/nginx_module
 
 SUBSTFILES= conf/nginx.conf \
@@ -164,7 +175,8 @@ pre-patch:
     mv ../naxsi-* naxsi
  cd ${WRKSRC} && \
     mv ../ngx_devel_kit-* ngx_devel_kit && \
-    mv ../lua-nginx-module-* lua-nginx-module
+    mv ../lua-nginx-module-* lua-nginx-module && \
+    mv ../headers-more-nginx-module-* headers-more-nginx-module
 
 pre-configure:
  @cd ${WRKSRC} && ${SUBST_CMD} ${SUBSTFILES}
Index: distinfo
===================================================================
RCS file: /cvs/ports/www/nginx/distinfo,v
retrieving revision 1.61
diff -u -p -u -p -r1.61 distinfo
--- distinfo 27 Jul 2017 22:01:58 -0000 1.61
+++ distinfo 2 Nov 2017 11:40:36 -0000
@@ -1,8 +1,10 @@
+SHA256 (headers-more-nginx-module-v0.32.tar.gz) = xtnauOofyZcDEAfi6PR8ztAUF+IDzYjVOp/p9q4ThyA=
 SHA256 (lua-nginx-module-v0.10.6.tar.gz) = uYxPZIWJu/Piw9X9GGZOen74msCD6WyOmE+pGeenwHM=
 SHA256 (naxsi-0.55.1.tar.gz) = Rd0N96awtqqcZOuMOajilNZZ2H+xjhks9Y8UAvPNsKg=
 SHA256 (nginx-1.12.1-chroot.patch) = PJF/2hg+WkMNlTXBhipDffH/v+46fm4zNqHFy7O6hzw=
 SHA256 (nginx-1.12.1.tar.gz) = h5O/QmSFow+RAhtrlFqf2KhNh9F7VmViw3l6uo+sdvs=
 SHA256 (ngx_devel_kit-v0.3.0.tar.gz) = iOBamainQZBm9a51lm+x78QJutRSLRSYbaB0VUrmFhk=
+SIZE (headers-more-nginx-module-v0.32.tar.gz) = 28033
 SIZE (lua-nginx-module-v0.10.6.tar.gz) = 597217
 SIZE (naxsi-0.55.1.tar.gz) = 185997
 SIZE (nginx-1.12.1-chroot.patch) = 8196
Index: pkg/DESCR-headers_more
===================================================================
RCS file: pkg/DESCR-headers_more
diff -N pkg/DESCR-headers_more
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ pkg/DESCR-headers_more 2 Nov 2017 11:40:36 -0000
@@ -0,0 +1,2 @@
+This module allows for setting and clearing input and output headers,
+while nginx's default only allows for adding headers.
Index: pkg/PLIST-headers_more
===================================================================
RCS file: pkg/PLIST-headers_more
diff -N pkg/PLIST-headers_more
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ pkg/PLIST-headers_more 2 Nov 2017 11:40:36 -0000
@@ -0,0 +1,2 @@
+@comment $OpenBSD: PLIST-lua,v 1.1 2016/11/04 22:13:43 jeremy Exp $
+ngx_http_headers_more_filter_module.so

Reply | Threaded
Open this post in threaded view
|

Re: Add headers_more subpackage to nginx

Stuart Henderson
On 2017/11/02 04:43, Jeremy Evans wrote:

> This adds the headers-more module as an nginx subpackage. This module
> extends nginx's default http headers module by allowing headers to be
> set and cleared instead of just added.
>
> Homepage for this module is:
> https://github.com/openresty/headers-more-nginx-module
>
> Among other things, it appears this module is necessary to correctly
> proxy HTTP traffic for Microsoft Exchange.
>
> Tested on amd64 making sure setting/clearing of request/response headers
> works as advertised when proxying.
>
> While here, bump the passenger subpackage and make sure it is buildable
> after the default ruby version change.
>
> OK?

OK with me. headers_more parts are pretty similar to what I have locally.

Reply | Threaded
Open this post in threaded view
|

Re: Add headers_more subpackage to nginx

Jeremy Evans-5
In reply to this post by Jeremy Evans-5
On 11/02 04:43, Jeremy Evans wrote:

> This adds the headers-more module as an nginx subpackage. This module
> extends nginx's default http headers module by allowing headers to be
> set and cleared instead of just added.
>
> Homepage for this module is:
> https://github.com/openresty/headers-more-nginx-module
>
> Among other things, it appears this module is necessary to correctly
> proxy HTTP traffic for Microsoft Exchange.
>
> Tested on amd64 making sure setting/clearing of request/response headers
> works as advertised when proxying.

Here's a revised diff since the build fix went in during p2k17.
I have an OK from sthen@.  Robert/William, do you have any problems with
this going in?

Thanks,
Jeremy

Index: Makefile
===================================================================
RCS file: /cvs/ports/www/nginx/Makefile,v
retrieving revision 1.114
diff -u -p -r1.114 Makefile
--- Makefile 2 Nov 2017 14:08:18 -0000 1.114
+++ Makefile 2 Nov 2017 10:51:16 -0000
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.114 2017/11/02 14:08:18 jeremy Exp $
+# $OpenBSD: Makefile,v 1.113 2017/07/27 22:01:58 robert Exp $
 
 BROKEN-arm= src/core/ngx_rwlock.c:116:2: error: \#error ngx_atomic_cmp_set() is not defined!
 BROKEN-hppa= src/core/ngx_rwlock.c:116:2: error: \#error ngx_atomic_cmp_set() is not defined!
@@ -11,6 +11,7 @@ COMMENT-mailproxy= nginx mail proxy modu
 COMMENT-stream= nginx TCP/UDP proxy module
 COMMENT-naxsi= nginx web application firewall module
 COMMENT-lua= nginx lua scripting module
+COMMENT-headers_more= nginx module for setting/adding/clearing headers
 COMMENT-perl= nginx perl scripting module
 COMMENT-passenger= nginx passenger (ruby/python/nodejs) integration module
 
@@ -26,6 +27,7 @@ PKGNAME-mailproxy= nginx-mailproxy-${VE
 PKGNAME-stream= nginx-stream-${VERSION}
 PKGNAME-naxsi= nginx-naxsi-${VERSION}
 PKGNAME-lua= nginx-lua-${VERSION}
+PKGNAME-headers_more= nginx-headers-more-${VERSION}
 PKGNAME-perl= nginx-perl-${VERSION}
 PKGNAME-passenger= nginx-passenger-${VERSION}
 
@@ -36,11 +38,13 @@ MASTER_SITES0= https://github.com/simpl/
 MASTER_SITES1= https://github.com/nbs-system/naxsi/archive/
 MASTER_SITES2= https://github.com/openresty/lua-nginx-module/archive/
 MASTER_SITES3= https://raw.githubusercontent.com/rnagy/nginx_chroot_patch/master/
+MASTER_SITES4= https://github.com/openresty/headers-more-nginx-module/archive/
 
 DISTFILES= ${DISTNAME}${EXTRACT_SUFX} \
  ngx_devel_kit-v0.3.0.tar.gz{v0.3.0.tar.gz}:0 \
  naxsi-0.55.1.tar.gz{0.55.1.tar.gz}:1 \
- lua-nginx-module-v0.10.6.tar.gz{v0.10.6.tar.gz}:2
+ lua-nginx-module-v0.10.6.tar.gz{v0.10.6.tar.gz}:2 \
+ headers-more-nginx-module-v0.32.tar.gz{v0.32.tar.gz}:4
 
 HOMEPAGE= http://nginx.org/
 
@@ -52,7 +56,8 @@ PERMIT_PACKAGE_CDROM= yes
 
 # XXX -lua removed following libressl api change; re-add to
 # MULTI_PACKAGES when this is worked-around
-MULTI_PACKAGES = -main -image_filter -geoip -xslt -mailproxy -stream -naxsi -perl -passenger # -lua
+MULTI_PACKAGES = -main -image_filter -geoip -xslt -mailproxy -stream \
+ -naxsi -perl -passenger -headers_more # -lua
 
 FLAVOR ?=
 PSEUDO_FLAVORS = no_lua
@@ -67,6 +72,7 @@ WANTLIB-geoip= GeoIP
 WANTLIB-xslt= exslt xml2 xslt
 WANTLIB-naxsi=
 WANTLIB-lua= ${MODLUA_WANTLIB} m
+WANTLIB-headers_more=
 WANTLIB-perl= c m perl
 WANTLIB-passenger= m pthread ${COMPILER_LIBCXX}
 
@@ -86,6 +92,7 @@ RUN_DEPENDS-geoip= www/nginx,-main=${VER
 RUN_DEPENDS-xslt= www/nginx,-main=${VERSION}
 RUN_DEPENDS-naxsi= www/nginx,-main=${VERSION}
 RUN_DEPENDS-lua= www/nginx,-main=${VERSION}
+RUN_DEPENDS-headers_more=www/nginx,-main=${VERSION}
 RUN_DEPENDS-perl= www/nginx,-main=${VERSION}
 RUN_DEPENDS-passenger= www/nginx,-main=${VERSION} \
  ruby23-passenger-*|ruby24-passenger-*:www/ruby-passenger
@@ -100,6 +107,7 @@ PREFIX-image_filter= ${NGINX_MODULES_DIR
 PREFIX-geoip= ${NGINX_MODULES_DIR}
 PREFIX-xslt= ${NGINX_MODULES_DIR}
 PREFIX-lua= ${NGINX_MODULES_DIR}
+PREFIX-headers_more= ${NGINX_MODULES_DIR}
 PREFIX-passenger= ${NGINX_MODULES_DIR}
 
 CFLAGS+= -Wall -Wpointer-arith \
@@ -153,6 +161,7 @@ CONFIGURE_ARGS+= --prefix=${NGINX_DIR} \
  --with-stream=dynamic \
  --add-dynamic-module=${WRKSRC}/naxsi/naxsi_src/ \
  --add-dynamic-module=${WRKSRC}/ngx_devel_kit \
+ --add-dynamic-module=${WRKSRC}/headers-more-nginx-module \
  --add-dynamic-module=${LOCALBASE}/lib/phusion-passenger${GEM_BIN_SUFFIX}/src/nginx_module
 
 SUBSTFILES= conf/nginx.conf \
@@ -166,7 +175,8 @@ pre-patch:
     mv ../naxsi-* naxsi
  cd ${WRKSRC} && \
     mv ../ngx_devel_kit-* ngx_devel_kit && \
-    mv ../lua-nginx-module-* lua-nginx-module
+    mv ../lua-nginx-module-* lua-nginx-module && \
+    mv ../headers-more-nginx-module-* headers-more-nginx-module
 
 pre-configure:
  @cd ${WRKSRC} && ${SUBST_CMD} ${SUBSTFILES}
Index: distinfo
===================================================================
RCS file: /cvs/ports/www/nginx/distinfo,v
retrieving revision 1.61
diff -u -p -r1.61 distinfo
--- distinfo 27 Jul 2017 22:01:58 -0000 1.61
+++ distinfo 2 Nov 2017 10:47:46 -0000
@@ -1,8 +1,10 @@
+SHA256 (headers-more-nginx-module-v0.32.tar.gz) = xtnauOofyZcDEAfi6PR8ztAUF+IDzYjVOp/p9q4ThyA=
 SHA256 (lua-nginx-module-v0.10.6.tar.gz) = uYxPZIWJu/Piw9X9GGZOen74msCD6WyOmE+pGeenwHM=
 SHA256 (naxsi-0.55.1.tar.gz) = Rd0N96awtqqcZOuMOajilNZZ2H+xjhks9Y8UAvPNsKg=
 SHA256 (nginx-1.12.1-chroot.patch) = PJF/2hg+WkMNlTXBhipDffH/v+46fm4zNqHFy7O6hzw=
 SHA256 (nginx-1.12.1.tar.gz) = h5O/QmSFow+RAhtrlFqf2KhNh9F7VmViw3l6uo+sdvs=
 SHA256 (ngx_devel_kit-v0.3.0.tar.gz) = iOBamainQZBm9a51lm+x78QJutRSLRSYbaB0VUrmFhk=
+SIZE (headers-more-nginx-module-v0.32.tar.gz) = 28033
 SIZE (lua-nginx-module-v0.10.6.tar.gz) = 597217
 SIZE (naxsi-0.55.1.tar.gz) = 185997
 SIZE (nginx-1.12.1-chroot.patch) = 8196
Index: pkg/DESCR-headers_more
===================================================================
RCS file: pkg/DESCR-headers_more
diff -N pkg/DESCR-headers_more
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ pkg/DESCR-headers_more 2 Nov 2017 10:34:31 -0000
@@ -0,0 +1,2 @@
+This module allows for setting and clearing input and output headers,
+while nginx's default only allows for adding headers.
Index: pkg/PLIST-headers_more
===================================================================
RCS file: pkg/PLIST-headers_more
diff -N pkg/PLIST-headers_more
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ pkg/PLIST-headers_more 2 Nov 2017 10:54:44 -0000
@@ -0,0 +1,2 @@
+@comment $OpenBSD: PLIST-lua,v 1.1 2016/11/04 22:13:43 jeremy Exp $
+ngx_http_headers_more_filter_module.so