Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-servers/nginx/files/, www-servers/nginx/
Date: Fri, 22 Jun 2018 10:37:07
Message-Id: 1529663811.27da4cba0ea86c7d562152c0df33c7315e8c8d06.whissi@gentoo
1 commit: 27da4cba0ea86c7d562152c0df33c7315e8c8d06
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jun 22 10:36:32 2018 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Fri Jun 22 10:36:51 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=27da4cba
7
8 www-servers/nginx: security cleanup
9
10 Bug: https://bugs.gentoo.org/658736
11 Package-Manager: Portage-2.3.40, Repoman-2.3.9
12
13 www-servers/nginx/Manifest | 5 -
14 ...1.15-allow-compilation-without-HTTP-cache.patch | 42 -
15 www-servers/nginx/nginx-1.13.12-r1.ebuild | 1064 --------------------
16 3 files changed, 1111 deletions(-)
17
18 diff --git a/www-servers/nginx/Manifest b/www-servers/nginx/Manifest
19 index 6b64157a4ab..613d35ccc7a 100644
20 --- a/www-servers/nginx/Manifest
21 +++ b/www-servers/nginx/Manifest
22 @@ -1,13 +1,11 @@
23 DIST modsecurity-2.9.2.tar.gz 4298993 BLAKE2B 32a92148f0e1a1166cf888b8172fc55340c5712c9b770583703c74db450e77226629640c9db03f32e9f28397e6488669d06a89e4d31cb5ab5fff26b30ad843e0 SHA512 69c87ef6f7b6411f4803eb25af32969a1da59722121257c2edf345a3f5a4ab9ae8a49c886cbbfc722c5bda91c6d6ea55232f968c0a0407d7d7b3af53dc862c21
24 DIST nginx-1.12.2.tar.gz 981687 BLAKE2B cca2d2b2267fee6feac7e91a5aaec229251e829203b02c207a6a89644fd6b1f2003d75225fadde9fdfc8dda444dc53c7ff0033a1e15a0f25019c878fc716d83f SHA512 3faa2043e237a7e1d15cc5661ac9d002a965220a78c25a863be9f19e01007347e53f776b61c229f6bd3d916cc1ccf92de260811f7b8092ec1b747fba7c0061f7
25 -DIST nginx-1.13.12.tar.gz 1016311 BLAKE2B 8b56e1e13c2598181153b9fe5f5a9ac6349ba1d6c98cfca708cb7ae1d3b6eec92df0132091107bc20c0ae1bec15020957c820f9414890151b4b1830f00af2d40 SHA512 c61668d4999d43ccd5ed8e99bd2f6992190503bb3c4103a22871e346feb8cbd049b04416ca7eb982c122a9a29bb21c6bb9f934411dd80bc02d946105f7917873
26 DIST nginx-1.14.0.tar.gz 1016272 BLAKE2B 37d292955dc5f03f6b3b05fd434807ba1033fab73494866e8bacb99df1d595a7665b3722e9bb7227a119cabfea79be08a14e589565cedb78693fc3990cee4466 SHA512 40f086c9f741727e6f55802b6c3a66f081f7c49c38646dc1491aa3e3c35bae12b65ea6594386609fc849bcd99a60d7cd8ecb3f8d519e0e9ab8db01d653e930e9
27 DIST nginx-1.15.0.tar.gz 1020675 BLAKE2B b8151877d06f96276fc8186dc8c32b8f1479e27c7f6bdba9158b1d945661891e14c39d2ab3ff8991b3906c5fffe721ab4014d709895a6e3f5bc22b687ea3c536 SHA512 7dbdf437d8d546059a8a03aa9c8d2be98dba7306e2daa49611c16f1e56413a25d4c622da13a815e8075a10f4a0cd744167deaeb971c0a69189940a7a05fa32df
28 DIST nginx-auth-ldap-42d195d7a7575ebab1c369ad3fc5d78dc2c2669c.tar.gz 18457 BLAKE2B 22225ca9e5299b20ab5a93a001cac48e446bd86b3a24ac49e716bc975b128890bdb4b0dbbf5730fbaaeadfd958160093c7a6af798dd0e6de27062f149a760333 SHA512 ec59637fda5acac053e815cb1d04b545fc6b765e5ec63d8c2c9c301abad87afaa2698145acac08e9e14c91e1423ebff7aff0cca2b940b19ccccbf4cf53973269
29 DIST nginx-auth-ldap-49a8b4d28fc4a518563c82e0b52821e5f37db1fc.tar.gz 17159 BLAKE2B f2209c8b5eb5616a362f2b532245167a5940faad6d66d98a94b3bf2d1e33a73492d42c60a9ddad347a592362a002ff38273a5d1f61f663984a09e14a3fe35e0f SHA512 323abd0ca8e90f5afcaf81a8ff1a8abe3dfcbff3d69f0dd4a1c005fe6436acbf3076c4c57a4df877b3d8e388cbea085d46301bb2df9c0752e2567817ff7cca92
30 DIST nginx_http_sticky_module_ng-1.2.6-10-g08a395c66e42.tar.bz2 124047 BLAKE2B d37ef9a15c91abe3c6258e420d1f99fa452f9d9966a0e13102174973314a3bac5413957a5fe632a9dcb1163b3be5df8116e05cc053ee061e19319ec25f341570 SHA512 6c1bfdcf89884b2855d51ae7da0f6e53a4ca3629e1aaf58433b70c07dcb2af797ba6e87d9b3eb4fe2fb6d4d697e862f2b4c2f8d8b3fdaea201740c97ec936529
31 DIST ngx_brotli-0.1.2.tar.gz 12668 BLAKE2B 904d3f28dcf9f2d5a8eefa2ab8ff991e34624897a9932e351ec4cea05f2b0dbee34ea495de2d546510a556fb10041b388be963f28fecfcd7dc8638f950b36fd0 SHA512 661b4ce5cc678600e5df6be7588b0f0d5d914df9a6788c994cebfa25e211720b9e7d2c08fc34eb6a84743ae2929920ebf2888075e122ac23816ab7c0f3ef4b76
32 -DIST ngx_brotli-37ab9b2933a0b756ba3447000b7f31d432ed8228.tar.gz 12692 BLAKE2B 8b969fcd7daf37d790e81ff6dd4d43a210c9097052cc7a2db9f2aa8ad3115ffe175b0839210c234610e5731be35327eb08eb0eb3f28783d272b172df07259651 SHA512 fb12e4b50b9a472ee2f4fe08ffd86c38072a4c254a4f99627d6f2411f915c139f6e7cfe41f29222bc70b57942cde85d8ef2cd5458638201c751cd4c818d65f10
33 DIST ngx_devel_kit-0.3.0-r1.tar.gz 66455 BLAKE2B e4e987a85b2283ba540b4b894382e65dac7fbca23e233b1031b38828908088370cdb1a9bded4d4ee1ceb1c2e1d506dc2b6f4ba5f6ee94248e863def5a1c8dd1a SHA512 558764c9be913a4f61d0e277d07bf3c272e1ce086b3fadb85b693a7e92805cd9fca4da7a8d29c96e53fc0d23b331327d3b2561ff61f19d2330e7d5d35ac7d614
34 DIST ngx_http_auth_pam-1.5.1.tar.gz 6863 BLAKE2B 00807cc3db8f6c007c968b8a30d7f6094b7d9db4eaa60d211fcb3ac60aeb28c5f8193578a7e1ca67acbbf57a319c8442fe44efc1e193927c3bce5961539f9c16 SHA512 973b94874d8a58c0df0ac2d31571eafc1e80b11179cba33ec88421a826207fbf7e99b0387e135a1ca48d82daacb78f19a4c21d3a27b49b16dc86b4748bb72261
35 DIST ngx_http_cache_purge-2.3.tar.gz 12248 BLAKE2B f83b267f4c19a9d4af5964522695814c164d200ecd4108bf8f6b5c21388eba8af989bdda646dee18a03174211e8c090a04736bbeb44043cb0e19fbccdc66278e SHA512 50a31dbf2216a6fae74a186af56dec4600cf55777e76a10ac0075f609e7737135aab063a64f2590dddcd0369ebebd4a523027f3d9ebcca74f7b4355be1c5dcc0
36 @@ -18,7 +16,6 @@ DIST ngx_http_geoip2_module-2.0.tar.gz 6766 BLAKE2B 338c9503530ebba6076a2222fe9d
37 DIST ngx_http_headers_more-0.32.tar.gz 28033 BLAKE2B 51cff34f9a690a3c9a2a05b04084cdd51530b1f41baa1d487bd5bd4349d37a6cc48edffb78466572bee3e42aea10f56e1f8bc47d53a2790023ff831eaa72381f SHA512 e42582b45c3111de3940bbeb67ce161aca2d55adcfb00c61c12256fa0e36221d38723013f36edbcf6d1b520f8dfb49d4657df8a956e66d36e68425afad382bd1
38 DIST ngx_http_headers_more-0.33.tar.gz 28130 BLAKE2B fe3097a7700ce5da087058f7bb44c95164b75137031187400473f6833bf0e33e5c4920807225a6ff94174fe7dbd6186cca176a33a629ca0911faab6804bdd12a SHA512 13165b1b8d4be281b8bd2404fa48d456013d560bace094c81da08a35dc6a4f025a809a3ae3a42be6bbf67abbcbe41e0730aba06f905220f3baeb01e1192a7d37
39 DIST ngx_http_lua-0.10.10.tar.gz 611973 BLAKE2B c84d039087973cc6f718fd5cfcb043fd96893d790d2d65b448faf63ad7e3b8713d529c7804a436cc972bcabb9d4d3a8a605fe70a4ccf0a696dfc493656ac513c SHA512 3440e3fe714407f0ff61e0da207669655b443f7b70ef8a91693ea05ed96d8fde349d9c8ea30d5ff53ea3f8e4a5c7d0a2834e136c340b1b1365d62006339a1e4d
40 -DIST ngx_http_lua-0.10.11.tar.gz 616653 BLAKE2B 6985823752755b78b626f597600adf45592ce4c8dc3a513dd43b9f5152c9746a795faa3714124d74814ad88739dd8889de50e764ad2ea808c48570d1e297aeec SHA512 35e1510c9da71c8bdf028f4ac253404550a83bd904f6c5639697d78c76708625bb6deaa858a7d086b5582f71bb46578e8f804887a46ccfbaf5f4de8510cb1511
41 DIST ngx_http_lua-0.10.13.tar.gz 624102 BLAKE2B 009506e4cd505a2e383e2c6344b62b541b3bbb28410d4ae2e88139227e22e19dd14372a902f172fadaf82a76c5875936caff4a8c98ff740456488e5ac6ff8c53 SHA512 8c316b9d12dc35779fcddc6bb90942c096f19fd8c2e090b8397e1e1ca6f0ebd7a4edddc03fddb31310147ba4e9db9fc4b3749cfd2323046d88045b3b3333f07d
42 DIST ngx_http_naxsi-0.55.3.tar.gz 187416 BLAKE2B de4b00bcfa3e81b7f339bde9f2517e228d2f914c1ac76babd7db1419168814d30f44623a67c0f79475c232ca456792cbdc8f2b6ef3ebd1524eff3f2acfa87685 SHA512 9e8f41a5cd1342cc9b8aa334a603842d14a256aab1f4a21205bb1278aecbb0c49e39c889d8113a5b41aad2efeaa2ed9f11cba6929173f50add91f54c4c59c8a0
43 DIST ngx_http_push_stream-0.5.2.tar.gz 182008 BLAKE2B b53c1269a5b96b35054011879dc2288ec7c9dd3965a1d4cea73fb7804626797b3cf7929ffa00fb0fc7479f5d6a7f8d006dbdde1ffa435f878c7cc9278e6cca00 SHA512 ee8bf9ece652da6aa5a39879298bba70d1842696545259f3f5e302cc61397b35f016364805805f9ab1914fc39ed2f07c015e042155789073e3d1fdc02a0783de
44 @@ -27,7 +24,6 @@ DIST ngx_http_slowfs_cache-1.10.tar.gz 11809 BLAKE2B 54ec1bd0d1cc43cdaafc93ebd46
45 DIST ngx_http_upload_progress-0.9.2-r1.tar.gz 17268 BLAKE2B 7bbbf52e326c64a008339d2f80f123630fd314f705224c8f1c7d0c90bb4d31a24aaa95df55c9022838179114a031731a894992960aecc727635e0e2a0761d2c4 SHA512 c31c46344d49704389722325a041b9cd170fa290acefe92cfc572c07f711cd3039de78f28df48ca7dcb79b2e4bbe442580aaaf4d92883fd3a14bf41d66dd9d8c
46 DIST ngx_http_upstream_check-31b1b42873fa56620d8a873ac13f5f26b52d0cd6.tar.gz 130052 BLAKE2B 0ff95fc9780193b514fc7b28f6c5c1a58942cd54472a495a1812a48ef4039390241c20c8a3e8dfd6168e87df3a9e3b37e9c33f11d13bdf5fb0d1f37041fe4ee8 SHA512 e7ea6712c27fd2610e8681b7f687e24c94cd7558d6f19f87568d4c2169115678a61c58b1cd3686a927173b566ff1e10cb1fb767fe63db61f860a77bac9792f9b
47 DIST ngx_http_upstream_check-9aecf15ec379fe98f62355c57b60c0bc83296f04.tar.gz 130073 BLAKE2B 3c93cef79425a46e22ae39adf13d5ebb0e5d36f5d6be8555ec068dd0017918f5355d82fbbe90ba934e58c52e89c2096e24012f75390c7159d1ebacfaaa112308 SHA512 fad2a0d3ac332b6e67c52e3525f6df8a432df3e92bc173190b8107fba7f24476ab9dae4824630299af68c15e856409bd47a3a79fb5b65e03a5133eb90142b8fc
48 -DIST ngx_http_vhost_traffic_status-0.1.15-gentoo.tar.gz 371234 BLAKE2B 6c164d8c5ee4f3a6729989d9ab2ba874dd5dc285f5c52baf50b05880f184d1ef779f320efa36db8228ab15a8885e972664aee2b1d367279edbf840e41a4c8108 SHA512 63bb0d576fb896526e13fd624eb61b0562756d9aef9124be3d4e845312885838b96d93a4233b15e1b0449714c9689ef1e88b680f23f5d9c909b31026d8c13d08
49 DIST ngx_http_vhost_traffic_status-0.1.17.tar.gz 380239 BLAKE2B ca642825d02a11d289ca45dfc6231e8ddb13d72bce0343beb2e7fea8f255ac30bdc7751ae1c521f42c5de0245ecd0cff31fea050f7c5b4610620e43c6f4250f2 SHA512 cb9abe922b0494c2587e404b0d603a0441a9a328ef5a83b11e0323e8038010e7d69dfa0d9e5c7122d7bd9b6799a684d4d934e5473442f9f41344c8d38d0d6550
50 DIST ngx_memc_module-0.18.tar.gz 37113 BLAKE2B e5b89c7c7a3e6f8ee7c1b2623fbec78851a9d7c1c37c1924e8c010b45a4e034afe504a5e228361ad88cf57e83ce06f5f6d635301f8201f1ebd7e99f30447d524 SHA512 8087bd361fb4e522493e66f93d59c9b13245d6eef0fe4a53f619d1826feb02af60769c0a04f87f2faf5308a44b794ef146a445bdbe7cbc7f21c0edaaba08c706
51 DIST ngx_memc_module-0.19.tar.gz 34654 BLAKE2B 536384c264d88535179634d459d3a47b1d9b11885fbce46fbe9fa4df3dce365320b5963c56aecde3b0039d4f9954943d95f25c5f4fada6256861257f82ebbb12 SHA512 a64ec8dffcd011db2cd12b501271bf5c408f2f31fd2bf477b8db4e88adc5bb5732c4c2181ed8378cab6a937869d8f747ef52b22fe256c90df8440b91890edbe7
52 @@ -35,5 +31,4 @@ DIST ngx_metrics-0.1.1.tar.gz 2964 BLAKE2B 95d71ea26c949c345b83e353bd66a20df18cc
53 DIST ngx_mogilefs_module-1.0.4.tar.gz 11208 BLAKE2B e0729b66554c8890727190a624d4c9aef6499dfc2e301541a9bfc15690caf6d3155c8a4b8f7a1555a7655b47aa0cd1b797aeb8ba82efa92ab80808218a0bdcff SHA512 b8cb7eaf6274f4e2247dbcb39db05072d2b2d4361256a325fafab5533d7ce0c4ae9e2905b954dfcfa4789c9cab5cccf2ac1c3a1f02f6a327ed95b562d7773ed1
54 DIST ngx_rtmp-1.2.0.tar.gz 519895 BLAKE2B a5a888473dd2ba2320ff74017e8445d96fa3e361acc559edb270ad075c937ab5630e537a67ad8ed134a7ec5809ae63e38791ac25ceab3e26160469be8cc2e82c SHA512 8965d9bee91a46375516ccd012d1c43cd23f15c0630d11ed01472b9a84504574b476f22c5584f43c972a8f923e9ae025b9b60c64aace0ed159c7279bcbd376c8
55 DIST ngx_rtmp-1.2.1.tar.gz 519919 BLAKE2B 744ccb8031eb9653f158f9eceba64fc9c8af7b9a42e64ef996ab3bbbe1402e5ffd3efcc8e4aaca437eb5e208e4b6f2d8643fcca953b32f32543eaa1ae4d9505c SHA512 4a0af5e9afa4deb0b53de8de7ddb2cfa6430d372e1ef9e421f01b509548bd134d427345442ac1ce667338cc2a1484dc2ab732e316e878ac7d3537dc527d5f922
56 -DIST njs-0.2.0.tar.gz 251246 BLAKE2B 76c0be4a98d5782df8d9ecb4b5a6a463a77fd59078f5d25a3763ea5e8633906966fc0a34c98dd9dca2dcc1f54994b0f47d8e80a5903faabbe43865930c2bc267 SHA512 8b1975594f47e49f6d245a99e64e59a3eebf916b9e7e8626e5b1487275688e3dd84691e99ed2207698724dc82d75c54176eb88b9104e847d1cd7db7ead89a391
57 DIST njs-0.2.2.tar.gz 253349 BLAKE2B 1ca508677a251ff38f5bca01292f2c7d2c41ac1c5d2cffae8b565694cbed9ebb2811b7e8893ea03384810e169ebb0cccfbf51d36166fcbc32e77fb30ba90d664 SHA512 e309b06b66e955873b82ef6c8881c3a98e0cf22e379b292c7561947db34c28990ade5461f42561e73c79c8e1e7914a990a003926054f884551edc16015ac4792
58
59 diff --git a/www-servers/nginx/files/http_vhost_traffic_status-0.1.15-allow-compilation-without-HTTP-cache.patch b/www-servers/nginx/files/http_vhost_traffic_status-0.1.15-allow-compilation-without-HTTP-cache.patch
60 deleted file mode 100644
61 index e3ac786a62e..00000000000
62 --- a/www-servers/nginx/files/http_vhost_traffic_status-0.1.15-allow-compilation-without-HTTP-cache.patch
63 +++ /dev/null
64 @@ -1,42 +0,0 @@
65 -From 75118e8998d876b5cd0f285a1fa184c3b6ba7fd6 Mon Sep 17 00:00:00 2001
66 -From: Thomas Deutschmann <whissi@××××××.de>
67 -Date: Fri, 16 Feb 2018 20:59:07 +0100
68 -Subject: [PATCH] Fix compilation without HTTP cache.
69 -
70 ----
71 - src/ngx_http_vhost_traffic_status_control.c | 4 ++++
72 - 1 file changed, 4 insertions(+)
73 -
74 -diff --git a/src/ngx_http_vhost_traffic_status_control.c b/src/ngx_http_vhost_traffic_status_control.c
75 -index ade1475..ee5fd3c 100644
76 ---- a/src/ngx_http_vhost_traffic_status_control.c
77 -+++ b/src/ngx_http_vhost_traffic_status_control.c
78 -@@ -196,6 +196,7 @@ ngx_http_vhost_traffic_status_node_status_group(
79 - control->r, *control->buf);
80 - break;
81 -
82 -+#if (NGX_HTTP_CACHE)
83 - case NGX_HTTP_VHOST_TRAFFIC_STATUS_UPSTREAM_CC:
84 - *control->buf = ngx_sprintf(*control->buf,
85 - NGX_HTTP_VHOST_TRAFFIC_STATUS_JSON_FMT_CACHE_S);
86 -@@ -203,6 +204,7 @@ ngx_http_vhost_traffic_status_node_status_group(
87 - *control->buf = ngx_http_vhost_traffic_status_display_set_cache(
88 - control->r, *control->buf, node);
89 - break;
90 -+#endif
91 -
92 - case NGX_HTTP_VHOST_TRAFFIC_STATUS_UPSTREAM_FG:
93 - *control->buf = ngx_sprintf(*control->buf,
94 -@@ -317,10 +319,12 @@ ngx_http_vhost_traffic_status_node_status_zone(
95 - }
96 - break;
97 -
98 -+#if (NGX_HTTP_CACHE)
99 - case NGX_HTTP_VHOST_TRAFFIC_STATUS_UPSTREAM_CC:
100 - *control->buf = ngx_http_vhost_traffic_status_display_set_cache_node(control->r,
101 - *control->buf, vtsn);
102 - break;
103 -+#endif
104 -
105 - case NGX_HTTP_VHOST_TRAFFIC_STATUS_UPSTREAM_FG:
106 - (void) ngx_http_vhost_traffic_status_node_position_key(&dst, 2);
107
108 diff --git a/www-servers/nginx/nginx-1.13.12-r1.ebuild b/www-servers/nginx/nginx-1.13.12-r1.ebuild
109 deleted file mode 100644
110 index e38965dd7ec..00000000000
111 --- a/www-servers/nginx/nginx-1.13.12-r1.ebuild
112 +++ /dev/null
113 @@ -1,1064 +0,0 @@
114 -# Copyright 1999-2018 Gentoo Foundation
115 -# Distributed under the terms of the GNU General Public License v2
116 -
117 -EAPI="6"
118 -
119 -# Maintainer notes:
120 -# - http_rewrite-independent pcre-support makes sense for matching locations without an actual rewrite
121 -# - any http-module activates the main http-functionality and overrides USE=-http
122 -# - keep the following requirements in mind before adding external modules:
123 -# * alive upstream
124 -# * sane packaging
125 -# * builds cleanly
126 -# * does not need a patch for nginx core
127 -# - TODO: test the google-perftools module (included in vanilla tarball)
128 -
129 -# prevent perl-module from adding automagic perl DEPENDs
130 -GENTOO_DEPEND_ON_PERL="no"
131 -
132 -# devel_kit (https://github.com/simpl/ngx_devel_kit, BSD license)
133 -DEVEL_KIT_MODULE_PV="0.3.0"
134 -DEVEL_KIT_MODULE_P="ngx_devel_kit-${DEVEL_KIT_MODULE_PV}-r1"
135 -DEVEL_KIT_MODULE_URI="https://github.com/simpl/ngx_devel_kit/archive/v${DEVEL_KIT_MODULE_PV}.tar.gz"
136 -DEVEL_KIT_MODULE_WD="${WORKDIR}/ngx_devel_kit-${DEVEL_KIT_MODULE_PV}"
137 -
138 -# ngx_brotli (https://github.com/eustas/ngx_brotli, BSD-2)
139 -HTTP_BROTLI_MODULE_PV="37ab9b2933a0b756ba3447000b7f31d432ed8228"
140 -HTTP_BROTLI_MODULE_P="ngx_brotli-${HTTP_BROTLI_MODULE_PV}"
141 -HTTP_BROTLI_MODULE_URI="https://github.com/eustas/ngx_brotli/archive/${HTTP_BROTLI_MODULE_PV}.tar.gz"
142 -HTTP_BROTLI_MODULE_WD="${WORKDIR}/ngx_brotli-${HTTP_BROTLI_MODULE_PV}"
143 -
144 -# http_uploadprogress (https://github.com/masterzen/nginx-upload-progress-module, BSD-2 license)
145 -HTTP_UPLOAD_PROGRESS_MODULE_PV="0.9.2"
146 -HTTP_UPLOAD_PROGRESS_MODULE_P="ngx_http_upload_progress-${HTTP_UPLOAD_PROGRESS_MODULE_PV}-r1"
147 -HTTP_UPLOAD_PROGRESS_MODULE_URI="https://github.com/masterzen/nginx-upload-progress-module/archive/v${HTTP_UPLOAD_PROGRESS_MODULE_PV}.tar.gz"
148 -HTTP_UPLOAD_PROGRESS_MODULE_WD="${WORKDIR}/nginx-upload-progress-module-${HTTP_UPLOAD_PROGRESS_MODULE_PV}"
149 -
150 -# http_headers_more (https://github.com/agentzh/headers-more-nginx-module, BSD license)
151 -HTTP_HEADERS_MORE_MODULE_PV="0.33"
152 -HTTP_HEADERS_MORE_MODULE_P="ngx_http_headers_more-${HTTP_HEADERS_MORE_MODULE_PV}"
153 -HTTP_HEADERS_MORE_MODULE_URI="https://github.com/agentzh/headers-more-nginx-module/archive/v${HTTP_HEADERS_MORE_MODULE_PV}.tar.gz"
154 -HTTP_HEADERS_MORE_MODULE_WD="${WORKDIR}/headers-more-nginx-module-${HTTP_HEADERS_MORE_MODULE_PV}"
155 -
156 -# http_cache_purge (http://labs.frickle.com/nginx_ngx_cache_purge/, https://github.com/FRiCKLE/ngx_cache_purge, BSD-2 license)
157 -HTTP_CACHE_PURGE_MODULE_PV="2.3"
158 -HTTP_CACHE_PURGE_MODULE_P="ngx_http_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}"
159 -HTTP_CACHE_PURGE_MODULE_URI="http://labs.frickle.com/files/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}.tar.gz"
160 -HTTP_CACHE_PURGE_MODULE_WD="${WORKDIR}/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}"
161 -
162 -# http_slowfs_cache (http://labs.frickle.com/nginx_ngx_slowfs_cache/, BSD-2 license)
163 -HTTP_SLOWFS_CACHE_MODULE_PV="1.10"
164 -HTTP_SLOWFS_CACHE_MODULE_P="ngx_http_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}"
165 -HTTP_SLOWFS_CACHE_MODULE_URI="http://labs.frickle.com/files/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}.tar.gz"
166 -HTTP_SLOWFS_CACHE_MODULE_WD="${WORKDIR}/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}"
167 -
168 -# http_fancyindex (https://github.com/aperezdc/ngx-fancyindex, BSD license)
169 -HTTP_FANCYINDEX_MODULE_PV="0.4.2"
170 -HTTP_FANCYINDEX_MODULE_P="ngx_http_fancyindex-${HTTP_FANCYINDEX_MODULE_PV}"
171 -HTTP_FANCYINDEX_MODULE_URI="https://github.com/aperezdc/ngx-fancyindex/archive/v${HTTP_FANCYINDEX_MODULE_PV}.tar.gz"
172 -HTTP_FANCYINDEX_MODULE_WD="${WORKDIR}/ngx-fancyindex-${HTTP_FANCYINDEX_MODULE_PV}"
173 -
174 -# http_lua (https://github.com/openresty/lua-nginx-module, BSD license)
175 -HTTP_LUA_MODULE_PV="0.10.11"
176 -HTTP_LUA_MODULE_P="ngx_http_lua-${HTTP_LUA_MODULE_PV}"
177 -HTTP_LUA_MODULE_URI="https://github.com/openresty/lua-nginx-module/archive/v${HTTP_LUA_MODULE_PV}.tar.gz"
178 -HTTP_LUA_MODULE_WD="${WORKDIR}/lua-nginx-module-${HTTP_LUA_MODULE_PV}"
179 -
180 -# http_auth_pam (https://github.com/stogh/ngx_http_auth_pam_module/, http://web.iti.upv.es/~sto/nginx/, BSD-2 license)
181 -HTTP_AUTH_PAM_MODULE_PV="1.5.1"
182 -HTTP_AUTH_PAM_MODULE_P="ngx_http_auth_pam-${HTTP_AUTH_PAM_MODULE_PV}"
183 -HTTP_AUTH_PAM_MODULE_URI="https://github.com/stogh/ngx_http_auth_pam_module/archive/v${HTTP_AUTH_PAM_MODULE_PV}.tar.gz"
184 -HTTP_AUTH_PAM_MODULE_WD="${WORKDIR}/ngx_http_auth_pam_module-${HTTP_AUTH_PAM_MODULE_PV}"
185 -
186 -# http_upstream_check (https://github.com/yaoweibin/nginx_upstream_check_module, BSD license)
187 -HTTP_UPSTREAM_CHECK_MODULE_PV="9aecf15ec379fe98f62355c57b60c0bc83296f04"
188 -HTTP_UPSTREAM_CHECK_MODULE_P="ngx_http_upstream_check-${HTTP_UPSTREAM_CHECK_MODULE_PV}"
189 -HTTP_UPSTREAM_CHECK_MODULE_URI="https://github.com/yaoweibin/nginx_upstream_check_module/archive/${HTTP_UPSTREAM_CHECK_MODULE_PV}.tar.gz"
190 -HTTP_UPSTREAM_CHECK_MODULE_WD="${WORKDIR}/nginx_upstream_check_module-${HTTP_UPSTREAM_CHECK_MODULE_PV}"
191 -
192 -# http_metrics (https://github.com/zenops/ngx_metrics, BSD license)
193 -HTTP_METRICS_MODULE_PV="0.1.1"
194 -HTTP_METRICS_MODULE_P="ngx_metrics-${HTTP_METRICS_MODULE_PV}"
195 -HTTP_METRICS_MODULE_URI="https://github.com/madvertise/ngx_metrics/archive/v${HTTP_METRICS_MODULE_PV}.tar.gz"
196 -HTTP_METRICS_MODULE_WD="${WORKDIR}/ngx_metrics-${HTTP_METRICS_MODULE_PV}"
197 -
198 -# http_vhost_traffic_status (https://github.com/vozlt/nginx-module-vts, BSD license)
199 -HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV="0.1.15-gentoo"
200 -HTTP_VHOST_TRAFFIC_STATUS_MODULE_P="ngx_http_vhost_traffic_status-${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}"
201 -HTTP_VHOST_TRAFFIC_STATUS_MODULE_URI="https://github.com/Whissi/nginx-module-vts/archive/v${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}.tar.gz"
202 -HTTP_VHOST_TRAFFIC_STATUS_MODULE_WD="${WORKDIR}/nginx-module-vts-${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}"
203 -
204 -# naxsi-core (https://github.com/nbs-system/naxsi, GPLv2+)
205 -HTTP_NAXSI_MODULE_PV="0.55.3"
206 -HTTP_NAXSI_MODULE_P="ngx_http_naxsi-${HTTP_NAXSI_MODULE_PV}"
207 -HTTP_NAXSI_MODULE_URI="https://github.com/nbs-system/naxsi/archive/${HTTP_NAXSI_MODULE_PV}.tar.gz"
208 -HTTP_NAXSI_MODULE_WD="${WORKDIR}/naxsi-${HTTP_NAXSI_MODULE_PV}/naxsi_src"
209 -
210 -# nginx-rtmp-module (https://github.com/arut/nginx-rtmp-module, BSD license)
211 -RTMP_MODULE_PV="1.2.1"
212 -RTMP_MODULE_P="ngx_rtmp-${RTMP_MODULE_PV}"
213 -RTMP_MODULE_URI="https://github.com/arut/nginx-rtmp-module/archive/v${RTMP_MODULE_PV}.tar.gz"
214 -RTMP_MODULE_WD="${WORKDIR}/nginx-rtmp-module-${RTMP_MODULE_PV}"
215 -
216 -# nginx-dav-ext-module (https://github.com/arut/nginx-dav-ext-module, BSD license)
217 -HTTP_DAV_EXT_MODULE_PV="0.1.0"
218 -HTTP_DAV_EXT_MODULE_P="ngx_http_dav_ext-${HTTP_DAV_EXT_MODULE_PV}"
219 -HTTP_DAV_EXT_MODULE_URI="https://github.com/arut/nginx-dav-ext-module/archive/v${HTTP_DAV_EXT_MODULE_PV}.tar.gz"
220 -HTTP_DAV_EXT_MODULE_WD="${WORKDIR}/nginx-dav-ext-module-${HTTP_DAV_EXT_MODULE_PV}"
221 -
222 -# echo-nginx-module (https://github.com/openresty/echo-nginx-module, BSD license)
223 -HTTP_ECHO_MODULE_PV="0.61"
224 -HTTP_ECHO_MODULE_P="ngx_http_echo-${HTTP_ECHO_MODULE_PV}"
225 -HTTP_ECHO_MODULE_URI="https://github.com/openresty/echo-nginx-module/archive/v${HTTP_ECHO_MODULE_PV}.tar.gz"
226 -HTTP_ECHO_MODULE_WD="${WORKDIR}/echo-nginx-module-${HTTP_ECHO_MODULE_PV}"
227 -
228 -# mod_security for nginx (https://modsecurity.org/, Apache-2.0)
229 -# keep the MODULE_P here consistent with upstream to avoid tarball duplication
230 -HTTP_SECURITY_MODULE_PV="2.9.2"
231 -HTTP_SECURITY_MODULE_P="modsecurity-${HTTP_SECURITY_MODULE_PV}"
232 -HTTP_SECURITY_MODULE_URI="https://www.modsecurity.org/tarball/${HTTP_SECURITY_MODULE_PV}/${HTTP_SECURITY_MODULE_P}.tar.gz"
233 -HTTP_SECURITY_MODULE_WD="${WORKDIR}/${HTTP_SECURITY_MODULE_P}"
234 -
235 -# push-stream-module (http://www.nginxpushstream.com, https://github.com/wandenberg/nginx-push-stream-module, GPL-3)
236 -HTTP_PUSH_STREAM_MODULE_PV="0.5.4"
237 -HTTP_PUSH_STREAM_MODULE_P="ngx_http_push_stream-${HTTP_PUSH_STREAM_MODULE_PV}"
238 -HTTP_PUSH_STREAM_MODULE_URI="https://github.com/wandenberg/nginx-push-stream-module/archive/${HTTP_PUSH_STREAM_MODULE_PV}.tar.gz"
239 -HTTP_PUSH_STREAM_MODULE_WD="${WORKDIR}/nginx-push-stream-module-${HTTP_PUSH_STREAM_MODULE_PV}"
240 -
241 -# sticky-module (https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng, BSD-2)
242 -HTTP_STICKY_MODULE_PV="1.2.6-10-g08a395c66e42"
243 -HTTP_STICKY_MODULE_P="nginx_http_sticky_module_ng-${HTTP_STICKY_MODULE_PV}"
244 -HTTP_STICKY_MODULE_URI="https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/get/${HTTP_STICKY_MODULE_PV}.tar.bz2"
245 -HTTP_STICKY_MODULE_WD="${WORKDIR}/nginx-goodies-nginx-sticky-module-ng-08a395c66e42"
246 -
247 -# mogilefs-module (https://github.com/vkholodkov/nginx-mogilefs-module, BSD-2)
248 -HTTP_MOGILEFS_MODULE_PV="1.0.4"
249 -HTTP_MOGILEFS_MODULE_P="ngx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}"
250 -HTTP_MOGILEFS_MODULE_URI="https://github.com/vkholodkov/nginx-mogilefs-module/archive/${HTTP_MOGILEFS_MODULE_PV}.tar.gz"
251 -HTTP_MOGILEFS_MODULE_WD="${WORKDIR}/nginx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}"
252 -
253 -# memc-module (https://github.com/openresty/memc-nginx-module, BSD-2)
254 -HTTP_MEMC_MODULE_PV="0.18"
255 -HTTP_MEMC_MODULE_P="ngx_memc_module-${HTTP_MEMC_MODULE_PV}"
256 -HTTP_MEMC_MODULE_URI="https://github.com/openresty/memc-nginx-module/archive/v${HTTP_MEMC_MODULE_PV}.tar.gz"
257 -HTTP_MEMC_MODULE_WD="${WORKDIR}/memc-nginx-module-${HTTP_MEMC_MODULE_PV}"
258 -
259 -# nginx-ldap-auth-module (https://github.com/kvspb/nginx-auth-ldap, BSD-2)
260 -HTTP_LDAP_MODULE_PV="42d195d7a7575ebab1c369ad3fc5d78dc2c2669c"
261 -HTTP_LDAP_MODULE_P="nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}"
262 -HTTP_LDAP_MODULE_URI="https://github.com/kvspb/nginx-auth-ldap/archive/${HTTP_LDAP_MODULE_PV}.tar.gz"
263 -HTTP_LDAP_MODULE_WD="${WORKDIR}/nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}"
264 -
265 -# njs-module (https://github.com/nginx/njs, as-is)
266 -NJS_MODULE_PV="0.2.0"
267 -NJS_MODULE_P="njs-${NJS_MODULE_PV}"
268 -NJS_MODULE_URI="https://github.com/nginx/njs/archive/${NJS_MODULE_PV}.tar.gz"
269 -NJS_MODULE_WD="${WORKDIR}/njs-${NJS_MODULE_PV}"
270 -
271 -# We handle deps below ourselves
272 -SSL_DEPS_SKIP=1
273 -AUTOTOOLS_AUTO_DEPEND="no"
274 -
275 -inherit autotools ssl-cert toolchain-funcs perl-module flag-o-matic user systemd versionator multilib
276 -
277 -DESCRIPTION="Robust, small and high performance http and reverse proxy server"
278 -HOMEPAGE="https://nginx.org"
279 -SRC_URI="https://nginx.org/download/${P}.tar.gz
280 - ${DEVEL_KIT_MODULE_URI} -> ${DEVEL_KIT_MODULE_P}.tar.gz
281 - nginx_modules_http_auth_ldap? ( ${HTTP_LDAP_MODULE_URI} -> ${HTTP_LDAP_MODULE_P}.tar.gz )
282 - nginx_modules_http_auth_pam? ( ${HTTP_AUTH_PAM_MODULE_URI} -> ${HTTP_AUTH_PAM_MODULE_P}.tar.gz )
283 - nginx_modules_http_brotli? ( ${HTTP_BROTLI_MODULE_URI} -> ${HTTP_BROTLI_MODULE_P}.tar.gz )
284 - nginx_modules_http_cache_purge? ( ${HTTP_CACHE_PURGE_MODULE_URI} -> ${HTTP_CACHE_PURGE_MODULE_P}.tar.gz )
285 - nginx_modules_http_dav_ext? ( ${HTTP_DAV_EXT_MODULE_URI} -> ${HTTP_DAV_EXT_MODULE_P}.tar.gz )
286 - nginx_modules_http_echo? ( ${HTTP_ECHO_MODULE_URI} -> ${HTTP_ECHO_MODULE_P}.tar.gz )
287 - nginx_modules_http_fancyindex? ( ${HTTP_FANCYINDEX_MODULE_URI} -> ${HTTP_FANCYINDEX_MODULE_P}.tar.gz )
288 - nginx_modules_http_headers_more? ( ${HTTP_HEADERS_MORE_MODULE_URI} -> ${HTTP_HEADERS_MORE_MODULE_P}.tar.gz )
289 - nginx_modules_http_javascript? ( ${NJS_MODULE_URI} -> ${NJS_MODULE_P}.tar.gz )
290 - nginx_modules_http_lua? ( ${HTTP_LUA_MODULE_URI} -> ${HTTP_LUA_MODULE_P}.tar.gz )
291 - nginx_modules_http_memc? ( ${HTTP_MEMC_MODULE_URI} -> ${HTTP_MEMC_MODULE_P}.tar.gz )
292 - nginx_modules_http_metrics? ( ${HTTP_METRICS_MODULE_URI} -> ${HTTP_METRICS_MODULE_P}.tar.gz )
293 - nginx_modules_http_mogilefs? ( ${HTTP_MOGILEFS_MODULE_URI} -> ${HTTP_MOGILEFS_MODULE_P}.tar.gz )
294 - nginx_modules_http_naxsi? ( ${HTTP_NAXSI_MODULE_URI} -> ${HTTP_NAXSI_MODULE_P}.tar.gz )
295 - nginx_modules_http_push_stream? ( ${HTTP_PUSH_STREAM_MODULE_URI} -> ${HTTP_PUSH_STREAM_MODULE_P}.tar.gz )
296 - nginx_modules_http_security? ( ${HTTP_SECURITY_MODULE_URI} -> ${HTTP_SECURITY_MODULE_P}.tar.gz )
297 - nginx_modules_http_slowfs_cache? ( ${HTTP_SLOWFS_CACHE_MODULE_URI} -> ${HTTP_SLOWFS_CACHE_MODULE_P}.tar.gz )
298 - nginx_modules_http_sticky? ( ${HTTP_STICKY_MODULE_URI} -> ${HTTP_STICKY_MODULE_P}.tar.bz2 )
299 - nginx_modules_http_upload_progress? ( ${HTTP_UPLOAD_PROGRESS_MODULE_URI} -> ${HTTP_UPLOAD_PROGRESS_MODULE_P}.tar.gz )
300 - nginx_modules_http_upstream_check? ( ${HTTP_UPSTREAM_CHECK_MODULE_URI} -> ${HTTP_UPSTREAM_CHECK_MODULE_P}.tar.gz )
301 - nginx_modules_http_vhost_traffic_status? ( ${HTTP_VHOST_TRAFFIC_STATUS_MODULE_URI} -> ${HTTP_VHOST_TRAFFIC_STATUS_MODULE_P}.tar.gz )
302 - nginx_modules_stream_javascript? ( ${NJS_MODULE_URI} -> ${NJS_MODULE_P}.tar.gz )
303 - rtmp? ( ${RTMP_MODULE_URI} -> ${RTMP_MODULE_P}.tar.gz )"
304 -
305 -LICENSE="BSD-2 BSD SSLeay MIT GPL-2 GPL-2+
306 - nginx_modules_http_security? ( Apache-2.0 )
307 - nginx_modules_http_push_stream? ( GPL-3 )"
308 -
309 -SLOT="mainline"
310 -KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~x86-fbsd ~amd64-linux ~x86-linux"
311 -
312 -# Package doesn't provide a real test suite
313 -RESTRICT="test"
314 -
315 -NGINX_MODULES_STD="access auth_basic autoindex browser charset empty_gif
316 - fastcgi geo grpc gzip limit_req limit_conn map memcached mirror
317 - proxy referer rewrite scgi ssi split_clients upstream_hash
318 - upstream_ip_hash upstream_keepalive upstream_least_conn
319 - upstream_zone userid uwsgi"
320 -NGINX_MODULES_OPT="addition auth_request dav degradation flv geoip gunzip
321 - gzip_static image_filter mp4 perl random_index realip secure_link
322 - slice stub_status sub xslt"
323 -NGINX_MODULES_STREAM_STD="access geo limit_conn map return split_clients
324 - upstream_hash upstream_least_conn upstream_zone"
325 -NGINX_MODULES_STREAM_OPT="geoip realip ssl_preread"
326 -NGINX_MODULES_MAIL="imap pop3 smtp"
327 -NGINX_MODULES_3RD="
328 - http_auth_ldap
329 - http_auth_pam
330 - http_brotli
331 - http_cache_purge
332 - http_dav_ext
333 - http_echo
334 - http_fancyindex
335 - http_headers_more
336 - http_javascript
337 - http_lua
338 - http_memc
339 - http_metrics
340 - http_mogilefs
341 - http_naxsi
342 - http_push_stream
343 - http_security
344 - http_slowfs_cache
345 - http_sticky
346 - http_upload_progress
347 - http_upstream_check
348 - http_vhost_traffic_status
349 - stream_javascript
350 -"
351 -
352 -IUSE="aio debug +http +http2 +http-cache +ipv6 libatomic libressl luajit +pcre
353 - pcre-jit rtmp selinux ssl threads userland_GNU vim-syntax"
354 -
355 -for mod in $NGINX_MODULES_STD; do
356 - IUSE="${IUSE} +nginx_modules_http_${mod}"
357 -done
358 -
359 -for mod in $NGINX_MODULES_OPT; do
360 - IUSE="${IUSE} nginx_modules_http_${mod}"
361 -done
362 -
363 -for mod in $NGINX_MODULES_STREAM_STD; do
364 - IUSE="${IUSE} nginx_modules_stream_${mod}"
365 -done
366 -
367 -for mod in $NGINX_MODULES_STREAM_OPT; do
368 - IUSE="${IUSE} nginx_modules_stream_${mod}"
369 -done
370 -
371 -for mod in $NGINX_MODULES_MAIL; do
372 - IUSE="${IUSE} nginx_modules_mail_${mod}"
373 -done
374 -
375 -for mod in $NGINX_MODULES_3RD; do
376 - IUSE="${IUSE} nginx_modules_${mod}"
377 -done
378 -
379 -# Add so we can warn users updating about config changes
380 -# @TODO: jbergstroem: remove on next release series
381 -IUSE="${IUSE} nginx_modules_http_spdy"
382 -
383 -CDEPEND="
384 - pcre? ( dev-libs/libpcre:= )
385 - pcre-jit? ( dev-libs/libpcre:=[jit] )
386 - ssl? (
387 - !libressl? ( dev-libs/openssl:0= )
388 - libressl? ( dev-libs/libressl:= )
389 - )
390 - http2? (
391 - !libressl? ( >=dev-libs/openssl-1.0.1c:0= )
392 - libressl? ( dev-libs/libressl:= )
393 - )
394 - http-cache? (
395 - userland_GNU? (
396 - !libressl? ( dev-libs/openssl:0= )
397 - libressl? ( dev-libs/libressl:= )
398 - )
399 - )
400 - nginx_modules_http_brotli? ( app-arch/brotli:= )
401 - nginx_modules_http_geoip? ( dev-libs/geoip )
402 - nginx_modules_http_gunzip? ( sys-libs/zlib )
403 - nginx_modules_http_gzip? ( sys-libs/zlib )
404 - nginx_modules_http_gzip_static? ( sys-libs/zlib )
405 - nginx_modules_http_image_filter? ( media-libs/gd:=[jpeg,png] )
406 - nginx_modules_http_perl? ( >=dev-lang/perl-5.8:= )
407 - nginx_modules_http_rewrite? ( dev-libs/libpcre:= )
408 - nginx_modules_http_secure_link? (
409 - userland_GNU? (
410 - !libressl? ( dev-libs/openssl:0= )
411 - libressl? ( dev-libs/libressl:= )
412 - )
413 - )
414 - nginx_modules_http_xslt? ( dev-libs/libxml2:= dev-libs/libxslt )
415 - nginx_modules_http_lua? ( !luajit? ( dev-lang/lua:0= ) luajit? ( dev-lang/luajit:2= ) )
416 - nginx_modules_http_auth_pam? ( virtual/pam )
417 - nginx_modules_http_metrics? ( dev-libs/yajl:= )
418 - nginx_modules_http_dav_ext? ( dev-libs/expat )
419 - nginx_modules_http_security? (
420 - dev-libs/apr:=
421 - dev-libs/apr-util:=
422 - dev-libs/libxml2:=
423 - net-misc/curl
424 - www-servers/apache
425 - )
426 - nginx_modules_http_auth_ldap? ( net-nds/openldap[ssl?] )"
427 -RDEPEND="${CDEPEND}
428 - selinux? ( sec-policy/selinux-nginx )
429 - !www-servers/nginx:0"
430 -DEPEND="${CDEPEND}
431 - nginx_modules_http_brotli? ( virtual/pkgconfig )
432 - nginx_modules_http_security? ( ${AUTOTOOLS_DEPEND} )
433 - arm? ( dev-libs/libatomic_ops )
434 - libatomic? ( dev-libs/libatomic_ops )"
435 -PDEPEND="vim-syntax? ( app-vim/nginx-syntax )"
436 -
437 -REQUIRED_USE="pcre-jit? ( pcre )
438 - nginx_modules_http_grpc? ( http2 )
439 - nginx_modules_http_lua? ( nginx_modules_http_rewrite )
440 - nginx_modules_http_naxsi? ( pcre )
441 - nginx_modules_http_dav_ext? ( nginx_modules_http_dav )
442 - nginx_modules_http_metrics? ( nginx_modules_http_stub_status )
443 - nginx_modules_http_security? ( pcre )
444 - nginx_modules_http_push_stream? ( ssl )"
445 -
446 -pkg_setup() {
447 - NGINX_HOME="/var/lib/nginx"
448 - NGINX_HOME_TMP="${NGINX_HOME}/tmp"
449 -
450 - ebegin "Creating nginx user and group"
451 - enewgroup ${PN}
452 - enewuser ${PN} -1 -1 "${NGINX_HOME}" ${PN}
453 - eend $?
454 -
455 - if use libatomic; then
456 - ewarn "GCC 4.1+ features built-in atomic operations."
457 - ewarn "Using libatomic_ops is only needed if using"
458 - ewarn "a different compiler or a GCC prior to 4.1"
459 - fi
460 -
461 - if [[ -n $NGINX_ADD_MODULES ]]; then
462 - ewarn "You are building custom modules via \$NGINX_ADD_MODULES!"
463 - ewarn "This nginx installation is not supported!"
464 - ewarn "Make sure you can reproduce the bug without those modules"
465 - ewarn "_before_ reporting bugs."
466 - fi
467 -
468 - if use !http; then
469 - ewarn "To actually disable all http-functionality you also have to disable"
470 - ewarn "all nginx http modules."
471 - fi
472 -
473 - if use nginx_modules_http_mogilefs && use threads; then
474 - eerror "mogilefs won't compile with threads support."
475 - eerror "Please disable either flag and try again."
476 - die "Can't compile mogilefs with threads support"
477 - fi
478 -}
479 -
480 -src_prepare() {
481 - eapply "${FILESDIR}/${PN}-1.4.1-fix-perl-install-path.patch"
482 - eapply "${FILESDIR}/${PN}-httpoxy-mitigation-r1.patch"
483 -
484 - if use nginx_modules_http_brotli; then
485 - cd "${HTTP_BROTLI_MODULE_WD}" || die
486 - eapply "${FILESDIR}"/http_brotli-detect-brotli-r1.patch
487 - cd "${S}" || die
488 - fi
489 -
490 - if use nginx_modules_http_upstream_check; then
491 - eapply -p0 "${FILESDIR}"/http_upstream_check-nginx-1.11.5+.patch
492 - fi
493 -
494 - if use nginx_modules_http_cache_purge; then
495 - cd "${HTTP_CACHE_PURGE_MODULE_WD}" || die
496 - eapply "${FILESDIR}"/http_cache_purge-1.11.6+.patch
497 - cd "${S}" || die
498 - fi
499 -
500 - if use nginx_modules_http_security; then
501 - cd "${HTTP_SECURITY_MODULE_WD}" || die
502 -
503 - eautoreconf
504 -
505 - if use luajit ; then
506 - sed -i \
507 - -e 's|^\(LUA_PKGNAMES\)=.*|\1="luajit"|' \
508 - configure || die
509 - fi
510 -
511 - cd "${S}" || die
512 - fi
513 -
514 - if use nginx_modules_http_upload_progress; then
515 - cd "${HTTP_UPLOAD_PROGRESS_MODULE_WD}" || die
516 - eapply "${FILESDIR}"/http_uploadprogress-issue_50-r1.patch
517 - cd "${S}" || die
518 - fi
519 -
520 - find auto/ -type f -print0 | xargs -0 sed -i 's:\&\& make:\&\& \\$(MAKE):' || die
521 - # We have config protection, don't rename etc files
522 - sed -i 's:.default::' auto/install || die
523 - # remove useless files
524 - sed -i -e '/koi-/d' -e '/win-/d' auto/install || die
525 -
526 - # don't install to /etc/nginx/ if not in use
527 - local module
528 - for module in fastcgi scgi uwsgi ; do
529 - if ! use nginx_modules_http_${module}; then
530 - sed -i -e "/${module}/d" auto/install || die
531 - fi
532 - done
533 -
534 - eapply_user
535 -}
536 -
537 -src_configure() {
538 - # mod_security needs to generate nginx/modsecurity/config before including it
539 - if use nginx_modules_http_security; then
540 - cd "${HTTP_SECURITY_MODULE_WD}" || die
541 -
542 - ./configure \
543 - --enable-standalone-module \
544 - --disable-mlogc \
545 - --with-ssdeep=no \
546 - $(use_enable pcre-jit) \
547 - $(use_with nginx_modules_http_lua lua) || die "configure failed for mod_security"
548 -
549 - cd "${S}" || die
550 - fi
551 -
552 - local myconf=() http_enabled= mail_enabled= stream_enabled=
553 -
554 - use aio && myconf+=( --with-file-aio )
555 - use debug && myconf+=( --with-debug )
556 - use http2 && myconf+=( --with-http_v2_module )
557 - use libatomic && myconf+=( --with-libatomic )
558 - use pcre && myconf+=( --with-pcre )
559 - use pcre-jit && myconf+=( --with-pcre-jit )
560 - use threads && myconf+=( --with-threads )
561 -
562 - # HTTP modules
563 - for mod in $NGINX_MODULES_STD; do
564 - if use nginx_modules_http_${mod}; then
565 - http_enabled=1
566 - else
567 - myconf+=( --without-http_${mod}_module )
568 - fi
569 - done
570 -
571 - for mod in $NGINX_MODULES_OPT; do
572 - if use nginx_modules_http_${mod}; then
573 - http_enabled=1
574 - myconf+=( --with-http_${mod}_module )
575 - fi
576 - done
577 -
578 - if use nginx_modules_http_fastcgi; then
579 - myconf+=( --with-http_realip_module )
580 - fi
581 -
582 - # third-party modules
583 - if use nginx_modules_http_upload_progress; then
584 - http_enabled=1
585 - myconf+=( --add-module=${HTTP_UPLOAD_PROGRESS_MODULE_WD} )
586 - fi
587 -
588 - if use nginx_modules_http_headers_more; then
589 - http_enabled=1
590 - myconf+=( --add-module=${HTTP_HEADERS_MORE_MODULE_WD} )
591 - fi
592 -
593 - if use nginx_modules_http_cache_purge; then
594 - http_enabled=1
595 - myconf+=( --add-module=${HTTP_CACHE_PURGE_MODULE_WD} )
596 - fi
597 -
598 - if use nginx_modules_http_slowfs_cache; then
599 - http_enabled=1
600 - myconf+=( --add-module=${HTTP_SLOWFS_CACHE_MODULE_WD} )
601 - fi
602 -
603 - if use nginx_modules_http_fancyindex; then
604 - http_enabled=1
605 - myconf+=( --add-module=${HTTP_FANCYINDEX_MODULE_WD} )
606 - fi
607 -
608 - if use nginx_modules_http_lua; then
609 - http_enabled=1
610 - if use luajit; then
611 - export LUAJIT_LIB=$(pkg-config --variable libdir luajit)
612 - export LUAJIT_INC=$(pkg-config --variable includedir luajit)
613 - else
614 - export LUA_LIB=$(pkg-config --variable libdir lua)
615 - export LUA_INC=$(pkg-config --variable includedir lua)
616 - fi
617 - myconf+=( --add-module=${DEVEL_KIT_MODULE_WD} )
618 - myconf+=( --add-module=${HTTP_LUA_MODULE_WD} )
619 - fi
620 -
621 - if use nginx_modules_http_auth_pam; then
622 - http_enabled=1
623 - myconf+=( --add-module=${HTTP_AUTH_PAM_MODULE_WD} )
624 - fi
625 -
626 - if use nginx_modules_http_upstream_check; then
627 - http_enabled=1
628 - myconf+=( --add-module=${HTTP_UPSTREAM_CHECK_MODULE_WD} )
629 - fi
630 -
631 - if use nginx_modules_http_metrics; then
632 - http_enabled=1
633 - myconf+=( --add-module=${HTTP_METRICS_MODULE_WD} )
634 - fi
635 -
636 - if use nginx_modules_http_naxsi ; then
637 - http_enabled=1
638 - myconf+=( --add-module=${HTTP_NAXSI_MODULE_WD} )
639 - fi
640 -
641 - if use rtmp ; then
642 - http_enabled=1
643 - myconf+=( --add-module=${RTMP_MODULE_WD} )
644 - fi
645 -
646 - if use nginx_modules_http_dav_ext ; then
647 - http_enabled=1
648 - myconf+=( --add-module=${HTTP_DAV_EXT_MODULE_WD} )
649 - fi
650 -
651 - if use nginx_modules_http_echo ; then
652 - http_enabled=1
653 - myconf+=( --add-module=${HTTP_ECHO_MODULE_WD} )
654 - fi
655 -
656 - if use nginx_modules_http_security ; then
657 - http_enabled=1
658 - myconf+=( --add-module=${HTTP_SECURITY_MODULE_WD}/nginx/modsecurity )
659 - fi
660 -
661 - if use nginx_modules_http_push_stream ; then
662 - http_enabled=1
663 - myconf+=( --add-module=${HTTP_PUSH_STREAM_MODULE_WD} )
664 - fi
665 -
666 - if use nginx_modules_http_sticky ; then
667 - http_enabled=1
668 - myconf+=( --add-module=${HTTP_STICKY_MODULE_WD} )
669 - fi
670 -
671 - if use nginx_modules_http_mogilefs ; then
672 - http_enabled=1
673 - myconf+=( --add-module=${HTTP_MOGILEFS_MODULE_WD} )
674 - fi
675 -
676 - if use nginx_modules_http_memc ; then
677 - http_enabled=1
678 - myconf+=( --add-module=${HTTP_MEMC_MODULE_WD} )
679 - fi
680 -
681 - if use nginx_modules_http_auth_ldap; then
682 - http_enabled=1
683 - myconf+=( --add-module=${HTTP_LDAP_MODULE_WD} )
684 - fi
685 -
686 - if use nginx_modules_http_vhost_traffic_status; then
687 - http_enabled=1
688 - myconf+=( --add-module=${HTTP_VHOST_TRAFFIC_STATUS_MODULE_WD} )
689 - fi
690 -
691 - if use nginx_modules_http_javascript || use nginx_modules_stream_javascript; then
692 - myconf+=( --add-module="${NJS_MODULE_WD}/nginx" )
693 - fi
694 -
695 - if use nginx_modules_http_brotli; then
696 - http_enabled=1
697 - myconf+=( --add-module=${HTTP_BROTLI_MODULE_WD} )
698 - fi
699 -
700 - if use http || use http-cache || use http2 || use nginx_modules_http_javascript; then
701 - http_enabled=1
702 - fi
703 -
704 - if [ $http_enabled ]; then
705 - use http-cache || myconf+=( --without-http-cache )
706 - use ssl && myconf+=( --with-http_ssl_module )
707 - else
708 - myconf+=( --without-http --without-http-cache )
709 - fi
710 -
711 - # Stream modules
712 - for mod in $NGINX_MODULES_STREAM_STD; do
713 - if use nginx_modules_stream_${mod}; then
714 - stream_enabled=1
715 - else
716 - myconf+=( --without-stream_${mod}_module )
717 - fi
718 - done
719 -
720 - for mod in $NGINX_MODULES_STREAM_OPT; do
721 - if use nginx_modules_stream_${mod}; then
722 - stream_enabled=1
723 - myconf+=( --with-stream_${mod}_module )
724 - fi
725 - done
726 -
727 - if use nginx_modules_stream_javascript; then
728 - stream_enabled=1
729 - fi
730 -
731 - if [ $stream_enabled ]; then
732 - myconf+=( --with-stream )
733 - use ssl && myconf+=( --with-stream_ssl_module )
734 - fi
735 -
736 - # MAIL modules
737 - for mod in $NGINX_MODULES_MAIL; do
738 - if use nginx_modules_mail_${mod}; then
739 - mail_enabled=1
740 - else
741 - myconf+=( --without-mail_${mod}_module )
742 - fi
743 - done
744 -
745 - if [ $mail_enabled ]; then
746 - myconf+=( --with-mail )
747 - use ssl && myconf+=( --with-mail_ssl_module )
748 - fi
749 -
750 - # custom modules
751 - for mod in $NGINX_ADD_MODULES; do
752 - myconf+=( --add-module=${mod} )
753 - done
754 -
755 - # https://bugs.gentoo.org/286772
756 - export LANG=C LC_ALL=C
757 - tc-export CC
758 -
759 - if ! use prefix; then
760 - myconf+=( --user=${PN} )
761 - myconf+=( --group=${PN} )
762 - fi
763 -
764 - local WITHOUT_IPV6=
765 - if ! use ipv6; then
766 - WITHOUT_IPV6=" -DNGX_HAVE_INET6=0"
767 - fi
768 -
769 - if [[ -n "${EXTRA_ECONF}" ]]; then
770 - myconf+=( ${EXTRA_ECONF} )
771 - ewarn "EXTRA_ECONF applied. Now you are on your own, good luck!"
772 - fi
773 -
774 - ./configure \
775 - --prefix="${EPREFIX}"/usr \
776 - --conf-path="${EPREFIX}"/etc/${PN}/${PN}.conf \
777 - --error-log-path="${EPREFIX}"/var/log/${PN}/error_log \
778 - --pid-path="${EPREFIX}"/run/${PN}.pid \
779 - --lock-path="${EPREFIX}"/run/lock/${PN}.lock \
780 - --with-cc-opt="-I${EROOT}usr/include${WITHOUT_IPV6}" \
781 - --with-ld-opt="-L${EROOT}usr/$(get_libdir)" \
782 - --http-log-path="${EPREFIX}"/var/log/${PN}/access_log \
783 - --http-client-body-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/client \
784 - --http-proxy-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/proxy \
785 - --http-fastcgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/fastcgi \
786 - --http-scgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/scgi \
787 - --http-uwsgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/uwsgi \
788 - --with-compat \
789 - "${myconf[@]}" || die "configure failed"
790 -
791 - # A purely cosmetic change that makes nginx -V more readable. This can be
792 - # good if people outside the gentoo community would troubleshoot and
793 - # question the users setup.
794 - sed -i -e "s|${WORKDIR}|external_module|g" objs/ngx_auto_config.h || die
795 -}
796 -
797 -src_compile() {
798 - use nginx_modules_http_security && emake -C "${HTTP_SECURITY_MODULE_WD}"
799 -
800 - # https://bugs.gentoo.org/286772
801 - export LANG=C LC_ALL=C
802 - emake LINK="${CC} ${LDFLAGS}" OTHERLDFLAGS="${LDFLAGS}"
803 -}
804 -
805 -src_install() {
806 - emake DESTDIR="${D%/}" install
807 -
808 - cp "${FILESDIR}"/nginx.conf-r2 "${ED}"etc/nginx/nginx.conf || die
809 -
810 - newinitd "${FILESDIR}"/nginx.initd-r4 nginx
811 - newconfd "${FILESDIR}"/nginx.confd nginx
812 -
813 - systemd_newunit "${FILESDIR}"/nginx.service-r1 nginx.service
814 -
815 - doman man/nginx.8
816 - dodoc CHANGES* README
817 -
818 - # just keepdir. do not copy the default htdocs files (bug #449136)
819 - keepdir /var/www/localhost
820 - rm -rf "${D}"usr/html || die
821 -
822 - # set up a list of directories to keep
823 - local keepdir_list="${NGINX_HOME_TMP}"/client
824 - local module
825 - for module in proxy fastcgi scgi uwsgi; do
826 - use nginx_modules_http_${module} && keepdir_list+=" ${NGINX_HOME_TMP}/${module}"
827 - done
828 -
829 - keepdir /var/log/nginx ${keepdir_list}
830 -
831 - # this solves a problem with SELinux where nginx doesn't see the directories
832 - # as root and tries to create them as nginx
833 - fperms 0750 "${NGINX_HOME_TMP}"
834 - fowners ${PN}:0 "${NGINX_HOME_TMP}"
835 -
836 - fperms 0700 ${keepdir_list}
837 - fowners ${PN}:${PN} ${keepdir_list}
838 -
839 - fperms 0710 /var/log/nginx
840 - fowners 0:${PN} /var/log/nginx
841 -
842 - # logrotate
843 - insinto /etc/logrotate.d
844 - newins "${FILESDIR}"/nginx.logrotate-r1 nginx
845 -
846 - if use nginx_modules_http_perl; then
847 - cd "${S}"/objs/src/http/modules/perl/ || die
848 - emake DESTDIR="${D}" INSTALLDIRS=vendor
849 - perl_delete_localpod
850 - cd "${S}" || die
851 - fi
852 -
853 - if use nginx_modules_http_cache_purge; then
854 - docinto ${HTTP_CACHE_PURGE_MODULE_P}
855 - dodoc "${HTTP_CACHE_PURGE_MODULE_WD}"/{CHANGES,README.md,TODO.md}
856 - fi
857 -
858 - if use nginx_modules_http_slowfs_cache; then
859 - docinto ${HTTP_SLOWFS_CACHE_MODULE_P}
860 - dodoc "${HTTP_SLOWFS_CACHE_MODULE_WD}"/{CHANGES,README.md}
861 - fi
862 -
863 - if use nginx_modules_http_fancyindex; then
864 - docinto ${HTTP_FANCYINDEX_MODULE_P}
865 - dodoc "${HTTP_FANCYINDEX_MODULE_WD}"/README.rst
866 - fi
867 -
868 - if use nginx_modules_http_lua; then
869 - docinto ${HTTP_LUA_MODULE_P}
870 - dodoc "${HTTP_LUA_MODULE_WD}"/README.markdown
871 - fi
872 -
873 - if use nginx_modules_http_auth_pam; then
874 - docinto ${HTTP_AUTH_PAM_MODULE_P}
875 - dodoc "${HTTP_AUTH_PAM_MODULE_WD}"/{README.md,ChangeLog}
876 - fi
877 -
878 - if use nginx_modules_http_upstream_check; then
879 - docinto ${HTTP_UPSTREAM_CHECK_MODULE_P}
880 - dodoc "${HTTP_UPSTREAM_CHECK_MODULE_WD}"/{README,CHANGES}
881 - fi
882 -
883 - if use nginx_modules_http_naxsi; then
884 - insinto /etc/nginx
885 - doins "${HTTP_NAXSI_MODULE_WD}"/../naxsi_config/naxsi_core.rules
886 - fi
887 -
888 - if use rtmp; then
889 - docinto ${RTMP_MODULE_P}
890 - dodoc "${RTMP_MODULE_WD}"/{AUTHORS,README.md,stat.xsl}
891 - fi
892 -
893 - if use nginx_modules_http_dav_ext; then
894 - docinto ${HTTP_DAV_EXT_MODULE_P}
895 - dodoc "${HTTP_DAV_EXT_MODULE_WD}"/README.rst
896 - fi
897 -
898 - if use nginx_modules_http_echo; then
899 - docinto ${HTTP_ECHO_MODULE_P}
900 - dodoc "${HTTP_ECHO_MODULE_WD}"/README.markdown
901 - fi
902 -
903 - if use nginx_modules_http_security; then
904 - docinto ${HTTP_SECURITY_MODULE_P}
905 - dodoc "${HTTP_SECURITY_MODULE_WD}"/{CHANGES,README.TXT,authors.txt}
906 - fi
907 -
908 - if use nginx_modules_http_push_stream; then
909 - docinto ${HTTP_PUSH_STREAM_MODULE_P}
910 - dodoc "${HTTP_PUSH_STREAM_MODULE_WD}"/{AUTHORS,CHANGELOG.textile,README.textile}
911 - fi
912 -
913 - if use nginx_modules_http_sticky; then
914 - docinto ${HTTP_STICKY_MODULE_P}
915 - dodoc "${HTTP_STICKY_MODULE_WD}"/{README.md,Changelog.txt,docs/sticky.pdf}
916 - fi
917 -
918 - if use nginx_modules_http_memc; then
919 - docinto ${HTTP_MEMC_MODULE_P}
920 - dodoc "${HTTP_MEMC_MODULE_WD}"/README.markdown
921 - fi
922 -
923 - if use nginx_modules_http_auth_ldap; then
924 - docinto ${HTTP_LDAP_MODULE_P}
925 - dodoc "${HTTP_LDAP_MODULE_WD}"/example.conf
926 - fi
927 -}
928 -
929 -pkg_postinst() {
930 - if use ssl; then
931 - if [[ ! -f "${EROOT}"etc/ssl/${PN}/${PN}.key ]]; then
932 - install_cert /etc/ssl/${PN}/${PN}
933 - use prefix || chown ${PN}:${PN} "${EROOT}"etc/ssl/${PN}/${PN}.{crt,csr,key,pem}
934 - fi
935 - fi
936 -
937 - if use nginx_modules_http_spdy; then
938 - ewarn ""
939 - ewarn "In nginx 1.9.5 the spdy module was superseded by http2."
940 - ewarn "Update your configs and package.use accordingly."
941 - fi
942 -
943 - if use nginx_modules_http_lua; then
944 - ewarn ""
945 - ewarn "While you can build lua 3rd party module against ${P}"
946 - ewarn "the author warns that >=${PN}-1.11.11 is still not an"
947 - ewarn "officially supported target yet. You are on your own."
948 - ewarn "Expect runtime failures, memory leaks and other problems!"
949 - fi
950 -
951 - if use nginx_modules_http_lua && use http2; then
952 - ewarn ""
953 - ewarn "Lua 3rd party module author warns against using ${P} with"
954 - ewarn "NGINX_MODULES_HTTP=\"lua http2\". For more info, see http://git.io/OldLsg"
955 - fi
956 -
957 - local _n_permission_layout_checks=0
958 - local _has_to_adjust_permissions=0
959 - local _has_to_show_permission_warning=0
960 -
961 - # Defaults to 1 to inform people doing a fresh installation
962 - # that we ship modified {scgi,uwsgi,fastcgi}_params files
963 - local _has_to_show_httpoxy_mitigation_notice=1
964 -
965 - local _replacing_version=
966 - for _replacing_version in ${REPLACING_VERSIONS}; do
967 - _n_permission_layout_checks=$((${_n_permission_layout_checks}+1))
968 -
969 - if [[ ${_n_permission_layout_checks} -gt 1 ]]; then
970 - # Should never happen:
971 - # Package is abusing slots but doesn't allow multiple parallel installations.
972 - # If we run into this situation it is unsafe to automatically adjust any
973 - # permission...
974 - _has_to_show_permission_warning=1
975 -
976 - ewarn "Replacing multiple ${PN}' versions is unsupported! " \
977 - "You will have to adjust permissions on your own."
978 -
979 - break
980 - fi
981 -
982 - local _replacing_version_branch=$(get_version_component_range 1-2 "${_replacing_version}")
983 - debug-print "Updating an existing installation (v${_replacing_version}; branch '${_replacing_version_branch}') ..."
984 -
985 - # Do we need to adjust permissions to fix CVE-2013-0337 (bug #458726, #469094)?
986 - # This was before we introduced multiple nginx versions so we
987 - # do not need to distinguish between stable and mainline
988 - local _need_to_fix_CVE2013_0337=1
989 -
990 - if version_is_at_least "1.4.1-r2" "${_replacing_version}"; then
991 - # We are updating an installation which should already be fixed
992 - _need_to_fix_CVE2013_0337=0
993 - debug-print "Skipping CVE-2013-0337 ... existing installation should not be affected!"
994 - else
995 - _has_to_adjust_permissions=1
996 - debug-print "Need to adjust permissions to fix CVE-2013-0337!"
997 - fi
998 -
999 - # Do we need to inform about HTTPoxy mitigation?
1000 - # In repository since commit 8be44f76d4ac02cebcd1e0e6e6284bb72d054b0f
1001 - if ! version_is_at_least "1.10" "${_replacing_version_branch}"; then
1002 - # Updating from <1.10
1003 - _has_to_show_httpoxy_mitigation_notice=1
1004 - debug-print "Need to inform about HTTPoxy mitigation!"
1005 - else
1006 - # Updating from >=1.10
1007 - local _fixed_in_pvr=
1008 - case "${_replacing_version_branch}" in
1009 - "1.10")
1010 - _fixed_in_pvr="1.10.1-r2"
1011 - ;;
1012 - "1.11")
1013 - _fixed_in_pvr="1.11.3-r1"
1014 - ;;
1015 - *)
1016 - # This should be any future branch.
1017 - # If we run this code it is safe to assume that the user has
1018 - # already seen the HTTPoxy mitigation notice because he/she is doing
1019 - # an update from previous version where we have already shown
1020 - # the warning. Otherwise, we wouldn't hit this code path ...
1021 - _fixed_in_pvr=
1022 - esac
1023 -
1024 - if [[ -z "${_fixed_in_pvr}" ]] || version_is_at_least "${_fixed_in_pvr}" "${_replacing_version}"; then
1025 - # We are updating an installation where we already informed
1026 - # that we are mitigating HTTPoxy per default
1027 - _has_to_show_httpoxy_mitigation_notice=0
1028 - debug-print "No need to inform about HTTPoxy mitigation ... information was already shown for existing installation!"
1029 - else
1030 - _has_to_show_httpoxy_mitigation_notice=1
1031 - debug-print "Need to inform about HTTPoxy mitigation!"
1032 - fi
1033 - fi
1034 -
1035 - # Do we need to adjust permissions to fix CVE-2016-1247 (bug #605008)?
1036 - # All branches up to 1.11 are affected
1037 - local _need_to_fix_CVE2016_1247=1
1038 -
1039 - if ! version_is_at_least "1.10" "${_replacing_version_branch}"; then
1040 - # Updating from <1.10
1041 - _has_to_adjust_permissions=1
1042 - debug-print "Need to adjust permissions to fix CVE-2016-1247!"
1043 - else
1044 - # Updating from >=1.10
1045 - local _fixed_in_pvr=
1046 - case "${_replacing_version_branch}" in
1047 - "1.10")
1048 - _fixed_in_pvr="1.10.2-r3"
1049 - ;;
1050 - "1.11")
1051 - _fixed_in_pvr="1.11.6-r1"
1052 - ;;
1053 - *)
1054 - # This should be any future branch.
1055 - # If we run this code it is safe to assume that we have already
1056 - # adjusted permissions or were never affected because user is
1057 - # doing an update from previous version which was safe or did
1058 - # the adjustments. Otherwise, we wouldn't hit this code path ...
1059 - _fixed_in_pvr=
1060 - esac
1061 -
1062 - if [[ -z "${_fixed_in_pvr}" ]] || version_is_at_least "${_fixed_in_pvr}" "${_replacing_version}"; then
1063 - # We are updating an installation which should already be adjusted
1064 - # or which was never affected
1065 - _need_to_fix_CVE2016_1247=0
1066 - debug-print "Skipping CVE-2016-1247 ... existing installation should not be affected!"
1067 - else
1068 - _has_to_adjust_permissions=1
1069 - debug-print "Need to adjust permissions to fix CVE-2016-1247!"
1070 - fi
1071 - fi
1072 - done
1073 -
1074 - if [[ ${_has_to_adjust_permissions} -eq 1 ]]; then
1075 - # We do not DIE when chmod/chown commands are failing because
1076 - # package is already merged on user's system at this stage
1077 - # and we cannot retry without losing the information that
1078 - # the existing installation needs to adjust permissions.
1079 - # Instead we are going to a show a big warning ...
1080 -
1081 - if [[ ${_has_to_show_permission_warning} -eq 0 ]] && [[ ${_need_to_fix_CVE2013_0337} -eq 1 ]]; then
1082 - ewarn ""
1083 - ewarn "The world-readable bit (if set) has been removed from the"
1084 - ewarn "following directories to mitigate a security bug"
1085 - ewarn "(CVE-2013-0337, bug #458726):"
1086 - ewarn ""
1087 - ewarn " ${EPREFIX%/}/var/log/nginx"
1088 - ewarn " ${EPREFIX%/}${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi}"
1089 - ewarn ""
1090 - ewarn "Check if this is correct for your setup before restarting nginx!"
1091 - ewarn "This is a one-time change and will not happen on subsequent updates."
1092 - ewarn "Furthermore nginx' temp directories got moved to '${EPREFIX%/}${NGINX_HOME_TMP}'"
1093 - chmod o-rwx \
1094 - "${EPREFIX%/}"/var/log/nginx \
1095 - "${EPREFIX%/}"${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi} || \
1096 - _has_to_show_permission_warning=1
1097 - fi
1098 -
1099 - if [[ ${_has_to_show_permission_warning} -eq 0 ]] && [[ ${_need_to_fix_CVE2016_1247} -eq 1 ]]; then
1100 - ewarn ""
1101 - ewarn "The permissions on the following directory have been reset in"
1102 - ewarn "order to mitigate a security bug (CVE-2016-1247, bug #605008):"
1103 - ewarn ""
1104 - ewarn " ${EPREFIX%/}/var/log/nginx"
1105 - ewarn ""
1106 - ewarn "Check if this is correct for your setup before restarting nginx!"
1107 - ewarn "Also ensure that no other log directory used by any of your"
1108 - ewarn "vhost(s) is not writeable for nginx user. Any of your log files"
1109 - ewarn "used by nginx can be abused to escalate privileges!"
1110 - ewarn "This is a one-time change and will not happen on subsequent updates."
1111 - chown 0:nginx "${EPREFIX%/}"/var/log/nginx || _has_to_show_permission_warning=1
1112 - chmod 710 "${EPREFIX%/}"/var/log/nginx || _has_to_show_permission_warning=1
1113 - fi
1114 -
1115 - if [[ ${_has_to_show_permission_warning} -eq 1 ]]; then
1116 - # Should never happen ...
1117 - ewarn ""
1118 - ewarn "*************************************************************"
1119 - ewarn "*************** W A R N I N G ***************"
1120 - ewarn "*************************************************************"
1121 - ewarn "The one-time only attempt to adjust permissions of the"
1122 - ewarn "existing nginx installation failed. Be aware that we will not"
1123 - ewarn "try to adjust the same permissions again because now you are"
1124 - ewarn "using a nginx version where we expect that the permissions"
1125 - ewarn "are already adjusted or that you know what you are doing and"
1126 - ewarn "want to keep custom permissions."
1127 - ewarn ""
1128 - fi
1129 - fi
1130 -
1131 - # Sanity check for CVE-2016-1247
1132 - # Required to warn users who received the warning above and thought
1133 - # they could fix it by unmerging and re-merging the package or have
1134 - # unmerged a affected installation on purpose in the past leaving
1135 - # /var/log/nginx on their system due to keepdir/non-empty folder
1136 - # and are now installing the package again.
1137 - local _sanity_check_testfile=$(mktemp --dry-run "${EPREFIX%/}"/var/log/nginx/.CVE-2016-1247.XXXXXXXXX)
1138 - su -s /bin/sh -c "touch ${_sanity_check_testfile}" nginx >&/dev/null
1139 - if [ $? -eq 0 ] ; then
1140 - # Cleanup -- no reason to die here!
1141 - rm -f "${_sanity_check_testfile}"
1142 -
1143 - ewarn ""
1144 - ewarn "*************************************************************"
1145 - ewarn "*************** W A R N I N G ***************"
1146 - ewarn "*************************************************************"
1147 - ewarn "Looks like your installation is vulnerable to CVE-2016-1247"
1148 - ewarn "(bug #605008) because nginx user is able to create files in"
1149 - ewarn ""
1150 - ewarn " ${EPREFIX%/}/var/log/nginx"
1151 - ewarn ""
1152 - ewarn "Also ensure that no other log directory used by any of your"
1153 - ewarn "vhost(s) is not writeable for nginx user. Any of your log files"
1154 - ewarn "used by nginx can be abused to escalate privileges!"
1155 - fi
1156 -
1157 - if [[ ${_has_to_show_httpoxy_mitigation_notice} -eq 1 ]]; then
1158 - # HTTPoxy mitigation
1159 - ewarn ""
1160 - ewarn "This nginx installation comes with a mitigation for the HTTPoxy"
1161 - ewarn "vulnerability for FastCGI, SCGI and uWSGI applications by setting"
1162 - ewarn "the HTTP_PROXY parameter to an empty string per default when you"
1163 - ewarn "are sourcing one of the default"
1164 - ewarn ""
1165 - ewarn " - 'fastcgi_params' or 'fastcgi.conf'"
1166 - ewarn " - 'scgi_params'"
1167 - ewarn " - 'uwsgi_params'"
1168 - ewarn ""
1169 - ewarn "files in your server block(s)."
1170 - ewarn ""
1171 - ewarn "If this is causing any problems for you make sure that you are sourcing the"
1172 - ewarn "default parameters _before_ you set your own values."
1173 - ewarn "If you are relying on user-supplied proxy values you have to remove the"
1174 - ewarn "correlating lines from the file(s) mentioned above."
1175 - ewarn ""
1176 - fi
1177 -}