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