Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-servers/nginx/
Date: Fri, 28 May 2021 09:01:50
Message-Id: 1622192467.1756c525a1ce5b99bdd3fe7c0d847674486942cc.whissi@gentoo
1 commit: 1756c525a1ce5b99bdd3fe7c0d847674486942cc
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Fri May 28 09:01:07 2021 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Fri May 28 09:01:07 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1756c525
7
8 www-servers/nginx: security cleanup
9
10 Bug: https://bugs.gentoo.org/792087
11 Package-Manager: Portage-3.0.19, Repoman-3.0.3
12 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
13
14 www-servers/nginx/Manifest | 5 -
15 www-servers/nginx/metadata.xml | 1 -
16 www-servers/nginx/nginx-1.18.0-r2.ebuild | 1084 -----------------------------
17 www-servers/nginx/nginx-1.19.10.ebuild | 1086 ------------------------------
18 www-servers/nginx/nginx-1.19.9.ebuild | 1086 ------------------------------
19 5 files changed, 3262 deletions(-)
20
21 diff --git a/www-servers/nginx/Manifest b/www-servers/nginx/Manifest
22 index 9fb1e65ef15..f3a6570b4ed 100644
23 --- a/www-servers/nginx/Manifest
24 +++ b/www-servers/nginx/Manifest
25 @@ -1,13 +1,9 @@
26 DIST modsecurity-2.9.3.tar.gz 4307670 BLAKE2B 337ea15cc8805af7ab43aed8aecf4c72ccc586d0d7e9d9b91f036a61baa70d1ac8b4ad8045a2bb7a13515912a15fba7d3cdb9670ae6730de43b1e44ee90ded6d SHA512 4e1ea5dd8edadf8f630e4fe92a200d3a8e78963fce3128b5975a1e1ecd0e8bf9ceecd9905c95f8c508932ccd837f1d8ae8bb2ba423307718c3c6a4ae9b783ddd
27 -DIST nginx-1.18.0.tar.gz 1039530 BLAKE2B a8962a6af96acb043ff0c3dc4ad5192083773c449950aff53b01f6f7c46a2a540eb061a43432acccd753fa71067b1451d75f440ba5526575b78608be9d40a50b SHA512 8c21eeb62ab6e32e436932500f700bd2fb99fd2d29e43c08a5bfed4714c189c29c7141db551fcd5d2437303b7439f71758f7407dfd3e801e704e45e7daa78ddb
28 -DIST nginx-1.19.10.tar.gz 1061062 BLAKE2B e6ba3023f34235ef3fc54cdaeda6ba357cab2f8bc3d639c218a87ba5ce3d5650d9f2356cc5fef5ce84db8977f5d46057d83c2730a9239b5759cbef665813872d SHA512 aa5b6e94d06e450358f105982a64b8498d1872c0e9b6f05b96b5a7057bdccc9b8078a781bc947e7a1c87737b20ec207de822e7992a25875a548a4b3ea3ae8eea
29 -DIST nginx-1.19.9.tar.gz 1060580 BLAKE2B 896f58de8051dcf76fc65b9e8263099e7d4c797832b5f9c354fe2440ff4a3155c0d9139a4022e4d828d17f11259be6853b264e22e43a986d249b5dc53a075d35 SHA512 a418aa22046f641afd95ee661c77c469d21c9957aa5ab74c4186526fcd18e0d701ee933a76ab143081b4b3f8815484074c2609aa257646218bf6b4b739b3cb88
30 DIST nginx-1.20.1.tar.gz 1061461 BLAKE2B ed359db6486fd2152e0246663b8d8f4fc6980594945212545d301ce6ce16088c760d11b26fa1f6e9c392b9464103c570ddccc4343f5ab3f84ede011bb7a6458d SHA512 3d9fd4bf2740eaf20fcc3c77260a3556aaf9dff2879afc2dbb5fff364dea27313ffbc51d335e9fc9c0186a2a44dac055ef60fde0d411b8cf842fdf661478c961
31 DIST nginx-1.21.0.tar.gz 1063682 BLAKE2B 3c29a8832e879677ff6df198aa420bbe546322a9d8b000827fdfbeb7e3519374cafd5a75910880f5ae07e78f0096952498c8515be788cf62916e3470d93c66d1 SHA512 1f0c790e5ba104278ef5fc357e60ba2fddd2d8abda1363e26b418324b050f0e9f4901ce23949adede699e9f1340e8480ad8a6c811b7420a74c8f5c101be8a7ad
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 DIST ngx_brotli-1.0.0rc.tar.gz 16207 BLAKE2B 450d0ea693bd98d4a1b615f2cdcaad41ccd28266f6d80beec7fe77fe750ab8c5d1bb55aabe15161b9b6d819d2b4d99a7774f2706f2f6fd084b52a7c7dddbc00c SHA512 05a880d5e48ac83be84498ed41fb4750211b827a9d7541acfd6ef494e5205a6e853d5594bfec3ab4ae668ea3f803e4f4b0ba550c76811971c8e266e42663c56d
35 -DIST ngx_brotli-25f86f0bac1101b6512135eac5f93c49c63609e3.tar.gz 16201 BLAKE2B 2da3ce8a9f29b713da4de4cd60fe22256742ff61e1718346e5246ffa0169d5a2e1babb625b16ac52e3b79431f749adb3ee0170957024953c139aaebc7a496478 SHA512 c6eb026f204e1e6f930ab7ca68cca78054318e05a0dc11d897d3516380dbc4e42e93d40334e3088bf348d4b7b182e87c77473974719e5850a4f97666f9babbd6
36 DIST ngx_devel_kit-0.3.1.tar.gz 66542 BLAKE2B 8242d884464d99a131a48f599f9d0c2b546610f73f646e7eb0dcfdb98220810d949189cffa721360ddbe3b7b8adc8b678a848b9d1a56db6c62fd4439ecb63d24 SHA512 de1e3349d8dd08e5982279b2219dc8a8006739f0409b8e0f5c50d93434beff1fbafba43e9c5ac85a5fab90afc5c0a7244a340610339c36f82f2cba7233e72de9
37 DIST ngx_http_auth_pam-1.5.2.tar.gz 7016 BLAKE2B 1efc8d2d12aa09a2b2a36f6f6d0132ac21fcd1720a2843ce598450198e2b7fe902e9ded15a78b66e8a897e811faa872e4e391bf211c795e320c1ccd57607c319 SHA512 b82e401533c44298c41bc9a1caaf3f7850e42da151c06a77a927f817810ebf5ce01c49ca81de42c326345765c784bb55e28fbf0f6a5500626f51e58a216b53c4
38 DIST ngx_http_cache_purge-2.3.tar.gz 12248 BLAKE2B f83b267f4c19a9d4af5964522695814c164d200ecd4108bf8f6b5c21388eba8af989bdda646dee18a03174211e8c090a04736bbeb44043cb0e19fbccdc66278e SHA512 50a31dbf2216a6fae74a186af56dec4600cf55777e76a10ac0075f609e7737135aab063a64f2590dddcd0369ebebd4a523027f3d9ebcca74f7b4355be1c5dcc0
39 @@ -27,5 +23,4 @@ DIST ngx_memc_module-0.19.tar.gz 34654 BLAKE2B 536384c264d88535179634d459d3a47b1
40 DIST ngx_metrics-0.1.1.tar.gz 2964 BLAKE2B 95d71ea26c949c345b83e353bd66a20df18cc8b2b93f692615a1b39c1f327393647f80e7a27e6929799a6e7e3469b61e1cd72f7821f7a820da4dd7cd9a96d85c SHA512 d36a8fb0104c83b6b564e03b351aa750cab08650264c74d6f786af357bfb7006b531a93270dd961896ea8dafe27e5db8548ede714c5f52c4742876bc73af4b5e
41 DIST ngx_mogilefs_module-1.0.4.tar.gz 11208 BLAKE2B e0729b66554c8890727190a624d4c9aef6499dfc2e301541a9bfc15690caf6d3155c8a4b8f7a1555a7655b47aa0cd1b797aeb8ba82efa92ab80808218a0bdcff SHA512 b8cb7eaf6274f4e2247dbcb39db05072d2b2d4361256a325fafab5533d7ce0c4ae9e2905b954dfcfa4789c9cab5cccf2ac1c3a1f02f6a327ed95b562d7773ed1
42 DIST ngx_rtmp-1.2.1.tar.gz 519919 BLAKE2B 744ccb8031eb9653f158f9eceba64fc9c8af7b9a42e64ef996ab3bbbe1402e5ffd3efcc8e4aaca437eb5e208e4b6f2d8643fcca953b32f32543eaa1ae4d9505c SHA512 4a0af5e9afa4deb0b53de8de7ddb2cfa6430d372e1ef9e421f01b509548bd134d427345442ac1ce667338cc2a1484dc2ab732e316e878ac7d3537dc527d5f922
43 -DIST njs-0.4.3.tar.gz 460997 BLAKE2B 373a4aca51ada84d628ae6b6254c9268b4cec4ac8870f81ba43ff693f20148a9ca862038e57a68c22cbff29ea613785e83778cc708cf1b47103e9f950a198289 SHA512 b3b4294817997a06661f00f53d38e0cde08e022f41b3663f9d17a91b343fb944e21184114f09d89995096faee491187c3ae424407f2855ed0670c0cccf928cd7
44 DIST njs-0.5.3.tar.gz 519938 BLAKE2B 1d06f8a20f6c37977e3b4b9afa0f136761a6998b85739a9853bb41d70ea6af42f49541035961fd0251eda2e10579f7bf983eaec2f9e19460138e53f44b9e6788 SHA512 b1d2e7498c37cc1df18e0f65866391637bf75d3d251fc7d7ad1ef5c76457697f49eaea088e1d157c94a6e779e9b8cc07b3f5aaac965666624506f517f6878c23
45
46 diff --git a/www-servers/nginx/metadata.xml b/www-servers/nginx/metadata.xml
47 index 3958772f3f4..4ba7cfcec3d 100644
48 --- a/www-servers/nginx/metadata.xml
49 +++ b/www-servers/nginx/metadata.xml
50 @@ -11,7 +11,6 @@
51 <flag name="http2">Enable HTTP2 module support</flag>
52 <flag name="http-cache">Enable HTTP cache support</flag>
53 <flag name="libatomic">Use libatomic instead of builtin atomic operations</flag>
54 - <flag name="luajit">Use <pkg>dev-lang/luajit</pkg> instead of <pkg>dev-lang/lua</pkg> for lua support when building the lua http module.</flag>
55 <flag name="pcre-jit">Enable JIT for pcre</flag>
56 <flag name="ssl">Enable HTTPS module for http. Enable SSL/TLS support for POP3/IMAP/SMTP for mail.</flag>
57 <flag name="rtmp">NGINX-based Media Streaming Server</flag>
58
59 diff --git a/www-servers/nginx/nginx-1.18.0-r2.ebuild b/www-servers/nginx/nginx-1.18.0-r2.ebuild
60 deleted file mode 100644
61 index c57e3bd041a..00000000000
62 --- a/www-servers/nginx/nginx-1.18.0-r2.ebuild
63 +++ /dev/null
64 @@ -1,1084 +0,0 @@
65 -# Copyright 1999-2021 Gentoo Authors
66 -# Distributed under the terms of the GNU General Public License v2
67 -
68 -EAPI="6"
69 -
70 -# Maintainer notes:
71 -# - http_rewrite-independent pcre-support makes sense for matching locations without an actual rewrite
72 -# - any http-module activates the main http-functionality and overrides USE=-http
73 -# - keep the following requirements in mind before adding external modules:
74 -# * alive upstream
75 -# * sane packaging
76 -# * builds cleanly
77 -# * does not need a patch for nginx core
78 -# - TODO: test the google-perftools module (included in vanilla tarball)
79 -
80 -# prevent perl-module from adding automagic perl DEPENDs
81 -GENTOO_DEPEND_ON_PERL="no"
82 -
83 -# devel_kit (https://github.com/simpl/ngx_devel_kit, BSD license)
84 -DEVEL_KIT_MODULE_PV="0.3.1"
85 -DEVEL_KIT_MODULE_P="ngx_devel_kit-${DEVEL_KIT_MODULE_PV}"
86 -DEVEL_KIT_MODULE_URI="https://github.com/simpl/ngx_devel_kit/archive/v${DEVEL_KIT_MODULE_PV}.tar.gz"
87 -DEVEL_KIT_MODULE_WD="${WORKDIR}/ngx_devel_kit-${DEVEL_KIT_MODULE_PV}"
88 -
89 -# ngx_brotli (https://github.com/eustas/ngx_brotli, BSD-2)
90 -HTTP_BROTLI_MODULE_PV="25f86f0bac1101b6512135eac5f93c49c63609e3"
91 -HTTP_BROTLI_MODULE_P="ngx_brotli-${HTTP_BROTLI_MODULE_PV}"
92 -HTTP_BROTLI_MODULE_URI="https://github.com/google/ngx_brotli/archive/${HTTP_BROTLI_MODULE_PV}.tar.gz"
93 -HTTP_BROTLI_MODULE_WD="${WORKDIR}/ngx_brotli-${HTTP_BROTLI_MODULE_PV}"
94 -
95 -# http_uploadprogress (https://github.com/masterzen/nginx-upload-progress-module, BSD-2 license)
96 -HTTP_UPLOAD_PROGRESS_MODULE_PV="0.9.2"
97 -HTTP_UPLOAD_PROGRESS_MODULE_P="ngx_http_upload_progress-${HTTP_UPLOAD_PROGRESS_MODULE_PV}-r1"
98 -HTTP_UPLOAD_PROGRESS_MODULE_URI="https://github.com/masterzen/nginx-upload-progress-module/archive/v${HTTP_UPLOAD_PROGRESS_MODULE_PV}.tar.gz"
99 -HTTP_UPLOAD_PROGRESS_MODULE_WD="${WORKDIR}/nginx-upload-progress-module-${HTTP_UPLOAD_PROGRESS_MODULE_PV}"
100 -
101 -# http_headers_more (https://github.com/agentzh/headers-more-nginx-module, BSD license)
102 -HTTP_HEADERS_MORE_MODULE_PV="0.33"
103 -HTTP_HEADERS_MORE_MODULE_P="ngx_http_headers_more-${HTTP_HEADERS_MORE_MODULE_PV}"
104 -HTTP_HEADERS_MORE_MODULE_URI="https://github.com/agentzh/headers-more-nginx-module/archive/v${HTTP_HEADERS_MORE_MODULE_PV}.tar.gz"
105 -HTTP_HEADERS_MORE_MODULE_WD="${WORKDIR}/headers-more-nginx-module-${HTTP_HEADERS_MORE_MODULE_PV}"
106 -
107 -# http_cache_purge (http://labs.frickle.com/nginx_ngx_cache_purge/, https://github.com/FRiCKLE/ngx_cache_purge, BSD-2 license)
108 -HTTP_CACHE_PURGE_MODULE_PV="2.3"
109 -HTTP_CACHE_PURGE_MODULE_P="ngx_http_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}"
110 -HTTP_CACHE_PURGE_MODULE_URI="http://labs.frickle.com/files/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}.tar.gz"
111 -HTTP_CACHE_PURGE_MODULE_WD="${WORKDIR}/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}"
112 -
113 -# http_slowfs_cache (http://labs.frickle.com/nginx_ngx_slowfs_cache/, BSD-2 license)
114 -HTTP_SLOWFS_CACHE_MODULE_PV="1.10"
115 -HTTP_SLOWFS_CACHE_MODULE_P="ngx_http_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}"
116 -HTTP_SLOWFS_CACHE_MODULE_URI="http://labs.frickle.com/files/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}.tar.gz"
117 -HTTP_SLOWFS_CACHE_MODULE_WD="${WORKDIR}/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}"
118 -
119 -# http_fancyindex (https://github.com/aperezdc/ngx-fancyindex, BSD license)
120 -HTTP_FANCYINDEX_MODULE_PV="0.4.4"
121 -HTTP_FANCYINDEX_MODULE_P="ngx_http_fancyindex-${HTTP_FANCYINDEX_MODULE_PV}"
122 -HTTP_FANCYINDEX_MODULE_URI="https://github.com/aperezdc/ngx-fancyindex/archive/v${HTTP_FANCYINDEX_MODULE_PV}.tar.gz"
123 -HTTP_FANCYINDEX_MODULE_WD="${WORKDIR}/ngx-fancyindex-${HTTP_FANCYINDEX_MODULE_PV}"
124 -
125 -# http_lua (https://github.com/openresty/lua-nginx-module, BSD license)
126 -HTTP_LUA_MODULE_PV="0.10.15"
127 -HTTP_LUA_MODULE_P="ngx_http_lua-${HTTP_LUA_MODULE_PV}"
128 -HTTP_LUA_MODULE_URI="https://github.com/openresty/lua-nginx-module/archive/v${HTTP_LUA_MODULE_PV}.tar.gz"
129 -HTTP_LUA_MODULE_WD="${WORKDIR}/lua-nginx-module-${HTTP_LUA_MODULE_PV}"
130 -
131 -# http_auth_pam (https://github.com/stogh/ngx_http_auth_pam_module/, http://web.iti.upv.es/~sto/nginx/, BSD-2 license)
132 -HTTP_AUTH_PAM_MODULE_PV="1.5.2"
133 -HTTP_AUTH_PAM_MODULE_P="ngx_http_auth_pam-${HTTP_AUTH_PAM_MODULE_PV}"
134 -HTTP_AUTH_PAM_MODULE_URI="https://github.com/stogh/ngx_http_auth_pam_module/archive/v${HTTP_AUTH_PAM_MODULE_PV}.tar.gz"
135 -HTTP_AUTH_PAM_MODULE_WD="${WORKDIR}/ngx_http_auth_pam_module-${HTTP_AUTH_PAM_MODULE_PV}"
136 -
137 -# http_upstream_check (https://github.com/yaoweibin/nginx_upstream_check_module, BSD license)
138 -HTTP_UPSTREAM_CHECK_MODULE_PV="9aecf15ec379fe98f62355c57b60c0bc83296f04"
139 -HTTP_UPSTREAM_CHECK_MODULE_P="ngx_http_upstream_check-${HTTP_UPSTREAM_CHECK_MODULE_PV}"
140 -HTTP_UPSTREAM_CHECK_MODULE_URI="https://github.com/yaoweibin/nginx_upstream_check_module/archive/${HTTP_UPSTREAM_CHECK_MODULE_PV}.tar.gz"
141 -HTTP_UPSTREAM_CHECK_MODULE_WD="${WORKDIR}/nginx_upstream_check_module-${HTTP_UPSTREAM_CHECK_MODULE_PV}"
142 -
143 -# http_metrics (https://github.com/zenops/ngx_metrics, BSD license)
144 -HTTP_METRICS_MODULE_PV="0.1.1"
145 -HTTP_METRICS_MODULE_P="ngx_metrics-${HTTP_METRICS_MODULE_PV}"
146 -HTTP_METRICS_MODULE_URI="https://github.com/madvertise/ngx_metrics/archive/v${HTTP_METRICS_MODULE_PV}.tar.gz"
147 -HTTP_METRICS_MODULE_WD="${WORKDIR}/ngx_metrics-${HTTP_METRICS_MODULE_PV}"
148 -
149 -# http_vhost_traffic_status (https://github.com/vozlt/nginx-module-vts, BSD license)
150 -HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV="46d85558e344dfe2b078ce757fd36c69a1ec2dd3"
151 -HTTP_VHOST_TRAFFIC_STATUS_MODULE_P="ngx_http_vhost_traffic_status-${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}"
152 -HTTP_VHOST_TRAFFIC_STATUS_MODULE_URI="https://github.com/vozlt/nginx-module-vts/archive/${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}.tar.gz"
153 -HTTP_VHOST_TRAFFIC_STATUS_MODULE_WD="${WORKDIR}/nginx-module-vts-${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}"
154 -
155 -# naxsi-core (https://github.com/nbs-system/naxsi, GPLv2+)
156 -HTTP_NAXSI_MODULE_PV="0.56"
157 -HTTP_NAXSI_MODULE_P="ngx_http_naxsi-${HTTP_NAXSI_MODULE_PV}"
158 -HTTP_NAXSI_MODULE_URI="https://github.com/nbs-system/naxsi/archive/${HTTP_NAXSI_MODULE_PV}.tar.gz"
159 -HTTP_NAXSI_MODULE_WD="${WORKDIR}/naxsi-${HTTP_NAXSI_MODULE_PV}/naxsi_src"
160 -
161 -# nginx-rtmp-module (https://github.com/arut/nginx-rtmp-module, BSD license)
162 -RTMP_MODULE_PV="1.2.1"
163 -RTMP_MODULE_P="ngx_rtmp-${RTMP_MODULE_PV}"
164 -RTMP_MODULE_URI="https://github.com/arut/nginx-rtmp-module/archive/v${RTMP_MODULE_PV}.tar.gz"
165 -RTMP_MODULE_WD="${WORKDIR}/nginx-rtmp-module-${RTMP_MODULE_PV}"
166 -
167 -# nginx-dav-ext-module (https://github.com/arut/nginx-dav-ext-module, BSD license)
168 -HTTP_DAV_EXT_MODULE_PV="3.0.0"
169 -HTTP_DAV_EXT_MODULE_P="ngx_http_dav_ext-${HTTP_DAV_EXT_MODULE_PV}"
170 -HTTP_DAV_EXT_MODULE_URI="https://github.com/arut/nginx-dav-ext-module/archive/v${HTTP_DAV_EXT_MODULE_PV}.tar.gz"
171 -HTTP_DAV_EXT_MODULE_WD="${WORKDIR}/nginx-dav-ext-module-${HTTP_DAV_EXT_MODULE_PV}"
172 -
173 -# echo-nginx-module (https://github.com/openresty/echo-nginx-module, BSD license)
174 -HTTP_ECHO_MODULE_PV="0.62"
175 -HTTP_ECHO_MODULE_P="ngx_http_echo-${HTTP_ECHO_MODULE_PV}"
176 -HTTP_ECHO_MODULE_URI="https://github.com/openresty/echo-nginx-module/archive/v${HTTP_ECHO_MODULE_PV}.tar.gz"
177 -HTTP_ECHO_MODULE_WD="${WORKDIR}/echo-nginx-module-${HTTP_ECHO_MODULE_PV}"
178 -
179 -# mod_security for nginx (https://modsecurity.org/, Apache-2.0)
180 -# keep the MODULE_P here consistent with upstream to avoid tarball duplication
181 -HTTP_SECURITY_MODULE_PV="2.9.3"
182 -HTTP_SECURITY_MODULE_P="modsecurity-${HTTP_SECURITY_MODULE_PV}"
183 -HTTP_SECURITY_MODULE_URI="https://www.modsecurity.org/tarball/${HTTP_SECURITY_MODULE_PV}/${HTTP_SECURITY_MODULE_P}.tar.gz"
184 -HTTP_SECURITY_MODULE_WD="${WORKDIR}/${HTTP_SECURITY_MODULE_P}"
185 -
186 -# push-stream-module (http://www.nginxpushstream.com, https://github.com/wandenberg/nginx-push-stream-module, GPL-3)
187 -HTTP_PUSH_STREAM_MODULE_PV="0.5.4"
188 -HTTP_PUSH_STREAM_MODULE_P="ngx_http_push_stream-${HTTP_PUSH_STREAM_MODULE_PV}"
189 -HTTP_PUSH_STREAM_MODULE_URI="https://github.com/wandenberg/nginx-push-stream-module/archive/${HTTP_PUSH_STREAM_MODULE_PV}.tar.gz"
190 -HTTP_PUSH_STREAM_MODULE_WD="${WORKDIR}/nginx-push-stream-module-${HTTP_PUSH_STREAM_MODULE_PV}"
191 -
192 -# sticky-module (https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng, BSD-2)
193 -HTTP_STICKY_MODULE_PV="1.2.6-10-g08a395c66e42"
194 -HTTP_STICKY_MODULE_P="nginx_http_sticky_module_ng-${HTTP_STICKY_MODULE_PV}"
195 -HTTP_STICKY_MODULE_URI="https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/get/${HTTP_STICKY_MODULE_PV}.tar.bz2"
196 -HTTP_STICKY_MODULE_WD="${WORKDIR}/nginx-goodies-nginx-sticky-module-ng-08a395c66e42"
197 -
198 -# mogilefs-module (https://github.com/vkholodkov/nginx-mogilefs-module, BSD-2)
199 -HTTP_MOGILEFS_MODULE_PV="1.0.4"
200 -HTTP_MOGILEFS_MODULE_P="ngx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}"
201 -HTTP_MOGILEFS_MODULE_URI="https://github.com/vkholodkov/nginx-mogilefs-module/archive/${HTTP_MOGILEFS_MODULE_PV}.tar.gz"
202 -HTTP_MOGILEFS_MODULE_WD="${WORKDIR}/nginx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}"
203 -
204 -# memc-module (https://github.com/openresty/memc-nginx-module, BSD-2)
205 -HTTP_MEMC_MODULE_PV="0.19"
206 -HTTP_MEMC_MODULE_P="ngx_memc_module-${HTTP_MEMC_MODULE_PV}"
207 -HTTP_MEMC_MODULE_URI="https://github.com/openresty/memc-nginx-module/archive/v${HTTP_MEMC_MODULE_PV}.tar.gz"
208 -HTTP_MEMC_MODULE_WD="${WORKDIR}/memc-nginx-module-${HTTP_MEMC_MODULE_PV}"
209 -
210 -# nginx-ldap-auth-module (https://github.com/kvspb/nginx-auth-ldap, BSD-2)
211 -HTTP_LDAP_MODULE_PV="42d195d7a7575ebab1c369ad3fc5d78dc2c2669c"
212 -HTTP_LDAP_MODULE_P="nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}"
213 -HTTP_LDAP_MODULE_URI="https://github.com/kvspb/nginx-auth-ldap/archive/${HTTP_LDAP_MODULE_PV}.tar.gz"
214 -HTTP_LDAP_MODULE_WD="${WORKDIR}/nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}"
215 -
216 -# geoip2 (https://github.com/leev/ngx_http_geoip2_module, BSD-2)
217 -GEOIP2_MODULE_PV="3.3"
218 -GEOIP2_MODULE_P="ngx_http_geoip2_module-${GEOIP2_MODULE_PV}"
219 -GEOIP2_MODULE_URI="https://github.com/leev/ngx_http_geoip2_module/archive/${GEOIP2_MODULE_PV}.tar.gz"
220 -GEOIP2_MODULE_WD="${WORKDIR}/ngx_http_geoip2_module-${GEOIP2_MODULE_PV}"
221 -
222 -# njs-module (https://github.com/nginx/njs, as-is)
223 -NJS_MODULE_PV="0.4.3"
224 -NJS_MODULE_P="njs-${NJS_MODULE_PV}"
225 -NJS_MODULE_URI="https://github.com/nginx/njs/archive/${NJS_MODULE_PV}.tar.gz"
226 -NJS_MODULE_WD="${WORKDIR}/njs-${NJS_MODULE_PV}"
227 -
228 -# We handle deps below ourselves
229 -SSL_DEPS_SKIP=1
230 -AUTOTOOLS_AUTO_DEPEND="no"
231 -
232 -inherit autotools ssl-cert toolchain-funcs perl-module flag-o-matic user systemd versionator multilib pax-utils
233 -
234 -DESCRIPTION="Robust, small and high performance http and reverse proxy server"
235 -HOMEPAGE="https://nginx.org"
236 -SRC_URI="https://nginx.org/download/${P}.tar.gz
237 - ${DEVEL_KIT_MODULE_URI} -> ${DEVEL_KIT_MODULE_P}.tar.gz
238 - nginx_modules_http_auth_ldap? ( ${HTTP_LDAP_MODULE_URI} -> ${HTTP_LDAP_MODULE_P}.tar.gz )
239 - nginx_modules_http_auth_pam? ( ${HTTP_AUTH_PAM_MODULE_URI} -> ${HTTP_AUTH_PAM_MODULE_P}.tar.gz )
240 - nginx_modules_http_brotli? ( ${HTTP_BROTLI_MODULE_URI} -> ${HTTP_BROTLI_MODULE_P}.tar.gz )
241 - nginx_modules_http_cache_purge? ( ${HTTP_CACHE_PURGE_MODULE_URI} -> ${HTTP_CACHE_PURGE_MODULE_P}.tar.gz )
242 - nginx_modules_http_dav_ext? ( ${HTTP_DAV_EXT_MODULE_URI} -> ${HTTP_DAV_EXT_MODULE_P}.tar.gz )
243 - nginx_modules_http_echo? ( ${HTTP_ECHO_MODULE_URI} -> ${HTTP_ECHO_MODULE_P}.tar.gz )
244 - nginx_modules_http_fancyindex? ( ${HTTP_FANCYINDEX_MODULE_URI} -> ${HTTP_FANCYINDEX_MODULE_P}.tar.gz )
245 - nginx_modules_http_geoip2? ( ${GEOIP2_MODULE_URI} -> ${GEOIP2_MODULE_P}.tar.gz )
246 - nginx_modules_http_headers_more? ( ${HTTP_HEADERS_MORE_MODULE_URI} -> ${HTTP_HEADERS_MORE_MODULE_P}.tar.gz )
247 - nginx_modules_http_javascript? ( ${NJS_MODULE_URI} -> ${NJS_MODULE_P}.tar.gz )
248 - nginx_modules_http_lua? ( ${HTTP_LUA_MODULE_URI} -> ${HTTP_LUA_MODULE_P}.tar.gz )
249 - nginx_modules_http_memc? ( ${HTTP_MEMC_MODULE_URI} -> ${HTTP_MEMC_MODULE_P}.tar.gz )
250 - nginx_modules_http_metrics? ( ${HTTP_METRICS_MODULE_URI} -> ${HTTP_METRICS_MODULE_P}.tar.gz )
251 - nginx_modules_http_mogilefs? ( ${HTTP_MOGILEFS_MODULE_URI} -> ${HTTP_MOGILEFS_MODULE_P}.tar.gz )
252 - nginx_modules_http_naxsi? ( ${HTTP_NAXSI_MODULE_URI} -> ${HTTP_NAXSI_MODULE_P}.tar.gz )
253 - nginx_modules_http_push_stream? ( ${HTTP_PUSH_STREAM_MODULE_URI} -> ${HTTP_PUSH_STREAM_MODULE_P}.tar.gz )
254 - nginx_modules_http_security? ( ${HTTP_SECURITY_MODULE_URI} -> ${HTTP_SECURITY_MODULE_P}.tar.gz )
255 - nginx_modules_http_slowfs_cache? ( ${HTTP_SLOWFS_CACHE_MODULE_URI} -> ${HTTP_SLOWFS_CACHE_MODULE_P}.tar.gz )
256 - nginx_modules_http_sticky? ( ${HTTP_STICKY_MODULE_URI} -> ${HTTP_STICKY_MODULE_P}.tar.bz2 )
257 - nginx_modules_http_upload_progress? ( ${HTTP_UPLOAD_PROGRESS_MODULE_URI} -> ${HTTP_UPLOAD_PROGRESS_MODULE_P}.tar.gz )
258 - nginx_modules_http_upstream_check? ( ${HTTP_UPSTREAM_CHECK_MODULE_URI} -> ${HTTP_UPSTREAM_CHECK_MODULE_P}.tar.gz )
259 - nginx_modules_http_vhost_traffic_status? ( ${HTTP_VHOST_TRAFFIC_STATUS_MODULE_URI} -> ${HTTP_VHOST_TRAFFIC_STATUS_MODULE_P}.tar.gz )
260 - nginx_modules_stream_geoip2? ( ${GEOIP2_MODULE_URI} -> ${GEOIP2_MODULE_P}.tar.gz )
261 - nginx_modules_stream_javascript? ( ${NJS_MODULE_URI} -> ${NJS_MODULE_P}.tar.gz )
262 - rtmp? ( ${RTMP_MODULE_URI} -> ${RTMP_MODULE_P}.tar.gz )"
263 -
264 -LICENSE="BSD-2 BSD SSLeay MIT GPL-2 GPL-2+
265 - nginx_modules_http_security? ( Apache-2.0 )
266 - nginx_modules_http_push_stream? ( GPL-3 )"
267 -
268 -SLOT="0"
269 -KEYWORDS="amd64 ~arm ~arm64 ~ppc ~ppc64 x86 ~amd64-linux ~x86-linux"
270 -
271 -# Package doesn't provide a real test suite
272 -RESTRICT="test"
273 -
274 -NGINX_MODULES_STD="access auth_basic autoindex browser charset empty_gif
275 - fastcgi geo grpc gzip limit_req limit_conn map memcached mirror
276 - proxy referer rewrite scgi ssi split_clients upstream_hash
277 - upstream_ip_hash upstream_keepalive upstream_least_conn
278 - upstream_zone userid uwsgi"
279 -NGINX_MODULES_OPT="addition auth_request dav degradation flv geoip gunzip
280 - gzip_static image_filter mp4 perl random_index realip secure_link
281 - slice stub_status sub xslt"
282 -NGINX_MODULES_STREAM_STD="access geo limit_conn map return split_clients
283 - upstream_hash upstream_least_conn upstream_zone"
284 -NGINX_MODULES_STREAM_OPT="geoip realip ssl_preread"
285 -NGINX_MODULES_MAIL="imap pop3 smtp"
286 -NGINX_MODULES_3RD="
287 - http_auth_ldap
288 - http_auth_pam
289 - http_brotli
290 - http_cache_purge
291 - http_dav_ext
292 - http_echo
293 - http_fancyindex
294 - http_geoip2
295 - http_headers_more
296 - http_javascript
297 - http_lua
298 - http_memc
299 - http_metrics
300 - http_mogilefs
301 - http_naxsi
302 - http_push_stream
303 - http_security
304 - http_slowfs_cache
305 - http_sticky
306 - http_upload_progress
307 - http_upstream_check
308 - http_vhost_traffic_status
309 - stream_geoip2
310 - stream_javascript
311 -"
312 -
313 -IUSE="aio debug +http +http2 +http-cache +ipv6 libatomic luajit +pcre
314 - pcre-jit rtmp selinux ssl threads userland_GNU vim-syntax"
315 -
316 -for mod in $NGINX_MODULES_STD; do
317 - IUSE="${IUSE} +nginx_modules_http_${mod}"
318 -done
319 -
320 -for mod in $NGINX_MODULES_OPT; do
321 - IUSE="${IUSE} nginx_modules_http_${mod}"
322 -done
323 -
324 -for mod in $NGINX_MODULES_STREAM_STD; do
325 - IUSE="${IUSE} nginx_modules_stream_${mod}"
326 -done
327 -
328 -for mod in $NGINX_MODULES_STREAM_OPT; do
329 - IUSE="${IUSE} nginx_modules_stream_${mod}"
330 -done
331 -
332 -for mod in $NGINX_MODULES_MAIL; do
333 - IUSE="${IUSE} nginx_modules_mail_${mod}"
334 -done
335 -
336 -for mod in $NGINX_MODULES_3RD; do
337 - IUSE="${IUSE} nginx_modules_${mod}"
338 -done
339 -
340 -# Add so we can warn users updating about config changes
341 -# @TODO: jbergstroem: remove on next release series
342 -IUSE="${IUSE} nginx_modules_http_spdy"
343 -
344 -CDEPEND="
345 - pcre? ( dev-libs/libpcre:= )
346 - pcre-jit? ( dev-libs/libpcre:=[jit] )
347 - ssl? (
348 - dev-libs/openssl:0=
349 - )
350 - http2? (
351 - >=dev-libs/openssl-1.0.1c:0=
352 - )
353 - http-cache? (
354 - userland_GNU? (
355 - dev-libs/openssl:0=
356 - )
357 - )
358 - nginx_modules_http_brotli? ( app-arch/brotli:= )
359 - nginx_modules_http_geoip? ( dev-libs/geoip )
360 - nginx_modules_http_geoip2? ( dev-libs/libmaxminddb:= )
361 - nginx_modules_http_gunzip? ( sys-libs/zlib )
362 - nginx_modules_http_gzip? ( sys-libs/zlib )
363 - nginx_modules_http_gzip_static? ( sys-libs/zlib )
364 - nginx_modules_http_image_filter? ( media-libs/gd:=[jpeg,png] )
365 - nginx_modules_http_perl? ( >=dev-lang/perl-5.8:= )
366 - nginx_modules_http_rewrite? ( dev-libs/libpcre:= )
367 - nginx_modules_http_secure_link? (
368 - userland_GNU? (
369 - dev-libs/openssl:0=
370 - )
371 - )
372 - nginx_modules_http_xslt? ( dev-libs/libxml2:= dev-libs/libxslt )
373 - nginx_modules_http_lua? ( dev-lang/luajit:2= )
374 - nginx_modules_http_auth_pam? ( sys-libs/pam )
375 - nginx_modules_http_metrics? ( dev-libs/yajl:= )
376 - nginx_modules_http_dav_ext? ( dev-libs/libxml2 )
377 - nginx_modules_http_security? (
378 - dev-libs/apr:=
379 - dev-libs/apr-util:=
380 - dev-libs/libxml2:=
381 - net-misc/curl
382 - www-servers/apache
383 - )
384 - nginx_modules_http_auth_ldap? ( net-nds/openldap[ssl?] )
385 - nginx_modules_stream_geoip? ( dev-libs/geoip )
386 - nginx_modules_stream_geoip2? ( dev-libs/libmaxminddb:= )"
387 -RDEPEND="${CDEPEND}
388 - selinux? ( sec-policy/selinux-nginx )
389 - !www-servers/nginx:mainline"
390 -DEPEND="${CDEPEND}
391 - nginx_modules_http_brotli? ( virtual/pkgconfig )
392 - nginx_modules_http_lua? ( virtual/pkgconfig )
393 - nginx_modules_http_security? ( ${AUTOTOOLS_DEPEND} )
394 - arm? ( dev-libs/libatomic_ops )
395 - libatomic? ( dev-libs/libatomic_ops )"
396 -PDEPEND="vim-syntax? ( app-vim/nginx-syntax )"
397 -
398 -REQUIRED_USE="pcre-jit? ( pcre )
399 - nginx_modules_http_fancyindex? ( nginx_modules_http_addition )
400 - nginx_modules_http_grpc? ( http2 )
401 - nginx_modules_http_lua? (
402 - luajit
403 - nginx_modules_http_rewrite
404 - )
405 - nginx_modules_http_naxsi? ( pcre )
406 - nginx_modules_http_dav_ext? ( nginx_modules_http_dav nginx_modules_http_xslt )
407 - nginx_modules_http_metrics? ( nginx_modules_http_stub_status )
408 - nginx_modules_http_security? ( pcre )
409 - nginx_modules_http_push_stream? ( ssl )"
410 -
411 -pkg_setup() {
412 - NGINX_HOME="/var/lib/nginx"
413 - NGINX_HOME_TMP="${NGINX_HOME}/tmp"
414 -
415 - ebegin "Creating nginx user and group"
416 - enewgroup ${PN}
417 - enewuser ${PN} -1 -1 "${NGINX_HOME}" ${PN}
418 - eend $?
419 -
420 - if use libatomic; then
421 - ewarn "GCC 4.1+ features built-in atomic operations."
422 - ewarn "Using libatomic_ops is only needed if using"
423 - ewarn "a different compiler or a GCC prior to 4.1"
424 - fi
425 -
426 - if [[ -n $NGINX_ADD_MODULES ]]; then
427 - ewarn "You are building custom modules via \$NGINX_ADD_MODULES!"
428 - ewarn "This nginx installation is not supported!"
429 - ewarn "Make sure you can reproduce the bug without those modules"
430 - ewarn "_before_ reporting bugs."
431 - fi
432 -
433 - if use !http; then
434 - ewarn "To actually disable all http-functionality you also have to disable"
435 - ewarn "all nginx http modules."
436 - fi
437 -
438 - if use nginx_modules_http_mogilefs && use threads; then
439 - eerror "mogilefs won't compile with threads support."
440 - eerror "Please disable either flag and try again."
441 - die "Can't compile mogilefs with threads support"
442 - fi
443 -}
444 -
445 -src_prepare() {
446 - eapply "${FILESDIR}/${PN}-1.4.1-fix-perl-install-path.patch"
447 - eapply "${FILESDIR}/${PN}-httpoxy-mitigation-r1.patch"
448 -
449 - if use nginx_modules_http_brotli; then
450 - cd "${HTTP_BROTLI_MODULE_WD}" || die
451 - eapply "${FILESDIR}"/http_brotli-detect-brotli-r3.patch
452 - cd "${S}" || die
453 - fi
454 -
455 - if use nginx_modules_http_upstream_check; then
456 - eapply -p0 "${FILESDIR}"/http_upstream_check-nginx-1.11.5+.patch
457 - fi
458 -
459 - if use nginx_modules_http_cache_purge; then
460 - cd "${HTTP_CACHE_PURGE_MODULE_WD}" || die
461 - eapply "${FILESDIR}"/http_cache_purge-1.11.6+.patch
462 - cd "${S}" || die
463 - fi
464 -
465 - if use nginx_modules_http_security; then
466 - cd "${HTTP_SECURITY_MODULE_WD}" || die
467 -
468 - eautoreconf
469 -
470 - if use luajit ; then
471 - sed -i \
472 - -e 's|^\(LUA_PKGNAMES\)=.*|\1="luajit"|' \
473 - configure || die
474 - fi
475 -
476 - cd "${S}" || die
477 - fi
478 -
479 - if use nginx_modules_http_upload_progress; then
480 - cd "${HTTP_UPLOAD_PROGRESS_MODULE_WD}" || die
481 - eapply "${FILESDIR}"/http_uploadprogress-issue_50-r1.patch
482 - cd "${S}" || die
483 - fi
484 -
485 - find auto/ -type f -print0 | xargs -0 sed -i 's:\&\& make:\&\& \\$(MAKE):' || die
486 - # We have config protection, don't rename etc files
487 - sed -i 's:.default::' auto/install || die
488 - # remove useless files
489 - sed -i -e '/koi-/d' -e '/win-/d' auto/install || die
490 -
491 - # don't install to /etc/nginx/ if not in use
492 - local module
493 - for module in fastcgi scgi uwsgi ; do
494 - if ! use nginx_modules_http_${module}; then
495 - sed -i -e "/${module}/d" auto/install || die
496 - fi
497 - done
498 -
499 - eapply_user
500 -}
501 -
502 -src_configure() {
503 - # mod_security needs to generate nginx/modsecurity/config before including it
504 - if use nginx_modules_http_security; then
505 - cd "${HTTP_SECURITY_MODULE_WD}" || die
506 -
507 - ./configure \
508 - --enable-standalone-module \
509 - --disable-mlogc \
510 - --with-ssdeep=no \
511 - $(use_enable pcre-jit) \
512 - $(use_with nginx_modules_http_lua lua) || die "configure failed for mod_security"
513 -
514 - cd "${S}" || die
515 - fi
516 -
517 - local myconf=() http_enabled= mail_enabled= stream_enabled=
518 -
519 - use aio && myconf+=( --with-file-aio )
520 - use debug && myconf+=( --with-debug )
521 - use http2 && myconf+=( --with-http_v2_module )
522 - use libatomic && myconf+=( --with-libatomic )
523 - use pcre && myconf+=( --with-pcre )
524 - use pcre-jit && myconf+=( --with-pcre-jit )
525 - use threads && myconf+=( --with-threads )
526 -
527 - # HTTP modules
528 - for mod in $NGINX_MODULES_STD; do
529 - if use nginx_modules_http_${mod}; then
530 - http_enabled=1
531 - else
532 - myconf+=( --without-http_${mod}_module )
533 - fi
534 - done
535 -
536 - for mod in $NGINX_MODULES_OPT; do
537 - if use nginx_modules_http_${mod}; then
538 - http_enabled=1
539 - myconf+=( --with-http_${mod}_module )
540 - fi
541 - done
542 -
543 - if use nginx_modules_http_fastcgi; then
544 - myconf+=( --with-http_realip_module )
545 - fi
546 -
547 - # third-party modules
548 - if use nginx_modules_http_upload_progress; then
549 - http_enabled=1
550 - myconf+=( --add-module=${HTTP_UPLOAD_PROGRESS_MODULE_WD} )
551 - fi
552 -
553 - if use nginx_modules_http_headers_more; then
554 - http_enabled=1
555 - myconf+=( --add-module=${HTTP_HEADERS_MORE_MODULE_WD} )
556 - fi
557 -
558 - if use nginx_modules_http_cache_purge; then
559 - http_enabled=1
560 - myconf+=( --add-module=${HTTP_CACHE_PURGE_MODULE_WD} )
561 - fi
562 -
563 - if use nginx_modules_http_slowfs_cache; then
564 - http_enabled=1
565 - myconf+=( --add-module=${HTTP_SLOWFS_CACHE_MODULE_WD} )
566 - fi
567 -
568 - if use nginx_modules_http_fancyindex; then
569 - http_enabled=1
570 - myconf+=( --add-module=${HTTP_FANCYINDEX_MODULE_WD} )
571 - fi
572 -
573 - if use nginx_modules_http_lua; then
574 - http_enabled=1
575 - export LUAJIT_LIB=$($(tc-getPKG_CONFIG) --variable libdir luajit)
576 - export LUAJIT_INC=$($(tc-getPKG_CONFIG) --variable includedir luajit)
577 - myconf+=( --add-module=${DEVEL_KIT_MODULE_WD} )
578 - myconf+=( --add-module=${HTTP_LUA_MODULE_WD} )
579 - fi
580 -
581 - if use nginx_modules_http_auth_pam; then
582 - http_enabled=1
583 - myconf+=( --add-module=${HTTP_AUTH_PAM_MODULE_WD} )
584 - fi
585 -
586 - if use nginx_modules_http_upstream_check; then
587 - http_enabled=1
588 - myconf+=( --add-module=${HTTP_UPSTREAM_CHECK_MODULE_WD} )
589 - fi
590 -
591 - if use nginx_modules_http_metrics; then
592 - http_enabled=1
593 - myconf+=( --add-module=${HTTP_METRICS_MODULE_WD} )
594 - fi
595 -
596 - if use nginx_modules_http_naxsi ; then
597 - http_enabled=1
598 - myconf+=( --add-module=${HTTP_NAXSI_MODULE_WD} )
599 - fi
600 -
601 - if use rtmp ; then
602 - http_enabled=1
603 - myconf+=( --add-module=${RTMP_MODULE_WD} )
604 - fi
605 -
606 - if use nginx_modules_http_dav_ext ; then
607 - http_enabled=1
608 - myconf+=( --add-module=${HTTP_DAV_EXT_MODULE_WD} )
609 - fi
610 -
611 - if use nginx_modules_http_echo ; then
612 - http_enabled=1
613 - myconf+=( --add-module=${HTTP_ECHO_MODULE_WD} )
614 - fi
615 -
616 - if use nginx_modules_http_security ; then
617 - http_enabled=1
618 - myconf+=( --add-module=${HTTP_SECURITY_MODULE_WD}/nginx/modsecurity )
619 - fi
620 -
621 - if use nginx_modules_http_push_stream ; then
622 - http_enabled=1
623 - myconf+=( --add-module=${HTTP_PUSH_STREAM_MODULE_WD} )
624 - fi
625 -
626 - if use nginx_modules_http_sticky ; then
627 - http_enabled=1
628 - myconf+=( --add-module=${HTTP_STICKY_MODULE_WD} )
629 - fi
630 -
631 - if use nginx_modules_http_mogilefs ; then
632 - http_enabled=1
633 - myconf+=( --add-module=${HTTP_MOGILEFS_MODULE_WD} )
634 - fi
635 -
636 - if use nginx_modules_http_memc ; then
637 - http_enabled=1
638 - myconf+=( --add-module=${HTTP_MEMC_MODULE_WD} )
639 - fi
640 -
641 - if use nginx_modules_http_auth_ldap; then
642 - http_enabled=1
643 - myconf+=( --add-module=${HTTP_LDAP_MODULE_WD} )
644 - fi
645 -
646 - if use nginx_modules_http_vhost_traffic_status; then
647 - http_enabled=1
648 - myconf+=( --add-module=${HTTP_VHOST_TRAFFIC_STATUS_MODULE_WD} )
649 - fi
650 -
651 - if use nginx_modules_http_geoip2 || use nginx_modules_stream_geoip2; then
652 - myconf+=( --add-module=${GEOIP2_MODULE_WD} )
653 - fi
654 -
655 - if use nginx_modules_http_javascript || use nginx_modules_stream_javascript; then
656 - myconf+=( --add-module="${NJS_MODULE_WD}/nginx" )
657 - fi
658 -
659 - if use nginx_modules_http_brotli; then
660 - http_enabled=1
661 - myconf+=( --add-module=${HTTP_BROTLI_MODULE_WD} )
662 - fi
663 -
664 - if use http || use http-cache || use http2 || use nginx_modules_http_javascript; then
665 - http_enabled=1
666 - fi
667 -
668 - if [ $http_enabled ]; then
669 - use http-cache || myconf+=( --without-http-cache )
670 - use ssl && myconf+=( --with-http_ssl_module )
671 - else
672 - myconf+=( --without-http --without-http-cache )
673 - fi
674 -
675 - # Stream modules
676 - for mod in $NGINX_MODULES_STREAM_STD; do
677 - if use nginx_modules_stream_${mod}; then
678 - stream_enabled=1
679 - else
680 - myconf+=( --without-stream_${mod}_module )
681 - fi
682 - done
683 -
684 - for mod in $NGINX_MODULES_STREAM_OPT; do
685 - if use nginx_modules_stream_${mod}; then
686 - stream_enabled=1
687 - myconf+=( --with-stream_${mod}_module )
688 - fi
689 - done
690 -
691 - if use nginx_modules_stream_geoip2 || use nginx_modules_stream_javascript; then
692 - stream_enabled=1
693 - fi
694 -
695 - if [ $stream_enabled ]; then
696 - myconf+=( --with-stream )
697 - use ssl && myconf+=( --with-stream_ssl_module )
698 - fi
699 -
700 - # MAIL modules
701 - for mod in $NGINX_MODULES_MAIL; do
702 - if use nginx_modules_mail_${mod}; then
703 - mail_enabled=1
704 - else
705 - myconf+=( --without-mail_${mod}_module )
706 - fi
707 - done
708 -
709 - if [ $mail_enabled ]; then
710 - myconf+=( --with-mail )
711 - use ssl && myconf+=( --with-mail_ssl_module )
712 - fi
713 -
714 - # custom modules
715 - for mod in $NGINX_ADD_MODULES; do
716 - myconf+=( --add-module=${mod} )
717 - done
718 -
719 - # https://bugs.gentoo.org/286772
720 - export LANG=C LC_ALL=C
721 - tc-export CC
722 -
723 - if ! use prefix; then
724 - myconf+=( --user=${PN} )
725 - myconf+=( --group=${PN} )
726 - fi
727 -
728 - local WITHOUT_IPV6=
729 - if ! use ipv6; then
730 - WITHOUT_IPV6=" -DNGX_HAVE_INET6=0"
731 - fi
732 -
733 - if [[ -n "${EXTRA_ECONF}" ]]; then
734 - myconf+=( ${EXTRA_ECONF} )
735 - ewarn "EXTRA_ECONF applied. Now you are on your own, good luck!"
736 - fi
737 -
738 - ./configure \
739 - --prefix="${EPREFIX}"/usr \
740 - --conf-path="${EPREFIX}"/etc/${PN}/${PN}.conf \
741 - --error-log-path="${EPREFIX}"/var/log/${PN}/error_log \
742 - --pid-path="${EPREFIX}"/run/${PN}.pid \
743 - --lock-path="${EPREFIX}"/run/lock/${PN}.lock \
744 - --with-cc-opt="-I${SYSROOT}${EPREFIX}/usr/include${WITHOUT_IPV6}" \
745 - --with-ld-opt="-L${SYSROOT}${EPREFIX}/usr/$(get_libdir)" \
746 - --http-log-path="${EPREFIX}"/var/log/${PN}/access_log \
747 - --http-client-body-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/client \
748 - --http-proxy-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/proxy \
749 - --http-fastcgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/fastcgi \
750 - --http-scgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/scgi \
751 - --http-uwsgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/uwsgi \
752 - --with-compat \
753 - "${myconf[@]}" || die "configure failed"
754 -
755 - # A purely cosmetic change that makes nginx -V more readable. This can be
756 - # good if people outside the gentoo community would troubleshoot and
757 - # question the users setup.
758 - sed -i -e "s|${WORKDIR}|external_module|g" objs/ngx_auto_config.h || die
759 -}
760 -
761 -src_compile() {
762 - use nginx_modules_http_security && emake -C "${HTTP_SECURITY_MODULE_WD}"
763 -
764 - # https://bugs.gentoo.org/286772
765 - export LANG=C LC_ALL=C
766 - emake LINK="${CC} ${LDFLAGS}" OTHERLDFLAGS="${LDFLAGS}"
767 -}
768 -
769 -src_install() {
770 - emake DESTDIR="${D%/}" install
771 -
772 - cp "${FILESDIR}"/nginx.conf-r2 "${ED%/}"/etc/nginx/nginx.conf || die
773 -
774 - newinitd "${FILESDIR}"/nginx.initd-r4 nginx
775 - newconfd "${FILESDIR}"/nginx.confd nginx
776 -
777 - systemd_newunit "${FILESDIR}"/nginx.service-r1 nginx.service
778 -
779 - doman man/nginx.8
780 - dodoc CHANGES* README
781 -
782 - # just keepdir. do not copy the default htdocs files (bug #449136)
783 - keepdir /var/www/localhost
784 - rm -rf "${ED%/}"/usr/html || die
785 -
786 - # set up a list of directories to keep
787 - local keepdir_list="${NGINX_HOME_TMP}"/client
788 - local module
789 - for module in proxy fastcgi scgi uwsgi; do
790 - use nginx_modules_http_${module} && keepdir_list+=" ${NGINX_HOME_TMP}/${module}"
791 - done
792 -
793 - keepdir /var/log/nginx ${keepdir_list}
794 -
795 - # this solves a problem with SELinux where nginx doesn't see the directories
796 - # as root and tries to create them as nginx
797 - fperms 0750 "${NGINX_HOME_TMP}"
798 - fowners ${PN}:0 "${NGINX_HOME_TMP}"
799 -
800 - fperms 0700 ${keepdir_list}
801 - fowners ${PN}:${PN} ${keepdir_list}
802 -
803 - fperms 0710 /var/log/nginx
804 - fowners 0:${PN} /var/log/nginx
805 -
806 - # logrotate
807 - insinto /etc/logrotate.d
808 - newins "${FILESDIR}"/nginx.logrotate-r1 nginx
809 -
810 - # Don't create /run
811 - rm -rf "${ED%/}"/run || die
812 -
813 - if use luajit; then
814 - pax-mark m "${ED%/}/usr/sbin/nginx"
815 - fi
816 -
817 - if use nginx_modules_http_perl; then
818 - cd "${S}"/objs/src/http/modules/perl/ || die
819 - emake DESTDIR="${D}" INSTALLDIRS=vendor
820 - perl_delete_localpod
821 - cd "${S}" || die
822 - fi
823 -
824 - if use nginx_modules_http_cache_purge; then
825 - docinto ${HTTP_CACHE_PURGE_MODULE_P}
826 - dodoc "${HTTP_CACHE_PURGE_MODULE_WD}"/{CHANGES,README.md,TODO.md}
827 - fi
828 -
829 - if use nginx_modules_http_slowfs_cache; then
830 - docinto ${HTTP_SLOWFS_CACHE_MODULE_P}
831 - dodoc "${HTTP_SLOWFS_CACHE_MODULE_WD}"/{CHANGES,README.md}
832 - fi
833 -
834 - if use nginx_modules_http_fancyindex; then
835 - docinto ${HTTP_FANCYINDEX_MODULE_P}
836 - dodoc "${HTTP_FANCYINDEX_MODULE_WD}"/README.rst
837 - fi
838 -
839 - if use nginx_modules_http_lua; then
840 - docinto ${HTTP_LUA_MODULE_P}
841 - dodoc "${HTTP_LUA_MODULE_WD}"/README.markdown
842 - fi
843 -
844 - if use nginx_modules_http_auth_pam; then
845 - docinto ${HTTP_AUTH_PAM_MODULE_P}
846 - dodoc "${HTTP_AUTH_PAM_MODULE_WD}"/{README.md,ChangeLog}
847 - fi
848 -
849 - if use nginx_modules_http_upstream_check; then
850 - docinto ${HTTP_UPSTREAM_CHECK_MODULE_P}
851 - dodoc "${HTTP_UPSTREAM_CHECK_MODULE_WD}"/{README,CHANGES}
852 - fi
853 -
854 - if use nginx_modules_http_naxsi; then
855 - insinto /etc/nginx
856 - doins "${HTTP_NAXSI_MODULE_WD}"/../naxsi_config/naxsi_core.rules
857 - fi
858 -
859 - if use rtmp; then
860 - docinto ${RTMP_MODULE_P}
861 - dodoc "${RTMP_MODULE_WD}"/{AUTHORS,README.md,stat.xsl}
862 - fi
863 -
864 - if use nginx_modules_http_dav_ext; then
865 - docinto ${HTTP_DAV_EXT_MODULE_P}
866 - dodoc "${HTTP_DAV_EXT_MODULE_WD}"/README.rst
867 - fi
868 -
869 - if use nginx_modules_http_echo; then
870 - docinto ${HTTP_ECHO_MODULE_P}
871 - dodoc "${HTTP_ECHO_MODULE_WD}"/README.markdown
872 - fi
873 -
874 - if use nginx_modules_http_security; then
875 - docinto ${HTTP_SECURITY_MODULE_P}
876 - dodoc "${HTTP_SECURITY_MODULE_WD}"/{CHANGES,README.md,authors.txt}
877 - fi
878 -
879 - if use nginx_modules_http_push_stream; then
880 - docinto ${HTTP_PUSH_STREAM_MODULE_P}
881 - dodoc "${HTTP_PUSH_STREAM_MODULE_WD}"/{AUTHORS,CHANGELOG.textile,README.textile}
882 - fi
883 -
884 - if use nginx_modules_http_sticky; then
885 - docinto ${HTTP_STICKY_MODULE_P}
886 - dodoc "${HTTP_STICKY_MODULE_WD}"/{README.md,Changelog.txt,docs/sticky.pdf}
887 - fi
888 -
889 - if use nginx_modules_http_memc; then
890 - docinto ${HTTP_MEMC_MODULE_P}
891 - dodoc "${HTTP_MEMC_MODULE_WD}"/README.markdown
892 - fi
893 -
894 - if use nginx_modules_http_auth_ldap; then
895 - docinto ${HTTP_LDAP_MODULE_P}
896 - dodoc "${HTTP_LDAP_MODULE_WD}"/example.conf
897 - fi
898 -}
899 -
900 -pkg_postinst() {
901 - if use ssl; then
902 - if [[ ! -f "${EROOT}"etc/ssl/${PN}/${PN}.key ]]; then
903 - install_cert /etc/ssl/${PN}/${PN}
904 - use prefix || chown ${PN}:${PN} "${EROOT}"etc/ssl/${PN}/${PN}.{crt,csr,key,pem}
905 - fi
906 - fi
907 -
908 - if use nginx_modules_http_spdy; then
909 - ewarn ""
910 - ewarn "In nginx 1.9.5 the spdy module was superseded by http2."
911 - ewarn "Update your configs and package.use accordingly."
912 - fi
913 -
914 - if use nginx_modules_http_lua; then
915 - ewarn ""
916 - ewarn "While you can build lua 3rd party module against ${P}"
917 - ewarn "the author warns that >=${PN}-1.11.11 is still not an"
918 - ewarn "officially supported target yet. You are on your own."
919 - ewarn "Expect runtime failures, memory leaks and other problems!"
920 - fi
921 -
922 - if use nginx_modules_http_lua && use http2; then
923 - ewarn ""
924 - ewarn "Lua 3rd party module author warns against using ${P} with"
925 - ewarn "NGINX_MODULES_HTTP=\"lua http2\". For more info, see https://git.io/OldLsg"
926 - fi
927 -
928 - local _n_permission_layout_checks=0
929 - local _has_to_adjust_permissions=0
930 - local _has_to_show_permission_warning=0
931 -
932 - # Defaults to 1 to inform people doing a fresh installation
933 - # that we ship modified {scgi,uwsgi,fastcgi}_params files
934 - local _has_to_show_httpoxy_mitigation_notice=1
935 -
936 - local _replacing_version=
937 - for _replacing_version in ${REPLACING_VERSIONS}; do
938 - _n_permission_layout_checks=$((${_n_permission_layout_checks}+1))
939 -
940 - if [[ ${_n_permission_layout_checks} -gt 1 ]]; then
941 - # Should never happen:
942 - # Package is abusing slots but doesn't allow multiple parallel installations.
943 - # If we run into this situation it is unsafe to automatically adjust any
944 - # permission...
945 - _has_to_show_permission_warning=1
946 -
947 - ewarn "Replacing multiple ${PN}' versions is unsupported! " \
948 - "You will have to adjust permissions on your own."
949 -
950 - break
951 - fi
952 -
953 - local _replacing_version_branch=$(get_version_component_range 1-2 "${_replacing_version}")
954 - debug-print "Updating an existing installation (v${_replacing_version}; branch '${_replacing_version_branch}') ..."
955 -
956 - # Do we need to adjust permissions to fix CVE-2013-0337 (bug #458726, #469094)?
957 - # This was before we introduced multiple nginx versions so we
958 - # do not need to distinguish between stable and mainline
959 - local _need_to_fix_CVE2013_0337=1
960 -
961 - if version_is_at_least "1.4.1-r2" "${_replacing_version}"; then
962 - # We are updating an installation which should already be fixed
963 - _need_to_fix_CVE2013_0337=0
964 - debug-print "Skipping CVE-2013-0337 ... existing installation should not be affected!"
965 - else
966 - _has_to_adjust_permissions=1
967 - debug-print "Need to adjust permissions to fix CVE-2013-0337!"
968 - fi
969 -
970 - # Do we need to inform about HTTPoxy mitigation?
971 - # In repository since commit 8be44f76d4ac02cebcd1e0e6e6284bb72d054b0f
972 - if ! version_is_at_least "1.10" "${_replacing_version_branch}"; then
973 - # Updating from <1.10
974 - _has_to_show_httpoxy_mitigation_notice=1
975 - debug-print "Need to inform about HTTPoxy mitigation!"
976 - else
977 - # Updating from >=1.10
978 - local _fixed_in_pvr=
979 - case "${_replacing_version_branch}" in
980 - "1.10")
981 - _fixed_in_pvr="1.10.1-r2"
982 - ;;
983 - "1.11")
984 - _fixed_in_pvr="1.11.3-r1"
985 - ;;
986 - *)
987 - # This should be any future branch.
988 - # If we run this code it is safe to assume that the user has
989 - # already seen the HTTPoxy mitigation notice because he/she is doing
990 - # an update from previous version where we have already shown
991 - # the warning. Otherwise, we wouldn't hit this code path ...
992 - _fixed_in_pvr=
993 - esac
994 -
995 - if [[ -z "${_fixed_in_pvr}" ]] || version_is_at_least "${_fixed_in_pvr}" "${_replacing_version}"; then
996 - # We are updating an installation where we already informed
997 - # that we are mitigating HTTPoxy per default
998 - _has_to_show_httpoxy_mitigation_notice=0
999 - debug-print "No need to inform about HTTPoxy mitigation ... information was already shown for existing installation!"
1000 - else
1001 - _has_to_show_httpoxy_mitigation_notice=1
1002 - debug-print "Need to inform about HTTPoxy mitigation!"
1003 - fi
1004 - fi
1005 -
1006 - # Do we need to adjust permissions to fix CVE-2016-1247 (bug #605008)?
1007 - # All branches up to 1.11 are affected
1008 - local _need_to_fix_CVE2016_1247=1
1009 -
1010 - if ! version_is_at_least "1.10" "${_replacing_version_branch}"; then
1011 - # Updating from <1.10
1012 - _has_to_adjust_permissions=1
1013 - debug-print "Need to adjust permissions to fix CVE-2016-1247!"
1014 - else
1015 - # Updating from >=1.10
1016 - local _fixed_in_pvr=
1017 - case "${_replacing_version_branch}" in
1018 - "1.10")
1019 - _fixed_in_pvr="1.10.2-r3"
1020 - ;;
1021 - "1.11")
1022 - _fixed_in_pvr="1.11.6-r1"
1023 - ;;
1024 - *)
1025 - # This should be any future branch.
1026 - # If we run this code it is safe to assume that we have already
1027 - # adjusted permissions or were never affected because user is
1028 - # doing an update from previous version which was safe or did
1029 - # the adjustments. Otherwise, we wouldn't hit this code path ...
1030 - _fixed_in_pvr=
1031 - esac
1032 -
1033 - if [[ -z "${_fixed_in_pvr}" ]] || version_is_at_least "${_fixed_in_pvr}" "${_replacing_version}"; then
1034 - # We are updating an installation which should already be adjusted
1035 - # or which was never affected
1036 - _need_to_fix_CVE2016_1247=0
1037 - debug-print "Skipping CVE-2016-1247 ... existing installation should not be affected!"
1038 - else
1039 - _has_to_adjust_permissions=1
1040 - debug-print "Need to adjust permissions to fix CVE-2016-1247!"
1041 - fi
1042 - fi
1043 - done
1044 -
1045 - if [[ ${_has_to_adjust_permissions} -eq 1 ]]; then
1046 - # We do not DIE when chmod/chown commands are failing because
1047 - # package is already merged on user's system at this stage
1048 - # and we cannot retry without losing the information that
1049 - # the existing installation needs to adjust permissions.
1050 - # Instead we are going to a show a big warning ...
1051 -
1052 - if [[ ${_has_to_show_permission_warning} -eq 0 ]] && [[ ${_need_to_fix_CVE2013_0337} -eq 1 ]]; then
1053 - ewarn ""
1054 - ewarn "The world-readable bit (if set) has been removed from the"
1055 - ewarn "following directories to mitigate a security bug"
1056 - ewarn "(CVE-2013-0337, bug #458726):"
1057 - ewarn ""
1058 - ewarn " ${EPREFIX}/var/log/nginx"
1059 - ewarn " ${EPREFIX}${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi}"
1060 - ewarn ""
1061 - ewarn "Check if this is correct for your setup before restarting nginx!"
1062 - ewarn "This is a one-time change and will not happen on subsequent updates."
1063 - ewarn "Furthermore nginx' temp directories got moved to '${EPREFIX}${NGINX_HOME_TMP}'"
1064 - chmod o-rwx \
1065 - "${EPREFIX}"/var/log/nginx \
1066 - "${EPREFIX}"${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi} || \
1067 - _has_to_show_permission_warning=1
1068 - fi
1069 -
1070 - if [[ ${_has_to_show_permission_warning} -eq 0 ]] && [[ ${_need_to_fix_CVE2016_1247} -eq 1 ]]; then
1071 - ewarn ""
1072 - ewarn "The permissions on the following directory have been reset in"
1073 - ewarn "order to mitigate a security bug (CVE-2016-1247, bug #605008):"
1074 - ewarn ""
1075 - ewarn " ${EPREFIX}/var/log/nginx"
1076 - ewarn ""
1077 - ewarn "Check if this is correct for your setup before restarting nginx!"
1078 - ewarn "Also ensure that no other log directory used by any of your"
1079 - ewarn "vhost(s) is not writeable for nginx user. Any of your log files"
1080 - ewarn "used by nginx can be abused to escalate privileges!"
1081 - ewarn "This is a one-time change and will not happen on subsequent updates."
1082 - chown 0:nginx "${EPREFIX}"/var/log/nginx || _has_to_show_permission_warning=1
1083 - chmod 710 "${EPREFIX}"/var/log/nginx || _has_to_show_permission_warning=1
1084 - fi
1085 -
1086 - if [[ ${_has_to_show_permission_warning} -eq 1 ]]; then
1087 - # Should never happen ...
1088 - ewarn ""
1089 - ewarn "*************************************************************"
1090 - ewarn "*************** W A R N I N G ***************"
1091 - ewarn "*************************************************************"
1092 - ewarn "The one-time only attempt to adjust permissions of the"
1093 - ewarn "existing nginx installation failed. Be aware that we will not"
1094 - ewarn "try to adjust the same permissions again because now you are"
1095 - ewarn "using a nginx version where we expect that the permissions"
1096 - ewarn "are already adjusted or that you know what you are doing and"
1097 - ewarn "want to keep custom permissions."
1098 - ewarn ""
1099 - fi
1100 - fi
1101 -
1102 - # Sanity check for CVE-2016-1247
1103 - # Required to warn users who received the warning above and thought
1104 - # they could fix it by unmerging and re-merging the package or have
1105 - # unmerged a affected installation on purpose in the past leaving
1106 - # /var/log/nginx on their system due to keepdir/non-empty folder
1107 - # and are now installing the package again.
1108 - local _sanity_check_testfile=$(mktemp --dry-run "${EPREFIX}"/var/log/nginx/.CVE-2016-1247.XXXXXXXXX)
1109 - su -s /bin/sh -c "touch ${_sanity_check_testfile}" nginx >&/dev/null
1110 - if [ $? -eq 0 ] ; then
1111 - # Cleanup -- no reason to die here!
1112 - rm -f "${_sanity_check_testfile}"
1113 -
1114 - ewarn ""
1115 - ewarn "*************************************************************"
1116 - ewarn "*************** W A R N I N G ***************"
1117 - ewarn "*************************************************************"
1118 - ewarn "Looks like your installation is vulnerable to CVE-2016-1247"
1119 - ewarn "(bug #605008) because nginx user is able to create files in"
1120 - ewarn ""
1121 - ewarn " ${EPREFIX}/var/log/nginx"
1122 - ewarn ""
1123 - ewarn "Also ensure that no other log directory used by any of your"
1124 - ewarn "vhost(s) is not writeable for nginx user. Any of your log files"
1125 - ewarn "used by nginx can be abused to escalate privileges!"
1126 - fi
1127 -
1128 - if [[ ${_has_to_show_httpoxy_mitigation_notice} -eq 1 ]]; then
1129 - # HTTPoxy mitigation
1130 - ewarn ""
1131 - ewarn "This nginx installation comes with a mitigation for the HTTPoxy"
1132 - ewarn "vulnerability for FastCGI, SCGI and uWSGI applications by setting"
1133 - ewarn "the HTTP_PROXY parameter to an empty string per default when you"
1134 - ewarn "are sourcing one of the default"
1135 - ewarn ""
1136 - ewarn " - 'fastcgi_params' or 'fastcgi.conf'"
1137 - ewarn " - 'scgi_params'"
1138 - ewarn " - 'uwsgi_params'"
1139 - ewarn ""
1140 - ewarn "files in your server block(s)."
1141 - ewarn ""
1142 - ewarn "If this is causing any problems for you make sure that you are sourcing the"
1143 - ewarn "default parameters _before_ you set your own values."
1144 - ewarn "If you are relying on user-supplied proxy values you have to remove the"
1145 - ewarn "correlating lines from the file(s) mentioned above."
1146 - ewarn ""
1147 - fi
1148 -}
1149
1150 diff --git a/www-servers/nginx/nginx-1.19.10.ebuild b/www-servers/nginx/nginx-1.19.10.ebuild
1151 deleted file mode 100644
1152 index 1cdf07062df..00000000000
1153 --- a/www-servers/nginx/nginx-1.19.10.ebuild
1154 +++ /dev/null
1155 @@ -1,1086 +0,0 @@
1156 -# Copyright 1999-2021 Gentoo Authors
1157 -# Distributed under the terms of the GNU General Public License v2
1158 -
1159 -EAPI=7
1160 -
1161 -# Maintainer notes:
1162 -# - http_rewrite-independent pcre-support makes sense for matching locations without an actual rewrite
1163 -# - any http-module activates the main http-functionality and overrides USE=-http
1164 -# - keep the following requirements in mind before adding external modules:
1165 -# * alive upstream
1166 -# * sane packaging
1167 -# * builds cleanly
1168 -# * does not need a patch for nginx core
1169 -# - TODO: test the google-perftools module (included in vanilla tarball)
1170 -
1171 -# prevent perl-module from adding automagic perl DEPENDs
1172 -GENTOO_DEPEND_ON_PERL="no"
1173 -
1174 -# devel_kit (https://github.com/simpl/ngx_devel_kit, BSD license)
1175 -DEVEL_KIT_MODULE_PV="0.3.1"
1176 -DEVEL_KIT_MODULE_P="ngx_devel_kit-${DEVEL_KIT_MODULE_PV}"
1177 -DEVEL_KIT_MODULE_URI="https://github.com/simpl/ngx_devel_kit/archive/v${DEVEL_KIT_MODULE_PV}.tar.gz"
1178 -DEVEL_KIT_MODULE_WD="${WORKDIR}/ngx_devel_kit-${DEVEL_KIT_MODULE_PV}"
1179 -
1180 -# ngx_brotli (https://github.com/google/ngx_brotli, BSD-2)
1181 -HTTP_BROTLI_MODULE_PV="1.0.0rc"
1182 -HTTP_BROTLI_MODULE_P="ngx_brotli-${HTTP_BROTLI_MODULE_PV}"
1183 -HTTP_BROTLI_MODULE_URI="https://github.com/google/ngx_brotli/archive/v${HTTP_BROTLI_MODULE_PV}.tar.gz"
1184 -HTTP_BROTLI_MODULE_WD="${WORKDIR}/ngx_brotli-${HTTP_BROTLI_MODULE_PV}"
1185 -
1186 -# http_uploadprogress (https://github.com/masterzen/nginx-upload-progress-module, BSD-2 license)
1187 -HTTP_UPLOAD_PROGRESS_MODULE_PV="0.9.2"
1188 -HTTP_UPLOAD_PROGRESS_MODULE_P="ngx_http_upload_progress-${HTTP_UPLOAD_PROGRESS_MODULE_PV}-r1"
1189 -HTTP_UPLOAD_PROGRESS_MODULE_URI="https://github.com/masterzen/nginx-upload-progress-module/archive/v${HTTP_UPLOAD_PROGRESS_MODULE_PV}.tar.gz"
1190 -HTTP_UPLOAD_PROGRESS_MODULE_WD="${WORKDIR}/nginx-upload-progress-module-${HTTP_UPLOAD_PROGRESS_MODULE_PV}"
1191 -
1192 -# http_headers_more (https://github.com/agentzh/headers-more-nginx-module, BSD license)
1193 -HTTP_HEADERS_MORE_MODULE_PV="0.33"
1194 -HTTP_HEADERS_MORE_MODULE_P="ngx_http_headers_more-${HTTP_HEADERS_MORE_MODULE_PV}"
1195 -HTTP_HEADERS_MORE_MODULE_URI="https://github.com/agentzh/headers-more-nginx-module/archive/v${HTTP_HEADERS_MORE_MODULE_PV}.tar.gz"
1196 -HTTP_HEADERS_MORE_MODULE_WD="${WORKDIR}/headers-more-nginx-module-${HTTP_HEADERS_MORE_MODULE_PV}"
1197 -
1198 -# http_cache_purge (http://labs.frickle.com/nginx_ngx_cache_purge/, https://github.com/FRiCKLE/ngx_cache_purge, BSD-2 license)
1199 -HTTP_CACHE_PURGE_MODULE_PV="2.3"
1200 -HTTP_CACHE_PURGE_MODULE_P="ngx_http_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}"
1201 -HTTP_CACHE_PURGE_MODULE_URI="http://labs.frickle.com/files/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}.tar.gz"
1202 -HTTP_CACHE_PURGE_MODULE_WD="${WORKDIR}/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}"
1203 -
1204 -# http_slowfs_cache (http://labs.frickle.com/nginx_ngx_slowfs_cache/, BSD-2 license)
1205 -HTTP_SLOWFS_CACHE_MODULE_PV="1.10"
1206 -HTTP_SLOWFS_CACHE_MODULE_P="ngx_http_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}"
1207 -HTTP_SLOWFS_CACHE_MODULE_URI="http://labs.frickle.com/files/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}.tar.gz"
1208 -HTTP_SLOWFS_CACHE_MODULE_WD="${WORKDIR}/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}"
1209 -
1210 -# http_fancyindex (https://github.com/aperezdc/ngx-fancyindex, BSD license)
1211 -HTTP_FANCYINDEX_MODULE_PV="0.4.4"
1212 -HTTP_FANCYINDEX_MODULE_P="ngx_http_fancyindex-${HTTP_FANCYINDEX_MODULE_PV}"
1213 -HTTP_FANCYINDEX_MODULE_URI="https://github.com/aperezdc/ngx-fancyindex/archive/v${HTTP_FANCYINDEX_MODULE_PV}.tar.gz"
1214 -HTTP_FANCYINDEX_MODULE_WD="${WORKDIR}/ngx-fancyindex-${HTTP_FANCYINDEX_MODULE_PV}"
1215 -
1216 -# http_lua (https://github.com/openresty/lua-nginx-module, BSD license)
1217 -HTTP_LUA_MODULE_PV="0.10.15"
1218 -HTTP_LUA_MODULE_P="ngx_http_lua-${HTTP_LUA_MODULE_PV}"
1219 -HTTP_LUA_MODULE_URI="https://github.com/openresty/lua-nginx-module/archive/v${HTTP_LUA_MODULE_PV}.tar.gz"
1220 -HTTP_LUA_MODULE_WD="${WORKDIR}/lua-nginx-module-${HTTP_LUA_MODULE_PV}"
1221 -LUA_COMPAT=( luajit )
1222 -
1223 -# http_auth_pam (https://github.com/stogh/ngx_http_auth_pam_module/, http://web.iti.upv.es/~sto/nginx/, BSD-2 license)
1224 -HTTP_AUTH_PAM_MODULE_PV="1.5.2"
1225 -HTTP_AUTH_PAM_MODULE_P="ngx_http_auth_pam-${HTTP_AUTH_PAM_MODULE_PV}"
1226 -HTTP_AUTH_PAM_MODULE_URI="https://github.com/stogh/ngx_http_auth_pam_module/archive/v${HTTP_AUTH_PAM_MODULE_PV}.tar.gz"
1227 -HTTP_AUTH_PAM_MODULE_WD="${WORKDIR}/ngx_http_auth_pam_module-${HTTP_AUTH_PAM_MODULE_PV}"
1228 -
1229 -# http_upstream_check (https://github.com/yaoweibin/nginx_upstream_check_module, BSD license)
1230 -HTTP_UPSTREAM_CHECK_MODULE_PV="9aecf15ec379fe98f62355c57b60c0bc83296f04"
1231 -HTTP_UPSTREAM_CHECK_MODULE_P="ngx_http_upstream_check-${HTTP_UPSTREAM_CHECK_MODULE_PV}"
1232 -HTTP_UPSTREAM_CHECK_MODULE_URI="https://github.com/yaoweibin/nginx_upstream_check_module/archive/${HTTP_UPSTREAM_CHECK_MODULE_PV}.tar.gz"
1233 -HTTP_UPSTREAM_CHECK_MODULE_WD="${WORKDIR}/nginx_upstream_check_module-${HTTP_UPSTREAM_CHECK_MODULE_PV}"
1234 -
1235 -# http_metrics (https://github.com/zenops/ngx_metrics, BSD license)
1236 -HTTP_METRICS_MODULE_PV="0.1.1"
1237 -HTTP_METRICS_MODULE_P="ngx_metrics-${HTTP_METRICS_MODULE_PV}"
1238 -HTTP_METRICS_MODULE_URI="https://github.com/madvertise/ngx_metrics/archive/v${HTTP_METRICS_MODULE_PV}.tar.gz"
1239 -HTTP_METRICS_MODULE_WD="${WORKDIR}/ngx_metrics-${HTTP_METRICS_MODULE_PV}"
1240 -
1241 -# http_vhost_traffic_status (https://github.com/vozlt/nginx-module-vts, BSD license)
1242 -HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV="46d85558e344dfe2b078ce757fd36c69a1ec2dd3"
1243 -HTTP_VHOST_TRAFFIC_STATUS_MODULE_P="ngx_http_vhost_traffic_status-${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}"
1244 -HTTP_VHOST_TRAFFIC_STATUS_MODULE_URI="https://github.com/vozlt/nginx-module-vts/archive/${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}.tar.gz"
1245 -HTTP_VHOST_TRAFFIC_STATUS_MODULE_WD="${WORKDIR}/nginx-module-vts-${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}"
1246 -
1247 -# naxsi-core (https://github.com/nbs-system/naxsi, GPLv2+)
1248 -HTTP_NAXSI_MODULE_PV="0.56"
1249 -HTTP_NAXSI_MODULE_P="ngx_http_naxsi-${HTTP_NAXSI_MODULE_PV}"
1250 -HTTP_NAXSI_MODULE_URI="https://github.com/nbs-system/naxsi/archive/${HTTP_NAXSI_MODULE_PV}.tar.gz"
1251 -HTTP_NAXSI_MODULE_WD="${WORKDIR}/naxsi-${HTTP_NAXSI_MODULE_PV}/naxsi_src"
1252 -
1253 -# nginx-rtmp-module (https://github.com/arut/nginx-rtmp-module, BSD license)
1254 -RTMP_MODULE_PV="1.2.1"
1255 -RTMP_MODULE_P="ngx_rtmp-${RTMP_MODULE_PV}"
1256 -RTMP_MODULE_URI="https://github.com/arut/nginx-rtmp-module/archive/v${RTMP_MODULE_PV}.tar.gz"
1257 -RTMP_MODULE_WD="${WORKDIR}/nginx-rtmp-module-${RTMP_MODULE_PV}"
1258 -
1259 -# nginx-dav-ext-module (https://github.com/arut/nginx-dav-ext-module, BSD license)
1260 -HTTP_DAV_EXT_MODULE_PV="3.0.0"
1261 -HTTP_DAV_EXT_MODULE_P="ngx_http_dav_ext-${HTTP_DAV_EXT_MODULE_PV}"
1262 -HTTP_DAV_EXT_MODULE_URI="https://github.com/arut/nginx-dav-ext-module/archive/v${HTTP_DAV_EXT_MODULE_PV}.tar.gz"
1263 -HTTP_DAV_EXT_MODULE_WD="${WORKDIR}/nginx-dav-ext-module-${HTTP_DAV_EXT_MODULE_PV}"
1264 -
1265 -# echo-nginx-module (https://github.com/openresty/echo-nginx-module, BSD license)
1266 -HTTP_ECHO_MODULE_PV="0.62"
1267 -HTTP_ECHO_MODULE_P="ngx_http_echo-${HTTP_ECHO_MODULE_PV}"
1268 -HTTP_ECHO_MODULE_URI="https://github.com/openresty/echo-nginx-module/archive/v${HTTP_ECHO_MODULE_PV}.tar.gz"
1269 -HTTP_ECHO_MODULE_WD="${WORKDIR}/echo-nginx-module-${HTTP_ECHO_MODULE_PV}"
1270 -
1271 -# mod_security for nginx (https://modsecurity.org/, Apache-2.0)
1272 -# keep the MODULE_P here consistent with upstream to avoid tarball duplication
1273 -HTTP_SECURITY_MODULE_PV="2.9.3"
1274 -HTTP_SECURITY_MODULE_P="modsecurity-${HTTP_SECURITY_MODULE_PV}"
1275 -HTTP_SECURITY_MODULE_URI="https://www.modsecurity.org/tarball/${HTTP_SECURITY_MODULE_PV}/${HTTP_SECURITY_MODULE_P}.tar.gz"
1276 -HTTP_SECURITY_MODULE_WD="${WORKDIR}/${HTTP_SECURITY_MODULE_P}"
1277 -
1278 -# push-stream-module (http://www.nginxpushstream.com, https://github.com/wandenberg/nginx-push-stream-module, GPL-3)
1279 -HTTP_PUSH_STREAM_MODULE_PV="0.5.4"
1280 -HTTP_PUSH_STREAM_MODULE_P="ngx_http_push_stream-${HTTP_PUSH_STREAM_MODULE_PV}"
1281 -HTTP_PUSH_STREAM_MODULE_URI="https://github.com/wandenberg/nginx-push-stream-module/archive/${HTTP_PUSH_STREAM_MODULE_PV}.tar.gz"
1282 -HTTP_PUSH_STREAM_MODULE_WD="${WORKDIR}/nginx-push-stream-module-${HTTP_PUSH_STREAM_MODULE_PV}"
1283 -
1284 -# sticky-module (https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng, BSD-2)
1285 -HTTP_STICKY_MODULE_PV="1.2.6-10-g08a395c66e42"
1286 -HTTP_STICKY_MODULE_P="nginx_http_sticky_module_ng-${HTTP_STICKY_MODULE_PV}"
1287 -HTTP_STICKY_MODULE_URI="https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/get/${HTTP_STICKY_MODULE_PV}.tar.bz2"
1288 -HTTP_STICKY_MODULE_WD="${WORKDIR}/nginx-goodies-nginx-sticky-module-ng-08a395c66e42"
1289 -
1290 -# mogilefs-module (https://github.com/vkholodkov/nginx-mogilefs-module, BSD-2)
1291 -HTTP_MOGILEFS_MODULE_PV="1.0.4"
1292 -HTTP_MOGILEFS_MODULE_P="ngx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}"
1293 -HTTP_MOGILEFS_MODULE_URI="https://github.com/vkholodkov/nginx-mogilefs-module/archive/${HTTP_MOGILEFS_MODULE_PV}.tar.gz"
1294 -HTTP_MOGILEFS_MODULE_WD="${WORKDIR}/nginx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}"
1295 -
1296 -# memc-module (https://github.com/openresty/memc-nginx-module, BSD-2)
1297 -HTTP_MEMC_MODULE_PV="0.19"
1298 -HTTP_MEMC_MODULE_P="ngx_memc_module-${HTTP_MEMC_MODULE_PV}"
1299 -HTTP_MEMC_MODULE_URI="https://github.com/openresty/memc-nginx-module/archive/v${HTTP_MEMC_MODULE_PV}.tar.gz"
1300 -HTTP_MEMC_MODULE_WD="${WORKDIR}/memc-nginx-module-${HTTP_MEMC_MODULE_PV}"
1301 -
1302 -# nginx-ldap-auth-module (https://github.com/kvspb/nginx-auth-ldap, BSD-2)
1303 -HTTP_LDAP_MODULE_PV="42d195d7a7575ebab1c369ad3fc5d78dc2c2669c"
1304 -HTTP_LDAP_MODULE_P="nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}"
1305 -HTTP_LDAP_MODULE_URI="https://github.com/kvspb/nginx-auth-ldap/archive/${HTTP_LDAP_MODULE_PV}.tar.gz"
1306 -HTTP_LDAP_MODULE_WD="${WORKDIR}/nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}"
1307 -
1308 -# geoip2 (https://github.com/leev/ngx_http_geoip2_module, BSD-2)
1309 -GEOIP2_MODULE_PV="3.3"
1310 -GEOIP2_MODULE_P="ngx_http_geoip2_module-${GEOIP2_MODULE_PV}"
1311 -GEOIP2_MODULE_URI="https://github.com/leev/ngx_http_geoip2_module/archive/${GEOIP2_MODULE_PV}.tar.gz"
1312 -GEOIP2_MODULE_WD="${WORKDIR}/ngx_http_geoip2_module-${GEOIP2_MODULE_PV}"
1313 -
1314 -# njs-module (https://github.com/nginx/njs, as-is)
1315 -NJS_MODULE_PV="0.5.3"
1316 -NJS_MODULE_P="njs-${NJS_MODULE_PV}"
1317 -NJS_MODULE_URI="https://github.com/nginx/njs/archive/${NJS_MODULE_PV}.tar.gz"
1318 -NJS_MODULE_WD="${WORKDIR}/njs-${NJS_MODULE_PV}"
1319 -
1320 -# We handle deps below ourselves
1321 -SSL_DEPS_SKIP=1
1322 -AUTOTOOLS_AUTO_DEPEND="no"
1323 -
1324 -inherit autotools lua-single ssl-cert toolchain-funcs perl-module flag-o-matic user systemd multilib pax-utils
1325 -
1326 -DESCRIPTION="Robust, small and high performance http and reverse proxy server"
1327 -HOMEPAGE="https://nginx.org"
1328 -SRC_URI="https://nginx.org/download/${P}.tar.gz
1329 - ${DEVEL_KIT_MODULE_URI} -> ${DEVEL_KIT_MODULE_P}.tar.gz
1330 - nginx_modules_http_auth_ldap? ( ${HTTP_LDAP_MODULE_URI} -> ${HTTP_LDAP_MODULE_P}.tar.gz )
1331 - nginx_modules_http_auth_pam? ( ${HTTP_AUTH_PAM_MODULE_URI} -> ${HTTP_AUTH_PAM_MODULE_P}.tar.gz )
1332 - nginx_modules_http_brotli? ( ${HTTP_BROTLI_MODULE_URI} -> ${HTTP_BROTLI_MODULE_P}.tar.gz )
1333 - nginx_modules_http_cache_purge? ( ${HTTP_CACHE_PURGE_MODULE_URI} -> ${HTTP_CACHE_PURGE_MODULE_P}.tar.gz )
1334 - nginx_modules_http_dav_ext? ( ${HTTP_DAV_EXT_MODULE_URI} -> ${HTTP_DAV_EXT_MODULE_P}.tar.gz )
1335 - nginx_modules_http_echo? ( ${HTTP_ECHO_MODULE_URI} -> ${HTTP_ECHO_MODULE_P}.tar.gz )
1336 - nginx_modules_http_fancyindex? ( ${HTTP_FANCYINDEX_MODULE_URI} -> ${HTTP_FANCYINDEX_MODULE_P}.tar.gz )
1337 - nginx_modules_http_geoip2? ( ${GEOIP2_MODULE_URI} -> ${GEOIP2_MODULE_P}.tar.gz )
1338 - nginx_modules_http_headers_more? ( ${HTTP_HEADERS_MORE_MODULE_URI} -> ${HTTP_HEADERS_MORE_MODULE_P}.tar.gz )
1339 - nginx_modules_http_javascript? ( ${NJS_MODULE_URI} -> ${NJS_MODULE_P}.tar.gz )
1340 - nginx_modules_http_lua? ( ${HTTP_LUA_MODULE_URI} -> ${HTTP_LUA_MODULE_P}.tar.gz )
1341 - nginx_modules_http_memc? ( ${HTTP_MEMC_MODULE_URI} -> ${HTTP_MEMC_MODULE_P}.tar.gz )
1342 - nginx_modules_http_metrics? ( ${HTTP_METRICS_MODULE_URI} -> ${HTTP_METRICS_MODULE_P}.tar.gz )
1343 - nginx_modules_http_mogilefs? ( ${HTTP_MOGILEFS_MODULE_URI} -> ${HTTP_MOGILEFS_MODULE_P}.tar.gz )
1344 - nginx_modules_http_naxsi? ( ${HTTP_NAXSI_MODULE_URI} -> ${HTTP_NAXSI_MODULE_P}.tar.gz )
1345 - nginx_modules_http_push_stream? ( ${HTTP_PUSH_STREAM_MODULE_URI} -> ${HTTP_PUSH_STREAM_MODULE_P}.tar.gz )
1346 - nginx_modules_http_security? ( ${HTTP_SECURITY_MODULE_URI} -> ${HTTP_SECURITY_MODULE_P}.tar.gz )
1347 - nginx_modules_http_slowfs_cache? ( ${HTTP_SLOWFS_CACHE_MODULE_URI} -> ${HTTP_SLOWFS_CACHE_MODULE_P}.tar.gz )
1348 - nginx_modules_http_sticky? ( ${HTTP_STICKY_MODULE_URI} -> ${HTTP_STICKY_MODULE_P}.tar.bz2 )
1349 - nginx_modules_http_upload_progress? ( ${HTTP_UPLOAD_PROGRESS_MODULE_URI} -> ${HTTP_UPLOAD_PROGRESS_MODULE_P}.tar.gz )
1350 - nginx_modules_http_upstream_check? ( ${HTTP_UPSTREAM_CHECK_MODULE_URI} -> ${HTTP_UPSTREAM_CHECK_MODULE_P}.tar.gz )
1351 - nginx_modules_http_vhost_traffic_status? ( ${HTTP_VHOST_TRAFFIC_STATUS_MODULE_URI} -> ${HTTP_VHOST_TRAFFIC_STATUS_MODULE_P}.tar.gz )
1352 - nginx_modules_stream_geoip2? ( ${GEOIP2_MODULE_URI} -> ${GEOIP2_MODULE_P}.tar.gz )
1353 - nginx_modules_stream_javascript? ( ${NJS_MODULE_URI} -> ${NJS_MODULE_P}.tar.gz )
1354 - rtmp? ( ${RTMP_MODULE_URI} -> ${RTMP_MODULE_P}.tar.gz )"
1355 -
1356 -LICENSE="BSD-2 BSD SSLeay MIT GPL-2 GPL-2+
1357 - nginx_modules_http_security? ( Apache-2.0 )
1358 - nginx_modules_http_push_stream? ( GPL-3 )"
1359 -
1360 -SLOT="mainline"
1361 -KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
1362 -
1363 -# Package doesn't provide a real test suite
1364 -RESTRICT="test"
1365 -
1366 -NGINX_MODULES_STD="access auth_basic autoindex browser charset empty_gif
1367 - fastcgi geo grpc gzip limit_req limit_conn map memcached mirror
1368 - proxy referer rewrite scgi ssi split_clients upstream_hash
1369 - upstream_ip_hash upstream_keepalive upstream_least_conn
1370 - upstream_zone userid uwsgi"
1371 -NGINX_MODULES_OPT="addition auth_request dav degradation flv geoip gunzip
1372 - gzip_static image_filter mp4 perl random_index realip secure_link
1373 - slice stub_status sub xslt"
1374 -NGINX_MODULES_STREAM_STD="access geo limit_conn map return split_clients
1375 - upstream_hash upstream_least_conn upstream_zone"
1376 -NGINX_MODULES_STREAM_OPT="geoip realip ssl_preread"
1377 -NGINX_MODULES_MAIL="imap pop3 smtp"
1378 -NGINX_MODULES_3RD="
1379 - http_auth_ldap
1380 - http_auth_pam
1381 - http_brotli
1382 - http_cache_purge
1383 - http_dav_ext
1384 - http_echo
1385 - http_fancyindex
1386 - http_geoip2
1387 - http_headers_more
1388 - http_javascript
1389 - http_lua
1390 - http_memc
1391 - http_metrics
1392 - http_mogilefs
1393 - http_naxsi
1394 - http_push_stream
1395 - http_security
1396 - http_slowfs_cache
1397 - http_sticky
1398 - http_upload_progress
1399 - http_upstream_check
1400 - http_vhost_traffic_status
1401 - stream_geoip2
1402 - stream_javascript
1403 -"
1404 -
1405 -IUSE="aio debug +http +http2 +http-cache +ipv6 libatomic +pcre
1406 - pcre-jit rtmp selinux ssl threads userland_GNU vim-syntax"
1407 -
1408 -for mod in $NGINX_MODULES_STD; do
1409 - IUSE="${IUSE} +nginx_modules_http_${mod}"
1410 -done
1411 -
1412 -for mod in $NGINX_MODULES_OPT; do
1413 - IUSE="${IUSE} nginx_modules_http_${mod}"
1414 -done
1415 -
1416 -for mod in $NGINX_MODULES_STREAM_STD; do
1417 - IUSE="${IUSE} nginx_modules_stream_${mod}"
1418 -done
1419 -
1420 -for mod in $NGINX_MODULES_STREAM_OPT; do
1421 - IUSE="${IUSE} nginx_modules_stream_${mod}"
1422 -done
1423 -
1424 -for mod in $NGINX_MODULES_MAIL; do
1425 - IUSE="${IUSE} nginx_modules_mail_${mod}"
1426 -done
1427 -
1428 -for mod in $NGINX_MODULES_3RD; do
1429 - IUSE="${IUSE} nginx_modules_${mod}"
1430 -done
1431 -
1432 -# Add so we can warn users updating about config changes
1433 -# @TODO: jbergstroem: remove on next release series
1434 -IUSE="${IUSE} nginx_modules_http_spdy"
1435 -
1436 -CDEPEND="
1437 - pcre? ( dev-libs/libpcre:= )
1438 - pcre-jit? ( dev-libs/libpcre:=[jit] )
1439 - ssl? (
1440 - dev-libs/openssl:0=
1441 - )
1442 - http2? (
1443 - >=dev-libs/openssl-1.0.1c:0=
1444 - )
1445 - http-cache? (
1446 - userland_GNU? (
1447 - dev-libs/openssl:0=
1448 - )
1449 - )
1450 - nginx_modules_http_brotli? ( app-arch/brotli:= )
1451 - nginx_modules_http_geoip? ( dev-libs/geoip )
1452 - nginx_modules_http_geoip2? ( dev-libs/libmaxminddb:= )
1453 - nginx_modules_http_gunzip? ( sys-libs/zlib )
1454 - nginx_modules_http_gzip? ( sys-libs/zlib )
1455 - nginx_modules_http_gzip_static? ( sys-libs/zlib )
1456 - nginx_modules_http_image_filter? ( media-libs/gd:=[jpeg,png] )
1457 - nginx_modules_http_perl? ( >=dev-lang/perl-5.8:= )
1458 - nginx_modules_http_rewrite? ( dev-libs/libpcre:= )
1459 - nginx_modules_http_secure_link? (
1460 - userland_GNU? (
1461 - dev-libs/openssl:0=
1462 - )
1463 - )
1464 - nginx_modules_http_xslt? ( dev-libs/libxml2:= dev-libs/libxslt )
1465 - nginx_modules_http_lua? ( ${LUA_DEPS} )
1466 - nginx_modules_http_auth_pam? ( sys-libs/pam )
1467 - nginx_modules_http_metrics? ( dev-libs/yajl:= )
1468 - nginx_modules_http_dav_ext? ( dev-libs/libxml2 )
1469 - nginx_modules_http_security? (
1470 - dev-libs/apr:=
1471 - dev-libs/apr-util:=
1472 - dev-libs/libxml2:=
1473 - net-misc/curl
1474 - www-servers/apache
1475 - )
1476 - nginx_modules_http_auth_ldap? ( net-nds/openldap[ssl?] )
1477 - nginx_modules_stream_geoip? ( dev-libs/geoip )
1478 - nginx_modules_stream_geoip2? ( dev-libs/libmaxminddb:= )"
1479 -RDEPEND="${CDEPEND}
1480 - selinux? ( sec-policy/selinux-nginx )
1481 - !www-servers/nginx:0"
1482 -DEPEND="${CDEPEND}
1483 - arm? ( dev-libs/libatomic_ops )
1484 - libatomic? ( dev-libs/libatomic_ops )"
1485 -BDEPEND="nginx_modules_http_brotli? ( virtual/pkgconfig )
1486 - nginx_modules_http_security? ( ${AUTOTOOLS_DEPEND} )"
1487 -PDEPEND="vim-syntax? ( app-vim/nginx-syntax )"
1488 -
1489 -REQUIRED_USE="pcre-jit? ( pcre )
1490 - nginx_modules_http_fancyindex? ( nginx_modules_http_addition )
1491 - nginx_modules_http_grpc? ( http2 )
1492 - nginx_modules_http_lua? (
1493 - ${LUA_REQUIRED_USE}
1494 - nginx_modules_http_rewrite
1495 - )
1496 - nginx_modules_http_naxsi? ( pcre )
1497 - nginx_modules_http_dav_ext? ( nginx_modules_http_dav nginx_modules_http_xslt )
1498 - nginx_modules_http_metrics? ( nginx_modules_http_stub_status )
1499 - nginx_modules_http_security? ( pcre )
1500 - nginx_modules_http_push_stream? ( ssl )"
1501 -
1502 -pkg_setup() {
1503 - NGINX_HOME="/var/lib/nginx"
1504 - NGINX_HOME_TMP="${NGINX_HOME}/tmp"
1505 -
1506 - ebegin "Creating nginx user and group"
1507 - enewgroup ${PN}
1508 - enewuser ${PN} -1 -1 "${NGINX_HOME}" ${PN}
1509 - eend $?
1510 -
1511 - if use libatomic; then
1512 - ewarn "GCC 4.1+ features built-in atomic operations."
1513 - ewarn "Using libatomic_ops is only needed if using"
1514 - ewarn "a different compiler or a GCC prior to 4.1"
1515 - fi
1516 -
1517 - if [[ -n $NGINX_ADD_MODULES ]]; then
1518 - ewarn "You are building custom modules via \$NGINX_ADD_MODULES!"
1519 - ewarn "This nginx installation is not supported!"
1520 - ewarn "Make sure you can reproduce the bug without those modules"
1521 - ewarn "_before_ reporting bugs."
1522 - fi
1523 -
1524 - if use !http; then
1525 - ewarn "To actually disable all http-functionality you also have to disable"
1526 - ewarn "all nginx http modules."
1527 - fi
1528 -
1529 - if use nginx_modules_http_mogilefs && use threads; then
1530 - eerror "mogilefs won't compile with threads support."
1531 - eerror "Please disable either flag and try again."
1532 - die "Can't compile mogilefs with threads support"
1533 - fi
1534 -
1535 - use nginx_modules_http_lua && lua-single_pkg_setup
1536 -}
1537 -
1538 -src_prepare() {
1539 - eapply "${FILESDIR}/${PN}-1.4.1-fix-perl-install-path.patch"
1540 - eapply "${FILESDIR}/${PN}-httpoxy-mitigation-r1.patch"
1541 -
1542 - if use nginx_modules_http_brotli; then
1543 - cd "${HTTP_BROTLI_MODULE_WD}" || die
1544 - eapply "${FILESDIR}"/http_brotli-detect-brotli-r3.patch
1545 - cd "${S}" || die
1546 - fi
1547 -
1548 - if use nginx_modules_http_upstream_check; then
1549 - eapply -p0 "${FILESDIR}"/http_upstream_check-nginx-1.11.5+.patch
1550 - fi
1551 -
1552 - if use nginx_modules_http_cache_purge; then
1553 - cd "${HTTP_CACHE_PURGE_MODULE_WD}" || die
1554 - eapply "${FILESDIR}"/http_cache_purge-1.11.6+.patch
1555 - cd "${S}" || die
1556 - fi
1557 -
1558 - if use nginx_modules_http_security; then
1559 - cd "${HTTP_SECURITY_MODULE_WD}" || die
1560 -
1561 - eautoreconf
1562 -
1563 - if use nginx_modules_http_lua; then
1564 - sed -i \
1565 - -e "s|^\(LUA_PKGNAMES\)=.*|\1=\"${ELUA}\"|" \
1566 - configure || die
1567 - fi
1568 -
1569 - cd "${S}" || die
1570 - fi
1571 -
1572 - if use nginx_modules_http_upload_progress; then
1573 - cd "${HTTP_UPLOAD_PROGRESS_MODULE_WD}" || die
1574 - eapply "${FILESDIR}"/http_uploadprogress-issue_50-r1.patch
1575 - cd "${S}" || die
1576 - fi
1577 -
1578 - find auto/ -type f -print0 | xargs -0 sed -i 's:\&\& make:\&\& \\$(MAKE):' || die
1579 - # We have config protection, don't rename etc files
1580 - sed -i 's:.default::' auto/install || die
1581 - # remove useless files
1582 - sed -i -e '/koi-/d' -e '/win-/d' auto/install || die
1583 -
1584 - # don't install to /etc/nginx/ if not in use
1585 - local module
1586 - for module in fastcgi scgi uwsgi ; do
1587 - if ! use nginx_modules_http_${module}; then
1588 - sed -i -e "/${module}/d" auto/install || die
1589 - fi
1590 - done
1591 -
1592 - eapply_user
1593 -}
1594 -
1595 -src_configure() {
1596 - # mod_security needs to generate nginx/modsecurity/config before including it
1597 - if use nginx_modules_http_security; then
1598 - cd "${HTTP_SECURITY_MODULE_WD}" || die
1599 -
1600 - ./configure \
1601 - --enable-standalone-module \
1602 - --disable-mlogc \
1603 - --with-ssdeep=no \
1604 - $(use_enable pcre-jit) \
1605 - $(use_with nginx_modules_http_lua lua) || die "configure failed for mod_security"
1606 -
1607 - cd "${S}" || die
1608 - fi
1609 -
1610 - local myconf=() http_enabled= mail_enabled= stream_enabled=
1611 -
1612 - use aio && myconf+=( --with-file-aio )
1613 - use debug && myconf+=( --with-debug )
1614 - use http2 && myconf+=( --with-http_v2_module )
1615 - use libatomic && myconf+=( --with-libatomic )
1616 - use pcre && myconf+=( --with-pcre )
1617 - use pcre-jit && myconf+=( --with-pcre-jit )
1618 - use threads && myconf+=( --with-threads )
1619 -
1620 - # HTTP modules
1621 - for mod in $NGINX_MODULES_STD; do
1622 - if use nginx_modules_http_${mod}; then
1623 - http_enabled=1
1624 - else
1625 - myconf+=( --without-http_${mod}_module )
1626 - fi
1627 - done
1628 -
1629 - for mod in $NGINX_MODULES_OPT; do
1630 - if use nginx_modules_http_${mod}; then
1631 - http_enabled=1
1632 - myconf+=( --with-http_${mod}_module )
1633 - fi
1634 - done
1635 -
1636 - if use nginx_modules_http_fastcgi; then
1637 - myconf+=( --with-http_realip_module )
1638 - fi
1639 -
1640 - # third-party modules
1641 - if use nginx_modules_http_upload_progress; then
1642 - http_enabled=1
1643 - myconf+=( --add-module=${HTTP_UPLOAD_PROGRESS_MODULE_WD} )
1644 - fi
1645 -
1646 - if use nginx_modules_http_headers_more; then
1647 - http_enabled=1
1648 - myconf+=( --add-module=${HTTP_HEADERS_MORE_MODULE_WD} )
1649 - fi
1650 -
1651 - if use nginx_modules_http_cache_purge; then
1652 - http_enabled=1
1653 - myconf+=( --add-module=${HTTP_CACHE_PURGE_MODULE_WD} )
1654 - fi
1655 -
1656 - if use nginx_modules_http_slowfs_cache; then
1657 - http_enabled=1
1658 - myconf+=( --add-module=${HTTP_SLOWFS_CACHE_MODULE_WD} )
1659 - fi
1660 -
1661 - if use nginx_modules_http_fancyindex; then
1662 - http_enabled=1
1663 - myconf+=( --add-module=${HTTP_FANCYINDEX_MODULE_WD} )
1664 - fi
1665 -
1666 - if use nginx_modules_http_lua; then
1667 - http_enabled=1
1668 - export LUAJIT_LIB=$(dirname $(lua_get_shared_lib))
1669 - export LUAJIT_INC=$(lua_get_include_dir)
1670 - myconf+=( --add-module=${DEVEL_KIT_MODULE_WD} )
1671 - myconf+=( --add-module=${HTTP_LUA_MODULE_WD} )
1672 - fi
1673 -
1674 - if use nginx_modules_http_auth_pam; then
1675 - http_enabled=1
1676 - myconf+=( --add-module=${HTTP_AUTH_PAM_MODULE_WD} )
1677 - fi
1678 -
1679 - if use nginx_modules_http_upstream_check; then
1680 - http_enabled=1
1681 - myconf+=( --add-module=${HTTP_UPSTREAM_CHECK_MODULE_WD} )
1682 - fi
1683 -
1684 - if use nginx_modules_http_metrics; then
1685 - http_enabled=1
1686 - myconf+=( --add-module=${HTTP_METRICS_MODULE_WD} )
1687 - fi
1688 -
1689 - if use nginx_modules_http_naxsi ; then
1690 - http_enabled=1
1691 - myconf+=( --add-module=${HTTP_NAXSI_MODULE_WD} )
1692 - fi
1693 -
1694 - if use rtmp ; then
1695 - http_enabled=1
1696 - myconf+=( --add-module=${RTMP_MODULE_WD} )
1697 - fi
1698 -
1699 - if use nginx_modules_http_dav_ext ; then
1700 - http_enabled=1
1701 - myconf+=( --add-module=${HTTP_DAV_EXT_MODULE_WD} )
1702 - fi
1703 -
1704 - if use nginx_modules_http_echo ; then
1705 - http_enabled=1
1706 - myconf+=( --add-module=${HTTP_ECHO_MODULE_WD} )
1707 - fi
1708 -
1709 - if use nginx_modules_http_security ; then
1710 - http_enabled=1
1711 - myconf+=( --add-module=${HTTP_SECURITY_MODULE_WD}/nginx/modsecurity )
1712 - fi
1713 -
1714 - if use nginx_modules_http_push_stream ; then
1715 - http_enabled=1
1716 - myconf+=( --add-module=${HTTP_PUSH_STREAM_MODULE_WD} )
1717 - fi
1718 -
1719 - if use nginx_modules_http_sticky ; then
1720 - http_enabled=1
1721 - myconf+=( --add-module=${HTTP_STICKY_MODULE_WD} )
1722 - fi
1723 -
1724 - if use nginx_modules_http_mogilefs ; then
1725 - http_enabled=1
1726 - myconf+=( --add-module=${HTTP_MOGILEFS_MODULE_WD} )
1727 - fi
1728 -
1729 - if use nginx_modules_http_memc ; then
1730 - http_enabled=1
1731 - myconf+=( --add-module=${HTTP_MEMC_MODULE_WD} )
1732 - fi
1733 -
1734 - if use nginx_modules_http_auth_ldap; then
1735 - http_enabled=1
1736 - myconf+=( --add-module=${HTTP_LDAP_MODULE_WD} )
1737 - fi
1738 -
1739 - if use nginx_modules_http_vhost_traffic_status; then
1740 - http_enabled=1
1741 - myconf+=( --add-module=${HTTP_VHOST_TRAFFIC_STATUS_MODULE_WD} )
1742 - fi
1743 -
1744 - if use nginx_modules_http_geoip2 || use nginx_modules_stream_geoip2; then
1745 - myconf+=( --add-module=${GEOIP2_MODULE_WD} )
1746 - fi
1747 -
1748 - if use nginx_modules_http_javascript || use nginx_modules_stream_javascript; then
1749 - myconf+=( --add-module="${NJS_MODULE_WD}/nginx" )
1750 - fi
1751 -
1752 - if use nginx_modules_http_brotli; then
1753 - http_enabled=1
1754 - myconf+=( --add-module=${HTTP_BROTLI_MODULE_WD} )
1755 - fi
1756 -
1757 - if use http || use http-cache || use http2 || use nginx_modules_http_javascript; then
1758 - http_enabled=1
1759 - fi
1760 -
1761 - if [ $http_enabled ]; then
1762 - use http-cache || myconf+=( --without-http-cache )
1763 - use ssl && myconf+=( --with-http_ssl_module )
1764 - else
1765 - myconf+=( --without-http --without-http-cache )
1766 - fi
1767 -
1768 - # Stream modules
1769 - for mod in $NGINX_MODULES_STREAM_STD; do
1770 - if use nginx_modules_stream_${mod}; then
1771 - stream_enabled=1
1772 - else
1773 - myconf+=( --without-stream_${mod}_module )
1774 - fi
1775 - done
1776 -
1777 - for mod in $NGINX_MODULES_STREAM_OPT; do
1778 - if use nginx_modules_stream_${mod}; then
1779 - stream_enabled=1
1780 - myconf+=( --with-stream_${mod}_module )
1781 - fi
1782 - done
1783 -
1784 - if use nginx_modules_stream_geoip2 || use nginx_modules_stream_javascript; then
1785 - stream_enabled=1
1786 - fi
1787 -
1788 - if [ $stream_enabled ]; then
1789 - myconf+=( --with-stream )
1790 - use ssl && myconf+=( --with-stream_ssl_module )
1791 - fi
1792 -
1793 - # MAIL modules
1794 - for mod in $NGINX_MODULES_MAIL; do
1795 - if use nginx_modules_mail_${mod}; then
1796 - mail_enabled=1
1797 - else
1798 - myconf+=( --without-mail_${mod}_module )
1799 - fi
1800 - done
1801 -
1802 - if [ $mail_enabled ]; then
1803 - myconf+=( --with-mail )
1804 - use ssl && myconf+=( --with-mail_ssl_module )
1805 - fi
1806 -
1807 - # custom modules
1808 - for mod in $NGINX_ADD_MODULES; do
1809 - myconf+=( --add-module=${mod} )
1810 - done
1811 -
1812 - # https://bugs.gentoo.org/286772
1813 - export LANG=C LC_ALL=C
1814 - tc-export AR CC
1815 -
1816 - if ! use prefix; then
1817 - myconf+=( --user=${PN} )
1818 - myconf+=( --group=${PN} )
1819 - fi
1820 -
1821 - local WITHOUT_IPV6=
1822 - if ! use ipv6; then
1823 - WITHOUT_IPV6=" -DNGX_HAVE_INET6=0"
1824 - fi
1825 -
1826 - if [[ -n "${EXTRA_ECONF}" ]]; then
1827 - myconf+=( ${EXTRA_ECONF} )
1828 - ewarn "EXTRA_ECONF applied. Now you are on your own, good luck!"
1829 - fi
1830 -
1831 - ./configure \
1832 - --prefix="${EPREFIX}"/usr \
1833 - --conf-path="${EPREFIX}"/etc/${PN}/${PN}.conf \
1834 - --error-log-path="${EPREFIX}"/var/log/${PN}/error_log \
1835 - --pid-path="${EPREFIX}"/run/${PN}.pid \
1836 - --lock-path="${EPREFIX}"/run/lock/${PN}.lock \
1837 - --with-cc-opt="-I${ESYSROOT}/usr/include${WITHOUT_IPV6}" \
1838 - --with-ld-opt="-L${ESYSROOT}/usr/$(get_libdir)" \
1839 - --http-log-path="${EPREFIX}"/var/log/${PN}/access_log \
1840 - --http-client-body-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/client \
1841 - --http-proxy-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/proxy \
1842 - --http-fastcgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/fastcgi \
1843 - --http-scgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/scgi \
1844 - --http-uwsgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/uwsgi \
1845 - --with-compat \
1846 - "${myconf[@]}" || die "configure failed"
1847 -
1848 - # A purely cosmetic change that makes nginx -V more readable. This can be
1849 - # good if people outside the gentoo community would troubleshoot and
1850 - # question the users setup.
1851 - sed -i -e "s|${WORKDIR}|external_module|g" objs/ngx_auto_config.h || die
1852 -}
1853 -
1854 -src_compile() {
1855 - use nginx_modules_http_security && emake -C "${HTTP_SECURITY_MODULE_WD}"
1856 -
1857 - # https://bugs.gentoo.org/286772
1858 - export LANG=C LC_ALL=C
1859 - emake LINK="${CC} ${LDFLAGS}" OTHERLDFLAGS="${LDFLAGS}"
1860 -}
1861 -
1862 -src_install() {
1863 - emake DESTDIR="${D}" install
1864 -
1865 - cp "${FILESDIR}"/nginx.conf-r2 "${ED}"/etc/nginx/nginx.conf || die
1866 -
1867 - newinitd "${FILESDIR}"/nginx.initd-r4 nginx
1868 - newconfd "${FILESDIR}"/nginx.confd nginx
1869 -
1870 - systemd_newunit "${FILESDIR}"/nginx.service-r1 nginx.service
1871 -
1872 - doman man/nginx.8
1873 - dodoc CHANGES* README
1874 -
1875 - # just keepdir. do not copy the default htdocs files (bug #449136)
1876 - keepdir /var/www/localhost
1877 - rm -rf "${ED}"/usr/html || die
1878 -
1879 - # set up a list of directories to keep
1880 - local keepdir_list="${NGINX_HOME_TMP}"/client
1881 - local module
1882 - for module in proxy fastcgi scgi uwsgi; do
1883 - use nginx_modules_http_${module} && keepdir_list+=" ${NGINX_HOME_TMP}/${module}"
1884 - done
1885 -
1886 - keepdir /var/log/nginx ${keepdir_list}
1887 -
1888 - # this solves a problem with SELinux where nginx doesn't see the directories
1889 - # as root and tries to create them as nginx
1890 - fperms 0750 "${NGINX_HOME_TMP}"
1891 - fowners ${PN}:0 "${NGINX_HOME_TMP}"
1892 -
1893 - fperms 0700 ${keepdir_list}
1894 - fowners ${PN}:${PN} ${keepdir_list}
1895 -
1896 - fperms 0710 /var/log/nginx
1897 - fowners 0:${PN} /var/log/nginx
1898 -
1899 - # logrotate
1900 - insinto /etc/logrotate.d
1901 - newins "${FILESDIR}"/nginx.logrotate-r1 nginx
1902 -
1903 - # Don't create /run
1904 - rm -rf "${ED}"/run || die
1905 -
1906 - if use lua_single_target_luajit; then
1907 - pax-mark m "${ED}/usr/sbin/nginx"
1908 - fi
1909 -
1910 - if use nginx_modules_http_perl; then
1911 - cd "${S}"/objs/src/http/modules/perl/ || die
1912 - emake DESTDIR="${D}" INSTALLDIRS=vendor
1913 - perl_delete_localpod
1914 - cd "${S}" || die
1915 - fi
1916 -
1917 - if use nginx_modules_http_cache_purge; then
1918 - docinto ${HTTP_CACHE_PURGE_MODULE_P}
1919 - dodoc "${HTTP_CACHE_PURGE_MODULE_WD}"/{CHANGES,README.md,TODO.md}
1920 - fi
1921 -
1922 - if use nginx_modules_http_slowfs_cache; then
1923 - docinto ${HTTP_SLOWFS_CACHE_MODULE_P}
1924 - dodoc "${HTTP_SLOWFS_CACHE_MODULE_WD}"/{CHANGES,README.md}
1925 - fi
1926 -
1927 - if use nginx_modules_http_fancyindex; then
1928 - docinto ${HTTP_FANCYINDEX_MODULE_P}
1929 - dodoc "${HTTP_FANCYINDEX_MODULE_WD}"/README.rst
1930 - fi
1931 -
1932 - if use nginx_modules_http_lua; then
1933 - docinto ${HTTP_LUA_MODULE_P}
1934 - dodoc "${HTTP_LUA_MODULE_WD}"/README.markdown
1935 - fi
1936 -
1937 - if use nginx_modules_http_auth_pam; then
1938 - docinto ${HTTP_AUTH_PAM_MODULE_P}
1939 - dodoc "${HTTP_AUTH_PAM_MODULE_WD}"/{README.md,ChangeLog}
1940 - fi
1941 -
1942 - if use nginx_modules_http_upstream_check; then
1943 - docinto ${HTTP_UPSTREAM_CHECK_MODULE_P}
1944 - dodoc "${HTTP_UPSTREAM_CHECK_MODULE_WD}"/{README,CHANGES}
1945 - fi
1946 -
1947 - if use nginx_modules_http_naxsi; then
1948 - insinto /etc/nginx
1949 - doins "${HTTP_NAXSI_MODULE_WD}"/../naxsi_config/naxsi_core.rules
1950 - fi
1951 -
1952 - if use rtmp; then
1953 - docinto ${RTMP_MODULE_P}
1954 - dodoc "${RTMP_MODULE_WD}"/{AUTHORS,README.md,stat.xsl}
1955 - fi
1956 -
1957 - if use nginx_modules_http_dav_ext; then
1958 - docinto ${HTTP_DAV_EXT_MODULE_P}
1959 - dodoc "${HTTP_DAV_EXT_MODULE_WD}"/README.rst
1960 - fi
1961 -
1962 - if use nginx_modules_http_echo; then
1963 - docinto ${HTTP_ECHO_MODULE_P}
1964 - dodoc "${HTTP_ECHO_MODULE_WD}"/README.markdown
1965 - fi
1966 -
1967 - if use nginx_modules_http_security; then
1968 - docinto ${HTTP_SECURITY_MODULE_P}
1969 - dodoc "${HTTP_SECURITY_MODULE_WD}"/{CHANGES,README.md,authors.txt}
1970 - fi
1971 -
1972 - if use nginx_modules_http_push_stream; then
1973 - docinto ${HTTP_PUSH_STREAM_MODULE_P}
1974 - dodoc "${HTTP_PUSH_STREAM_MODULE_WD}"/{AUTHORS,CHANGELOG.textile,README.textile}
1975 - fi
1976 -
1977 - if use nginx_modules_http_sticky; then
1978 - docinto ${HTTP_STICKY_MODULE_P}
1979 - dodoc "${HTTP_STICKY_MODULE_WD}"/{README.md,Changelog.txt,docs/sticky.pdf}
1980 - fi
1981 -
1982 - if use nginx_modules_http_memc; then
1983 - docinto ${HTTP_MEMC_MODULE_P}
1984 - dodoc "${HTTP_MEMC_MODULE_WD}"/README.markdown
1985 - fi
1986 -
1987 - if use nginx_modules_http_auth_ldap; then
1988 - docinto ${HTTP_LDAP_MODULE_P}
1989 - dodoc "${HTTP_LDAP_MODULE_WD}"/example.conf
1990 - fi
1991 -}
1992 -
1993 -pkg_postinst() {
1994 - if use ssl; then
1995 - if [[ ! -f "${EROOT}"/etc/ssl/${PN}/${PN}.key ]]; then
1996 - install_cert /etc/ssl/${PN}/${PN}
1997 - use prefix || chown ${PN}:${PN} "${EROOT}"/etc/ssl/${PN}/${PN}.{crt,csr,key,pem}
1998 - fi
1999 - fi
2000 -
2001 - if use nginx_modules_http_spdy; then
2002 - ewarn ""
2003 - ewarn "In nginx 1.9.5 the spdy module was superseded by http2."
2004 - ewarn "Update your configs and package.use accordingly."
2005 - fi
2006 -
2007 - if use nginx_modules_http_lua; then
2008 - ewarn ""
2009 - ewarn "While you can build lua 3rd party module against ${P}"
2010 - ewarn "the author warns that >=${PN}-1.11.11 is still not an"
2011 - ewarn "officially supported target yet. You are on your own."
2012 - ewarn "Expect runtime failures, memory leaks and other problems!"
2013 - fi
2014 -
2015 - if use nginx_modules_http_lua && use http2; then
2016 - ewarn ""
2017 - ewarn "Lua 3rd party module author warns against using ${P} with"
2018 - ewarn "NGINX_MODULES_HTTP=\"lua http2\". For more info, see https://git.io/OldLsg"
2019 - fi
2020 -
2021 - local _n_permission_layout_checks=0
2022 - local _has_to_adjust_permissions=0
2023 - local _has_to_show_permission_warning=0
2024 -
2025 - # Defaults to 1 to inform people doing a fresh installation
2026 - # that we ship modified {scgi,uwsgi,fastcgi}_params files
2027 - local _has_to_show_httpoxy_mitigation_notice=1
2028 -
2029 - local _replacing_version=
2030 - for _replacing_version in ${REPLACING_VERSIONS}; do
2031 - _n_permission_layout_checks=$((${_n_permission_layout_checks}+1))
2032 -
2033 - if [[ ${_n_permission_layout_checks} -gt 1 ]]; then
2034 - # Should never happen:
2035 - # Package is abusing slots but doesn't allow multiple parallel installations.
2036 - # If we run into this situation it is unsafe to automatically adjust any
2037 - # permission...
2038 - _has_to_show_permission_warning=1
2039 -
2040 - ewarn "Replacing multiple ${PN}' versions is unsupported! " \
2041 - "You will have to adjust permissions on your own."
2042 -
2043 - break
2044 - fi
2045 -
2046 - local _replacing_version_branch=$(ver_cut 1-2 "${_replacing_version}")
2047 - debug-print "Updating an existing installation (v${_replacing_version}; branch '${_replacing_version_branch}') ..."
2048 -
2049 - # Do we need to adjust permissions to fix CVE-2013-0337 (bug #458726, #469094)?
2050 - # This was before we introduced multiple nginx versions so we
2051 - # do not need to distinguish between stable and mainline
2052 - local _need_to_fix_CVE2013_0337=1
2053 -
2054 - if ver_test ${_replacing_version} -ge 1.4.1-r2; then
2055 - # We are updating an installation which should already be fixed
2056 - _need_to_fix_CVE2013_0337=0
2057 - debug-print "Skipping CVE-2013-0337 ... existing installation should not be affected!"
2058 - else
2059 - _has_to_adjust_permissions=1
2060 - debug-print "Need to adjust permissions to fix CVE-2013-0337!"
2061 - fi
2062 -
2063 - # Do we need to inform about HTTPoxy mitigation?
2064 - # In repository since commit 8be44f76d4ac02cebcd1e0e6e6284bb72d054b0f
2065 - if ver_test ${_replacing_version_branch} -lt 1.10; then
2066 - # Updating from <1.10
2067 - _has_to_show_httpoxy_mitigation_notice=1
2068 - debug-print "Need to inform about HTTPoxy mitigation!"
2069 - else
2070 - # Updating from >=1.10
2071 - local _fixed_in_pvr=
2072 - case "${_replacing_version_branch}" in
2073 - "1.10")
2074 - _fixed_in_pvr="1.10.1-r2"
2075 - ;;
2076 - "1.11")
2077 - _fixed_in_pvr="1.11.3-r1"
2078 - ;;
2079 - *)
2080 - # This should be any future branch.
2081 - # If we run this code it is safe to assume that the user has
2082 - # already seen the HTTPoxy mitigation notice because he/she is doing
2083 - # an update from previous version where we have already shown
2084 - # the warning. Otherwise, we wouldn't hit this code path ...
2085 - _fixed_in_pvr=
2086 - esac
2087 -
2088 - if [[ -z "${_fixed_in_pvr}" ]] || ver_test ${_replacing_version} -ge ${_fixed_in_pvr}; then
2089 - # We are updating an installation where we already informed
2090 - # that we are mitigating HTTPoxy per default
2091 - _has_to_show_httpoxy_mitigation_notice=0
2092 - debug-print "No need to inform about HTTPoxy mitigation ... information was already shown for existing installation!"
2093 - else
2094 - _has_to_show_httpoxy_mitigation_notice=1
2095 - debug-print "Need to inform about HTTPoxy mitigation!"
2096 - fi
2097 - fi
2098 -
2099 - # Do we need to adjust permissions to fix CVE-2016-1247 (bug #605008)?
2100 - # All branches up to 1.11 are affected
2101 - local _need_to_fix_CVE2016_1247=1
2102 -
2103 - if ver_test ${_replacing_version_branch} -lt 1.10; then
2104 - # Updating from <1.10
2105 - _has_to_adjust_permissions=1
2106 - debug-print "Need to adjust permissions to fix CVE-2016-1247!"
2107 - else
2108 - # Updating from >=1.10
2109 - local _fixed_in_pvr=
2110 - case "${_replacing_version_branch}" in
2111 - "1.10")
2112 - _fixed_in_pvr="1.10.2-r3"
2113 - ;;
2114 - "1.11")
2115 - _fixed_in_pvr="1.11.6-r1"
2116 - ;;
2117 - *)
2118 - # This should be any future branch.
2119 - # If we run this code it is safe to assume that we have already
2120 - # adjusted permissions or were never affected because user is
2121 - # doing an update from previous version which was safe or did
2122 - # the adjustments. Otherwise, we wouldn't hit this code path ...
2123 - _fixed_in_pvr=
2124 - esac
2125 -
2126 - if [[ -z "${_fixed_in_pvr}" ]] || ver_test ${_replacing_version} -ge ${_fixed_in_pvr}; then
2127 - # We are updating an installation which should already be adjusted
2128 - # or which was never affected
2129 - _need_to_fix_CVE2016_1247=0
2130 - debug-print "Skipping CVE-2016-1247 ... existing installation should not be affected!"
2131 - else
2132 - _has_to_adjust_permissions=1
2133 - debug-print "Need to adjust permissions to fix CVE-2016-1247!"
2134 - fi
2135 - fi
2136 - done
2137 -
2138 - if [[ ${_has_to_adjust_permissions} -eq 1 ]]; then
2139 - # We do not DIE when chmod/chown commands are failing because
2140 - # package is already merged on user's system at this stage
2141 - # and we cannot retry without losing the information that
2142 - # the existing installation needs to adjust permissions.
2143 - # Instead we are going to a show a big warning ...
2144 -
2145 - if [[ ${_has_to_show_permission_warning} -eq 0 ]] && [[ ${_need_to_fix_CVE2013_0337} -eq 1 ]]; then
2146 - ewarn ""
2147 - ewarn "The world-readable bit (if set) has been removed from the"
2148 - ewarn "following directories to mitigate a security bug"
2149 - ewarn "(CVE-2013-0337, bug #458726):"
2150 - ewarn ""
2151 - ewarn " ${EPREFIX}/var/log/nginx"
2152 - ewarn " ${EPREFIX}${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi}"
2153 - ewarn ""
2154 - ewarn "Check if this is correct for your setup before restarting nginx!"
2155 - ewarn "This is a one-time change and will not happen on subsequent updates."
2156 - ewarn "Furthermore nginx' temp directories got moved to '${EPREFIX}${NGINX_HOME_TMP}'"
2157 - chmod o-rwx \
2158 - "${EPREFIX}"/var/log/nginx \
2159 - "${EPREFIX}"${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi} || \
2160 - _has_to_show_permission_warning=1
2161 - fi
2162 -
2163 - if [[ ${_has_to_show_permission_warning} -eq 0 ]] && [[ ${_need_to_fix_CVE2016_1247} -eq 1 ]]; then
2164 - ewarn ""
2165 - ewarn "The permissions on the following directory have been reset in"
2166 - ewarn "order to mitigate a security bug (CVE-2016-1247, bug #605008):"
2167 - ewarn ""
2168 - ewarn " ${EPREFIX}/var/log/nginx"
2169 - ewarn ""
2170 - ewarn "Check if this is correct for your setup before restarting nginx!"
2171 - ewarn "Also ensure that no other log directory used by any of your"
2172 - ewarn "vhost(s) is not writeable for nginx user. Any of your log files"
2173 - ewarn "used by nginx can be abused to escalate privileges!"
2174 - ewarn "This is a one-time change and will not happen on subsequent updates."
2175 - chown 0:nginx "${EPREFIX}"/var/log/nginx || _has_to_show_permission_warning=1
2176 - chmod 710 "${EPREFIX}"/var/log/nginx || _has_to_show_permission_warning=1
2177 - fi
2178 -
2179 - if [[ ${_has_to_show_permission_warning} -eq 1 ]]; then
2180 - # Should never happen ...
2181 - ewarn ""
2182 - ewarn "*************************************************************"
2183 - ewarn "*************** W A R N I N G ***************"
2184 - ewarn "*************************************************************"
2185 - ewarn "The one-time only attempt to adjust permissions of the"
2186 - ewarn "existing nginx installation failed. Be aware that we will not"
2187 - ewarn "try to adjust the same permissions again because now you are"
2188 - ewarn "using a nginx version where we expect that the permissions"
2189 - ewarn "are already adjusted or that you know what you are doing and"
2190 - ewarn "want to keep custom permissions."
2191 - ewarn ""
2192 - fi
2193 - fi
2194 -
2195 - # Sanity check for CVE-2016-1247
2196 - # Required to warn users who received the warning above and thought
2197 - # they could fix it by unmerging and re-merging the package or have
2198 - # unmerged a affected installation on purpose in the past leaving
2199 - # /var/log/nginx on their system due to keepdir/non-empty folder
2200 - # and are now installing the package again.
2201 - local _sanity_check_testfile=$(mktemp --dry-run "${EPREFIX}"/var/log/nginx/.CVE-2016-1247.XXXXXXXXX)
2202 - su -s /bin/sh -c "touch ${_sanity_check_testfile}" nginx >&/dev/null
2203 - if [ $? -eq 0 ] ; then
2204 - # Cleanup -- no reason to die here!
2205 - rm -f "${_sanity_check_testfile}"
2206 -
2207 - ewarn ""
2208 - ewarn "*************************************************************"
2209 - ewarn "*************** W A R N I N G ***************"
2210 - ewarn "*************************************************************"
2211 - ewarn "Looks like your installation is vulnerable to CVE-2016-1247"
2212 - ewarn "(bug #605008) because nginx user is able to create files in"
2213 - ewarn ""
2214 - ewarn " ${EPREFIX}/var/log/nginx"
2215 - ewarn ""
2216 - ewarn "Also ensure that no other log directory used by any of your"
2217 - ewarn "vhost(s) is not writeable for nginx user. Any of your log files"
2218 - ewarn "used by nginx can be abused to escalate privileges!"
2219 - fi
2220 -
2221 - if [[ ${_has_to_show_httpoxy_mitigation_notice} -eq 1 ]]; then
2222 - # HTTPoxy mitigation
2223 - ewarn ""
2224 - ewarn "This nginx installation comes with a mitigation for the HTTPoxy"
2225 - ewarn "vulnerability for FastCGI, SCGI and uWSGI applications by setting"
2226 - ewarn "the HTTP_PROXY parameter to an empty string per default when you"
2227 - ewarn "are sourcing one of the default"
2228 - ewarn ""
2229 - ewarn " - 'fastcgi_params' or 'fastcgi.conf'"
2230 - ewarn " - 'scgi_params'"
2231 - ewarn " - 'uwsgi_params'"
2232 - ewarn ""
2233 - ewarn "files in your server block(s)."
2234 - ewarn ""
2235 - ewarn "If this is causing any problems for you make sure that you are sourcing the"
2236 - ewarn "default parameters _before_ you set your own values."
2237 - ewarn "If you are relying on user-supplied proxy values you have to remove the"
2238 - ewarn "correlating lines from the file(s) mentioned above."
2239 - ewarn ""
2240 - fi
2241 -}
2242
2243 diff --git a/www-servers/nginx/nginx-1.19.9.ebuild b/www-servers/nginx/nginx-1.19.9.ebuild
2244 deleted file mode 100644
2245 index 1cdf07062df..00000000000
2246 --- a/www-servers/nginx/nginx-1.19.9.ebuild
2247 +++ /dev/null
2248 @@ -1,1086 +0,0 @@
2249 -# Copyright 1999-2021 Gentoo Authors
2250 -# Distributed under the terms of the GNU General Public License v2
2251 -
2252 -EAPI=7
2253 -
2254 -# Maintainer notes:
2255 -# - http_rewrite-independent pcre-support makes sense for matching locations without an actual rewrite
2256 -# - any http-module activates the main http-functionality and overrides USE=-http
2257 -# - keep the following requirements in mind before adding external modules:
2258 -# * alive upstream
2259 -# * sane packaging
2260 -# * builds cleanly
2261 -# * does not need a patch for nginx core
2262 -# - TODO: test the google-perftools module (included in vanilla tarball)
2263 -
2264 -# prevent perl-module from adding automagic perl DEPENDs
2265 -GENTOO_DEPEND_ON_PERL="no"
2266 -
2267 -# devel_kit (https://github.com/simpl/ngx_devel_kit, BSD license)
2268 -DEVEL_KIT_MODULE_PV="0.3.1"
2269 -DEVEL_KIT_MODULE_P="ngx_devel_kit-${DEVEL_KIT_MODULE_PV}"
2270 -DEVEL_KIT_MODULE_URI="https://github.com/simpl/ngx_devel_kit/archive/v${DEVEL_KIT_MODULE_PV}.tar.gz"
2271 -DEVEL_KIT_MODULE_WD="${WORKDIR}/ngx_devel_kit-${DEVEL_KIT_MODULE_PV}"
2272 -
2273 -# ngx_brotli (https://github.com/google/ngx_brotli, BSD-2)
2274 -HTTP_BROTLI_MODULE_PV="1.0.0rc"
2275 -HTTP_BROTLI_MODULE_P="ngx_brotli-${HTTP_BROTLI_MODULE_PV}"
2276 -HTTP_BROTLI_MODULE_URI="https://github.com/google/ngx_brotli/archive/v${HTTP_BROTLI_MODULE_PV}.tar.gz"
2277 -HTTP_BROTLI_MODULE_WD="${WORKDIR}/ngx_brotli-${HTTP_BROTLI_MODULE_PV}"
2278 -
2279 -# http_uploadprogress (https://github.com/masterzen/nginx-upload-progress-module, BSD-2 license)
2280 -HTTP_UPLOAD_PROGRESS_MODULE_PV="0.9.2"
2281 -HTTP_UPLOAD_PROGRESS_MODULE_P="ngx_http_upload_progress-${HTTP_UPLOAD_PROGRESS_MODULE_PV}-r1"
2282 -HTTP_UPLOAD_PROGRESS_MODULE_URI="https://github.com/masterzen/nginx-upload-progress-module/archive/v${HTTP_UPLOAD_PROGRESS_MODULE_PV}.tar.gz"
2283 -HTTP_UPLOAD_PROGRESS_MODULE_WD="${WORKDIR}/nginx-upload-progress-module-${HTTP_UPLOAD_PROGRESS_MODULE_PV}"
2284 -
2285 -# http_headers_more (https://github.com/agentzh/headers-more-nginx-module, BSD license)
2286 -HTTP_HEADERS_MORE_MODULE_PV="0.33"
2287 -HTTP_HEADERS_MORE_MODULE_P="ngx_http_headers_more-${HTTP_HEADERS_MORE_MODULE_PV}"
2288 -HTTP_HEADERS_MORE_MODULE_URI="https://github.com/agentzh/headers-more-nginx-module/archive/v${HTTP_HEADERS_MORE_MODULE_PV}.tar.gz"
2289 -HTTP_HEADERS_MORE_MODULE_WD="${WORKDIR}/headers-more-nginx-module-${HTTP_HEADERS_MORE_MODULE_PV}"
2290 -
2291 -# http_cache_purge (http://labs.frickle.com/nginx_ngx_cache_purge/, https://github.com/FRiCKLE/ngx_cache_purge, BSD-2 license)
2292 -HTTP_CACHE_PURGE_MODULE_PV="2.3"
2293 -HTTP_CACHE_PURGE_MODULE_P="ngx_http_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}"
2294 -HTTP_CACHE_PURGE_MODULE_URI="http://labs.frickle.com/files/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}.tar.gz"
2295 -HTTP_CACHE_PURGE_MODULE_WD="${WORKDIR}/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}"
2296 -
2297 -# http_slowfs_cache (http://labs.frickle.com/nginx_ngx_slowfs_cache/, BSD-2 license)
2298 -HTTP_SLOWFS_CACHE_MODULE_PV="1.10"
2299 -HTTP_SLOWFS_CACHE_MODULE_P="ngx_http_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}"
2300 -HTTP_SLOWFS_CACHE_MODULE_URI="http://labs.frickle.com/files/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}.tar.gz"
2301 -HTTP_SLOWFS_CACHE_MODULE_WD="${WORKDIR}/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}"
2302 -
2303 -# http_fancyindex (https://github.com/aperezdc/ngx-fancyindex, BSD license)
2304 -HTTP_FANCYINDEX_MODULE_PV="0.4.4"
2305 -HTTP_FANCYINDEX_MODULE_P="ngx_http_fancyindex-${HTTP_FANCYINDEX_MODULE_PV}"
2306 -HTTP_FANCYINDEX_MODULE_URI="https://github.com/aperezdc/ngx-fancyindex/archive/v${HTTP_FANCYINDEX_MODULE_PV}.tar.gz"
2307 -HTTP_FANCYINDEX_MODULE_WD="${WORKDIR}/ngx-fancyindex-${HTTP_FANCYINDEX_MODULE_PV}"
2308 -
2309 -# http_lua (https://github.com/openresty/lua-nginx-module, BSD license)
2310 -HTTP_LUA_MODULE_PV="0.10.15"
2311 -HTTP_LUA_MODULE_P="ngx_http_lua-${HTTP_LUA_MODULE_PV}"
2312 -HTTP_LUA_MODULE_URI="https://github.com/openresty/lua-nginx-module/archive/v${HTTP_LUA_MODULE_PV}.tar.gz"
2313 -HTTP_LUA_MODULE_WD="${WORKDIR}/lua-nginx-module-${HTTP_LUA_MODULE_PV}"
2314 -LUA_COMPAT=( luajit )
2315 -
2316 -# http_auth_pam (https://github.com/stogh/ngx_http_auth_pam_module/, http://web.iti.upv.es/~sto/nginx/, BSD-2 license)
2317 -HTTP_AUTH_PAM_MODULE_PV="1.5.2"
2318 -HTTP_AUTH_PAM_MODULE_P="ngx_http_auth_pam-${HTTP_AUTH_PAM_MODULE_PV}"
2319 -HTTP_AUTH_PAM_MODULE_URI="https://github.com/stogh/ngx_http_auth_pam_module/archive/v${HTTP_AUTH_PAM_MODULE_PV}.tar.gz"
2320 -HTTP_AUTH_PAM_MODULE_WD="${WORKDIR}/ngx_http_auth_pam_module-${HTTP_AUTH_PAM_MODULE_PV}"
2321 -
2322 -# http_upstream_check (https://github.com/yaoweibin/nginx_upstream_check_module, BSD license)
2323 -HTTP_UPSTREAM_CHECK_MODULE_PV="9aecf15ec379fe98f62355c57b60c0bc83296f04"
2324 -HTTP_UPSTREAM_CHECK_MODULE_P="ngx_http_upstream_check-${HTTP_UPSTREAM_CHECK_MODULE_PV}"
2325 -HTTP_UPSTREAM_CHECK_MODULE_URI="https://github.com/yaoweibin/nginx_upstream_check_module/archive/${HTTP_UPSTREAM_CHECK_MODULE_PV}.tar.gz"
2326 -HTTP_UPSTREAM_CHECK_MODULE_WD="${WORKDIR}/nginx_upstream_check_module-${HTTP_UPSTREAM_CHECK_MODULE_PV}"
2327 -
2328 -# http_metrics (https://github.com/zenops/ngx_metrics, BSD license)
2329 -HTTP_METRICS_MODULE_PV="0.1.1"
2330 -HTTP_METRICS_MODULE_P="ngx_metrics-${HTTP_METRICS_MODULE_PV}"
2331 -HTTP_METRICS_MODULE_URI="https://github.com/madvertise/ngx_metrics/archive/v${HTTP_METRICS_MODULE_PV}.tar.gz"
2332 -HTTP_METRICS_MODULE_WD="${WORKDIR}/ngx_metrics-${HTTP_METRICS_MODULE_PV}"
2333 -
2334 -# http_vhost_traffic_status (https://github.com/vozlt/nginx-module-vts, BSD license)
2335 -HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV="46d85558e344dfe2b078ce757fd36c69a1ec2dd3"
2336 -HTTP_VHOST_TRAFFIC_STATUS_MODULE_P="ngx_http_vhost_traffic_status-${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}"
2337 -HTTP_VHOST_TRAFFIC_STATUS_MODULE_URI="https://github.com/vozlt/nginx-module-vts/archive/${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}.tar.gz"
2338 -HTTP_VHOST_TRAFFIC_STATUS_MODULE_WD="${WORKDIR}/nginx-module-vts-${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}"
2339 -
2340 -# naxsi-core (https://github.com/nbs-system/naxsi, GPLv2+)
2341 -HTTP_NAXSI_MODULE_PV="0.56"
2342 -HTTP_NAXSI_MODULE_P="ngx_http_naxsi-${HTTP_NAXSI_MODULE_PV}"
2343 -HTTP_NAXSI_MODULE_URI="https://github.com/nbs-system/naxsi/archive/${HTTP_NAXSI_MODULE_PV}.tar.gz"
2344 -HTTP_NAXSI_MODULE_WD="${WORKDIR}/naxsi-${HTTP_NAXSI_MODULE_PV}/naxsi_src"
2345 -
2346 -# nginx-rtmp-module (https://github.com/arut/nginx-rtmp-module, BSD license)
2347 -RTMP_MODULE_PV="1.2.1"
2348 -RTMP_MODULE_P="ngx_rtmp-${RTMP_MODULE_PV}"
2349 -RTMP_MODULE_URI="https://github.com/arut/nginx-rtmp-module/archive/v${RTMP_MODULE_PV}.tar.gz"
2350 -RTMP_MODULE_WD="${WORKDIR}/nginx-rtmp-module-${RTMP_MODULE_PV}"
2351 -
2352 -# nginx-dav-ext-module (https://github.com/arut/nginx-dav-ext-module, BSD license)
2353 -HTTP_DAV_EXT_MODULE_PV="3.0.0"
2354 -HTTP_DAV_EXT_MODULE_P="ngx_http_dav_ext-${HTTP_DAV_EXT_MODULE_PV}"
2355 -HTTP_DAV_EXT_MODULE_URI="https://github.com/arut/nginx-dav-ext-module/archive/v${HTTP_DAV_EXT_MODULE_PV}.tar.gz"
2356 -HTTP_DAV_EXT_MODULE_WD="${WORKDIR}/nginx-dav-ext-module-${HTTP_DAV_EXT_MODULE_PV}"
2357 -
2358 -# echo-nginx-module (https://github.com/openresty/echo-nginx-module, BSD license)
2359 -HTTP_ECHO_MODULE_PV="0.62"
2360 -HTTP_ECHO_MODULE_P="ngx_http_echo-${HTTP_ECHO_MODULE_PV}"
2361 -HTTP_ECHO_MODULE_URI="https://github.com/openresty/echo-nginx-module/archive/v${HTTP_ECHO_MODULE_PV}.tar.gz"
2362 -HTTP_ECHO_MODULE_WD="${WORKDIR}/echo-nginx-module-${HTTP_ECHO_MODULE_PV}"
2363 -
2364 -# mod_security for nginx (https://modsecurity.org/, Apache-2.0)
2365 -# keep the MODULE_P here consistent with upstream to avoid tarball duplication
2366 -HTTP_SECURITY_MODULE_PV="2.9.3"
2367 -HTTP_SECURITY_MODULE_P="modsecurity-${HTTP_SECURITY_MODULE_PV}"
2368 -HTTP_SECURITY_MODULE_URI="https://www.modsecurity.org/tarball/${HTTP_SECURITY_MODULE_PV}/${HTTP_SECURITY_MODULE_P}.tar.gz"
2369 -HTTP_SECURITY_MODULE_WD="${WORKDIR}/${HTTP_SECURITY_MODULE_P}"
2370 -
2371 -# push-stream-module (http://www.nginxpushstream.com, https://github.com/wandenberg/nginx-push-stream-module, GPL-3)
2372 -HTTP_PUSH_STREAM_MODULE_PV="0.5.4"
2373 -HTTP_PUSH_STREAM_MODULE_P="ngx_http_push_stream-${HTTP_PUSH_STREAM_MODULE_PV}"
2374 -HTTP_PUSH_STREAM_MODULE_URI="https://github.com/wandenberg/nginx-push-stream-module/archive/${HTTP_PUSH_STREAM_MODULE_PV}.tar.gz"
2375 -HTTP_PUSH_STREAM_MODULE_WD="${WORKDIR}/nginx-push-stream-module-${HTTP_PUSH_STREAM_MODULE_PV}"
2376 -
2377 -# sticky-module (https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng, BSD-2)
2378 -HTTP_STICKY_MODULE_PV="1.2.6-10-g08a395c66e42"
2379 -HTTP_STICKY_MODULE_P="nginx_http_sticky_module_ng-${HTTP_STICKY_MODULE_PV}"
2380 -HTTP_STICKY_MODULE_URI="https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/get/${HTTP_STICKY_MODULE_PV}.tar.bz2"
2381 -HTTP_STICKY_MODULE_WD="${WORKDIR}/nginx-goodies-nginx-sticky-module-ng-08a395c66e42"
2382 -
2383 -# mogilefs-module (https://github.com/vkholodkov/nginx-mogilefs-module, BSD-2)
2384 -HTTP_MOGILEFS_MODULE_PV="1.0.4"
2385 -HTTP_MOGILEFS_MODULE_P="ngx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}"
2386 -HTTP_MOGILEFS_MODULE_URI="https://github.com/vkholodkov/nginx-mogilefs-module/archive/${HTTP_MOGILEFS_MODULE_PV}.tar.gz"
2387 -HTTP_MOGILEFS_MODULE_WD="${WORKDIR}/nginx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}"
2388 -
2389 -# memc-module (https://github.com/openresty/memc-nginx-module, BSD-2)
2390 -HTTP_MEMC_MODULE_PV="0.19"
2391 -HTTP_MEMC_MODULE_P="ngx_memc_module-${HTTP_MEMC_MODULE_PV}"
2392 -HTTP_MEMC_MODULE_URI="https://github.com/openresty/memc-nginx-module/archive/v${HTTP_MEMC_MODULE_PV}.tar.gz"
2393 -HTTP_MEMC_MODULE_WD="${WORKDIR}/memc-nginx-module-${HTTP_MEMC_MODULE_PV}"
2394 -
2395 -# nginx-ldap-auth-module (https://github.com/kvspb/nginx-auth-ldap, BSD-2)
2396 -HTTP_LDAP_MODULE_PV="42d195d7a7575ebab1c369ad3fc5d78dc2c2669c"
2397 -HTTP_LDAP_MODULE_P="nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}"
2398 -HTTP_LDAP_MODULE_URI="https://github.com/kvspb/nginx-auth-ldap/archive/${HTTP_LDAP_MODULE_PV}.tar.gz"
2399 -HTTP_LDAP_MODULE_WD="${WORKDIR}/nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}"
2400 -
2401 -# geoip2 (https://github.com/leev/ngx_http_geoip2_module, BSD-2)
2402 -GEOIP2_MODULE_PV="3.3"
2403 -GEOIP2_MODULE_P="ngx_http_geoip2_module-${GEOIP2_MODULE_PV}"
2404 -GEOIP2_MODULE_URI="https://github.com/leev/ngx_http_geoip2_module/archive/${GEOIP2_MODULE_PV}.tar.gz"
2405 -GEOIP2_MODULE_WD="${WORKDIR}/ngx_http_geoip2_module-${GEOIP2_MODULE_PV}"
2406 -
2407 -# njs-module (https://github.com/nginx/njs, as-is)
2408 -NJS_MODULE_PV="0.5.3"
2409 -NJS_MODULE_P="njs-${NJS_MODULE_PV}"
2410 -NJS_MODULE_URI="https://github.com/nginx/njs/archive/${NJS_MODULE_PV}.tar.gz"
2411 -NJS_MODULE_WD="${WORKDIR}/njs-${NJS_MODULE_PV}"
2412 -
2413 -# We handle deps below ourselves
2414 -SSL_DEPS_SKIP=1
2415 -AUTOTOOLS_AUTO_DEPEND="no"
2416 -
2417 -inherit autotools lua-single ssl-cert toolchain-funcs perl-module flag-o-matic user systemd multilib pax-utils
2418 -
2419 -DESCRIPTION="Robust, small and high performance http and reverse proxy server"
2420 -HOMEPAGE="https://nginx.org"
2421 -SRC_URI="https://nginx.org/download/${P}.tar.gz
2422 - ${DEVEL_KIT_MODULE_URI} -> ${DEVEL_KIT_MODULE_P}.tar.gz
2423 - nginx_modules_http_auth_ldap? ( ${HTTP_LDAP_MODULE_URI} -> ${HTTP_LDAP_MODULE_P}.tar.gz )
2424 - nginx_modules_http_auth_pam? ( ${HTTP_AUTH_PAM_MODULE_URI} -> ${HTTP_AUTH_PAM_MODULE_P}.tar.gz )
2425 - nginx_modules_http_brotli? ( ${HTTP_BROTLI_MODULE_URI} -> ${HTTP_BROTLI_MODULE_P}.tar.gz )
2426 - nginx_modules_http_cache_purge? ( ${HTTP_CACHE_PURGE_MODULE_URI} -> ${HTTP_CACHE_PURGE_MODULE_P}.tar.gz )
2427 - nginx_modules_http_dav_ext? ( ${HTTP_DAV_EXT_MODULE_URI} -> ${HTTP_DAV_EXT_MODULE_P}.tar.gz )
2428 - nginx_modules_http_echo? ( ${HTTP_ECHO_MODULE_URI} -> ${HTTP_ECHO_MODULE_P}.tar.gz )
2429 - nginx_modules_http_fancyindex? ( ${HTTP_FANCYINDEX_MODULE_URI} -> ${HTTP_FANCYINDEX_MODULE_P}.tar.gz )
2430 - nginx_modules_http_geoip2? ( ${GEOIP2_MODULE_URI} -> ${GEOIP2_MODULE_P}.tar.gz )
2431 - nginx_modules_http_headers_more? ( ${HTTP_HEADERS_MORE_MODULE_URI} -> ${HTTP_HEADERS_MORE_MODULE_P}.tar.gz )
2432 - nginx_modules_http_javascript? ( ${NJS_MODULE_URI} -> ${NJS_MODULE_P}.tar.gz )
2433 - nginx_modules_http_lua? ( ${HTTP_LUA_MODULE_URI} -> ${HTTP_LUA_MODULE_P}.tar.gz )
2434 - nginx_modules_http_memc? ( ${HTTP_MEMC_MODULE_URI} -> ${HTTP_MEMC_MODULE_P}.tar.gz )
2435 - nginx_modules_http_metrics? ( ${HTTP_METRICS_MODULE_URI} -> ${HTTP_METRICS_MODULE_P}.tar.gz )
2436 - nginx_modules_http_mogilefs? ( ${HTTP_MOGILEFS_MODULE_URI} -> ${HTTP_MOGILEFS_MODULE_P}.tar.gz )
2437 - nginx_modules_http_naxsi? ( ${HTTP_NAXSI_MODULE_URI} -> ${HTTP_NAXSI_MODULE_P}.tar.gz )
2438 - nginx_modules_http_push_stream? ( ${HTTP_PUSH_STREAM_MODULE_URI} -> ${HTTP_PUSH_STREAM_MODULE_P}.tar.gz )
2439 - nginx_modules_http_security? ( ${HTTP_SECURITY_MODULE_URI} -> ${HTTP_SECURITY_MODULE_P}.tar.gz )
2440 - nginx_modules_http_slowfs_cache? ( ${HTTP_SLOWFS_CACHE_MODULE_URI} -> ${HTTP_SLOWFS_CACHE_MODULE_P}.tar.gz )
2441 - nginx_modules_http_sticky? ( ${HTTP_STICKY_MODULE_URI} -> ${HTTP_STICKY_MODULE_P}.tar.bz2 )
2442 - nginx_modules_http_upload_progress? ( ${HTTP_UPLOAD_PROGRESS_MODULE_URI} -> ${HTTP_UPLOAD_PROGRESS_MODULE_P}.tar.gz )
2443 - nginx_modules_http_upstream_check? ( ${HTTP_UPSTREAM_CHECK_MODULE_URI} -> ${HTTP_UPSTREAM_CHECK_MODULE_P}.tar.gz )
2444 - nginx_modules_http_vhost_traffic_status? ( ${HTTP_VHOST_TRAFFIC_STATUS_MODULE_URI} -> ${HTTP_VHOST_TRAFFIC_STATUS_MODULE_P}.tar.gz )
2445 - nginx_modules_stream_geoip2? ( ${GEOIP2_MODULE_URI} -> ${GEOIP2_MODULE_P}.tar.gz )
2446 - nginx_modules_stream_javascript? ( ${NJS_MODULE_URI} -> ${NJS_MODULE_P}.tar.gz )
2447 - rtmp? ( ${RTMP_MODULE_URI} -> ${RTMP_MODULE_P}.tar.gz )"
2448 -
2449 -LICENSE="BSD-2 BSD SSLeay MIT GPL-2 GPL-2+
2450 - nginx_modules_http_security? ( Apache-2.0 )
2451 - nginx_modules_http_push_stream? ( GPL-3 )"
2452 -
2453 -SLOT="mainline"
2454 -KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
2455 -
2456 -# Package doesn't provide a real test suite
2457 -RESTRICT="test"
2458 -
2459 -NGINX_MODULES_STD="access auth_basic autoindex browser charset empty_gif
2460 - fastcgi geo grpc gzip limit_req limit_conn map memcached mirror
2461 - proxy referer rewrite scgi ssi split_clients upstream_hash
2462 - upstream_ip_hash upstream_keepalive upstream_least_conn
2463 - upstream_zone userid uwsgi"
2464 -NGINX_MODULES_OPT="addition auth_request dav degradation flv geoip gunzip
2465 - gzip_static image_filter mp4 perl random_index realip secure_link
2466 - slice stub_status sub xslt"
2467 -NGINX_MODULES_STREAM_STD="access geo limit_conn map return split_clients
2468 - upstream_hash upstream_least_conn upstream_zone"
2469 -NGINX_MODULES_STREAM_OPT="geoip realip ssl_preread"
2470 -NGINX_MODULES_MAIL="imap pop3 smtp"
2471 -NGINX_MODULES_3RD="
2472 - http_auth_ldap
2473 - http_auth_pam
2474 - http_brotli
2475 - http_cache_purge
2476 - http_dav_ext
2477 - http_echo
2478 - http_fancyindex
2479 - http_geoip2
2480 - http_headers_more
2481 - http_javascript
2482 - http_lua
2483 - http_memc
2484 - http_metrics
2485 - http_mogilefs
2486 - http_naxsi
2487 - http_push_stream
2488 - http_security
2489 - http_slowfs_cache
2490 - http_sticky
2491 - http_upload_progress
2492 - http_upstream_check
2493 - http_vhost_traffic_status
2494 - stream_geoip2
2495 - stream_javascript
2496 -"
2497 -
2498 -IUSE="aio debug +http +http2 +http-cache +ipv6 libatomic +pcre
2499 - pcre-jit rtmp selinux ssl threads userland_GNU vim-syntax"
2500 -
2501 -for mod in $NGINX_MODULES_STD; do
2502 - IUSE="${IUSE} +nginx_modules_http_${mod}"
2503 -done
2504 -
2505 -for mod in $NGINX_MODULES_OPT; do
2506 - IUSE="${IUSE} nginx_modules_http_${mod}"
2507 -done
2508 -
2509 -for mod in $NGINX_MODULES_STREAM_STD; do
2510 - IUSE="${IUSE} nginx_modules_stream_${mod}"
2511 -done
2512 -
2513 -for mod in $NGINX_MODULES_STREAM_OPT; do
2514 - IUSE="${IUSE} nginx_modules_stream_${mod}"
2515 -done
2516 -
2517 -for mod in $NGINX_MODULES_MAIL; do
2518 - IUSE="${IUSE} nginx_modules_mail_${mod}"
2519 -done
2520 -
2521 -for mod in $NGINX_MODULES_3RD; do
2522 - IUSE="${IUSE} nginx_modules_${mod}"
2523 -done
2524 -
2525 -# Add so we can warn users updating about config changes
2526 -# @TODO: jbergstroem: remove on next release series
2527 -IUSE="${IUSE} nginx_modules_http_spdy"
2528 -
2529 -CDEPEND="
2530 - pcre? ( dev-libs/libpcre:= )
2531 - pcre-jit? ( dev-libs/libpcre:=[jit] )
2532 - ssl? (
2533 - dev-libs/openssl:0=
2534 - )
2535 - http2? (
2536 - >=dev-libs/openssl-1.0.1c:0=
2537 - )
2538 - http-cache? (
2539 - userland_GNU? (
2540 - dev-libs/openssl:0=
2541 - )
2542 - )
2543 - nginx_modules_http_brotli? ( app-arch/brotli:= )
2544 - nginx_modules_http_geoip? ( dev-libs/geoip )
2545 - nginx_modules_http_geoip2? ( dev-libs/libmaxminddb:= )
2546 - nginx_modules_http_gunzip? ( sys-libs/zlib )
2547 - nginx_modules_http_gzip? ( sys-libs/zlib )
2548 - nginx_modules_http_gzip_static? ( sys-libs/zlib )
2549 - nginx_modules_http_image_filter? ( media-libs/gd:=[jpeg,png] )
2550 - nginx_modules_http_perl? ( >=dev-lang/perl-5.8:= )
2551 - nginx_modules_http_rewrite? ( dev-libs/libpcre:= )
2552 - nginx_modules_http_secure_link? (
2553 - userland_GNU? (
2554 - dev-libs/openssl:0=
2555 - )
2556 - )
2557 - nginx_modules_http_xslt? ( dev-libs/libxml2:= dev-libs/libxslt )
2558 - nginx_modules_http_lua? ( ${LUA_DEPS} )
2559 - nginx_modules_http_auth_pam? ( sys-libs/pam )
2560 - nginx_modules_http_metrics? ( dev-libs/yajl:= )
2561 - nginx_modules_http_dav_ext? ( dev-libs/libxml2 )
2562 - nginx_modules_http_security? (
2563 - dev-libs/apr:=
2564 - dev-libs/apr-util:=
2565 - dev-libs/libxml2:=
2566 - net-misc/curl
2567 - www-servers/apache
2568 - )
2569 - nginx_modules_http_auth_ldap? ( net-nds/openldap[ssl?] )
2570 - nginx_modules_stream_geoip? ( dev-libs/geoip )
2571 - nginx_modules_stream_geoip2? ( dev-libs/libmaxminddb:= )"
2572 -RDEPEND="${CDEPEND}
2573 - selinux? ( sec-policy/selinux-nginx )
2574 - !www-servers/nginx:0"
2575 -DEPEND="${CDEPEND}
2576 - arm? ( dev-libs/libatomic_ops )
2577 - libatomic? ( dev-libs/libatomic_ops )"
2578 -BDEPEND="nginx_modules_http_brotli? ( virtual/pkgconfig )
2579 - nginx_modules_http_security? ( ${AUTOTOOLS_DEPEND} )"
2580 -PDEPEND="vim-syntax? ( app-vim/nginx-syntax )"
2581 -
2582 -REQUIRED_USE="pcre-jit? ( pcre )
2583 - nginx_modules_http_fancyindex? ( nginx_modules_http_addition )
2584 - nginx_modules_http_grpc? ( http2 )
2585 - nginx_modules_http_lua? (
2586 - ${LUA_REQUIRED_USE}
2587 - nginx_modules_http_rewrite
2588 - )
2589 - nginx_modules_http_naxsi? ( pcre )
2590 - nginx_modules_http_dav_ext? ( nginx_modules_http_dav nginx_modules_http_xslt )
2591 - nginx_modules_http_metrics? ( nginx_modules_http_stub_status )
2592 - nginx_modules_http_security? ( pcre )
2593 - nginx_modules_http_push_stream? ( ssl )"
2594 -
2595 -pkg_setup() {
2596 - NGINX_HOME="/var/lib/nginx"
2597 - NGINX_HOME_TMP="${NGINX_HOME}/tmp"
2598 -
2599 - ebegin "Creating nginx user and group"
2600 - enewgroup ${PN}
2601 - enewuser ${PN} -1 -1 "${NGINX_HOME}" ${PN}
2602 - eend $?
2603 -
2604 - if use libatomic; then
2605 - ewarn "GCC 4.1+ features built-in atomic operations."
2606 - ewarn "Using libatomic_ops is only needed if using"
2607 - ewarn "a different compiler or a GCC prior to 4.1"
2608 - fi
2609 -
2610 - if [[ -n $NGINX_ADD_MODULES ]]; then
2611 - ewarn "You are building custom modules via \$NGINX_ADD_MODULES!"
2612 - ewarn "This nginx installation is not supported!"
2613 - ewarn "Make sure you can reproduce the bug without those modules"
2614 - ewarn "_before_ reporting bugs."
2615 - fi
2616 -
2617 - if use !http; then
2618 - ewarn "To actually disable all http-functionality you also have to disable"
2619 - ewarn "all nginx http modules."
2620 - fi
2621 -
2622 - if use nginx_modules_http_mogilefs && use threads; then
2623 - eerror "mogilefs won't compile with threads support."
2624 - eerror "Please disable either flag and try again."
2625 - die "Can't compile mogilefs with threads support"
2626 - fi
2627 -
2628 - use nginx_modules_http_lua && lua-single_pkg_setup
2629 -}
2630 -
2631 -src_prepare() {
2632 - eapply "${FILESDIR}/${PN}-1.4.1-fix-perl-install-path.patch"
2633 - eapply "${FILESDIR}/${PN}-httpoxy-mitigation-r1.patch"
2634 -
2635 - if use nginx_modules_http_brotli; then
2636 - cd "${HTTP_BROTLI_MODULE_WD}" || die
2637 - eapply "${FILESDIR}"/http_brotli-detect-brotli-r3.patch
2638 - cd "${S}" || die
2639 - fi
2640 -
2641 - if use nginx_modules_http_upstream_check; then
2642 - eapply -p0 "${FILESDIR}"/http_upstream_check-nginx-1.11.5+.patch
2643 - fi
2644 -
2645 - if use nginx_modules_http_cache_purge; then
2646 - cd "${HTTP_CACHE_PURGE_MODULE_WD}" || die
2647 - eapply "${FILESDIR}"/http_cache_purge-1.11.6+.patch
2648 - cd "${S}" || die
2649 - fi
2650 -
2651 - if use nginx_modules_http_security; then
2652 - cd "${HTTP_SECURITY_MODULE_WD}" || die
2653 -
2654 - eautoreconf
2655 -
2656 - if use nginx_modules_http_lua; then
2657 - sed -i \
2658 - -e "s|^\(LUA_PKGNAMES\)=.*|\1=\"${ELUA}\"|" \
2659 - configure || die
2660 - fi
2661 -
2662 - cd "${S}" || die
2663 - fi
2664 -
2665 - if use nginx_modules_http_upload_progress; then
2666 - cd "${HTTP_UPLOAD_PROGRESS_MODULE_WD}" || die
2667 - eapply "${FILESDIR}"/http_uploadprogress-issue_50-r1.patch
2668 - cd "${S}" || die
2669 - fi
2670 -
2671 - find auto/ -type f -print0 | xargs -0 sed -i 's:\&\& make:\&\& \\$(MAKE):' || die
2672 - # We have config protection, don't rename etc files
2673 - sed -i 's:.default::' auto/install || die
2674 - # remove useless files
2675 - sed -i -e '/koi-/d' -e '/win-/d' auto/install || die
2676 -
2677 - # don't install to /etc/nginx/ if not in use
2678 - local module
2679 - for module in fastcgi scgi uwsgi ; do
2680 - if ! use nginx_modules_http_${module}; then
2681 - sed -i -e "/${module}/d" auto/install || die
2682 - fi
2683 - done
2684 -
2685 - eapply_user
2686 -}
2687 -
2688 -src_configure() {
2689 - # mod_security needs to generate nginx/modsecurity/config before including it
2690 - if use nginx_modules_http_security; then
2691 - cd "${HTTP_SECURITY_MODULE_WD}" || die
2692 -
2693 - ./configure \
2694 - --enable-standalone-module \
2695 - --disable-mlogc \
2696 - --with-ssdeep=no \
2697 - $(use_enable pcre-jit) \
2698 - $(use_with nginx_modules_http_lua lua) || die "configure failed for mod_security"
2699 -
2700 - cd "${S}" || die
2701 - fi
2702 -
2703 - local myconf=() http_enabled= mail_enabled= stream_enabled=
2704 -
2705 - use aio && myconf+=( --with-file-aio )
2706 - use debug && myconf+=( --with-debug )
2707 - use http2 && myconf+=( --with-http_v2_module )
2708 - use libatomic && myconf+=( --with-libatomic )
2709 - use pcre && myconf+=( --with-pcre )
2710 - use pcre-jit && myconf+=( --with-pcre-jit )
2711 - use threads && myconf+=( --with-threads )
2712 -
2713 - # HTTP modules
2714 - for mod in $NGINX_MODULES_STD; do
2715 - if use nginx_modules_http_${mod}; then
2716 - http_enabled=1
2717 - else
2718 - myconf+=( --without-http_${mod}_module )
2719 - fi
2720 - done
2721 -
2722 - for mod in $NGINX_MODULES_OPT; do
2723 - if use nginx_modules_http_${mod}; then
2724 - http_enabled=1
2725 - myconf+=( --with-http_${mod}_module )
2726 - fi
2727 - done
2728 -
2729 - if use nginx_modules_http_fastcgi; then
2730 - myconf+=( --with-http_realip_module )
2731 - fi
2732 -
2733 - # third-party modules
2734 - if use nginx_modules_http_upload_progress; then
2735 - http_enabled=1
2736 - myconf+=( --add-module=${HTTP_UPLOAD_PROGRESS_MODULE_WD} )
2737 - fi
2738 -
2739 - if use nginx_modules_http_headers_more; then
2740 - http_enabled=1
2741 - myconf+=( --add-module=${HTTP_HEADERS_MORE_MODULE_WD} )
2742 - fi
2743 -
2744 - if use nginx_modules_http_cache_purge; then
2745 - http_enabled=1
2746 - myconf+=( --add-module=${HTTP_CACHE_PURGE_MODULE_WD} )
2747 - fi
2748 -
2749 - if use nginx_modules_http_slowfs_cache; then
2750 - http_enabled=1
2751 - myconf+=( --add-module=${HTTP_SLOWFS_CACHE_MODULE_WD} )
2752 - fi
2753 -
2754 - if use nginx_modules_http_fancyindex; then
2755 - http_enabled=1
2756 - myconf+=( --add-module=${HTTP_FANCYINDEX_MODULE_WD} )
2757 - fi
2758 -
2759 - if use nginx_modules_http_lua; then
2760 - http_enabled=1
2761 - export LUAJIT_LIB=$(dirname $(lua_get_shared_lib))
2762 - export LUAJIT_INC=$(lua_get_include_dir)
2763 - myconf+=( --add-module=${DEVEL_KIT_MODULE_WD} )
2764 - myconf+=( --add-module=${HTTP_LUA_MODULE_WD} )
2765 - fi
2766 -
2767 - if use nginx_modules_http_auth_pam; then
2768 - http_enabled=1
2769 - myconf+=( --add-module=${HTTP_AUTH_PAM_MODULE_WD} )
2770 - fi
2771 -
2772 - if use nginx_modules_http_upstream_check; then
2773 - http_enabled=1
2774 - myconf+=( --add-module=${HTTP_UPSTREAM_CHECK_MODULE_WD} )
2775 - fi
2776 -
2777 - if use nginx_modules_http_metrics; then
2778 - http_enabled=1
2779 - myconf+=( --add-module=${HTTP_METRICS_MODULE_WD} )
2780 - fi
2781 -
2782 - if use nginx_modules_http_naxsi ; then
2783 - http_enabled=1
2784 - myconf+=( --add-module=${HTTP_NAXSI_MODULE_WD} )
2785 - fi
2786 -
2787 - if use rtmp ; then
2788 - http_enabled=1
2789 - myconf+=( --add-module=${RTMP_MODULE_WD} )
2790 - fi
2791 -
2792 - if use nginx_modules_http_dav_ext ; then
2793 - http_enabled=1
2794 - myconf+=( --add-module=${HTTP_DAV_EXT_MODULE_WD} )
2795 - fi
2796 -
2797 - if use nginx_modules_http_echo ; then
2798 - http_enabled=1
2799 - myconf+=( --add-module=${HTTP_ECHO_MODULE_WD} )
2800 - fi
2801 -
2802 - if use nginx_modules_http_security ; then
2803 - http_enabled=1
2804 - myconf+=( --add-module=${HTTP_SECURITY_MODULE_WD}/nginx/modsecurity )
2805 - fi
2806 -
2807 - if use nginx_modules_http_push_stream ; then
2808 - http_enabled=1
2809 - myconf+=( --add-module=${HTTP_PUSH_STREAM_MODULE_WD} )
2810 - fi
2811 -
2812 - if use nginx_modules_http_sticky ; then
2813 - http_enabled=1
2814 - myconf+=( --add-module=${HTTP_STICKY_MODULE_WD} )
2815 - fi
2816 -
2817 - if use nginx_modules_http_mogilefs ; then
2818 - http_enabled=1
2819 - myconf+=( --add-module=${HTTP_MOGILEFS_MODULE_WD} )
2820 - fi
2821 -
2822 - if use nginx_modules_http_memc ; then
2823 - http_enabled=1
2824 - myconf+=( --add-module=${HTTP_MEMC_MODULE_WD} )
2825 - fi
2826 -
2827 - if use nginx_modules_http_auth_ldap; then
2828 - http_enabled=1
2829 - myconf+=( --add-module=${HTTP_LDAP_MODULE_WD} )
2830 - fi
2831 -
2832 - if use nginx_modules_http_vhost_traffic_status; then
2833 - http_enabled=1
2834 - myconf+=( --add-module=${HTTP_VHOST_TRAFFIC_STATUS_MODULE_WD} )
2835 - fi
2836 -
2837 - if use nginx_modules_http_geoip2 || use nginx_modules_stream_geoip2; then
2838 - myconf+=( --add-module=${GEOIP2_MODULE_WD} )
2839 - fi
2840 -
2841 - if use nginx_modules_http_javascript || use nginx_modules_stream_javascript; then
2842 - myconf+=( --add-module="${NJS_MODULE_WD}/nginx" )
2843 - fi
2844 -
2845 - if use nginx_modules_http_brotli; then
2846 - http_enabled=1
2847 - myconf+=( --add-module=${HTTP_BROTLI_MODULE_WD} )
2848 - fi
2849 -
2850 - if use http || use http-cache || use http2 || use nginx_modules_http_javascript; then
2851 - http_enabled=1
2852 - fi
2853 -
2854 - if [ $http_enabled ]; then
2855 - use http-cache || myconf+=( --without-http-cache )
2856 - use ssl && myconf+=( --with-http_ssl_module )
2857 - else
2858 - myconf+=( --without-http --without-http-cache )
2859 - fi
2860 -
2861 - # Stream modules
2862 - for mod in $NGINX_MODULES_STREAM_STD; do
2863 - if use nginx_modules_stream_${mod}; then
2864 - stream_enabled=1
2865 - else
2866 - myconf+=( --without-stream_${mod}_module )
2867 - fi
2868 - done
2869 -
2870 - for mod in $NGINX_MODULES_STREAM_OPT; do
2871 - if use nginx_modules_stream_${mod}; then
2872 - stream_enabled=1
2873 - myconf+=( --with-stream_${mod}_module )
2874 - fi
2875 - done
2876 -
2877 - if use nginx_modules_stream_geoip2 || use nginx_modules_stream_javascript; then
2878 - stream_enabled=1
2879 - fi
2880 -
2881 - if [ $stream_enabled ]; then
2882 - myconf+=( --with-stream )
2883 - use ssl && myconf+=( --with-stream_ssl_module )
2884 - fi
2885 -
2886 - # MAIL modules
2887 - for mod in $NGINX_MODULES_MAIL; do
2888 - if use nginx_modules_mail_${mod}; then
2889 - mail_enabled=1
2890 - else
2891 - myconf+=( --without-mail_${mod}_module )
2892 - fi
2893 - done
2894 -
2895 - if [ $mail_enabled ]; then
2896 - myconf+=( --with-mail )
2897 - use ssl && myconf+=( --with-mail_ssl_module )
2898 - fi
2899 -
2900 - # custom modules
2901 - for mod in $NGINX_ADD_MODULES; do
2902 - myconf+=( --add-module=${mod} )
2903 - done
2904 -
2905 - # https://bugs.gentoo.org/286772
2906 - export LANG=C LC_ALL=C
2907 - tc-export AR CC
2908 -
2909 - if ! use prefix; then
2910 - myconf+=( --user=${PN} )
2911 - myconf+=( --group=${PN} )
2912 - fi
2913 -
2914 - local WITHOUT_IPV6=
2915 - if ! use ipv6; then
2916 - WITHOUT_IPV6=" -DNGX_HAVE_INET6=0"
2917 - fi
2918 -
2919 - if [[ -n "${EXTRA_ECONF}" ]]; then
2920 - myconf+=( ${EXTRA_ECONF} )
2921 - ewarn "EXTRA_ECONF applied. Now you are on your own, good luck!"
2922 - fi
2923 -
2924 - ./configure \
2925 - --prefix="${EPREFIX}"/usr \
2926 - --conf-path="${EPREFIX}"/etc/${PN}/${PN}.conf \
2927 - --error-log-path="${EPREFIX}"/var/log/${PN}/error_log \
2928 - --pid-path="${EPREFIX}"/run/${PN}.pid \
2929 - --lock-path="${EPREFIX}"/run/lock/${PN}.lock \
2930 - --with-cc-opt="-I${ESYSROOT}/usr/include${WITHOUT_IPV6}" \
2931 - --with-ld-opt="-L${ESYSROOT}/usr/$(get_libdir)" \
2932 - --http-log-path="${EPREFIX}"/var/log/${PN}/access_log \
2933 - --http-client-body-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/client \
2934 - --http-proxy-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/proxy \
2935 - --http-fastcgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/fastcgi \
2936 - --http-scgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/scgi \
2937 - --http-uwsgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/uwsgi \
2938 - --with-compat \
2939 - "${myconf[@]}" || die "configure failed"
2940 -
2941 - # A purely cosmetic change that makes nginx -V more readable. This can be
2942 - # good if people outside the gentoo community would troubleshoot and
2943 - # question the users setup.
2944 - sed -i -e "s|${WORKDIR}|external_module|g" objs/ngx_auto_config.h || die
2945 -}
2946 -
2947 -src_compile() {
2948 - use nginx_modules_http_security && emake -C "${HTTP_SECURITY_MODULE_WD}"
2949 -
2950 - # https://bugs.gentoo.org/286772
2951 - export LANG=C LC_ALL=C
2952 - emake LINK="${CC} ${LDFLAGS}" OTHERLDFLAGS="${LDFLAGS}"
2953 -}
2954 -
2955 -src_install() {
2956 - emake DESTDIR="${D}" install
2957 -
2958 - cp "${FILESDIR}"/nginx.conf-r2 "${ED}"/etc/nginx/nginx.conf || die
2959 -
2960 - newinitd "${FILESDIR}"/nginx.initd-r4 nginx
2961 - newconfd "${FILESDIR}"/nginx.confd nginx
2962 -
2963 - systemd_newunit "${FILESDIR}"/nginx.service-r1 nginx.service
2964 -
2965 - doman man/nginx.8
2966 - dodoc CHANGES* README
2967 -
2968 - # just keepdir. do not copy the default htdocs files (bug #449136)
2969 - keepdir /var/www/localhost
2970 - rm -rf "${ED}"/usr/html || die
2971 -
2972 - # set up a list of directories to keep
2973 - local keepdir_list="${NGINX_HOME_TMP}"/client
2974 - local module
2975 - for module in proxy fastcgi scgi uwsgi; do
2976 - use nginx_modules_http_${module} && keepdir_list+=" ${NGINX_HOME_TMP}/${module}"
2977 - done
2978 -
2979 - keepdir /var/log/nginx ${keepdir_list}
2980 -
2981 - # this solves a problem with SELinux where nginx doesn't see the directories
2982 - # as root and tries to create them as nginx
2983 - fperms 0750 "${NGINX_HOME_TMP}"
2984 - fowners ${PN}:0 "${NGINX_HOME_TMP}"
2985 -
2986 - fperms 0700 ${keepdir_list}
2987 - fowners ${PN}:${PN} ${keepdir_list}
2988 -
2989 - fperms 0710 /var/log/nginx
2990 - fowners 0:${PN} /var/log/nginx
2991 -
2992 - # logrotate
2993 - insinto /etc/logrotate.d
2994 - newins "${FILESDIR}"/nginx.logrotate-r1 nginx
2995 -
2996 - # Don't create /run
2997 - rm -rf "${ED}"/run || die
2998 -
2999 - if use lua_single_target_luajit; then
3000 - pax-mark m "${ED}/usr/sbin/nginx"
3001 - fi
3002 -
3003 - if use nginx_modules_http_perl; then
3004 - cd "${S}"/objs/src/http/modules/perl/ || die
3005 - emake DESTDIR="${D}" INSTALLDIRS=vendor
3006 - perl_delete_localpod
3007 - cd "${S}" || die
3008 - fi
3009 -
3010 - if use nginx_modules_http_cache_purge; then
3011 - docinto ${HTTP_CACHE_PURGE_MODULE_P}
3012 - dodoc "${HTTP_CACHE_PURGE_MODULE_WD}"/{CHANGES,README.md,TODO.md}
3013 - fi
3014 -
3015 - if use nginx_modules_http_slowfs_cache; then
3016 - docinto ${HTTP_SLOWFS_CACHE_MODULE_P}
3017 - dodoc "${HTTP_SLOWFS_CACHE_MODULE_WD}"/{CHANGES,README.md}
3018 - fi
3019 -
3020 - if use nginx_modules_http_fancyindex; then
3021 - docinto ${HTTP_FANCYINDEX_MODULE_P}
3022 - dodoc "${HTTP_FANCYINDEX_MODULE_WD}"/README.rst
3023 - fi
3024 -
3025 - if use nginx_modules_http_lua; then
3026 - docinto ${HTTP_LUA_MODULE_P}
3027 - dodoc "${HTTP_LUA_MODULE_WD}"/README.markdown
3028 - fi
3029 -
3030 - if use nginx_modules_http_auth_pam; then
3031 - docinto ${HTTP_AUTH_PAM_MODULE_P}
3032 - dodoc "${HTTP_AUTH_PAM_MODULE_WD}"/{README.md,ChangeLog}
3033 - fi
3034 -
3035 - if use nginx_modules_http_upstream_check; then
3036 - docinto ${HTTP_UPSTREAM_CHECK_MODULE_P}
3037 - dodoc "${HTTP_UPSTREAM_CHECK_MODULE_WD}"/{README,CHANGES}
3038 - fi
3039 -
3040 - if use nginx_modules_http_naxsi; then
3041 - insinto /etc/nginx
3042 - doins "${HTTP_NAXSI_MODULE_WD}"/../naxsi_config/naxsi_core.rules
3043 - fi
3044 -
3045 - if use rtmp; then
3046 - docinto ${RTMP_MODULE_P}
3047 - dodoc "${RTMP_MODULE_WD}"/{AUTHORS,README.md,stat.xsl}
3048 - fi
3049 -
3050 - if use nginx_modules_http_dav_ext; then
3051 - docinto ${HTTP_DAV_EXT_MODULE_P}
3052 - dodoc "${HTTP_DAV_EXT_MODULE_WD}"/README.rst
3053 - fi
3054 -
3055 - if use nginx_modules_http_echo; then
3056 - docinto ${HTTP_ECHO_MODULE_P}
3057 - dodoc "${HTTP_ECHO_MODULE_WD}"/README.markdown
3058 - fi
3059 -
3060 - if use nginx_modules_http_security; then
3061 - docinto ${HTTP_SECURITY_MODULE_P}
3062 - dodoc "${HTTP_SECURITY_MODULE_WD}"/{CHANGES,README.md,authors.txt}
3063 - fi
3064 -
3065 - if use nginx_modules_http_push_stream; then
3066 - docinto ${HTTP_PUSH_STREAM_MODULE_P}
3067 - dodoc "${HTTP_PUSH_STREAM_MODULE_WD}"/{AUTHORS,CHANGELOG.textile,README.textile}
3068 - fi
3069 -
3070 - if use nginx_modules_http_sticky; then
3071 - docinto ${HTTP_STICKY_MODULE_P}
3072 - dodoc "${HTTP_STICKY_MODULE_WD}"/{README.md,Changelog.txt,docs/sticky.pdf}
3073 - fi
3074 -
3075 - if use nginx_modules_http_memc; then
3076 - docinto ${HTTP_MEMC_MODULE_P}
3077 - dodoc "${HTTP_MEMC_MODULE_WD}"/README.markdown
3078 - fi
3079 -
3080 - if use nginx_modules_http_auth_ldap; then
3081 - docinto ${HTTP_LDAP_MODULE_P}
3082 - dodoc "${HTTP_LDAP_MODULE_WD}"/example.conf
3083 - fi
3084 -}
3085 -
3086 -pkg_postinst() {
3087 - if use ssl; then
3088 - if [[ ! -f "${EROOT}"/etc/ssl/${PN}/${PN}.key ]]; then
3089 - install_cert /etc/ssl/${PN}/${PN}
3090 - use prefix || chown ${PN}:${PN} "${EROOT}"/etc/ssl/${PN}/${PN}.{crt,csr,key,pem}
3091 - fi
3092 - fi
3093 -
3094 - if use nginx_modules_http_spdy; then
3095 - ewarn ""
3096 - ewarn "In nginx 1.9.5 the spdy module was superseded by http2."
3097 - ewarn "Update your configs and package.use accordingly."
3098 - fi
3099 -
3100 - if use nginx_modules_http_lua; then
3101 - ewarn ""
3102 - ewarn "While you can build lua 3rd party module against ${P}"
3103 - ewarn "the author warns that >=${PN}-1.11.11 is still not an"
3104 - ewarn "officially supported target yet. You are on your own."
3105 - ewarn "Expect runtime failures, memory leaks and other problems!"
3106 - fi
3107 -
3108 - if use nginx_modules_http_lua && use http2; then
3109 - ewarn ""
3110 - ewarn "Lua 3rd party module author warns against using ${P} with"
3111 - ewarn "NGINX_MODULES_HTTP=\"lua http2\". For more info, see https://git.io/OldLsg"
3112 - fi
3113 -
3114 - local _n_permission_layout_checks=0
3115 - local _has_to_adjust_permissions=0
3116 - local _has_to_show_permission_warning=0
3117 -
3118 - # Defaults to 1 to inform people doing a fresh installation
3119 - # that we ship modified {scgi,uwsgi,fastcgi}_params files
3120 - local _has_to_show_httpoxy_mitigation_notice=1
3121 -
3122 - local _replacing_version=
3123 - for _replacing_version in ${REPLACING_VERSIONS}; do
3124 - _n_permission_layout_checks=$((${_n_permission_layout_checks}+1))
3125 -
3126 - if [[ ${_n_permission_layout_checks} -gt 1 ]]; then
3127 - # Should never happen:
3128 - # Package is abusing slots but doesn't allow multiple parallel installations.
3129 - # If we run into this situation it is unsafe to automatically adjust any
3130 - # permission...
3131 - _has_to_show_permission_warning=1
3132 -
3133 - ewarn "Replacing multiple ${PN}' versions is unsupported! " \
3134 - "You will have to adjust permissions on your own."
3135 -
3136 - break
3137 - fi
3138 -
3139 - local _replacing_version_branch=$(ver_cut 1-2 "${_replacing_version}")
3140 - debug-print "Updating an existing installation (v${_replacing_version}; branch '${_replacing_version_branch}') ..."
3141 -
3142 - # Do we need to adjust permissions to fix CVE-2013-0337 (bug #458726, #469094)?
3143 - # This was before we introduced multiple nginx versions so we
3144 - # do not need to distinguish between stable and mainline
3145 - local _need_to_fix_CVE2013_0337=1
3146 -
3147 - if ver_test ${_replacing_version} -ge 1.4.1-r2; then
3148 - # We are updating an installation which should already be fixed
3149 - _need_to_fix_CVE2013_0337=0
3150 - debug-print "Skipping CVE-2013-0337 ... existing installation should not be affected!"
3151 - else
3152 - _has_to_adjust_permissions=1
3153 - debug-print "Need to adjust permissions to fix CVE-2013-0337!"
3154 - fi
3155 -
3156 - # Do we need to inform about HTTPoxy mitigation?
3157 - # In repository since commit 8be44f76d4ac02cebcd1e0e6e6284bb72d054b0f
3158 - if ver_test ${_replacing_version_branch} -lt 1.10; then
3159 - # Updating from <1.10
3160 - _has_to_show_httpoxy_mitigation_notice=1
3161 - debug-print "Need to inform about HTTPoxy mitigation!"
3162 - else
3163 - # Updating from >=1.10
3164 - local _fixed_in_pvr=
3165 - case "${_replacing_version_branch}" in
3166 - "1.10")
3167 - _fixed_in_pvr="1.10.1-r2"
3168 - ;;
3169 - "1.11")
3170 - _fixed_in_pvr="1.11.3-r1"
3171 - ;;
3172 - *)
3173 - # This should be any future branch.
3174 - # If we run this code it is safe to assume that the user has
3175 - # already seen the HTTPoxy mitigation notice because he/she is doing
3176 - # an update from previous version where we have already shown
3177 - # the warning. Otherwise, we wouldn't hit this code path ...
3178 - _fixed_in_pvr=
3179 - esac
3180 -
3181 - if [[ -z "${_fixed_in_pvr}" ]] || ver_test ${_replacing_version} -ge ${_fixed_in_pvr}; then
3182 - # We are updating an installation where we already informed
3183 - # that we are mitigating HTTPoxy per default
3184 - _has_to_show_httpoxy_mitigation_notice=0
3185 - debug-print "No need to inform about HTTPoxy mitigation ... information was already shown for existing installation!"
3186 - else
3187 - _has_to_show_httpoxy_mitigation_notice=1
3188 - debug-print "Need to inform about HTTPoxy mitigation!"
3189 - fi
3190 - fi
3191 -
3192 - # Do we need to adjust permissions to fix CVE-2016-1247 (bug #605008)?
3193 - # All branches up to 1.11 are affected
3194 - local _need_to_fix_CVE2016_1247=1
3195 -
3196 - if ver_test ${_replacing_version_branch} -lt 1.10; then
3197 - # Updating from <1.10
3198 - _has_to_adjust_permissions=1
3199 - debug-print "Need to adjust permissions to fix CVE-2016-1247!"
3200 - else
3201 - # Updating from >=1.10
3202 - local _fixed_in_pvr=
3203 - case "${_replacing_version_branch}" in
3204 - "1.10")
3205 - _fixed_in_pvr="1.10.2-r3"
3206 - ;;
3207 - "1.11")
3208 - _fixed_in_pvr="1.11.6-r1"
3209 - ;;
3210 - *)
3211 - # This should be any future branch.
3212 - # If we run this code it is safe to assume that we have already
3213 - # adjusted permissions or were never affected because user is
3214 - # doing an update from previous version which was safe or did
3215 - # the adjustments. Otherwise, we wouldn't hit this code path ...
3216 - _fixed_in_pvr=
3217 - esac
3218 -
3219 - if [[ -z "${_fixed_in_pvr}" ]] || ver_test ${_replacing_version} -ge ${_fixed_in_pvr}; then
3220 - # We are updating an installation which should already be adjusted
3221 - # or which was never affected
3222 - _need_to_fix_CVE2016_1247=0
3223 - debug-print "Skipping CVE-2016-1247 ... existing installation should not be affected!"
3224 - else
3225 - _has_to_adjust_permissions=1
3226 - debug-print "Need to adjust permissions to fix CVE-2016-1247!"
3227 - fi
3228 - fi
3229 - done
3230 -
3231 - if [[ ${_has_to_adjust_permissions} -eq 1 ]]; then
3232 - # We do not DIE when chmod/chown commands are failing because
3233 - # package is already merged on user's system at this stage
3234 - # and we cannot retry without losing the information that
3235 - # the existing installation needs to adjust permissions.
3236 - # Instead we are going to a show a big warning ...
3237 -
3238 - if [[ ${_has_to_show_permission_warning} -eq 0 ]] && [[ ${_need_to_fix_CVE2013_0337} -eq 1 ]]; then
3239 - ewarn ""
3240 - ewarn "The world-readable bit (if set) has been removed from the"
3241 - ewarn "following directories to mitigate a security bug"
3242 - ewarn "(CVE-2013-0337, bug #458726):"
3243 - ewarn ""
3244 - ewarn " ${EPREFIX}/var/log/nginx"
3245 - ewarn " ${EPREFIX}${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi}"
3246 - ewarn ""
3247 - ewarn "Check if this is correct for your setup before restarting nginx!"
3248 - ewarn "This is a one-time change and will not happen on subsequent updates."
3249 - ewarn "Furthermore nginx' temp directories got moved to '${EPREFIX}${NGINX_HOME_TMP}'"
3250 - chmod o-rwx \
3251 - "${EPREFIX}"/var/log/nginx \
3252 - "${EPREFIX}"${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi} || \
3253 - _has_to_show_permission_warning=1
3254 - fi
3255 -
3256 - if [[ ${_has_to_show_permission_warning} -eq 0 ]] && [[ ${_need_to_fix_CVE2016_1247} -eq 1 ]]; then
3257 - ewarn ""
3258 - ewarn "The permissions on the following directory have been reset in"
3259 - ewarn "order to mitigate a security bug (CVE-2016-1247, bug #605008):"
3260 - ewarn ""
3261 - ewarn " ${EPREFIX}/var/log/nginx"
3262 - ewarn ""
3263 - ewarn "Check if this is correct for your setup before restarting nginx!"
3264 - ewarn "Also ensure that no other log directory used by any of your"
3265 - ewarn "vhost(s) is not writeable for nginx user. Any of your log files"
3266 - ewarn "used by nginx can be abused to escalate privileges!"
3267 - ewarn "This is a one-time change and will not happen on subsequent updates."
3268 - chown 0:nginx "${EPREFIX}"/var/log/nginx || _has_to_show_permission_warning=1
3269 - chmod 710 "${EPREFIX}"/var/log/nginx || _has_to_show_permission_warning=1
3270 - fi
3271 -
3272 - if [[ ${_has_to_show_permission_warning} -eq 1 ]]; then
3273 - # Should never happen ...
3274 - ewarn ""
3275 - ewarn "*************************************************************"
3276 - ewarn "*************** W A R N I N G ***************"
3277 - ewarn "*************************************************************"
3278 - ewarn "The one-time only attempt to adjust permissions of the"
3279 - ewarn "existing nginx installation failed. Be aware that we will not"
3280 - ewarn "try to adjust the same permissions again because now you are"
3281 - ewarn "using a nginx version where we expect that the permissions"
3282 - ewarn "are already adjusted or that you know what you are doing and"
3283 - ewarn "want to keep custom permissions."
3284 - ewarn ""
3285 - fi
3286 - fi
3287 -
3288 - # Sanity check for CVE-2016-1247
3289 - # Required to warn users who received the warning above and thought
3290 - # they could fix it by unmerging and re-merging the package or have
3291 - # unmerged a affected installation on purpose in the past leaving
3292 - # /var/log/nginx on their system due to keepdir/non-empty folder
3293 - # and are now installing the package again.
3294 - local _sanity_check_testfile=$(mktemp --dry-run "${EPREFIX}"/var/log/nginx/.CVE-2016-1247.XXXXXXXXX)
3295 - su -s /bin/sh -c "touch ${_sanity_check_testfile}" nginx >&/dev/null
3296 - if [ $? -eq 0 ] ; then
3297 - # Cleanup -- no reason to die here!
3298 - rm -f "${_sanity_check_testfile}"
3299 -
3300 - ewarn ""
3301 - ewarn "*************************************************************"
3302 - ewarn "*************** W A R N I N G ***************"
3303 - ewarn "*************************************************************"
3304 - ewarn "Looks like your installation is vulnerable to CVE-2016-1247"
3305 - ewarn "(bug #605008) because nginx user is able to create files in"
3306 - ewarn ""
3307 - ewarn " ${EPREFIX}/var/log/nginx"
3308 - ewarn ""
3309 - ewarn "Also ensure that no other log directory used by any of your"
3310 - ewarn "vhost(s) is not writeable for nginx user. Any of your log files"
3311 - ewarn "used by nginx can be abused to escalate privileges!"
3312 - fi
3313 -
3314 - if [[ ${_has_to_show_httpoxy_mitigation_notice} -eq 1 ]]; then
3315 - # HTTPoxy mitigation
3316 - ewarn ""
3317 - ewarn "This nginx installation comes with a mitigation for the HTTPoxy"
3318 - ewarn "vulnerability for FastCGI, SCGI and uWSGI applications by setting"
3319 - ewarn "the HTTP_PROXY parameter to an empty string per default when you"
3320 - ewarn "are sourcing one of the default"
3321 - ewarn ""
3322 - ewarn " - 'fastcgi_params' or 'fastcgi.conf'"
3323 - ewarn " - 'scgi_params'"
3324 - ewarn " - 'uwsgi_params'"
3325 - ewarn ""
3326 - ewarn "files in your server block(s)."
3327 - ewarn ""
3328 - ewarn "If this is causing any problems for you make sure that you are sourcing the"
3329 - ewarn "default parameters _before_ you set your own values."
3330 - ewarn "If you are relying on user-supplied proxy values you have to remove the"
3331 - ewarn "correlating lines from the file(s) mentioned above."
3332 - ewarn ""
3333 - fi
3334 -}