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