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