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