1 |
commit: 594f6913c9d77a9025c1ba947f456261726efcf9 |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue May 26 18:09:41 2020 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue May 26 18:40:53 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=594f6913 |
7 |
|
8 |
www-servers/nginx: drop old |
9 |
|
10 |
Package-Manager: Portage-2.3.100, Repoman-2.3.22 |
11 |
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> |
12 |
|
13 |
www-servers/nginx/Manifest | 8 +- |
14 |
www-servers/nginx/nginx-1.16.1-r1.ebuild | 1090 ---------------------------- |
15 |
www-servers/nginx/nginx-1.17.10-r1.ebuild | 1093 ----------------------------- |
16 |
3 files changed, 1 insertion(+), 2190 deletions(-) |
17 |
|
18 |
diff --git a/www-servers/nginx/Manifest b/www-servers/nginx/Manifest |
19 |
index e3ee2189b10..523b0974076 100644 |
20 |
--- a/www-servers/nginx/Manifest |
21 |
+++ b/www-servers/nginx/Manifest |
22 |
@@ -1,6 +1,4 @@ |
23 |
DIST modsecurity-2.9.3.tar.gz 4307670 BLAKE2B 337ea15cc8805af7ab43aed8aecf4c72ccc586d0d7e9d9b91f036a61baa70d1ac8b4ad8045a2bb7a13515912a15fba7d3cdb9670ae6730de43b1e44ee90ded6d SHA512 4e1ea5dd8edadf8f630e4fe92a200d3a8e78963fce3128b5975a1e1ecd0e8bf9ceecd9905c95f8c508932ccd837f1d8ae8bb2ba423307718c3c6a4ae9b783ddd |
24 |
-DIST nginx-1.16.1.tar.gz 1032630 BLAKE2B 838c5f08b56378dd3ef3940a979eb1449c4ed7ef5b4b112da2531c0996d121ae32ae4e94d3b4ba198fefcdc1b06683e4b0cfa0087db82fcab13bffb5f67f8aa4 SHA512 17e95b43fa47d4fef5e652dea587518e16ab5ec562c9c94355c356440166d4b6a6a41ee520d406e5a34791a327d2e3c46b3f9b105ac9ce07afdd495c49eca437 |
25 |
-DIST nginx-1.17.10.tar.gz 1039541 BLAKE2B 5e86be6c6aebfd336579269ecfa09eab9ff5c0185e0bd36f993b5ccac4d13f64ef3d10cad4d0ac00c7fb67e3ecb048b7b0f4c74cf5c5376fdc643b5cecee28ac SHA512 0b49169bc49e07733862e09ec5bfa93601ffa57379f98d52a115e511502905baf4cd33b73a03d74416f8c6ffa95ebf4459fc934bd40bfdf54d5b6d35ac4f8756 |
26 |
DIST nginx-1.18.0.tar.gz 1039530 BLAKE2B a8962a6af96acb043ff0c3dc4ad5192083773c449950aff53b01f6f7c46a2a540eb061a43432acccd753fa71067b1451d75f440ba5526575b78608be9d40a50b SHA512 8c21eeb62ab6e32e436932500f700bd2fb99fd2d29e43c08a5bfed4714c189c29c7141db551fcd5d2437303b7439f71758f7407dfd3e801e704e45e7daa78ddb |
27 |
DIST nginx-auth-ldap-42d195d7a7575ebab1c369ad3fc5d78dc2c2669c.tar.gz 18457 BLAKE2B 22225ca9e5299b20ab5a93a001cac48e446bd86b3a24ac49e716bc975b128890bdb4b0dbbf5730fbaaeadfd958160093c7a6af798dd0e6de27062f149a760333 SHA512 ec59637fda5acac053e815cb1d04b545fc6b765e5ec63d8c2c9c301abad87afaa2698145acac08e9e14c91e1423ebff7aff0cca2b940b19ccccbf4cf53973269 |
28 |
DIST nginx_http_sticky_module_ng-1.2.6-10-g08a395c66e42.tar.bz2 124047 BLAKE2B d37ef9a15c91abe3c6258e420d1f99fa452f9d9966a0e13102174973314a3bac5413957a5fe632a9dcb1163b3be5df8116e05cc053ee061e19319ec25f341570 SHA512 6c1bfdcf89884b2855d51ae7da0f6e53a4ca3629e1aaf58433b70c07dcb2af797ba6e87d9b3eb4fe2fb6d4d697e862f2b4c2f8d8b3fdaea201740c97ec936529 |
29 |
@@ -9,10 +7,8 @@ DIST ngx_devel_kit-0.3.1.tar.gz 66542 BLAKE2B 8242d884464d99a131a48f599f9d0c2b54 |
30 |
DIST ngx_http_auth_pam-1.5.1.tar.gz 6863 BLAKE2B 00807cc3db8f6c007c968b8a30d7f6094b7d9db4eaa60d211fcb3ac60aeb28c5f8193578a7e1ca67acbbf57a319c8442fe44efc1e193927c3bce5961539f9c16 SHA512 973b94874d8a58c0df0ac2d31571eafc1e80b11179cba33ec88421a826207fbf7e99b0387e135a1ca48d82daacb78f19a4c21d3a27b49b16dc86b4748bb72261 |
31 |
DIST ngx_http_cache_purge-2.3.tar.gz 12248 BLAKE2B f83b267f4c19a9d4af5964522695814c164d200ecd4108bf8f6b5c21388eba8af989bdda646dee18a03174211e8c090a04736bbeb44043cb0e19fbccdc66278e SHA512 50a31dbf2216a6fae74a186af56dec4600cf55777e76a10ac0075f609e7737135aab063a64f2590dddcd0369ebebd4a523027f3d9ebcca74f7b4355be1c5dcc0 |
32 |
DIST ngx_http_dav_ext-3.0.0.tar.gz 14558 BLAKE2B 0d370bfe34600d43a540dd19a386aa52ce135b2eae14e4e108a359d5ff3405939130d1c802062c7523057ec35d38322d3fbed8c13deb58ce7a08ebf9e3f106d4 SHA512 d0193ba90f1ef46c4e470630c4394bdf99d94fd2e3bd8be6cb2ba1655ec59944b1269025f032b79dc2c6dad366e54389ef6a6da2ddeb91d535a4027f2162fbde |
33 |
-DIST ngx_http_echo-0.61.tar.gz 53155 BLAKE2B 72565b5d79598b5dcd1c10fa0f718e749894ca5f1232d5aae60c61e268b5904af35fdcd35afcf72de93852af9e0ca58805d77cbc37919fba9012158b5545baab SHA512 c90b81a4e85a8e9beeb5ff591dc91adb25fa4e0b6cb47086b577e5fa36db2368442dd011187675e358781956c364b949bc4d920ca2b534481b21c9987d2a9a3b |
34 |
DIST ngx_http_echo-0.62rc1.tar.gz 53331 BLAKE2B e7fded849e34a64804dbbc62cd7b535683c65f12b571a7382d3e6a0700ce000853c40a9715c238414a000361613eb3fa550b72f15eeda6d8d99346a0e54e8604 SHA512 9f4e1a91058c803c14711a1a66175e373ad0e05353c72963c39cda9bc5396e792ec1a3d18738af9991bee35bfd5d39d4c1777859ac1db0c0f73c6873b535746e |
35 |
-DIST ngx_http_fancyindex-0.4.3.tar.gz 25274 BLAKE2B 5ce3102326f6b8cc2b333ed08f7a66476842d2c70089175e577a3ba958317ed702f24ece002506007eb45e9e50b8f6ecb137cde222566308986cba2682b70f7d SHA512 fe5f6afc29c99f66151c1a06e27b5749b0a16227638583d9c961adc94b2942b981184382f95e70d927f00b09b43f597b963a85a41bde5903b10e42f86bc321f1 |
36 |
-DIST ngx_http_geoip2_module-3.2.tar.gz 8465 BLAKE2B 93d1fb9573e9dbd932670a595d2c0341571eaa2e079ed98e85e282712dc0cdfb798d59ccc2ae7466dab23e093c2eec17d1694f2748d80683928ad135b70b0bfc SHA512 84b26955234e29dbfbf2431b652fcc453c5e86b95f837296df4f3d6c730e3e0773223dae890eebfc9b5763f46082bde6f38d6505b8bf78133b89e7297016cc5d |
37 |
+DIST ngx_http_fancyindex-0.4.4.tar.gz 26292 BLAKE2B a1ed76cb31cd4f7a349bcbe63d75f8e00331d0ba4ee9b7b1df41dac77fe64ebe6c72a6fd5f6ebc9de53e8d3a8a2ad5185fbaa533d8ff008fcf92f6956f267d80 SHA512 bf8ebb188c10fee5e6ebcb338fe20fdf859bb88d9b2b0e3da6f3e2f1847738d30760d2642d0dfe257092bdf2399b561631556a3a8e2fb33dc9cd0c59d371c173 |
38 |
DIST ngx_http_geoip2_module-3.3.tar.gz 8509 BLAKE2B 4841e1bdd13b9b85f34732d1eb7447638f62bb09e1bd480da0fa8b0085d3b2d90a740732ef534c355feb71d7db613c73f68a4e6e3624b47a0937be046dfa1f8d SHA512 06963b598c54e22d75ce837fb222f5aa6c9494c29e558ff46f1205d7159fc305414bfac4ed3288c836dcbf7628d92f26458e1992d34fc2f4b73275a32847bdc0 |
39 |
DIST ngx_http_headers_more-0.33.tar.gz 28130 BLAKE2B fe3097a7700ce5da087058f7bb44c95164b75137031187400473f6833bf0e33e5c4920807225a6ff94174fe7dbd6186cca176a33a629ca0911faab6804bdd12a SHA512 13165b1b8d4be281b8bd2404fa48d456013d560bace094c81da08a35dc6a4f025a809a3ae3a42be6bbf67abbcbe41e0730aba06f905220f3baeb01e1192a7d37 |
40 |
DIST ngx_http_lua-0.10.15.tar.gz 655110 BLAKE2B 73bf8e2f157c93f3d4e54b5aa63deb266731a10e3e48b2257756efee8d752e86440ca9c27bd27bc1d90075a5ffb58772eecb7c445db44cd055d2b9e0b4bac082 SHA512 1feea538464275e6e571860592628ad639b2259c8aab7f38575b81c0b355f1ade32a91643267bc9ec16519e3bcf3d132511513dc8c949f74a3bff975c85d8ff7 |
41 |
@@ -26,6 +22,4 @@ DIST ngx_memc_module-0.19.tar.gz 34654 BLAKE2B 536384c264d88535179634d459d3a47b1 |
42 |
DIST ngx_metrics-0.1.1.tar.gz 2964 BLAKE2B 95d71ea26c949c345b83e353bd66a20df18cc8b2b93f692615a1b39c1f327393647f80e7a27e6929799a6e7e3469b61e1cd72f7821f7a820da4dd7cd9a96d85c SHA512 d36a8fb0104c83b6b564e03b351aa750cab08650264c74d6f786af357bfb7006b531a93270dd961896ea8dafe27e5db8548ede714c5f52c4742876bc73af4b5e |
43 |
DIST ngx_mogilefs_module-1.0.4.tar.gz 11208 BLAKE2B e0729b66554c8890727190a624d4c9aef6499dfc2e301541a9bfc15690caf6d3155c8a4b8f7a1555a7655b47aa0cd1b797aeb8ba82efa92ab80808218a0bdcff SHA512 b8cb7eaf6274f4e2247dbcb39db05072d2b2d4361256a325fafab5533d7ce0c4ae9e2905b954dfcfa4789c9cab5cccf2ac1c3a1f02f6a327ed95b562d7773ed1 |
44 |
DIST ngx_rtmp-1.2.1.tar.gz 519919 BLAKE2B 744ccb8031eb9653f158f9eceba64fc9c8af7b9a42e64ef996ab3bbbe1402e5ffd3efcc8e4aaca437eb5e208e4b6f2d8643fcca953b32f32543eaa1ae4d9505c SHA512 4a0af5e9afa4deb0b53de8de7ddb2cfa6430d372e1ef9e421f01b509548bd134d427345442ac1ce667338cc2a1484dc2ab732e316e878ac7d3537dc527d5f922 |
45 |
-DIST njs-0.3.5.tar.gz 339177 BLAKE2B 6327be0b7c8077870408722376782bca579a6cfdf1fe2a4950fc0d289311ad21f671bc2b47d06f70d95d4f68d99e8c70fd4598dcc167b79c57704d99a098d284 SHA512 236e0284f251856f74eb51d8251bb5be725d2ca90056f2feef7677eb636a4e97e203f3bba81fb6b677158d615dc2d6ffcb0dc1059fb678ab12b7d14cc4ea7241 |
46 |
-DIST njs-0.4.0.tar.gz 418439 BLAKE2B e4b9f529a10f90ece864a6b1969507e9573296288ef85f4a71163644415404d4541129326ef9635fe5b8aff3b59ab76c2b3995894c41a53ffb632b6bee8b8e5f SHA512 ea9a063ef83791dd7a7896c584d1b8c635c3ff81792c6e5bad61bdfe8185c6f9ce436ad5e360b267b42bf0d5986553bbdf3c0f1264627f82550aadc361be0a3c |
47 |
DIST njs-0.4.1.tar.gz 422917 BLAKE2B 8a6b9c06b74256289636e06437a8160a0e91767959cd2c4dde4f6769437b2654cd2aa6e65902251bd135429c87ef497f7137ffe0afee72c2723d147db8615810 SHA512 58ae280be37ac0402886281837b82a7038ea62d3bde5a0857d8008806937b2d11fe4984986b1e40bd9528ee8d2f5aac271346dc387f30930161cc2b41aa08998 |
48 |
|
49 |
diff --git a/www-servers/nginx/nginx-1.16.1-r1.ebuild b/www-servers/nginx/nginx-1.16.1-r1.ebuild |
50 |
deleted file mode 100644 |
51 |
index 6c2a3c9e53d..00000000000 |
52 |
--- a/www-servers/nginx/nginx-1.16.1-r1.ebuild |
53 |
+++ /dev/null |
54 |
@@ -1,1090 +0,0 @@ |
55 |
-# Copyright 1999-2020 Gentoo Authors |
56 |
-# Distributed under the terms of the GNU General Public License v2 |
57 |
- |
58 |
-EAPI="6" |
59 |
- |
60 |
-# Maintainer notes: |
61 |
-# - http_rewrite-independent pcre-support makes sense for matching locations without an actual rewrite |
62 |
-# - any http-module activates the main http-functionality and overrides USE=-http |
63 |
-# - keep the following requirements in mind before adding external modules: |
64 |
-# * alive upstream |
65 |
-# * sane packaging |
66 |
-# * builds cleanly |
67 |
-# * does not need a patch for nginx core |
68 |
-# - TODO: test the google-perftools module (included in vanilla tarball) |
69 |
- |
70 |
-# prevent perl-module from adding automagic perl DEPENDs |
71 |
-GENTOO_DEPEND_ON_PERL="no" |
72 |
- |
73 |
-# devel_kit (https://github.com/simpl/ngx_devel_kit, BSD license) |
74 |
-DEVEL_KIT_MODULE_PV="0.3.1" |
75 |
-DEVEL_KIT_MODULE_P="ngx_devel_kit-${DEVEL_KIT_MODULE_PV}" |
76 |
-DEVEL_KIT_MODULE_URI="https://github.com/simpl/ngx_devel_kit/archive/v${DEVEL_KIT_MODULE_PV}.tar.gz" |
77 |
-DEVEL_KIT_MODULE_WD="${WORKDIR}/ngx_devel_kit-${DEVEL_KIT_MODULE_PV}" |
78 |
- |
79 |
-# ngx_brotli (https://github.com/eustas/ngx_brotli, BSD-2) |
80 |
-HTTP_BROTLI_MODULE_PV="8104036af9cff4b1d34f22d00ba857e2a93a243c" |
81 |
-HTTP_BROTLI_MODULE_P="ngx_brotli-${HTTP_BROTLI_MODULE_PV}" |
82 |
-HTTP_BROTLI_MODULE_URI="https://github.com/eustas/ngx_brotli/archive/${HTTP_BROTLI_MODULE_PV}.tar.gz" |
83 |
-HTTP_BROTLI_MODULE_WD="${WORKDIR}/ngx_brotli-${HTTP_BROTLI_MODULE_PV}" |
84 |
- |
85 |
-# http_uploadprogress (https://github.com/masterzen/nginx-upload-progress-module, BSD-2 license) |
86 |
-HTTP_UPLOAD_PROGRESS_MODULE_PV="0.9.2" |
87 |
-HTTP_UPLOAD_PROGRESS_MODULE_P="ngx_http_upload_progress-${HTTP_UPLOAD_PROGRESS_MODULE_PV}-r1" |
88 |
-HTTP_UPLOAD_PROGRESS_MODULE_URI="https://github.com/masterzen/nginx-upload-progress-module/archive/v${HTTP_UPLOAD_PROGRESS_MODULE_PV}.tar.gz" |
89 |
-HTTP_UPLOAD_PROGRESS_MODULE_WD="${WORKDIR}/nginx-upload-progress-module-${HTTP_UPLOAD_PROGRESS_MODULE_PV}" |
90 |
- |
91 |
-# http_headers_more (https://github.com/agentzh/headers-more-nginx-module, BSD license) |
92 |
-HTTP_HEADERS_MORE_MODULE_PV="0.33" |
93 |
-HTTP_HEADERS_MORE_MODULE_P="ngx_http_headers_more-${HTTP_HEADERS_MORE_MODULE_PV}" |
94 |
-HTTP_HEADERS_MORE_MODULE_URI="https://github.com/agentzh/headers-more-nginx-module/archive/v${HTTP_HEADERS_MORE_MODULE_PV}.tar.gz" |
95 |
-HTTP_HEADERS_MORE_MODULE_WD="${WORKDIR}/headers-more-nginx-module-${HTTP_HEADERS_MORE_MODULE_PV}" |
96 |
- |
97 |
-# http_cache_purge (http://labs.frickle.com/nginx_ngx_cache_purge/, https://github.com/FRiCKLE/ngx_cache_purge, BSD-2 license) |
98 |
-HTTP_CACHE_PURGE_MODULE_PV="2.3" |
99 |
-HTTP_CACHE_PURGE_MODULE_P="ngx_http_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}" |
100 |
-HTTP_CACHE_PURGE_MODULE_URI="http://labs.frickle.com/files/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}.tar.gz" |
101 |
-HTTP_CACHE_PURGE_MODULE_WD="${WORKDIR}/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}" |
102 |
- |
103 |
-# http_slowfs_cache (http://labs.frickle.com/nginx_ngx_slowfs_cache/, BSD-2 license) |
104 |
-HTTP_SLOWFS_CACHE_MODULE_PV="1.10" |
105 |
-HTTP_SLOWFS_CACHE_MODULE_P="ngx_http_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}" |
106 |
-HTTP_SLOWFS_CACHE_MODULE_URI="http://labs.frickle.com/files/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}.tar.gz" |
107 |
-HTTP_SLOWFS_CACHE_MODULE_WD="${WORKDIR}/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}" |
108 |
- |
109 |
-# http_fancyindex (https://github.com/aperezdc/ngx-fancyindex, BSD license) |
110 |
-HTTP_FANCYINDEX_MODULE_PV="0.4.3" |
111 |
-HTTP_FANCYINDEX_MODULE_P="ngx_http_fancyindex-${HTTP_FANCYINDEX_MODULE_PV}" |
112 |
-HTTP_FANCYINDEX_MODULE_URI="https://github.com/aperezdc/ngx-fancyindex/archive/v${HTTP_FANCYINDEX_MODULE_PV}.tar.gz" |
113 |
-HTTP_FANCYINDEX_MODULE_WD="${WORKDIR}/ngx-fancyindex-${HTTP_FANCYINDEX_MODULE_PV}" |
114 |
- |
115 |
-# http_lua (https://github.com/openresty/lua-nginx-module, BSD license) |
116 |
-HTTP_LUA_MODULE_PV="0.10.15" |
117 |
-HTTP_LUA_MODULE_P="ngx_http_lua-${HTTP_LUA_MODULE_PV}" |
118 |
-HTTP_LUA_MODULE_URI="https://github.com/openresty/lua-nginx-module/archive/v${HTTP_LUA_MODULE_PV}.tar.gz" |
119 |
-HTTP_LUA_MODULE_WD="${WORKDIR}/lua-nginx-module-${HTTP_LUA_MODULE_PV}" |
120 |
- |
121 |
-# http_auth_pam (https://github.com/stogh/ngx_http_auth_pam_module/, http://web.iti.upv.es/~sto/nginx/, BSD-2 license) |
122 |
-HTTP_AUTH_PAM_MODULE_PV="1.5.1" |
123 |
-HTTP_AUTH_PAM_MODULE_P="ngx_http_auth_pam-${HTTP_AUTH_PAM_MODULE_PV}" |
124 |
-HTTP_AUTH_PAM_MODULE_URI="https://github.com/stogh/ngx_http_auth_pam_module/archive/v${HTTP_AUTH_PAM_MODULE_PV}.tar.gz" |
125 |
-HTTP_AUTH_PAM_MODULE_WD="${WORKDIR}/ngx_http_auth_pam_module-${HTTP_AUTH_PAM_MODULE_PV}" |
126 |
- |
127 |
-# http_upstream_check (https://github.com/yaoweibin/nginx_upstream_check_module, BSD license) |
128 |
-HTTP_UPSTREAM_CHECK_MODULE_PV="9aecf15ec379fe98f62355c57b60c0bc83296f04" |
129 |
-HTTP_UPSTREAM_CHECK_MODULE_P="ngx_http_upstream_check-${HTTP_UPSTREAM_CHECK_MODULE_PV}" |
130 |
-HTTP_UPSTREAM_CHECK_MODULE_URI="https://github.com/yaoweibin/nginx_upstream_check_module/archive/${HTTP_UPSTREAM_CHECK_MODULE_PV}.tar.gz" |
131 |
-HTTP_UPSTREAM_CHECK_MODULE_WD="${WORKDIR}/nginx_upstream_check_module-${HTTP_UPSTREAM_CHECK_MODULE_PV}" |
132 |
- |
133 |
-# http_metrics (https://github.com/zenops/ngx_metrics, BSD license) |
134 |
-HTTP_METRICS_MODULE_PV="0.1.1" |
135 |
-HTTP_METRICS_MODULE_P="ngx_metrics-${HTTP_METRICS_MODULE_PV}" |
136 |
-HTTP_METRICS_MODULE_URI="https://github.com/madvertise/ngx_metrics/archive/v${HTTP_METRICS_MODULE_PV}.tar.gz" |
137 |
-HTTP_METRICS_MODULE_WD="${WORKDIR}/ngx_metrics-${HTTP_METRICS_MODULE_PV}" |
138 |
- |
139 |
-# http_vhost_traffic_status (https://github.com/vozlt/nginx-module-vts, BSD license) |
140 |
-HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV="46d85558e344dfe2b078ce757fd36c69a1ec2dd3" |
141 |
-HTTP_VHOST_TRAFFIC_STATUS_MODULE_P="ngx_http_vhost_traffic_status-${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}" |
142 |
-HTTP_VHOST_TRAFFIC_STATUS_MODULE_URI="https://github.com/vozlt/nginx-module-vts/archive/${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}.tar.gz" |
143 |
-HTTP_VHOST_TRAFFIC_STATUS_MODULE_WD="${WORKDIR}/nginx-module-vts-${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}" |
144 |
- |
145 |
-# naxsi-core (https://github.com/nbs-system/naxsi, GPLv2+) |
146 |
-HTTP_NAXSI_MODULE_PV="0.56" |
147 |
-HTTP_NAXSI_MODULE_P="ngx_http_naxsi-${HTTP_NAXSI_MODULE_PV}" |
148 |
-HTTP_NAXSI_MODULE_URI="https://github.com/nbs-system/naxsi/archive/${HTTP_NAXSI_MODULE_PV}.tar.gz" |
149 |
-HTTP_NAXSI_MODULE_WD="${WORKDIR}/naxsi-${HTTP_NAXSI_MODULE_PV}/naxsi_src" |
150 |
- |
151 |
-# nginx-rtmp-module (https://github.com/arut/nginx-rtmp-module, BSD license) |
152 |
-RTMP_MODULE_PV="1.2.1" |
153 |
-RTMP_MODULE_P="ngx_rtmp-${RTMP_MODULE_PV}" |
154 |
-RTMP_MODULE_URI="https://github.com/arut/nginx-rtmp-module/archive/v${RTMP_MODULE_PV}.tar.gz" |
155 |
-RTMP_MODULE_WD="${WORKDIR}/nginx-rtmp-module-${RTMP_MODULE_PV}" |
156 |
- |
157 |
-# nginx-dav-ext-module (https://github.com/arut/nginx-dav-ext-module, BSD license) |
158 |
-HTTP_DAV_EXT_MODULE_PV="3.0.0" |
159 |
-HTTP_DAV_EXT_MODULE_P="ngx_http_dav_ext-${HTTP_DAV_EXT_MODULE_PV}" |
160 |
-HTTP_DAV_EXT_MODULE_URI="https://github.com/arut/nginx-dav-ext-module/archive/v${HTTP_DAV_EXT_MODULE_PV}.tar.gz" |
161 |
-HTTP_DAV_EXT_MODULE_WD="${WORKDIR}/nginx-dav-ext-module-${HTTP_DAV_EXT_MODULE_PV}" |
162 |
- |
163 |
-# echo-nginx-module (https://github.com/openresty/echo-nginx-module, BSD license) |
164 |
-HTTP_ECHO_MODULE_PV="0.61" |
165 |
-HTTP_ECHO_MODULE_P="ngx_http_echo-${HTTP_ECHO_MODULE_PV}" |
166 |
-HTTP_ECHO_MODULE_URI="https://github.com/openresty/echo-nginx-module/archive/v${HTTP_ECHO_MODULE_PV}.tar.gz" |
167 |
-HTTP_ECHO_MODULE_WD="${WORKDIR}/echo-nginx-module-${HTTP_ECHO_MODULE_PV}" |
168 |
- |
169 |
-# mod_security for nginx (https://modsecurity.org/, Apache-2.0) |
170 |
-# keep the MODULE_P here consistent with upstream to avoid tarball duplication |
171 |
-HTTP_SECURITY_MODULE_PV="2.9.3" |
172 |
-HTTP_SECURITY_MODULE_P="modsecurity-${HTTP_SECURITY_MODULE_PV}" |
173 |
-HTTP_SECURITY_MODULE_URI="https://www.modsecurity.org/tarball/${HTTP_SECURITY_MODULE_PV}/${HTTP_SECURITY_MODULE_P}.tar.gz" |
174 |
-HTTP_SECURITY_MODULE_WD="${WORKDIR}/${HTTP_SECURITY_MODULE_P}" |
175 |
- |
176 |
-# push-stream-module (http://www.nginxpushstream.com, https://github.com/wandenberg/nginx-push-stream-module, GPL-3) |
177 |
-HTTP_PUSH_STREAM_MODULE_PV="0.5.4" |
178 |
-HTTP_PUSH_STREAM_MODULE_P="ngx_http_push_stream-${HTTP_PUSH_STREAM_MODULE_PV}" |
179 |
-HTTP_PUSH_STREAM_MODULE_URI="https://github.com/wandenberg/nginx-push-stream-module/archive/${HTTP_PUSH_STREAM_MODULE_PV}.tar.gz" |
180 |
-HTTP_PUSH_STREAM_MODULE_WD="${WORKDIR}/nginx-push-stream-module-${HTTP_PUSH_STREAM_MODULE_PV}" |
181 |
- |
182 |
-# sticky-module (https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng, BSD-2) |
183 |
-HTTP_STICKY_MODULE_PV="1.2.6-10-g08a395c66e42" |
184 |
-HTTP_STICKY_MODULE_P="nginx_http_sticky_module_ng-${HTTP_STICKY_MODULE_PV}" |
185 |
-HTTP_STICKY_MODULE_URI="https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/get/${HTTP_STICKY_MODULE_PV}.tar.bz2" |
186 |
-HTTP_STICKY_MODULE_WD="${WORKDIR}/nginx-goodies-nginx-sticky-module-ng-08a395c66e42" |
187 |
- |
188 |
-# mogilefs-module (https://github.com/vkholodkov/nginx-mogilefs-module, BSD-2) |
189 |
-HTTP_MOGILEFS_MODULE_PV="1.0.4" |
190 |
-HTTP_MOGILEFS_MODULE_P="ngx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}" |
191 |
-HTTP_MOGILEFS_MODULE_URI="https://github.com/vkholodkov/nginx-mogilefs-module/archive/${HTTP_MOGILEFS_MODULE_PV}.tar.gz" |
192 |
-HTTP_MOGILEFS_MODULE_WD="${WORKDIR}/nginx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}" |
193 |
- |
194 |
-# memc-module (https://github.com/openresty/memc-nginx-module, BSD-2) |
195 |
-HTTP_MEMC_MODULE_PV="0.19" |
196 |
-HTTP_MEMC_MODULE_P="ngx_memc_module-${HTTP_MEMC_MODULE_PV}" |
197 |
-HTTP_MEMC_MODULE_URI="https://github.com/openresty/memc-nginx-module/archive/v${HTTP_MEMC_MODULE_PV}.tar.gz" |
198 |
-HTTP_MEMC_MODULE_WD="${WORKDIR}/memc-nginx-module-${HTTP_MEMC_MODULE_PV}" |
199 |
- |
200 |
-# nginx-ldap-auth-module (https://github.com/kvspb/nginx-auth-ldap, BSD-2) |
201 |
-HTTP_LDAP_MODULE_PV="42d195d7a7575ebab1c369ad3fc5d78dc2c2669c" |
202 |
-HTTP_LDAP_MODULE_P="nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}" |
203 |
-HTTP_LDAP_MODULE_URI="https://github.com/kvspb/nginx-auth-ldap/archive/${HTTP_LDAP_MODULE_PV}.tar.gz" |
204 |
-HTTP_LDAP_MODULE_WD="${WORKDIR}/nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}" |
205 |
- |
206 |
-# geoip2 (https://github.com/leev/ngx_http_geoip2_module, BSD-2) |
207 |
-GEOIP2_MODULE_PV="3.2" |
208 |
-GEOIP2_MODULE_P="ngx_http_geoip2_module-${GEOIP2_MODULE_PV}" |
209 |
-GEOIP2_MODULE_URI="https://github.com/leev/ngx_http_geoip2_module/archive/${GEOIP2_MODULE_PV}.tar.gz" |
210 |
-GEOIP2_MODULE_WD="${WORKDIR}/ngx_http_geoip2_module-${GEOIP2_MODULE_PV}" |
211 |
- |
212 |
-# njs-module (https://github.com/nginx/njs, as-is) |
213 |
-NJS_MODULE_PV="0.3.5" |
214 |
-NJS_MODULE_P="njs-${NJS_MODULE_PV}" |
215 |
-NJS_MODULE_URI="https://github.com/nginx/njs/archive/${NJS_MODULE_PV}.tar.gz" |
216 |
-NJS_MODULE_WD="${WORKDIR}/njs-${NJS_MODULE_PV}" |
217 |
- |
218 |
-# We handle deps below ourselves |
219 |
-SSL_DEPS_SKIP=1 |
220 |
-AUTOTOOLS_AUTO_DEPEND="no" |
221 |
- |
222 |
-inherit autotools ssl-cert toolchain-funcs perl-module flag-o-matic user systemd versionator multilib pax-utils |
223 |
- |
224 |
-DESCRIPTION="Robust, small and high performance http and reverse proxy server" |
225 |
-HOMEPAGE="https://nginx.org" |
226 |
-SRC_URI="https://nginx.org/download/${P}.tar.gz |
227 |
- ${DEVEL_KIT_MODULE_URI} -> ${DEVEL_KIT_MODULE_P}.tar.gz |
228 |
- nginx_modules_http_auth_ldap? ( ${HTTP_LDAP_MODULE_URI} -> ${HTTP_LDAP_MODULE_P}.tar.gz ) |
229 |
- nginx_modules_http_auth_pam? ( ${HTTP_AUTH_PAM_MODULE_URI} -> ${HTTP_AUTH_PAM_MODULE_P}.tar.gz ) |
230 |
- nginx_modules_http_brotli? ( ${HTTP_BROTLI_MODULE_URI} -> ${HTTP_BROTLI_MODULE_P}.tar.gz ) |
231 |
- nginx_modules_http_cache_purge? ( ${HTTP_CACHE_PURGE_MODULE_URI} -> ${HTTP_CACHE_PURGE_MODULE_P}.tar.gz ) |
232 |
- nginx_modules_http_dav_ext? ( ${HTTP_DAV_EXT_MODULE_URI} -> ${HTTP_DAV_EXT_MODULE_P}.tar.gz ) |
233 |
- nginx_modules_http_echo? ( ${HTTP_ECHO_MODULE_URI} -> ${HTTP_ECHO_MODULE_P}.tar.gz ) |
234 |
- nginx_modules_http_fancyindex? ( ${HTTP_FANCYINDEX_MODULE_URI} -> ${HTTP_FANCYINDEX_MODULE_P}.tar.gz ) |
235 |
- nginx_modules_http_geoip2? ( ${GEOIP2_MODULE_URI} -> ${GEOIP2_MODULE_P}.tar.gz ) |
236 |
- nginx_modules_http_headers_more? ( ${HTTP_HEADERS_MORE_MODULE_URI} -> ${HTTP_HEADERS_MORE_MODULE_P}.tar.gz ) |
237 |
- nginx_modules_http_javascript? ( ${NJS_MODULE_URI} -> ${NJS_MODULE_P}.tar.gz ) |
238 |
- nginx_modules_http_lua? ( ${HTTP_LUA_MODULE_URI} -> ${HTTP_LUA_MODULE_P}.tar.gz ) |
239 |
- nginx_modules_http_memc? ( ${HTTP_MEMC_MODULE_URI} -> ${HTTP_MEMC_MODULE_P}.tar.gz ) |
240 |
- nginx_modules_http_metrics? ( ${HTTP_METRICS_MODULE_URI} -> ${HTTP_METRICS_MODULE_P}.tar.gz ) |
241 |
- nginx_modules_http_mogilefs? ( ${HTTP_MOGILEFS_MODULE_URI} -> ${HTTP_MOGILEFS_MODULE_P}.tar.gz ) |
242 |
- nginx_modules_http_naxsi? ( ${HTTP_NAXSI_MODULE_URI} -> ${HTTP_NAXSI_MODULE_P}.tar.gz ) |
243 |
- nginx_modules_http_push_stream? ( ${HTTP_PUSH_STREAM_MODULE_URI} -> ${HTTP_PUSH_STREAM_MODULE_P}.tar.gz ) |
244 |
- nginx_modules_http_security? ( ${HTTP_SECURITY_MODULE_URI} -> ${HTTP_SECURITY_MODULE_P}.tar.gz ) |
245 |
- nginx_modules_http_slowfs_cache? ( ${HTTP_SLOWFS_CACHE_MODULE_URI} -> ${HTTP_SLOWFS_CACHE_MODULE_P}.tar.gz ) |
246 |
- nginx_modules_http_sticky? ( ${HTTP_STICKY_MODULE_URI} -> ${HTTP_STICKY_MODULE_P}.tar.bz2 ) |
247 |
- nginx_modules_http_upload_progress? ( ${HTTP_UPLOAD_PROGRESS_MODULE_URI} -> ${HTTP_UPLOAD_PROGRESS_MODULE_P}.tar.gz ) |
248 |
- nginx_modules_http_upstream_check? ( ${HTTP_UPSTREAM_CHECK_MODULE_URI} -> ${HTTP_UPSTREAM_CHECK_MODULE_P}.tar.gz ) |
249 |
- nginx_modules_http_vhost_traffic_status? ( ${HTTP_VHOST_TRAFFIC_STATUS_MODULE_URI} -> ${HTTP_VHOST_TRAFFIC_STATUS_MODULE_P}.tar.gz ) |
250 |
- nginx_modules_stream_geoip2? ( ${GEOIP2_MODULE_URI} -> ${GEOIP2_MODULE_P}.tar.gz ) |
251 |
- nginx_modules_stream_javascript? ( ${NJS_MODULE_URI} -> ${NJS_MODULE_P}.tar.gz ) |
252 |
- rtmp? ( ${RTMP_MODULE_URI} -> ${RTMP_MODULE_P}.tar.gz )" |
253 |
- |
254 |
-LICENSE="BSD-2 BSD SSLeay MIT GPL-2 GPL-2+ |
255 |
- nginx_modules_http_security? ( Apache-2.0 ) |
256 |
- nginx_modules_http_push_stream? ( GPL-3 )" |
257 |
- |
258 |
-SLOT="0" |
259 |
-KEYWORDS="amd64 ~arm ~arm64 ~ppc ~ppc64 x86 ~amd64-linux ~x86-linux" |
260 |
- |
261 |
-# Package doesn't provide a real test suite |
262 |
-RESTRICT="test" |
263 |
- |
264 |
-NGINX_MODULES_STD="access auth_basic autoindex browser charset empty_gif |
265 |
- fastcgi geo grpc gzip limit_req limit_conn map memcached mirror |
266 |
- proxy referer rewrite scgi ssi split_clients upstream_hash |
267 |
- upstream_ip_hash upstream_keepalive upstream_least_conn |
268 |
- upstream_zone userid uwsgi" |
269 |
-NGINX_MODULES_OPT="addition auth_request dav degradation flv geoip gunzip |
270 |
- gzip_static image_filter mp4 perl random_index realip secure_link |
271 |
- slice stub_status sub xslt" |
272 |
-NGINX_MODULES_STREAM_STD="access geo limit_conn map return split_clients |
273 |
- upstream_hash upstream_least_conn upstream_zone" |
274 |
-NGINX_MODULES_STREAM_OPT="geoip realip ssl_preread" |
275 |
-NGINX_MODULES_MAIL="imap pop3 smtp" |
276 |
-NGINX_MODULES_3RD=" |
277 |
- http_auth_ldap |
278 |
- http_auth_pam |
279 |
- http_brotli |
280 |
- http_cache_purge |
281 |
- http_dav_ext |
282 |
- http_echo |
283 |
- http_fancyindex |
284 |
- http_geoip2 |
285 |
- http_headers_more |
286 |
- http_javascript |
287 |
- http_lua |
288 |
- http_memc |
289 |
- http_metrics |
290 |
- http_mogilefs |
291 |
- http_naxsi |
292 |
- http_push_stream |
293 |
- http_security |
294 |
- http_slowfs_cache |
295 |
- http_sticky |
296 |
- http_upload_progress |
297 |
- http_upstream_check |
298 |
- http_vhost_traffic_status |
299 |
- stream_geoip2 |
300 |
- stream_javascript |
301 |
-" |
302 |
- |
303 |
-IUSE="aio debug +http +http2 +http-cache +ipv6 libatomic libressl luajit +pcre |
304 |
- pcre-jit rtmp selinux ssl threads userland_GNU vim-syntax" |
305 |
- |
306 |
-for mod in $NGINX_MODULES_STD; do |
307 |
- IUSE="${IUSE} +nginx_modules_http_${mod}" |
308 |
-done |
309 |
- |
310 |
-for mod in $NGINX_MODULES_OPT; do |
311 |
- IUSE="${IUSE} nginx_modules_http_${mod}" |
312 |
-done |
313 |
- |
314 |
-for mod in $NGINX_MODULES_STREAM_STD; do |
315 |
- IUSE="${IUSE} nginx_modules_stream_${mod}" |
316 |
-done |
317 |
- |
318 |
-for mod in $NGINX_MODULES_STREAM_OPT; do |
319 |
- IUSE="${IUSE} nginx_modules_stream_${mod}" |
320 |
-done |
321 |
- |
322 |
-for mod in $NGINX_MODULES_MAIL; do |
323 |
- IUSE="${IUSE} nginx_modules_mail_${mod}" |
324 |
-done |
325 |
- |
326 |
-for mod in $NGINX_MODULES_3RD; do |
327 |
- IUSE="${IUSE} nginx_modules_${mod}" |
328 |
-done |
329 |
- |
330 |
-# Add so we can warn users updating about config changes |
331 |
-# @TODO: jbergstroem: remove on next release series |
332 |
-IUSE="${IUSE} nginx_modules_http_spdy" |
333 |
- |
334 |
-CDEPEND=" |
335 |
- pcre? ( dev-libs/libpcre:= ) |
336 |
- pcre-jit? ( dev-libs/libpcre:=[jit] ) |
337 |
- ssl? ( |
338 |
- !libressl? ( dev-libs/openssl:0= ) |
339 |
- libressl? ( dev-libs/libressl:= ) |
340 |
- ) |
341 |
- http2? ( |
342 |
- !libressl? ( >=dev-libs/openssl-1.0.1c:0= ) |
343 |
- libressl? ( dev-libs/libressl:= ) |
344 |
- ) |
345 |
- http-cache? ( |
346 |
- userland_GNU? ( |
347 |
- !libressl? ( dev-libs/openssl:0= ) |
348 |
- libressl? ( dev-libs/libressl:= ) |
349 |
- ) |
350 |
- ) |
351 |
- nginx_modules_http_brotli? ( app-arch/brotli:= ) |
352 |
- nginx_modules_http_geoip? ( dev-libs/geoip ) |
353 |
- nginx_modules_http_geoip2? ( dev-libs/libmaxminddb:= ) |
354 |
- nginx_modules_http_gunzip? ( sys-libs/zlib ) |
355 |
- nginx_modules_http_gzip? ( sys-libs/zlib ) |
356 |
- nginx_modules_http_gzip_static? ( sys-libs/zlib ) |
357 |
- nginx_modules_http_image_filter? ( media-libs/gd:=[jpeg,png] ) |
358 |
- nginx_modules_http_perl? ( >=dev-lang/perl-5.8:= ) |
359 |
- nginx_modules_http_rewrite? ( dev-libs/libpcre:= ) |
360 |
- nginx_modules_http_secure_link? ( |
361 |
- userland_GNU? ( |
362 |
- !libressl? ( dev-libs/openssl:0= ) |
363 |
- libressl? ( dev-libs/libressl:= ) |
364 |
- ) |
365 |
- ) |
366 |
- nginx_modules_http_xslt? ( dev-libs/libxml2:= dev-libs/libxslt ) |
367 |
- nginx_modules_http_lua? ( dev-lang/luajit:2= ) |
368 |
- nginx_modules_http_auth_pam? ( sys-libs/pam ) |
369 |
- nginx_modules_http_metrics? ( dev-libs/yajl:= ) |
370 |
- nginx_modules_http_dav_ext? ( dev-libs/libxml2 ) |
371 |
- nginx_modules_http_security? ( |
372 |
- dev-libs/apr:= |
373 |
- dev-libs/apr-util:= |
374 |
- dev-libs/libxml2:= |
375 |
- net-misc/curl |
376 |
- www-servers/apache |
377 |
- ) |
378 |
- nginx_modules_http_auth_ldap? ( net-nds/openldap[ssl?] ) |
379 |
- nginx_modules_stream_geoip? ( dev-libs/geoip ) |
380 |
- nginx_modules_stream_geoip2? ( dev-libs/libmaxminddb:= )" |
381 |
-RDEPEND="${CDEPEND} |
382 |
- selinux? ( sec-policy/selinux-nginx ) |
383 |
- !www-servers/nginx:mainline" |
384 |
-DEPEND="${CDEPEND} |
385 |
- nginx_modules_http_brotli? ( virtual/pkgconfig ) |
386 |
- nginx_modules_http_security? ( ${AUTOTOOLS_DEPEND} ) |
387 |
- arm? ( dev-libs/libatomic_ops ) |
388 |
- libatomic? ( dev-libs/libatomic_ops )" |
389 |
-PDEPEND="vim-syntax? ( app-vim/nginx-syntax )" |
390 |
- |
391 |
-REQUIRED_USE="pcre-jit? ( pcre ) |
392 |
- nginx_modules_http_fancyindex? ( nginx_modules_http_addition ) |
393 |
- nginx_modules_http_grpc? ( http2 ) |
394 |
- nginx_modules_http_lua? ( |
395 |
- luajit |
396 |
- nginx_modules_http_rewrite |
397 |
- ) |
398 |
- nginx_modules_http_naxsi? ( pcre ) |
399 |
- nginx_modules_http_dav_ext? ( nginx_modules_http_dav nginx_modules_http_xslt ) |
400 |
- nginx_modules_http_metrics? ( nginx_modules_http_stub_status ) |
401 |
- nginx_modules_http_security? ( pcre ) |
402 |
- nginx_modules_http_push_stream? ( ssl )" |
403 |
- |
404 |
-pkg_setup() { |
405 |
- NGINX_HOME="/var/lib/nginx" |
406 |
- NGINX_HOME_TMP="${NGINX_HOME}/tmp" |
407 |
- |
408 |
- ebegin "Creating nginx user and group" |
409 |
- enewgroup ${PN} |
410 |
- enewuser ${PN} -1 -1 "${NGINX_HOME}" ${PN} |
411 |
- eend $? |
412 |
- |
413 |
- if use libatomic; then |
414 |
- ewarn "GCC 4.1+ features built-in atomic operations." |
415 |
- ewarn "Using libatomic_ops is only needed if using" |
416 |
- ewarn "a different compiler or a GCC prior to 4.1" |
417 |
- fi |
418 |
- |
419 |
- if [[ -n $NGINX_ADD_MODULES ]]; then |
420 |
- ewarn "You are building custom modules via \$NGINX_ADD_MODULES!" |
421 |
- ewarn "This nginx installation is not supported!" |
422 |
- ewarn "Make sure you can reproduce the bug without those modules" |
423 |
- ewarn "_before_ reporting bugs." |
424 |
- fi |
425 |
- |
426 |
- if use !http; then |
427 |
- ewarn "To actually disable all http-functionality you also have to disable" |
428 |
- ewarn "all nginx http modules." |
429 |
- fi |
430 |
- |
431 |
- if use nginx_modules_http_mogilefs && use threads; then |
432 |
- eerror "mogilefs won't compile with threads support." |
433 |
- eerror "Please disable either flag and try again." |
434 |
- die "Can't compile mogilefs with threads support" |
435 |
- fi |
436 |
-} |
437 |
- |
438 |
-src_prepare() { |
439 |
- eapply "${FILESDIR}/${PN}-1.4.1-fix-perl-install-path.patch" |
440 |
- eapply "${FILESDIR}/${PN}-httpoxy-mitigation-r1.patch" |
441 |
- |
442 |
- if use nginx_modules_http_auth_pam; then |
443 |
- cd "${HTTP_AUTH_PAM_MODULE_WD}" || die |
444 |
- eapply "${FILESDIR}"/http_auth_pam-1.5.1-adjust-loglevel-for-authentication-failures.patch |
445 |
- cd "${S}" || die |
446 |
- fi |
447 |
- |
448 |
- if use nginx_modules_http_brotli; then |
449 |
- cd "${HTTP_BROTLI_MODULE_WD}" || die |
450 |
- eapply "${FILESDIR}"/http_brotli-detect-brotli-r2.patch |
451 |
- cd "${S}" || die |
452 |
- fi |
453 |
- |
454 |
- if use nginx_modules_http_upstream_check; then |
455 |
- eapply -p0 "${FILESDIR}"/http_upstream_check-nginx-1.11.5+.patch |
456 |
- fi |
457 |
- |
458 |
- if use nginx_modules_http_cache_purge; then |
459 |
- cd "${HTTP_CACHE_PURGE_MODULE_WD}" || die |
460 |
- eapply "${FILESDIR}"/http_cache_purge-1.11.6+.patch |
461 |
- cd "${S}" || die |
462 |
- fi |
463 |
- |
464 |
- if use nginx_modules_http_security; then |
465 |
- cd "${HTTP_SECURITY_MODULE_WD}" || die |
466 |
- |
467 |
- eautoreconf |
468 |
- |
469 |
- if use luajit ; then |
470 |
- sed -i \ |
471 |
- -e 's|^\(LUA_PKGNAMES\)=.*|\1="luajit"|' \ |
472 |
- configure || die |
473 |
- fi |
474 |
- |
475 |
- cd "${S}" || die |
476 |
- fi |
477 |
- |
478 |
- if use nginx_modules_http_upload_progress; then |
479 |
- cd "${HTTP_UPLOAD_PROGRESS_MODULE_WD}" || die |
480 |
- eapply "${FILESDIR}"/http_uploadprogress-issue_50-r1.patch |
481 |
- cd "${S}" || die |
482 |
- fi |
483 |
- |
484 |
- find auto/ -type f -print0 | xargs -0 sed -i 's:\&\& make:\&\& \\$(MAKE):' || die |
485 |
- # We have config protection, don't rename etc files |
486 |
- sed -i 's:.default::' auto/install || die |
487 |
- # remove useless files |
488 |
- sed -i -e '/koi-/d' -e '/win-/d' auto/install || die |
489 |
- |
490 |
- # don't install to /etc/nginx/ if not in use |
491 |
- local module |
492 |
- for module in fastcgi scgi uwsgi ; do |
493 |
- if ! use nginx_modules_http_${module}; then |
494 |
- sed -i -e "/${module}/d" auto/install || die |
495 |
- fi |
496 |
- done |
497 |
- |
498 |
- eapply_user |
499 |
-} |
500 |
- |
501 |
-src_configure() { |
502 |
- # mod_security needs to generate nginx/modsecurity/config before including it |
503 |
- if use nginx_modules_http_security; then |
504 |
- cd "${HTTP_SECURITY_MODULE_WD}" || die |
505 |
- |
506 |
- ./configure \ |
507 |
- --enable-standalone-module \ |
508 |
- --disable-mlogc \ |
509 |
- --with-ssdeep=no \ |
510 |
- $(use_enable pcre-jit) \ |
511 |
- $(use_with nginx_modules_http_lua lua) || die "configure failed for mod_security" |
512 |
- |
513 |
- cd "${S}" || die |
514 |
- fi |
515 |
- |
516 |
- local myconf=() http_enabled= mail_enabled= stream_enabled= |
517 |
- |
518 |
- use aio && myconf+=( --with-file-aio ) |
519 |
- use debug && myconf+=( --with-debug ) |
520 |
- use http2 && myconf+=( --with-http_v2_module ) |
521 |
- use libatomic && myconf+=( --with-libatomic ) |
522 |
- use pcre && myconf+=( --with-pcre ) |
523 |
- use pcre-jit && myconf+=( --with-pcre-jit ) |
524 |
- use threads && myconf+=( --with-threads ) |
525 |
- |
526 |
- # HTTP modules |
527 |
- for mod in $NGINX_MODULES_STD; do |
528 |
- if use nginx_modules_http_${mod}; then |
529 |
- http_enabled=1 |
530 |
- else |
531 |
- myconf+=( --without-http_${mod}_module ) |
532 |
- fi |
533 |
- done |
534 |
- |
535 |
- for mod in $NGINX_MODULES_OPT; do |
536 |
- if use nginx_modules_http_${mod}; then |
537 |
- http_enabled=1 |
538 |
- myconf+=( --with-http_${mod}_module ) |
539 |
- fi |
540 |
- done |
541 |
- |
542 |
- if use nginx_modules_http_fastcgi; then |
543 |
- myconf+=( --with-http_realip_module ) |
544 |
- fi |
545 |
- |
546 |
- # third-party modules |
547 |
- if use nginx_modules_http_upload_progress; then |
548 |
- http_enabled=1 |
549 |
- myconf+=( --add-module=${HTTP_UPLOAD_PROGRESS_MODULE_WD} ) |
550 |
- fi |
551 |
- |
552 |
- if use nginx_modules_http_headers_more; then |
553 |
- http_enabled=1 |
554 |
- myconf+=( --add-module=${HTTP_HEADERS_MORE_MODULE_WD} ) |
555 |
- fi |
556 |
- |
557 |
- if use nginx_modules_http_cache_purge; then |
558 |
- http_enabled=1 |
559 |
- myconf+=( --add-module=${HTTP_CACHE_PURGE_MODULE_WD} ) |
560 |
- fi |
561 |
- |
562 |
- if use nginx_modules_http_slowfs_cache; then |
563 |
- http_enabled=1 |
564 |
- myconf+=( --add-module=${HTTP_SLOWFS_CACHE_MODULE_WD} ) |
565 |
- fi |
566 |
- |
567 |
- if use nginx_modules_http_fancyindex; then |
568 |
- http_enabled=1 |
569 |
- myconf+=( --add-module=${HTTP_FANCYINDEX_MODULE_WD} ) |
570 |
- fi |
571 |
- |
572 |
- if use nginx_modules_http_lua; then |
573 |
- http_enabled=1 |
574 |
- export LUAJIT_LIB=$(pkg-config --variable libdir luajit) |
575 |
- export LUAJIT_INC=$(pkg-config --variable includedir luajit) |
576 |
- myconf+=( --add-module=${DEVEL_KIT_MODULE_WD} ) |
577 |
- myconf+=( --add-module=${HTTP_LUA_MODULE_WD} ) |
578 |
- fi |
579 |
- |
580 |
- if use nginx_modules_http_auth_pam; then |
581 |
- http_enabled=1 |
582 |
- myconf+=( --add-module=${HTTP_AUTH_PAM_MODULE_WD} ) |
583 |
- fi |
584 |
- |
585 |
- if use nginx_modules_http_upstream_check; then |
586 |
- http_enabled=1 |
587 |
- myconf+=( --add-module=${HTTP_UPSTREAM_CHECK_MODULE_WD} ) |
588 |
- fi |
589 |
- |
590 |
- if use nginx_modules_http_metrics; then |
591 |
- http_enabled=1 |
592 |
- myconf+=( --add-module=${HTTP_METRICS_MODULE_WD} ) |
593 |
- fi |
594 |
- |
595 |
- if use nginx_modules_http_naxsi ; then |
596 |
- http_enabled=1 |
597 |
- myconf+=( --add-module=${HTTP_NAXSI_MODULE_WD} ) |
598 |
- fi |
599 |
- |
600 |
- if use rtmp ; then |
601 |
- http_enabled=1 |
602 |
- myconf+=( --add-module=${RTMP_MODULE_WD} ) |
603 |
- fi |
604 |
- |
605 |
- if use nginx_modules_http_dav_ext ; then |
606 |
- http_enabled=1 |
607 |
- myconf+=( --add-module=${HTTP_DAV_EXT_MODULE_WD} ) |
608 |
- fi |
609 |
- |
610 |
- if use nginx_modules_http_echo ; then |
611 |
- http_enabled=1 |
612 |
- myconf+=( --add-module=${HTTP_ECHO_MODULE_WD} ) |
613 |
- fi |
614 |
- |
615 |
- if use nginx_modules_http_security ; then |
616 |
- http_enabled=1 |
617 |
- myconf+=( --add-module=${HTTP_SECURITY_MODULE_WD}/nginx/modsecurity ) |
618 |
- fi |
619 |
- |
620 |
- if use nginx_modules_http_push_stream ; then |
621 |
- http_enabled=1 |
622 |
- myconf+=( --add-module=${HTTP_PUSH_STREAM_MODULE_WD} ) |
623 |
- fi |
624 |
- |
625 |
- if use nginx_modules_http_sticky ; then |
626 |
- http_enabled=1 |
627 |
- myconf+=( --add-module=${HTTP_STICKY_MODULE_WD} ) |
628 |
- fi |
629 |
- |
630 |
- if use nginx_modules_http_mogilefs ; then |
631 |
- http_enabled=1 |
632 |
- myconf+=( --add-module=${HTTP_MOGILEFS_MODULE_WD} ) |
633 |
- fi |
634 |
- |
635 |
- if use nginx_modules_http_memc ; then |
636 |
- http_enabled=1 |
637 |
- myconf+=( --add-module=${HTTP_MEMC_MODULE_WD} ) |
638 |
- fi |
639 |
- |
640 |
- if use nginx_modules_http_auth_ldap; then |
641 |
- http_enabled=1 |
642 |
- myconf+=( --add-module=${HTTP_LDAP_MODULE_WD} ) |
643 |
- fi |
644 |
- |
645 |
- if use nginx_modules_http_vhost_traffic_status; then |
646 |
- http_enabled=1 |
647 |
- myconf+=( --add-module=${HTTP_VHOST_TRAFFIC_STATUS_MODULE_WD} ) |
648 |
- fi |
649 |
- |
650 |
- if use nginx_modules_http_geoip2 || use nginx_modules_stream_geoip2; then |
651 |
- myconf+=( --add-module=${GEOIP2_MODULE_WD} ) |
652 |
- fi |
653 |
- |
654 |
- if use nginx_modules_http_javascript || use nginx_modules_stream_javascript; then |
655 |
- myconf+=( --add-module="${NJS_MODULE_WD}/nginx" ) |
656 |
- fi |
657 |
- |
658 |
- if use nginx_modules_http_brotli; then |
659 |
- http_enabled=1 |
660 |
- myconf+=( --add-module=${HTTP_BROTLI_MODULE_WD} ) |
661 |
- fi |
662 |
- |
663 |
- if use http || use http-cache || use http2 || use nginx_modules_http_javascript; then |
664 |
- http_enabled=1 |
665 |
- fi |
666 |
- |
667 |
- if [ $http_enabled ]; then |
668 |
- use http-cache || myconf+=( --without-http-cache ) |
669 |
- use ssl && myconf+=( --with-http_ssl_module ) |
670 |
- else |
671 |
- myconf+=( --without-http --without-http-cache ) |
672 |
- fi |
673 |
- |
674 |
- # Stream modules |
675 |
- for mod in $NGINX_MODULES_STREAM_STD; do |
676 |
- if use nginx_modules_stream_${mod}; then |
677 |
- stream_enabled=1 |
678 |
- else |
679 |
- myconf+=( --without-stream_${mod}_module ) |
680 |
- fi |
681 |
- done |
682 |
- |
683 |
- for mod in $NGINX_MODULES_STREAM_OPT; do |
684 |
- if use nginx_modules_stream_${mod}; then |
685 |
- stream_enabled=1 |
686 |
- myconf+=( --with-stream_${mod}_module ) |
687 |
- fi |
688 |
- done |
689 |
- |
690 |
- if use nginx_modules_stream_geoip2 || use nginx_modules_stream_javascript; then |
691 |
- stream_enabled=1 |
692 |
- fi |
693 |
- |
694 |
- if [ $stream_enabled ]; then |
695 |
- myconf+=( --with-stream ) |
696 |
- use ssl && myconf+=( --with-stream_ssl_module ) |
697 |
- fi |
698 |
- |
699 |
- # MAIL modules |
700 |
- for mod in $NGINX_MODULES_MAIL; do |
701 |
- if use nginx_modules_mail_${mod}; then |
702 |
- mail_enabled=1 |
703 |
- else |
704 |
- myconf+=( --without-mail_${mod}_module ) |
705 |
- fi |
706 |
- done |
707 |
- |
708 |
- if [ $mail_enabled ]; then |
709 |
- myconf+=( --with-mail ) |
710 |
- use ssl && myconf+=( --with-mail_ssl_module ) |
711 |
- fi |
712 |
- |
713 |
- # custom modules |
714 |
- for mod in $NGINX_ADD_MODULES; do |
715 |
- myconf+=( --add-module=${mod} ) |
716 |
- done |
717 |
- |
718 |
- # https://bugs.gentoo.org/286772 |
719 |
- export LANG=C LC_ALL=C |
720 |
- tc-export CC |
721 |
- |
722 |
- if ! use prefix; then |
723 |
- myconf+=( --user=${PN} ) |
724 |
- myconf+=( --group=${PN} ) |
725 |
- fi |
726 |
- |
727 |
- local WITHOUT_IPV6= |
728 |
- if ! use ipv6; then |
729 |
- WITHOUT_IPV6=" -DNGX_HAVE_INET6=0" |
730 |
- fi |
731 |
- |
732 |
- if [[ -n "${EXTRA_ECONF}" ]]; then |
733 |
- myconf+=( ${EXTRA_ECONF} ) |
734 |
- ewarn "EXTRA_ECONF applied. Now you are on your own, good luck!" |
735 |
- fi |
736 |
- |
737 |
- ./configure \ |
738 |
- --prefix="${EPREFIX}"/usr \ |
739 |
- --conf-path="${EPREFIX}"/etc/${PN}/${PN}.conf \ |
740 |
- --error-log-path="${EPREFIX}"/var/log/${PN}/error_log \ |
741 |
- --pid-path="${EPREFIX}"/run/${PN}.pid \ |
742 |
- --lock-path="${EPREFIX}"/run/lock/${PN}.lock \ |
743 |
- --with-cc-opt="-I${EROOT}usr/include${WITHOUT_IPV6}" \ |
744 |
- --with-ld-opt="-L${EROOT}usr/$(get_libdir)" \ |
745 |
- --http-log-path="${EPREFIX}"/var/log/${PN}/access_log \ |
746 |
- --http-client-body-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/client \ |
747 |
- --http-proxy-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/proxy \ |
748 |
- --http-fastcgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/fastcgi \ |
749 |
- --http-scgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/scgi \ |
750 |
- --http-uwsgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/uwsgi \ |
751 |
- --with-compat \ |
752 |
- "${myconf[@]}" || die "configure failed" |
753 |
- |
754 |
- # A purely cosmetic change that makes nginx -V more readable. This can be |
755 |
- # good if people outside the gentoo community would troubleshoot and |
756 |
- # question the users setup. |
757 |
- sed -i -e "s|${WORKDIR}|external_module|g" objs/ngx_auto_config.h || die |
758 |
-} |
759 |
- |
760 |
-src_compile() { |
761 |
- use nginx_modules_http_security && emake -C "${HTTP_SECURITY_MODULE_WD}" |
762 |
- |
763 |
- # https://bugs.gentoo.org/286772 |
764 |
- export LANG=C LC_ALL=C |
765 |
- emake LINK="${CC} ${LDFLAGS}" OTHERLDFLAGS="${LDFLAGS}" |
766 |
-} |
767 |
- |
768 |
-src_install() { |
769 |
- emake DESTDIR="${D%/}" install |
770 |
- |
771 |
- cp "${FILESDIR}"/nginx.conf-r2 "${ED}"etc/nginx/nginx.conf || die |
772 |
- |
773 |
- newinitd "${FILESDIR}"/nginx.initd-r4 nginx |
774 |
- newconfd "${FILESDIR}"/nginx.confd nginx |
775 |
- |
776 |
- systemd_newunit "${FILESDIR}"/nginx.service-r1 nginx.service |
777 |
- |
778 |
- doman man/nginx.8 |
779 |
- dodoc CHANGES* README |
780 |
- |
781 |
- # just keepdir. do not copy the default htdocs files (bug #449136) |
782 |
- keepdir /var/www/localhost |
783 |
- rm -rf "${D}"usr/html || die |
784 |
- |
785 |
- # set up a list of directories to keep |
786 |
- local keepdir_list="${NGINX_HOME_TMP}"/client |
787 |
- local module |
788 |
- for module in proxy fastcgi scgi uwsgi; do |
789 |
- use nginx_modules_http_${module} && keepdir_list+=" ${NGINX_HOME_TMP}/${module}" |
790 |
- done |
791 |
- |
792 |
- keepdir /var/log/nginx ${keepdir_list} |
793 |
- |
794 |
- # this solves a problem with SELinux where nginx doesn't see the directories |
795 |
- # as root and tries to create them as nginx |
796 |
- fperms 0750 "${NGINX_HOME_TMP}" |
797 |
- fowners ${PN}:0 "${NGINX_HOME_TMP}" |
798 |
- |
799 |
- fperms 0700 ${keepdir_list} |
800 |
- fowners ${PN}:${PN} ${keepdir_list} |
801 |
- |
802 |
- fperms 0710 /var/log/nginx |
803 |
- fowners 0:${PN} /var/log/nginx |
804 |
- |
805 |
- # logrotate |
806 |
- insinto /etc/logrotate.d |
807 |
- newins "${FILESDIR}"/nginx.logrotate-r1 nginx |
808 |
- |
809 |
- if use luajit; then |
810 |
- pax-mark m "${ED%/}/usr/sbin/nginx" |
811 |
- fi |
812 |
- |
813 |
- if use nginx_modules_http_perl; then |
814 |
- cd "${S}"/objs/src/http/modules/perl/ || die |
815 |
- emake DESTDIR="${D}" INSTALLDIRS=vendor |
816 |
- perl_delete_localpod |
817 |
- cd "${S}" || die |
818 |
- fi |
819 |
- |
820 |
- if use nginx_modules_http_cache_purge; then |
821 |
- docinto ${HTTP_CACHE_PURGE_MODULE_P} |
822 |
- dodoc "${HTTP_CACHE_PURGE_MODULE_WD}"/{CHANGES,README.md,TODO.md} |
823 |
- fi |
824 |
- |
825 |
- if use nginx_modules_http_slowfs_cache; then |
826 |
- docinto ${HTTP_SLOWFS_CACHE_MODULE_P} |
827 |
- dodoc "${HTTP_SLOWFS_CACHE_MODULE_WD}"/{CHANGES,README.md} |
828 |
- fi |
829 |
- |
830 |
- if use nginx_modules_http_fancyindex; then |
831 |
- docinto ${HTTP_FANCYINDEX_MODULE_P} |
832 |
- dodoc "${HTTP_FANCYINDEX_MODULE_WD}"/README.rst |
833 |
- fi |
834 |
- |
835 |
- if use nginx_modules_http_lua; then |
836 |
- docinto ${HTTP_LUA_MODULE_P} |
837 |
- dodoc "${HTTP_LUA_MODULE_WD}"/README.markdown |
838 |
- fi |
839 |
- |
840 |
- if use nginx_modules_http_auth_pam; then |
841 |
- docinto ${HTTP_AUTH_PAM_MODULE_P} |
842 |
- dodoc "${HTTP_AUTH_PAM_MODULE_WD}"/{README.md,ChangeLog} |
843 |
- fi |
844 |
- |
845 |
- if use nginx_modules_http_upstream_check; then |
846 |
- docinto ${HTTP_UPSTREAM_CHECK_MODULE_P} |
847 |
- dodoc "${HTTP_UPSTREAM_CHECK_MODULE_WD}"/{README,CHANGES} |
848 |
- fi |
849 |
- |
850 |
- if use nginx_modules_http_naxsi; then |
851 |
- insinto /etc/nginx |
852 |
- doins "${HTTP_NAXSI_MODULE_WD}"/../naxsi_config/naxsi_core.rules |
853 |
- fi |
854 |
- |
855 |
- if use rtmp; then |
856 |
- docinto ${RTMP_MODULE_P} |
857 |
- dodoc "${RTMP_MODULE_WD}"/{AUTHORS,README.md,stat.xsl} |
858 |
- fi |
859 |
- |
860 |
- if use nginx_modules_http_dav_ext; then |
861 |
- docinto ${HTTP_DAV_EXT_MODULE_P} |
862 |
- dodoc "${HTTP_DAV_EXT_MODULE_WD}"/README.rst |
863 |
- fi |
864 |
- |
865 |
- if use nginx_modules_http_echo; then |
866 |
- docinto ${HTTP_ECHO_MODULE_P} |
867 |
- dodoc "${HTTP_ECHO_MODULE_WD}"/README.markdown |
868 |
- fi |
869 |
- |
870 |
- if use nginx_modules_http_security; then |
871 |
- docinto ${HTTP_SECURITY_MODULE_P} |
872 |
- dodoc "${HTTP_SECURITY_MODULE_WD}"/{CHANGES,README.md,authors.txt} |
873 |
- fi |
874 |
- |
875 |
- if use nginx_modules_http_push_stream; then |
876 |
- docinto ${HTTP_PUSH_STREAM_MODULE_P} |
877 |
- dodoc "${HTTP_PUSH_STREAM_MODULE_WD}"/{AUTHORS,CHANGELOG.textile,README.textile} |
878 |
- fi |
879 |
- |
880 |
- if use nginx_modules_http_sticky; then |
881 |
- docinto ${HTTP_STICKY_MODULE_P} |
882 |
- dodoc "${HTTP_STICKY_MODULE_WD}"/{README.md,Changelog.txt,docs/sticky.pdf} |
883 |
- fi |
884 |
- |
885 |
- if use nginx_modules_http_memc; then |
886 |
- docinto ${HTTP_MEMC_MODULE_P} |
887 |
- dodoc "${HTTP_MEMC_MODULE_WD}"/README.markdown |
888 |
- fi |
889 |
- |
890 |
- if use nginx_modules_http_auth_ldap; then |
891 |
- docinto ${HTTP_LDAP_MODULE_P} |
892 |
- dodoc "${HTTP_LDAP_MODULE_WD}"/example.conf |
893 |
- fi |
894 |
-} |
895 |
- |
896 |
-pkg_postinst() { |
897 |
- if use ssl; then |
898 |
- if [[ ! -f "${EROOT}"etc/ssl/${PN}/${PN}.key ]]; then |
899 |
- install_cert /etc/ssl/${PN}/${PN} |
900 |
- use prefix || chown ${PN}:${PN} "${EROOT}"etc/ssl/${PN}/${PN}.{crt,csr,key,pem} |
901 |
- fi |
902 |
- fi |
903 |
- |
904 |
- if use nginx_modules_http_spdy; then |
905 |
- ewarn "" |
906 |
- ewarn "In nginx 1.9.5 the spdy module was superseded by http2." |
907 |
- ewarn "Update your configs and package.use accordingly." |
908 |
- fi |
909 |
- |
910 |
- if use nginx_modules_http_lua; then |
911 |
- ewarn "" |
912 |
- ewarn "While you can build lua 3rd party module against ${P}" |
913 |
- ewarn "the author warns that >=${PN}-1.11.11 is still not an" |
914 |
- ewarn "officially supported target yet. You are on your own." |
915 |
- ewarn "Expect runtime failures, memory leaks and other problems!" |
916 |
- fi |
917 |
- |
918 |
- if use nginx_modules_http_lua && use http2; then |
919 |
- ewarn "" |
920 |
- ewarn "Lua 3rd party module author warns against using ${P} with" |
921 |
- ewarn "NGINX_MODULES_HTTP=\"lua http2\". For more info, see https://git.io/OldLsg" |
922 |
- fi |
923 |
- |
924 |
- local _n_permission_layout_checks=0 |
925 |
- local _has_to_adjust_permissions=0 |
926 |
- local _has_to_show_permission_warning=0 |
927 |
- |
928 |
- # Defaults to 1 to inform people doing a fresh installation |
929 |
- # that we ship modified {scgi,uwsgi,fastcgi}_params files |
930 |
- local _has_to_show_httpoxy_mitigation_notice=1 |
931 |
- |
932 |
- local _replacing_version= |
933 |
- for _replacing_version in ${REPLACING_VERSIONS}; do |
934 |
- _n_permission_layout_checks=$((${_n_permission_layout_checks}+1)) |
935 |
- |
936 |
- if [[ ${_n_permission_layout_checks} -gt 1 ]]; then |
937 |
- # Should never happen: |
938 |
- # Package is abusing slots but doesn't allow multiple parallel installations. |
939 |
- # If we run into this situation it is unsafe to automatically adjust any |
940 |
- # permission... |
941 |
- _has_to_show_permission_warning=1 |
942 |
- |
943 |
- ewarn "Replacing multiple ${PN}' versions is unsupported! " \ |
944 |
- "You will have to adjust permissions on your own." |
945 |
- |
946 |
- break |
947 |
- fi |
948 |
- |
949 |
- local _replacing_version_branch=$(get_version_component_range 1-2 "${_replacing_version}") |
950 |
- debug-print "Updating an existing installation (v${_replacing_version}; branch '${_replacing_version_branch}') ..." |
951 |
- |
952 |
- # Do we need to adjust permissions to fix CVE-2013-0337 (bug #458726, #469094)? |
953 |
- # This was before we introduced multiple nginx versions so we |
954 |
- # do not need to distinguish between stable and mainline |
955 |
- local _need_to_fix_CVE2013_0337=1 |
956 |
- |
957 |
- if version_is_at_least "1.4.1-r2" "${_replacing_version}"; then |
958 |
- # We are updating an installation which should already be fixed |
959 |
- _need_to_fix_CVE2013_0337=0 |
960 |
- debug-print "Skipping CVE-2013-0337 ... existing installation should not be affected!" |
961 |
- else |
962 |
- _has_to_adjust_permissions=1 |
963 |
- debug-print "Need to adjust permissions to fix CVE-2013-0337!" |
964 |
- fi |
965 |
- |
966 |
- # Do we need to inform about HTTPoxy mitigation? |
967 |
- # In repository since commit 8be44f76d4ac02cebcd1e0e6e6284bb72d054b0f |
968 |
- if ! version_is_at_least "1.10" "${_replacing_version_branch}"; then |
969 |
- # Updating from <1.10 |
970 |
- _has_to_show_httpoxy_mitigation_notice=1 |
971 |
- debug-print "Need to inform about HTTPoxy mitigation!" |
972 |
- else |
973 |
- # Updating from >=1.10 |
974 |
- local _fixed_in_pvr= |
975 |
- case "${_replacing_version_branch}" in |
976 |
- "1.10") |
977 |
- _fixed_in_pvr="1.10.1-r2" |
978 |
- ;; |
979 |
- "1.11") |
980 |
- _fixed_in_pvr="1.11.3-r1" |
981 |
- ;; |
982 |
- *) |
983 |
- # This should be any future branch. |
984 |
- # If we run this code it is safe to assume that the user has |
985 |
- # already seen the HTTPoxy mitigation notice because he/she is doing |
986 |
- # an update from previous version where we have already shown |
987 |
- # the warning. Otherwise, we wouldn't hit this code path ... |
988 |
- _fixed_in_pvr= |
989 |
- esac |
990 |
- |
991 |
- if [[ -z "${_fixed_in_pvr}" ]] || version_is_at_least "${_fixed_in_pvr}" "${_replacing_version}"; then |
992 |
- # We are updating an installation where we already informed |
993 |
- # that we are mitigating HTTPoxy per default |
994 |
- _has_to_show_httpoxy_mitigation_notice=0 |
995 |
- debug-print "No need to inform about HTTPoxy mitigation ... information was already shown for existing installation!" |
996 |
- else |
997 |
- _has_to_show_httpoxy_mitigation_notice=1 |
998 |
- debug-print "Need to inform about HTTPoxy mitigation!" |
999 |
- fi |
1000 |
- fi |
1001 |
- |
1002 |
- # Do we need to adjust permissions to fix CVE-2016-1247 (bug #605008)? |
1003 |
- # All branches up to 1.11 are affected |
1004 |
- local _need_to_fix_CVE2016_1247=1 |
1005 |
- |
1006 |
- if ! version_is_at_least "1.10" "${_replacing_version_branch}"; then |
1007 |
- # Updating from <1.10 |
1008 |
- _has_to_adjust_permissions=1 |
1009 |
- debug-print "Need to adjust permissions to fix CVE-2016-1247!" |
1010 |
- else |
1011 |
- # Updating from >=1.10 |
1012 |
- local _fixed_in_pvr= |
1013 |
- case "${_replacing_version_branch}" in |
1014 |
- "1.10") |
1015 |
- _fixed_in_pvr="1.10.2-r3" |
1016 |
- ;; |
1017 |
- "1.11") |
1018 |
- _fixed_in_pvr="1.11.6-r1" |
1019 |
- ;; |
1020 |
- *) |
1021 |
- # This should be any future branch. |
1022 |
- # If we run this code it is safe to assume that we have already |
1023 |
- # adjusted permissions or were never affected because user is |
1024 |
- # doing an update from previous version which was safe or did |
1025 |
- # the adjustments. Otherwise, we wouldn't hit this code path ... |
1026 |
- _fixed_in_pvr= |
1027 |
- esac |
1028 |
- |
1029 |
- if [[ -z "${_fixed_in_pvr}" ]] || version_is_at_least "${_fixed_in_pvr}" "${_replacing_version}"; then |
1030 |
- # We are updating an installation which should already be adjusted |
1031 |
- # or which was never affected |
1032 |
- _need_to_fix_CVE2016_1247=0 |
1033 |
- debug-print "Skipping CVE-2016-1247 ... existing installation should not be affected!" |
1034 |
- else |
1035 |
- _has_to_adjust_permissions=1 |
1036 |
- debug-print "Need to adjust permissions to fix CVE-2016-1247!" |
1037 |
- fi |
1038 |
- fi |
1039 |
- done |
1040 |
- |
1041 |
- if [[ ${_has_to_adjust_permissions} -eq 1 ]]; then |
1042 |
- # We do not DIE when chmod/chown commands are failing because |
1043 |
- # package is already merged on user's system at this stage |
1044 |
- # and we cannot retry without losing the information that |
1045 |
- # the existing installation needs to adjust permissions. |
1046 |
- # Instead we are going to a show a big warning ... |
1047 |
- |
1048 |
- if [[ ${_has_to_show_permission_warning} -eq 0 ]] && [[ ${_need_to_fix_CVE2013_0337} -eq 1 ]]; then |
1049 |
- ewarn "" |
1050 |
- ewarn "The world-readable bit (if set) has been removed from the" |
1051 |
- ewarn "following directories to mitigate a security bug" |
1052 |
- ewarn "(CVE-2013-0337, bug #458726):" |
1053 |
- ewarn "" |
1054 |
- ewarn " ${EPREFIX}/var/log/nginx" |
1055 |
- ewarn " ${EPREFIX}${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi}" |
1056 |
- ewarn "" |
1057 |
- ewarn "Check if this is correct for your setup before restarting nginx!" |
1058 |
- ewarn "This is a one-time change and will not happen on subsequent updates." |
1059 |
- ewarn "Furthermore nginx' temp directories got moved to '${EPREFIX}${NGINX_HOME_TMP}'" |
1060 |
- chmod o-rwx \ |
1061 |
- "${EPREFIX}"/var/log/nginx \ |
1062 |
- "${EPREFIX}"${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi} || \ |
1063 |
- _has_to_show_permission_warning=1 |
1064 |
- fi |
1065 |
- |
1066 |
- if [[ ${_has_to_show_permission_warning} -eq 0 ]] && [[ ${_need_to_fix_CVE2016_1247} -eq 1 ]]; then |
1067 |
- ewarn "" |
1068 |
- ewarn "The permissions on the following directory have been reset in" |
1069 |
- ewarn "order to mitigate a security bug (CVE-2016-1247, bug #605008):" |
1070 |
- ewarn "" |
1071 |
- ewarn " ${EPREFIX}/var/log/nginx" |
1072 |
- ewarn "" |
1073 |
- ewarn "Check if this is correct for your setup before restarting nginx!" |
1074 |
- ewarn "Also ensure that no other log directory used by any of your" |
1075 |
- ewarn "vhost(s) is not writeable for nginx user. Any of your log files" |
1076 |
- ewarn "used by nginx can be abused to escalate privileges!" |
1077 |
- ewarn "This is a one-time change and will not happen on subsequent updates." |
1078 |
- chown 0:nginx "${EPREFIX}"/var/log/nginx || _has_to_show_permission_warning=1 |
1079 |
- chmod 710 "${EPREFIX}"/var/log/nginx || _has_to_show_permission_warning=1 |
1080 |
- fi |
1081 |
- |
1082 |
- if [[ ${_has_to_show_permission_warning} -eq 1 ]]; then |
1083 |
- # Should never happen ... |
1084 |
- ewarn "" |
1085 |
- ewarn "*************************************************************" |
1086 |
- ewarn "*************** W A R N I N G ***************" |
1087 |
- ewarn "*************************************************************" |
1088 |
- ewarn "The one-time only attempt to adjust permissions of the" |
1089 |
- ewarn "existing nginx installation failed. Be aware that we will not" |
1090 |
- ewarn "try to adjust the same permissions again because now you are" |
1091 |
- ewarn "using a nginx version where we expect that the permissions" |
1092 |
- ewarn "are already adjusted or that you know what you are doing and" |
1093 |
- ewarn "want to keep custom permissions." |
1094 |
- ewarn "" |
1095 |
- fi |
1096 |
- fi |
1097 |
- |
1098 |
- # Sanity check for CVE-2016-1247 |
1099 |
- # Required to warn users who received the warning above and thought |
1100 |
- # they could fix it by unmerging and re-merging the package or have |
1101 |
- # unmerged a affected installation on purpose in the past leaving |
1102 |
- # /var/log/nginx on their system due to keepdir/non-empty folder |
1103 |
- # and are now installing the package again. |
1104 |
- local _sanity_check_testfile=$(mktemp --dry-run "${EPREFIX}"/var/log/nginx/.CVE-2016-1247.XXXXXXXXX) |
1105 |
- su -s /bin/sh -c "touch ${_sanity_check_testfile}" nginx >&/dev/null |
1106 |
- if [ $? -eq 0 ] ; then |
1107 |
- # Cleanup -- no reason to die here! |
1108 |
- rm -f "${_sanity_check_testfile}" |
1109 |
- |
1110 |
- ewarn "" |
1111 |
- ewarn "*************************************************************" |
1112 |
- ewarn "*************** W A R N I N G ***************" |
1113 |
- ewarn "*************************************************************" |
1114 |
- ewarn "Looks like your installation is vulnerable to CVE-2016-1247" |
1115 |
- ewarn "(bug #605008) because nginx user is able to create files in" |
1116 |
- ewarn "" |
1117 |
- ewarn " ${EPREFIX}/var/log/nginx" |
1118 |
- ewarn "" |
1119 |
- ewarn "Also ensure that no other log directory used by any of your" |
1120 |
- ewarn "vhost(s) is not writeable for nginx user. Any of your log files" |
1121 |
- ewarn "used by nginx can be abused to escalate privileges!" |
1122 |
- fi |
1123 |
- |
1124 |
- if [[ ${_has_to_show_httpoxy_mitigation_notice} -eq 1 ]]; then |
1125 |
- # HTTPoxy mitigation |
1126 |
- ewarn "" |
1127 |
- ewarn "This nginx installation comes with a mitigation for the HTTPoxy" |
1128 |
- ewarn "vulnerability for FastCGI, SCGI and uWSGI applications by setting" |
1129 |
- ewarn "the HTTP_PROXY parameter to an empty string per default when you" |
1130 |
- ewarn "are sourcing one of the default" |
1131 |
- ewarn "" |
1132 |
- ewarn " - 'fastcgi_params' or 'fastcgi.conf'" |
1133 |
- ewarn " - 'scgi_params'" |
1134 |
- ewarn " - 'uwsgi_params'" |
1135 |
- ewarn "" |
1136 |
- ewarn "files in your server block(s)." |
1137 |
- ewarn "" |
1138 |
- ewarn "If this is causing any problems for you make sure that you are sourcing the" |
1139 |
- ewarn "default parameters _before_ you set your own values." |
1140 |
- ewarn "If you are relying on user-supplied proxy values you have to remove the" |
1141 |
- ewarn "correlating lines from the file(s) mentioned above." |
1142 |
- ewarn "" |
1143 |
- fi |
1144 |
-} |
1145 |
|
1146 |
diff --git a/www-servers/nginx/nginx-1.17.10-r1.ebuild b/www-servers/nginx/nginx-1.17.10-r1.ebuild |
1147 |
deleted file mode 100644 |
1148 |
index 4f0830ed4f2..00000000000 |
1149 |
--- a/www-servers/nginx/nginx-1.17.10-r1.ebuild |
1150 |
+++ /dev/null |
1151 |
@@ -1,1093 +0,0 @@ |
1152 |
-# Copyright 1999-2020 Gentoo Authors |
1153 |
-# Distributed under the terms of the GNU General Public License v2 |
1154 |
- |
1155 |
-EAPI="6" |
1156 |
- |
1157 |
-# Maintainer notes: |
1158 |
-# - http_rewrite-independent pcre-support makes sense for matching locations without an actual rewrite |
1159 |
-# - any http-module activates the main http-functionality and overrides USE=-http |
1160 |
-# - keep the following requirements in mind before adding external modules: |
1161 |
-# * alive upstream |
1162 |
-# * sane packaging |
1163 |
-# * builds cleanly |
1164 |
-# * does not need a patch for nginx core |
1165 |
-# - TODO: test the google-perftools module (included in vanilla tarball) |
1166 |
- |
1167 |
-# prevent perl-module from adding automagic perl DEPENDs |
1168 |
-GENTOO_DEPEND_ON_PERL="no" |
1169 |
- |
1170 |
-# devel_kit (https://github.com/simpl/ngx_devel_kit, BSD license) |
1171 |
-DEVEL_KIT_MODULE_PV="0.3.1" |
1172 |
-DEVEL_KIT_MODULE_P="ngx_devel_kit-${DEVEL_KIT_MODULE_PV}" |
1173 |
-DEVEL_KIT_MODULE_URI="https://github.com/simpl/ngx_devel_kit/archive/v${DEVEL_KIT_MODULE_PV}.tar.gz" |
1174 |
-DEVEL_KIT_MODULE_WD="${WORKDIR}/ngx_devel_kit-${DEVEL_KIT_MODULE_PV}" |
1175 |
- |
1176 |
-# ngx_brotli (https://github.com/eustas/ngx_brotli, BSD-2) |
1177 |
-HTTP_BROTLI_MODULE_PV="8104036af9cff4b1d34f22d00ba857e2a93a243c" |
1178 |
-HTTP_BROTLI_MODULE_P="ngx_brotli-${HTTP_BROTLI_MODULE_PV}" |
1179 |
-HTTP_BROTLI_MODULE_URI="https://github.com/eustas/ngx_brotli/archive/${HTTP_BROTLI_MODULE_PV}.tar.gz" |
1180 |
-HTTP_BROTLI_MODULE_WD="${WORKDIR}/ngx_brotli-${HTTP_BROTLI_MODULE_PV}" |
1181 |
- |
1182 |
-# http_uploadprogress (https://github.com/masterzen/nginx-upload-progress-module, BSD-2 license) |
1183 |
-HTTP_UPLOAD_PROGRESS_MODULE_PV="0.9.2" |
1184 |
-HTTP_UPLOAD_PROGRESS_MODULE_P="ngx_http_upload_progress-${HTTP_UPLOAD_PROGRESS_MODULE_PV}-r1" |
1185 |
-HTTP_UPLOAD_PROGRESS_MODULE_URI="https://github.com/masterzen/nginx-upload-progress-module/archive/v${HTTP_UPLOAD_PROGRESS_MODULE_PV}.tar.gz" |
1186 |
-HTTP_UPLOAD_PROGRESS_MODULE_WD="${WORKDIR}/nginx-upload-progress-module-${HTTP_UPLOAD_PROGRESS_MODULE_PV}" |
1187 |
- |
1188 |
-# http_headers_more (https://github.com/agentzh/headers-more-nginx-module, BSD license) |
1189 |
-HTTP_HEADERS_MORE_MODULE_PV="0.33" |
1190 |
-HTTP_HEADERS_MORE_MODULE_P="ngx_http_headers_more-${HTTP_HEADERS_MORE_MODULE_PV}" |
1191 |
-HTTP_HEADERS_MORE_MODULE_URI="https://github.com/agentzh/headers-more-nginx-module/archive/v${HTTP_HEADERS_MORE_MODULE_PV}.tar.gz" |
1192 |
-HTTP_HEADERS_MORE_MODULE_WD="${WORKDIR}/headers-more-nginx-module-${HTTP_HEADERS_MORE_MODULE_PV}" |
1193 |
- |
1194 |
-# http_cache_purge (http://labs.frickle.com/nginx_ngx_cache_purge/, https://github.com/FRiCKLE/ngx_cache_purge, BSD-2 license) |
1195 |
-HTTP_CACHE_PURGE_MODULE_PV="2.3" |
1196 |
-HTTP_CACHE_PURGE_MODULE_P="ngx_http_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}" |
1197 |
-HTTP_CACHE_PURGE_MODULE_URI="http://labs.frickle.com/files/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}.tar.gz" |
1198 |
-HTTP_CACHE_PURGE_MODULE_WD="${WORKDIR}/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}" |
1199 |
- |
1200 |
-# http_slowfs_cache (http://labs.frickle.com/nginx_ngx_slowfs_cache/, BSD-2 license) |
1201 |
-HTTP_SLOWFS_CACHE_MODULE_PV="1.10" |
1202 |
-HTTP_SLOWFS_CACHE_MODULE_P="ngx_http_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}" |
1203 |
-HTTP_SLOWFS_CACHE_MODULE_URI="http://labs.frickle.com/files/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}.tar.gz" |
1204 |
-HTTP_SLOWFS_CACHE_MODULE_WD="${WORKDIR}/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}" |
1205 |
- |
1206 |
-# http_fancyindex (https://github.com/aperezdc/ngx-fancyindex, BSD license) |
1207 |
-HTTP_FANCYINDEX_MODULE_PV="0.4.3" |
1208 |
-HTTP_FANCYINDEX_MODULE_P="ngx_http_fancyindex-${HTTP_FANCYINDEX_MODULE_PV}" |
1209 |
-HTTP_FANCYINDEX_MODULE_URI="https://github.com/aperezdc/ngx-fancyindex/archive/v${HTTP_FANCYINDEX_MODULE_PV}.tar.gz" |
1210 |
-HTTP_FANCYINDEX_MODULE_WD="${WORKDIR}/ngx-fancyindex-${HTTP_FANCYINDEX_MODULE_PV}" |
1211 |
- |
1212 |
-# http_lua (https://github.com/openresty/lua-nginx-module, BSD license) |
1213 |
-HTTP_LUA_MODULE_PV="0.10.15" |
1214 |
-HTTP_LUA_MODULE_P="ngx_http_lua-${HTTP_LUA_MODULE_PV}" |
1215 |
-HTTP_LUA_MODULE_URI="https://github.com/openresty/lua-nginx-module/archive/v${HTTP_LUA_MODULE_PV}.tar.gz" |
1216 |
-HTTP_LUA_MODULE_WD="${WORKDIR}/lua-nginx-module-${HTTP_LUA_MODULE_PV}" |
1217 |
- |
1218 |
-# http_auth_pam (https://github.com/stogh/ngx_http_auth_pam_module/, http://web.iti.upv.es/~sto/nginx/, BSD-2 license) |
1219 |
-HTTP_AUTH_PAM_MODULE_PV="1.5.1" |
1220 |
-HTTP_AUTH_PAM_MODULE_P="ngx_http_auth_pam-${HTTP_AUTH_PAM_MODULE_PV}" |
1221 |
-HTTP_AUTH_PAM_MODULE_URI="https://github.com/stogh/ngx_http_auth_pam_module/archive/v${HTTP_AUTH_PAM_MODULE_PV}.tar.gz" |
1222 |
-HTTP_AUTH_PAM_MODULE_WD="${WORKDIR}/ngx_http_auth_pam_module-${HTTP_AUTH_PAM_MODULE_PV}" |
1223 |
- |
1224 |
-# http_upstream_check (https://github.com/yaoweibin/nginx_upstream_check_module, BSD license) |
1225 |
-HTTP_UPSTREAM_CHECK_MODULE_PV="9aecf15ec379fe98f62355c57b60c0bc83296f04" |
1226 |
-HTTP_UPSTREAM_CHECK_MODULE_P="ngx_http_upstream_check-${HTTP_UPSTREAM_CHECK_MODULE_PV}" |
1227 |
-HTTP_UPSTREAM_CHECK_MODULE_URI="https://github.com/yaoweibin/nginx_upstream_check_module/archive/${HTTP_UPSTREAM_CHECK_MODULE_PV}.tar.gz" |
1228 |
-HTTP_UPSTREAM_CHECK_MODULE_WD="${WORKDIR}/nginx_upstream_check_module-${HTTP_UPSTREAM_CHECK_MODULE_PV}" |
1229 |
- |
1230 |
-# http_metrics (https://github.com/zenops/ngx_metrics, BSD license) |
1231 |
-HTTP_METRICS_MODULE_PV="0.1.1" |
1232 |
-HTTP_METRICS_MODULE_P="ngx_metrics-${HTTP_METRICS_MODULE_PV}" |
1233 |
-HTTP_METRICS_MODULE_URI="https://github.com/madvertise/ngx_metrics/archive/v${HTTP_METRICS_MODULE_PV}.tar.gz" |
1234 |
-HTTP_METRICS_MODULE_WD="${WORKDIR}/ngx_metrics-${HTTP_METRICS_MODULE_PV}" |
1235 |
- |
1236 |
-# http_vhost_traffic_status (https://github.com/vozlt/nginx-module-vts, BSD license) |
1237 |
-HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV="46d85558e344dfe2b078ce757fd36c69a1ec2dd3" |
1238 |
-HTTP_VHOST_TRAFFIC_STATUS_MODULE_P="ngx_http_vhost_traffic_status-${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}" |
1239 |
-HTTP_VHOST_TRAFFIC_STATUS_MODULE_URI="https://github.com/vozlt/nginx-module-vts/archive/${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}.tar.gz" |
1240 |
-HTTP_VHOST_TRAFFIC_STATUS_MODULE_WD="${WORKDIR}/nginx-module-vts-${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}" |
1241 |
- |
1242 |
-# naxsi-core (https://github.com/nbs-system/naxsi, GPLv2+) |
1243 |
-HTTP_NAXSI_MODULE_PV="0.56" |
1244 |
-HTTP_NAXSI_MODULE_P="ngx_http_naxsi-${HTTP_NAXSI_MODULE_PV}" |
1245 |
-HTTP_NAXSI_MODULE_URI="https://github.com/nbs-system/naxsi/archive/${HTTP_NAXSI_MODULE_PV}.tar.gz" |
1246 |
-HTTP_NAXSI_MODULE_WD="${WORKDIR}/naxsi-${HTTP_NAXSI_MODULE_PV}/naxsi_src" |
1247 |
- |
1248 |
-# nginx-rtmp-module (https://github.com/arut/nginx-rtmp-module, BSD license) |
1249 |
-RTMP_MODULE_PV="1.2.1" |
1250 |
-RTMP_MODULE_P="ngx_rtmp-${RTMP_MODULE_PV}" |
1251 |
-RTMP_MODULE_URI="https://github.com/arut/nginx-rtmp-module/archive/v${RTMP_MODULE_PV}.tar.gz" |
1252 |
-RTMP_MODULE_WD="${WORKDIR}/nginx-rtmp-module-${RTMP_MODULE_PV}" |
1253 |
- |
1254 |
-# nginx-dav-ext-module (https://github.com/arut/nginx-dav-ext-module, BSD license) |
1255 |
-HTTP_DAV_EXT_MODULE_PV="3.0.0" |
1256 |
-HTTP_DAV_EXT_MODULE_P="ngx_http_dav_ext-${HTTP_DAV_EXT_MODULE_PV}" |
1257 |
-HTTP_DAV_EXT_MODULE_URI="https://github.com/arut/nginx-dav-ext-module/archive/v${HTTP_DAV_EXT_MODULE_PV}.tar.gz" |
1258 |
-HTTP_DAV_EXT_MODULE_WD="${WORKDIR}/nginx-dav-ext-module-${HTTP_DAV_EXT_MODULE_PV}" |
1259 |
- |
1260 |
-# echo-nginx-module (https://github.com/openresty/echo-nginx-module, BSD license) |
1261 |
-HTTP_ECHO_MODULE_PV="0.62rc1" |
1262 |
-HTTP_ECHO_MODULE_P="ngx_http_echo-${HTTP_ECHO_MODULE_PV}" |
1263 |
-HTTP_ECHO_MODULE_URI="https://github.com/openresty/echo-nginx-module/archive/v${HTTP_ECHO_MODULE_PV}.tar.gz" |
1264 |
-HTTP_ECHO_MODULE_WD="${WORKDIR}/echo-nginx-module-${HTTP_ECHO_MODULE_PV}" |
1265 |
- |
1266 |
-# mod_security for nginx (https://modsecurity.org/, Apache-2.0) |
1267 |
-# keep the MODULE_P here consistent with upstream to avoid tarball duplication |
1268 |
-HTTP_SECURITY_MODULE_PV="2.9.3" |
1269 |
-HTTP_SECURITY_MODULE_P="modsecurity-${HTTP_SECURITY_MODULE_PV}" |
1270 |
-HTTP_SECURITY_MODULE_URI="https://www.modsecurity.org/tarball/${HTTP_SECURITY_MODULE_PV}/${HTTP_SECURITY_MODULE_P}.tar.gz" |
1271 |
-HTTP_SECURITY_MODULE_WD="${WORKDIR}/${HTTP_SECURITY_MODULE_P}" |
1272 |
- |
1273 |
-# push-stream-module (http://www.nginxpushstream.com, https://github.com/wandenberg/nginx-push-stream-module, GPL-3) |
1274 |
-HTTP_PUSH_STREAM_MODULE_PV="0.5.4" |
1275 |
-HTTP_PUSH_STREAM_MODULE_P="ngx_http_push_stream-${HTTP_PUSH_STREAM_MODULE_PV}" |
1276 |
-HTTP_PUSH_STREAM_MODULE_URI="https://github.com/wandenberg/nginx-push-stream-module/archive/${HTTP_PUSH_STREAM_MODULE_PV}.tar.gz" |
1277 |
-HTTP_PUSH_STREAM_MODULE_WD="${WORKDIR}/nginx-push-stream-module-${HTTP_PUSH_STREAM_MODULE_PV}" |
1278 |
- |
1279 |
-# sticky-module (https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng, BSD-2) |
1280 |
-HTTP_STICKY_MODULE_PV="1.2.6-10-g08a395c66e42" |
1281 |
-HTTP_STICKY_MODULE_P="nginx_http_sticky_module_ng-${HTTP_STICKY_MODULE_PV}" |
1282 |
-HTTP_STICKY_MODULE_URI="https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/get/${HTTP_STICKY_MODULE_PV}.tar.bz2" |
1283 |
-HTTP_STICKY_MODULE_WD="${WORKDIR}/nginx-goodies-nginx-sticky-module-ng-08a395c66e42" |
1284 |
- |
1285 |
-# mogilefs-module (https://github.com/vkholodkov/nginx-mogilefs-module, BSD-2) |
1286 |
-HTTP_MOGILEFS_MODULE_PV="1.0.4" |
1287 |
-HTTP_MOGILEFS_MODULE_P="ngx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}" |
1288 |
-HTTP_MOGILEFS_MODULE_URI="https://github.com/vkholodkov/nginx-mogilefs-module/archive/${HTTP_MOGILEFS_MODULE_PV}.tar.gz" |
1289 |
-HTTP_MOGILEFS_MODULE_WD="${WORKDIR}/nginx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}" |
1290 |
- |
1291 |
-# memc-module (https://github.com/openresty/memc-nginx-module, BSD-2) |
1292 |
-HTTP_MEMC_MODULE_PV="0.19" |
1293 |
-HTTP_MEMC_MODULE_P="ngx_memc_module-${HTTP_MEMC_MODULE_PV}" |
1294 |
-HTTP_MEMC_MODULE_URI="https://github.com/openresty/memc-nginx-module/archive/v${HTTP_MEMC_MODULE_PV}.tar.gz" |
1295 |
-HTTP_MEMC_MODULE_WD="${WORKDIR}/memc-nginx-module-${HTTP_MEMC_MODULE_PV}" |
1296 |
- |
1297 |
-# nginx-ldap-auth-module (https://github.com/kvspb/nginx-auth-ldap, BSD-2) |
1298 |
-HTTP_LDAP_MODULE_PV="42d195d7a7575ebab1c369ad3fc5d78dc2c2669c" |
1299 |
-HTTP_LDAP_MODULE_P="nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}" |
1300 |
-HTTP_LDAP_MODULE_URI="https://github.com/kvspb/nginx-auth-ldap/archive/${HTTP_LDAP_MODULE_PV}.tar.gz" |
1301 |
-HTTP_LDAP_MODULE_WD="${WORKDIR}/nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}" |
1302 |
- |
1303 |
-# geoip2 (https://github.com/leev/ngx_http_geoip2_module, BSD-2) |
1304 |
-GEOIP2_MODULE_PV="3.3" |
1305 |
-GEOIP2_MODULE_P="ngx_http_geoip2_module-${GEOIP2_MODULE_PV}" |
1306 |
-GEOIP2_MODULE_URI="https://github.com/leev/ngx_http_geoip2_module/archive/${GEOIP2_MODULE_PV}.tar.gz" |
1307 |
-GEOIP2_MODULE_WD="${WORKDIR}/ngx_http_geoip2_module-${GEOIP2_MODULE_PV}" |
1308 |
- |
1309 |
-# njs-module (https://github.com/nginx/njs, as-is) |
1310 |
-NJS_MODULE_PV="0.4.0" |
1311 |
-NJS_MODULE_P="njs-${NJS_MODULE_PV}" |
1312 |
-NJS_MODULE_URI="https://github.com/nginx/njs/archive/${NJS_MODULE_PV}.tar.gz" |
1313 |
-NJS_MODULE_WD="${WORKDIR}/njs-${NJS_MODULE_PV}" |
1314 |
- |
1315 |
-# We handle deps below ourselves |
1316 |
-SSL_DEPS_SKIP=1 |
1317 |
-AUTOTOOLS_AUTO_DEPEND="no" |
1318 |
- |
1319 |
-inherit autotools ssl-cert toolchain-funcs perl-module flag-o-matic user systemd versionator multilib pax-utils |
1320 |
- |
1321 |
-DESCRIPTION="Robust, small and high performance http and reverse proxy server" |
1322 |
-HOMEPAGE="https://nginx.org" |
1323 |
-SRC_URI="https://nginx.org/download/${P}.tar.gz |
1324 |
- ${DEVEL_KIT_MODULE_URI} -> ${DEVEL_KIT_MODULE_P}.tar.gz |
1325 |
- nginx_modules_http_auth_ldap? ( ${HTTP_LDAP_MODULE_URI} -> ${HTTP_LDAP_MODULE_P}.tar.gz ) |
1326 |
- nginx_modules_http_auth_pam? ( ${HTTP_AUTH_PAM_MODULE_URI} -> ${HTTP_AUTH_PAM_MODULE_P}.tar.gz ) |
1327 |
- nginx_modules_http_brotli? ( ${HTTP_BROTLI_MODULE_URI} -> ${HTTP_BROTLI_MODULE_P}.tar.gz ) |
1328 |
- nginx_modules_http_cache_purge? ( ${HTTP_CACHE_PURGE_MODULE_URI} -> ${HTTP_CACHE_PURGE_MODULE_P}.tar.gz ) |
1329 |
- nginx_modules_http_dav_ext? ( ${HTTP_DAV_EXT_MODULE_URI} -> ${HTTP_DAV_EXT_MODULE_P}.tar.gz ) |
1330 |
- nginx_modules_http_echo? ( ${HTTP_ECHO_MODULE_URI} -> ${HTTP_ECHO_MODULE_P}.tar.gz ) |
1331 |
- nginx_modules_http_fancyindex? ( ${HTTP_FANCYINDEX_MODULE_URI} -> ${HTTP_FANCYINDEX_MODULE_P}.tar.gz ) |
1332 |
- nginx_modules_http_geoip2? ( ${GEOIP2_MODULE_URI} -> ${GEOIP2_MODULE_P}.tar.gz ) |
1333 |
- nginx_modules_http_headers_more? ( ${HTTP_HEADERS_MORE_MODULE_URI} -> ${HTTP_HEADERS_MORE_MODULE_P}.tar.gz ) |
1334 |
- nginx_modules_http_javascript? ( ${NJS_MODULE_URI} -> ${NJS_MODULE_P}.tar.gz ) |
1335 |
- nginx_modules_http_lua? ( ${HTTP_LUA_MODULE_URI} -> ${HTTP_LUA_MODULE_P}.tar.gz ) |
1336 |
- nginx_modules_http_memc? ( ${HTTP_MEMC_MODULE_URI} -> ${HTTP_MEMC_MODULE_P}.tar.gz ) |
1337 |
- nginx_modules_http_metrics? ( ${HTTP_METRICS_MODULE_URI} -> ${HTTP_METRICS_MODULE_P}.tar.gz ) |
1338 |
- nginx_modules_http_mogilefs? ( ${HTTP_MOGILEFS_MODULE_URI} -> ${HTTP_MOGILEFS_MODULE_P}.tar.gz ) |
1339 |
- nginx_modules_http_naxsi? ( ${HTTP_NAXSI_MODULE_URI} -> ${HTTP_NAXSI_MODULE_P}.tar.gz ) |
1340 |
- nginx_modules_http_push_stream? ( ${HTTP_PUSH_STREAM_MODULE_URI} -> ${HTTP_PUSH_STREAM_MODULE_P}.tar.gz ) |
1341 |
- nginx_modules_http_security? ( ${HTTP_SECURITY_MODULE_URI} -> ${HTTP_SECURITY_MODULE_P}.tar.gz ) |
1342 |
- nginx_modules_http_slowfs_cache? ( ${HTTP_SLOWFS_CACHE_MODULE_URI} -> ${HTTP_SLOWFS_CACHE_MODULE_P}.tar.gz ) |
1343 |
- nginx_modules_http_sticky? ( ${HTTP_STICKY_MODULE_URI} -> ${HTTP_STICKY_MODULE_P}.tar.bz2 ) |
1344 |
- nginx_modules_http_upload_progress? ( ${HTTP_UPLOAD_PROGRESS_MODULE_URI} -> ${HTTP_UPLOAD_PROGRESS_MODULE_P}.tar.gz ) |
1345 |
- nginx_modules_http_upstream_check? ( ${HTTP_UPSTREAM_CHECK_MODULE_URI} -> ${HTTP_UPSTREAM_CHECK_MODULE_P}.tar.gz ) |
1346 |
- nginx_modules_http_vhost_traffic_status? ( ${HTTP_VHOST_TRAFFIC_STATUS_MODULE_URI} -> ${HTTP_VHOST_TRAFFIC_STATUS_MODULE_P}.tar.gz ) |
1347 |
- nginx_modules_stream_geoip2? ( ${GEOIP2_MODULE_URI} -> ${GEOIP2_MODULE_P}.tar.gz ) |
1348 |
- nginx_modules_stream_javascript? ( ${NJS_MODULE_URI} -> ${NJS_MODULE_P}.tar.gz ) |
1349 |
- rtmp? ( ${RTMP_MODULE_URI} -> ${RTMP_MODULE_P}.tar.gz )" |
1350 |
- |
1351 |
-LICENSE="BSD-2 BSD SSLeay MIT GPL-2 GPL-2+ |
1352 |
- nginx_modules_http_security? ( Apache-2.0 ) |
1353 |
- nginx_modules_http_push_stream? ( GPL-3 )" |
1354 |
- |
1355 |
-SLOT="mainline" |
1356 |
-KEYWORDS="amd64 ~arm ~arm64 ~ppc ~ppc64 x86 ~amd64-linux ~x86-linux" |
1357 |
- |
1358 |
-# Package doesn't provide a real test suite |
1359 |
-RESTRICT="test" |
1360 |
- |
1361 |
-NGINX_MODULES_STD="access auth_basic autoindex browser charset empty_gif |
1362 |
- fastcgi geo grpc gzip limit_req limit_conn map memcached mirror |
1363 |
- proxy referer rewrite scgi ssi split_clients upstream_hash |
1364 |
- upstream_ip_hash upstream_keepalive upstream_least_conn |
1365 |
- upstream_zone userid uwsgi" |
1366 |
-NGINX_MODULES_OPT="addition auth_request dav degradation flv geoip gunzip |
1367 |
- gzip_static image_filter mp4 perl random_index realip secure_link |
1368 |
- slice stub_status sub xslt" |
1369 |
-NGINX_MODULES_STREAM_STD="access geo limit_conn map return split_clients |
1370 |
- upstream_hash upstream_least_conn upstream_zone" |
1371 |
-NGINX_MODULES_STREAM_OPT="geoip realip ssl_preread" |
1372 |
-NGINX_MODULES_MAIL="imap pop3 smtp" |
1373 |
-NGINX_MODULES_3RD=" |
1374 |
- http_auth_ldap |
1375 |
- http_auth_pam |
1376 |
- http_brotli |
1377 |
- http_cache_purge |
1378 |
- http_dav_ext |
1379 |
- http_echo |
1380 |
- http_fancyindex |
1381 |
- http_geoip2 |
1382 |
- http_headers_more |
1383 |
- http_javascript |
1384 |
- http_lua |
1385 |
- http_memc |
1386 |
- http_metrics |
1387 |
- http_mogilefs |
1388 |
- http_naxsi |
1389 |
- http_push_stream |
1390 |
- http_security |
1391 |
- http_slowfs_cache |
1392 |
- http_sticky |
1393 |
- http_upload_progress |
1394 |
- http_upstream_check |
1395 |
- http_vhost_traffic_status |
1396 |
- stream_geoip2 |
1397 |
- stream_javascript |
1398 |
-" |
1399 |
- |
1400 |
-IUSE="aio debug +http +http2 +http-cache +ipv6 libatomic libressl luajit +pcre |
1401 |
- pcre-jit rtmp selinux ssl threads userland_GNU vim-syntax" |
1402 |
- |
1403 |
-for mod in $NGINX_MODULES_STD; do |
1404 |
- IUSE="${IUSE} +nginx_modules_http_${mod}" |
1405 |
-done |
1406 |
- |
1407 |
-for mod in $NGINX_MODULES_OPT; do |
1408 |
- IUSE="${IUSE} nginx_modules_http_${mod}" |
1409 |
-done |
1410 |
- |
1411 |
-for mod in $NGINX_MODULES_STREAM_STD; do |
1412 |
- IUSE="${IUSE} nginx_modules_stream_${mod}" |
1413 |
-done |
1414 |
- |
1415 |
-for mod in $NGINX_MODULES_STREAM_OPT; do |
1416 |
- IUSE="${IUSE} nginx_modules_stream_${mod}" |
1417 |
-done |
1418 |
- |
1419 |
-for mod in $NGINX_MODULES_MAIL; do |
1420 |
- IUSE="${IUSE} nginx_modules_mail_${mod}" |
1421 |
-done |
1422 |
- |
1423 |
-for mod in $NGINX_MODULES_3RD; do |
1424 |
- IUSE="${IUSE} nginx_modules_${mod}" |
1425 |
-done |
1426 |
- |
1427 |
-# Add so we can warn users updating about config changes |
1428 |
-# @TODO: jbergstroem: remove on next release series |
1429 |
-IUSE="${IUSE} nginx_modules_http_spdy" |
1430 |
- |
1431 |
-CDEPEND=" |
1432 |
- pcre? ( dev-libs/libpcre:= ) |
1433 |
- pcre-jit? ( dev-libs/libpcre:=[jit] ) |
1434 |
- ssl? ( |
1435 |
- !libressl? ( dev-libs/openssl:0= ) |
1436 |
- libressl? ( dev-libs/libressl:= ) |
1437 |
- ) |
1438 |
- http2? ( |
1439 |
- !libressl? ( >=dev-libs/openssl-1.0.1c:0= ) |
1440 |
- libressl? ( dev-libs/libressl:= ) |
1441 |
- ) |
1442 |
- http-cache? ( |
1443 |
- userland_GNU? ( |
1444 |
- !libressl? ( dev-libs/openssl:0= ) |
1445 |
- libressl? ( dev-libs/libressl:= ) |
1446 |
- ) |
1447 |
- ) |
1448 |
- nginx_modules_http_brotli? ( app-arch/brotli:= ) |
1449 |
- nginx_modules_http_geoip? ( dev-libs/geoip ) |
1450 |
- nginx_modules_http_geoip2? ( dev-libs/libmaxminddb:= ) |
1451 |
- nginx_modules_http_gunzip? ( sys-libs/zlib ) |
1452 |
- nginx_modules_http_gzip? ( sys-libs/zlib ) |
1453 |
- nginx_modules_http_gzip_static? ( sys-libs/zlib ) |
1454 |
- nginx_modules_http_image_filter? ( media-libs/gd:=[jpeg,png] ) |
1455 |
- nginx_modules_http_perl? ( >=dev-lang/perl-5.8:= ) |
1456 |
- nginx_modules_http_rewrite? ( dev-libs/libpcre:= ) |
1457 |
- nginx_modules_http_secure_link? ( |
1458 |
- userland_GNU? ( |
1459 |
- !libressl? ( dev-libs/openssl:0= ) |
1460 |
- libressl? ( dev-libs/libressl:= ) |
1461 |
- ) |
1462 |
- ) |
1463 |
- nginx_modules_http_xslt? ( dev-libs/libxml2:= dev-libs/libxslt ) |
1464 |
- nginx_modules_http_lua? ( dev-lang/luajit:2= ) |
1465 |
- nginx_modules_http_auth_pam? ( sys-libs/pam ) |
1466 |
- nginx_modules_http_metrics? ( dev-libs/yajl:= ) |
1467 |
- nginx_modules_http_dav_ext? ( dev-libs/libxml2 ) |
1468 |
- nginx_modules_http_security? ( |
1469 |
- dev-libs/apr:= |
1470 |
- dev-libs/apr-util:= |
1471 |
- dev-libs/libxml2:= |
1472 |
- net-misc/curl |
1473 |
- www-servers/apache |
1474 |
- ) |
1475 |
- nginx_modules_http_auth_ldap? ( net-nds/openldap[ssl?] ) |
1476 |
- nginx_modules_stream_geoip? ( dev-libs/geoip ) |
1477 |
- nginx_modules_stream_geoip2? ( dev-libs/libmaxminddb:= )" |
1478 |
-RDEPEND="${CDEPEND} |
1479 |
- selinux? ( sec-policy/selinux-nginx ) |
1480 |
- !www-servers/nginx:0" |
1481 |
-DEPEND="${CDEPEND} |
1482 |
- nginx_modules_http_brotli? ( virtual/pkgconfig ) |
1483 |
- nginx_modules_http_security? ( ${AUTOTOOLS_DEPEND} ) |
1484 |
- arm? ( dev-libs/libatomic_ops ) |
1485 |
- libatomic? ( dev-libs/libatomic_ops )" |
1486 |
-PDEPEND="vim-syntax? ( app-vim/nginx-syntax )" |
1487 |
- |
1488 |
-REQUIRED_USE="pcre-jit? ( pcre ) |
1489 |
- nginx_modules_http_fancyindex? ( nginx_modules_http_addition ) |
1490 |
- nginx_modules_http_grpc? ( http2 ) |
1491 |
- nginx_modules_http_lua? ( |
1492 |
- luajit |
1493 |
- nginx_modules_http_rewrite |
1494 |
- ) |
1495 |
- nginx_modules_http_naxsi? ( pcre ) |
1496 |
- nginx_modules_http_dav_ext? ( nginx_modules_http_dav nginx_modules_http_xslt ) |
1497 |
- nginx_modules_http_metrics? ( nginx_modules_http_stub_status ) |
1498 |
- nginx_modules_http_security? ( pcre ) |
1499 |
- nginx_modules_http_push_stream? ( ssl )" |
1500 |
- |
1501 |
-pkg_setup() { |
1502 |
- NGINX_HOME="/var/lib/nginx" |
1503 |
- NGINX_HOME_TMP="${NGINX_HOME}/tmp" |
1504 |
- |
1505 |
- ebegin "Creating nginx user and group" |
1506 |
- enewgroup ${PN} |
1507 |
- enewuser ${PN} -1 -1 "${NGINX_HOME}" ${PN} |
1508 |
- eend $? |
1509 |
- |
1510 |
- if use libatomic; then |
1511 |
- ewarn "GCC 4.1+ features built-in atomic operations." |
1512 |
- ewarn "Using libatomic_ops is only needed if using" |
1513 |
- ewarn "a different compiler or a GCC prior to 4.1" |
1514 |
- fi |
1515 |
- |
1516 |
- if [[ -n $NGINX_ADD_MODULES ]]; then |
1517 |
- ewarn "You are building custom modules via \$NGINX_ADD_MODULES!" |
1518 |
- ewarn "This nginx installation is not supported!" |
1519 |
- ewarn "Make sure you can reproduce the bug without those modules" |
1520 |
- ewarn "_before_ reporting bugs." |
1521 |
- fi |
1522 |
- |
1523 |
- if use !http; then |
1524 |
- ewarn "To actually disable all http-functionality you also have to disable" |
1525 |
- ewarn "all nginx http modules." |
1526 |
- fi |
1527 |
- |
1528 |
- if use nginx_modules_http_mogilefs && use threads; then |
1529 |
- eerror "mogilefs won't compile with threads support." |
1530 |
- eerror "Please disable either flag and try again." |
1531 |
- die "Can't compile mogilefs with threads support" |
1532 |
- fi |
1533 |
-} |
1534 |
- |
1535 |
-src_prepare() { |
1536 |
- eapply "${FILESDIR}/${PN}-1.4.1-fix-perl-install-path.patch" |
1537 |
- eapply "${FILESDIR}/${PN}-httpoxy-mitigation-r1.patch" |
1538 |
- |
1539 |
- if use nginx_modules_http_auth_pam; then |
1540 |
- cd "${HTTP_AUTH_PAM_MODULE_WD}" || die |
1541 |
- eapply "${FILESDIR}"/http_auth_pam-1.5.1-adjust-loglevel-for-authentication-failures.patch |
1542 |
- cd "${S}" || die |
1543 |
- fi |
1544 |
- |
1545 |
- if use nginx_modules_http_brotli; then |
1546 |
- cd "${HTTP_BROTLI_MODULE_WD}" || die |
1547 |
- eapply "${FILESDIR}"/http_brotli-detect-brotli-r2.patch |
1548 |
- cd "${S}" || die |
1549 |
- fi |
1550 |
- |
1551 |
- if use nginx_modules_http_upstream_check; then |
1552 |
- eapply -p0 "${FILESDIR}"/http_upstream_check-nginx-1.11.5+.patch |
1553 |
- fi |
1554 |
- |
1555 |
- if use nginx_modules_http_cache_purge; then |
1556 |
- cd "${HTTP_CACHE_PURGE_MODULE_WD}" || die |
1557 |
- eapply "${FILESDIR}"/http_cache_purge-1.11.6+.patch |
1558 |
- cd "${S}" || die |
1559 |
- fi |
1560 |
- |
1561 |
- if use nginx_modules_http_security; then |
1562 |
- cd "${HTTP_SECURITY_MODULE_WD}" || die |
1563 |
- |
1564 |
- eautoreconf |
1565 |
- |
1566 |
- if use luajit ; then |
1567 |
- sed -i \ |
1568 |
- -e 's|^\(LUA_PKGNAMES\)=.*|\1="luajit"|' \ |
1569 |
- configure || die |
1570 |
- fi |
1571 |
- |
1572 |
- cd "${S}" || die |
1573 |
- fi |
1574 |
- |
1575 |
- if use nginx_modules_http_upload_progress; then |
1576 |
- cd "${HTTP_UPLOAD_PROGRESS_MODULE_WD}" || die |
1577 |
- eapply "${FILESDIR}"/http_uploadprogress-issue_50-r1.patch |
1578 |
- cd "${S}" || die |
1579 |
- fi |
1580 |
- |
1581 |
- find auto/ -type f -print0 | xargs -0 sed -i 's:\&\& make:\&\& \\$(MAKE):' || die |
1582 |
- # We have config protection, don't rename etc files |
1583 |
- sed -i 's:.default::' auto/install || die |
1584 |
- # remove useless files |
1585 |
- sed -i -e '/koi-/d' -e '/win-/d' auto/install || die |
1586 |
- |
1587 |
- # don't install to /etc/nginx/ if not in use |
1588 |
- local module |
1589 |
- for module in fastcgi scgi uwsgi ; do |
1590 |
- if ! use nginx_modules_http_${module}; then |
1591 |
- sed -i -e "/${module}/d" auto/install || die |
1592 |
- fi |
1593 |
- done |
1594 |
- |
1595 |
- eapply_user |
1596 |
-} |
1597 |
- |
1598 |
-src_configure() { |
1599 |
- # mod_security needs to generate nginx/modsecurity/config before including it |
1600 |
- if use nginx_modules_http_security; then |
1601 |
- cd "${HTTP_SECURITY_MODULE_WD}" || die |
1602 |
- |
1603 |
- ./configure \ |
1604 |
- --enable-standalone-module \ |
1605 |
- --disable-mlogc \ |
1606 |
- --with-ssdeep=no \ |
1607 |
- $(use_enable pcre-jit) \ |
1608 |
- $(use_with nginx_modules_http_lua lua) || die "configure failed for mod_security" |
1609 |
- |
1610 |
- cd "${S}" || die |
1611 |
- fi |
1612 |
- |
1613 |
- local myconf=() http_enabled= mail_enabled= stream_enabled= |
1614 |
- |
1615 |
- use aio && myconf+=( --with-file-aio ) |
1616 |
- use debug && myconf+=( --with-debug ) |
1617 |
- use http2 && myconf+=( --with-http_v2_module ) |
1618 |
- use libatomic && myconf+=( --with-libatomic ) |
1619 |
- use pcre && myconf+=( --with-pcre ) |
1620 |
- use pcre-jit && myconf+=( --with-pcre-jit ) |
1621 |
- use threads && myconf+=( --with-threads ) |
1622 |
- |
1623 |
- # HTTP modules |
1624 |
- for mod in $NGINX_MODULES_STD; do |
1625 |
- if use nginx_modules_http_${mod}; then |
1626 |
- http_enabled=1 |
1627 |
- else |
1628 |
- myconf+=( --without-http_${mod}_module ) |
1629 |
- fi |
1630 |
- done |
1631 |
- |
1632 |
- for mod in $NGINX_MODULES_OPT; do |
1633 |
- if use nginx_modules_http_${mod}; then |
1634 |
- http_enabled=1 |
1635 |
- myconf+=( --with-http_${mod}_module ) |
1636 |
- fi |
1637 |
- done |
1638 |
- |
1639 |
- if use nginx_modules_http_fastcgi; then |
1640 |
- myconf+=( --with-http_realip_module ) |
1641 |
- fi |
1642 |
- |
1643 |
- # third-party modules |
1644 |
- if use nginx_modules_http_upload_progress; then |
1645 |
- http_enabled=1 |
1646 |
- myconf+=( --add-module=${HTTP_UPLOAD_PROGRESS_MODULE_WD} ) |
1647 |
- fi |
1648 |
- |
1649 |
- if use nginx_modules_http_headers_more; then |
1650 |
- http_enabled=1 |
1651 |
- myconf+=( --add-module=${HTTP_HEADERS_MORE_MODULE_WD} ) |
1652 |
- fi |
1653 |
- |
1654 |
- if use nginx_modules_http_cache_purge; then |
1655 |
- http_enabled=1 |
1656 |
- myconf+=( --add-module=${HTTP_CACHE_PURGE_MODULE_WD} ) |
1657 |
- fi |
1658 |
- |
1659 |
- if use nginx_modules_http_slowfs_cache; then |
1660 |
- http_enabled=1 |
1661 |
- myconf+=( --add-module=${HTTP_SLOWFS_CACHE_MODULE_WD} ) |
1662 |
- fi |
1663 |
- |
1664 |
- if use nginx_modules_http_fancyindex; then |
1665 |
- http_enabled=1 |
1666 |
- myconf+=( --add-module=${HTTP_FANCYINDEX_MODULE_WD} ) |
1667 |
- fi |
1668 |
- |
1669 |
- if use nginx_modules_http_lua; then |
1670 |
- http_enabled=1 |
1671 |
- export LUAJIT_LIB=$(pkg-config --variable libdir luajit) |
1672 |
- export LUAJIT_INC=$(pkg-config --variable includedir luajit) |
1673 |
- myconf+=( --add-module=${DEVEL_KIT_MODULE_WD} ) |
1674 |
- myconf+=( --add-module=${HTTP_LUA_MODULE_WD} ) |
1675 |
- fi |
1676 |
- |
1677 |
- if use nginx_modules_http_auth_pam; then |
1678 |
- http_enabled=1 |
1679 |
- myconf+=( --add-module=${HTTP_AUTH_PAM_MODULE_WD} ) |
1680 |
- fi |
1681 |
- |
1682 |
- if use nginx_modules_http_upstream_check; then |
1683 |
- http_enabled=1 |
1684 |
- myconf+=( --add-module=${HTTP_UPSTREAM_CHECK_MODULE_WD} ) |
1685 |
- fi |
1686 |
- |
1687 |
- if use nginx_modules_http_metrics; then |
1688 |
- http_enabled=1 |
1689 |
- myconf+=( --add-module=${HTTP_METRICS_MODULE_WD} ) |
1690 |
- fi |
1691 |
- |
1692 |
- if use nginx_modules_http_naxsi ; then |
1693 |
- http_enabled=1 |
1694 |
- myconf+=( --add-module=${HTTP_NAXSI_MODULE_WD} ) |
1695 |
- fi |
1696 |
- |
1697 |
- if use rtmp ; then |
1698 |
- http_enabled=1 |
1699 |
- myconf+=( --add-module=${RTMP_MODULE_WD} ) |
1700 |
- fi |
1701 |
- |
1702 |
- if use nginx_modules_http_dav_ext ; then |
1703 |
- http_enabled=1 |
1704 |
- myconf+=( --add-module=${HTTP_DAV_EXT_MODULE_WD} ) |
1705 |
- fi |
1706 |
- |
1707 |
- if use nginx_modules_http_echo ; then |
1708 |
- http_enabled=1 |
1709 |
- myconf+=( --add-module=${HTTP_ECHO_MODULE_WD} ) |
1710 |
- fi |
1711 |
- |
1712 |
- if use nginx_modules_http_security ; then |
1713 |
- http_enabled=1 |
1714 |
- myconf+=( --add-module=${HTTP_SECURITY_MODULE_WD}/nginx/modsecurity ) |
1715 |
- fi |
1716 |
- |
1717 |
- if use nginx_modules_http_push_stream ; then |
1718 |
- http_enabled=1 |
1719 |
- myconf+=( --add-module=${HTTP_PUSH_STREAM_MODULE_WD} ) |
1720 |
- fi |
1721 |
- |
1722 |
- if use nginx_modules_http_sticky ; then |
1723 |
- http_enabled=1 |
1724 |
- myconf+=( --add-module=${HTTP_STICKY_MODULE_WD} ) |
1725 |
- fi |
1726 |
- |
1727 |
- if use nginx_modules_http_mogilefs ; then |
1728 |
- http_enabled=1 |
1729 |
- myconf+=( --add-module=${HTTP_MOGILEFS_MODULE_WD} ) |
1730 |
- fi |
1731 |
- |
1732 |
- if use nginx_modules_http_memc ; then |
1733 |
- http_enabled=1 |
1734 |
- myconf+=( --add-module=${HTTP_MEMC_MODULE_WD} ) |
1735 |
- fi |
1736 |
- |
1737 |
- if use nginx_modules_http_auth_ldap; then |
1738 |
- http_enabled=1 |
1739 |
- myconf+=( --add-module=${HTTP_LDAP_MODULE_WD} ) |
1740 |
- fi |
1741 |
- |
1742 |
- if use nginx_modules_http_vhost_traffic_status; then |
1743 |
- http_enabled=1 |
1744 |
- myconf+=( --add-module=${HTTP_VHOST_TRAFFIC_STATUS_MODULE_WD} ) |
1745 |
- fi |
1746 |
- |
1747 |
- if use nginx_modules_http_geoip2 || use nginx_modules_stream_geoip2; then |
1748 |
- myconf+=( --add-module=${GEOIP2_MODULE_WD} ) |
1749 |
- fi |
1750 |
- |
1751 |
- if use nginx_modules_http_javascript || use nginx_modules_stream_javascript; then |
1752 |
- myconf+=( --add-module="${NJS_MODULE_WD}/nginx" ) |
1753 |
- fi |
1754 |
- |
1755 |
- if use nginx_modules_http_brotli; then |
1756 |
- http_enabled=1 |
1757 |
- myconf+=( --add-module=${HTTP_BROTLI_MODULE_WD} ) |
1758 |
- fi |
1759 |
- |
1760 |
- if use http || use http-cache || use http2 || use nginx_modules_http_javascript; then |
1761 |
- http_enabled=1 |
1762 |
- fi |
1763 |
- |
1764 |
- if [ $http_enabled ]; then |
1765 |
- use http-cache || myconf+=( --without-http-cache ) |
1766 |
- use ssl && myconf+=( --with-http_ssl_module ) |
1767 |
- else |
1768 |
- myconf+=( --without-http --without-http-cache ) |
1769 |
- fi |
1770 |
- |
1771 |
- # Stream modules |
1772 |
- for mod in $NGINX_MODULES_STREAM_STD; do |
1773 |
- if use nginx_modules_stream_${mod}; then |
1774 |
- stream_enabled=1 |
1775 |
- else |
1776 |
- myconf+=( --without-stream_${mod}_module ) |
1777 |
- fi |
1778 |
- done |
1779 |
- |
1780 |
- for mod in $NGINX_MODULES_STREAM_OPT; do |
1781 |
- if use nginx_modules_stream_${mod}; then |
1782 |
- stream_enabled=1 |
1783 |
- myconf+=( --with-stream_${mod}_module ) |
1784 |
- fi |
1785 |
- done |
1786 |
- |
1787 |
- if use nginx_modules_stream_geoip2 || use nginx_modules_stream_javascript; then |
1788 |
- stream_enabled=1 |
1789 |
- fi |
1790 |
- |
1791 |
- if [ $stream_enabled ]; then |
1792 |
- myconf+=( --with-stream ) |
1793 |
- use ssl && myconf+=( --with-stream_ssl_module ) |
1794 |
- fi |
1795 |
- |
1796 |
- # MAIL modules |
1797 |
- for mod in $NGINX_MODULES_MAIL; do |
1798 |
- if use nginx_modules_mail_${mod}; then |
1799 |
- mail_enabled=1 |
1800 |
- else |
1801 |
- myconf+=( --without-mail_${mod}_module ) |
1802 |
- fi |
1803 |
- done |
1804 |
- |
1805 |
- if [ $mail_enabled ]; then |
1806 |
- myconf+=( --with-mail ) |
1807 |
- use ssl && myconf+=( --with-mail_ssl_module ) |
1808 |
- fi |
1809 |
- |
1810 |
- # custom modules |
1811 |
- for mod in $NGINX_ADD_MODULES; do |
1812 |
- myconf+=( --add-module=${mod} ) |
1813 |
- done |
1814 |
- |
1815 |
- # https://bugs.gentoo.org/286772 |
1816 |
- export LANG=C LC_ALL=C |
1817 |
- tc-export CC |
1818 |
- |
1819 |
- if ! use prefix; then |
1820 |
- myconf+=( --user=${PN} ) |
1821 |
- myconf+=( --group=${PN} ) |
1822 |
- fi |
1823 |
- |
1824 |
- local WITHOUT_IPV6= |
1825 |
- if ! use ipv6; then |
1826 |
- WITHOUT_IPV6=" -DNGX_HAVE_INET6=0" |
1827 |
- fi |
1828 |
- |
1829 |
- if [[ -n "${EXTRA_ECONF}" ]]; then |
1830 |
- myconf+=( ${EXTRA_ECONF} ) |
1831 |
- ewarn "EXTRA_ECONF applied. Now you are on your own, good luck!" |
1832 |
- fi |
1833 |
- |
1834 |
- ./configure \ |
1835 |
- --prefix="${EPREFIX}"/usr \ |
1836 |
- --conf-path="${EPREFIX}"/etc/${PN}/${PN}.conf \ |
1837 |
- --error-log-path="${EPREFIX}"/var/log/${PN}/error_log \ |
1838 |
- --pid-path="${EPREFIX}"/run/${PN}.pid \ |
1839 |
- --lock-path="${EPREFIX}"/run/lock/${PN}.lock \ |
1840 |
- --with-cc-opt="-I${EROOT}usr/include${WITHOUT_IPV6}" \ |
1841 |
- --with-ld-opt="-L${EROOT}usr/$(get_libdir)" \ |
1842 |
- --http-log-path="${EPREFIX}"/var/log/${PN}/access_log \ |
1843 |
- --http-client-body-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/client \ |
1844 |
- --http-proxy-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/proxy \ |
1845 |
- --http-fastcgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/fastcgi \ |
1846 |
- --http-scgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/scgi \ |
1847 |
- --http-uwsgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/uwsgi \ |
1848 |
- --with-compat \ |
1849 |
- "${myconf[@]}" || die "configure failed" |
1850 |
- |
1851 |
- # A purely cosmetic change that makes nginx -V more readable. This can be |
1852 |
- # good if people outside the gentoo community would troubleshoot and |
1853 |
- # question the users setup. |
1854 |
- sed -i -e "s|${WORKDIR}|external_module|g" objs/ngx_auto_config.h || die |
1855 |
-} |
1856 |
- |
1857 |
-src_compile() { |
1858 |
- use nginx_modules_http_security && emake -C "${HTTP_SECURITY_MODULE_WD}" |
1859 |
- |
1860 |
- # https://bugs.gentoo.org/286772 |
1861 |
- export LANG=C LC_ALL=C |
1862 |
- emake LINK="${CC} ${LDFLAGS}" OTHERLDFLAGS="${LDFLAGS}" |
1863 |
-} |
1864 |
- |
1865 |
-src_install() { |
1866 |
- emake DESTDIR="${D%/}" install |
1867 |
- |
1868 |
- cp "${FILESDIR}"/nginx.conf-r2 "${ED%/}"/etc/nginx/nginx.conf || die |
1869 |
- |
1870 |
- newinitd "${FILESDIR}"/nginx.initd-r4 nginx |
1871 |
- newconfd "${FILESDIR}"/nginx.confd nginx |
1872 |
- |
1873 |
- systemd_newunit "${FILESDIR}"/nginx.service-r1 nginx.service |
1874 |
- |
1875 |
- doman man/nginx.8 |
1876 |
- dodoc CHANGES* README |
1877 |
- |
1878 |
- # just keepdir. do not copy the default htdocs files (bug #449136) |
1879 |
- keepdir /var/www/localhost |
1880 |
- rm -rf "${ED%/}"/usr/html || die |
1881 |
- |
1882 |
- # set up a list of directories to keep |
1883 |
- local keepdir_list="${NGINX_HOME_TMP}"/client |
1884 |
- local module |
1885 |
- for module in proxy fastcgi scgi uwsgi; do |
1886 |
- use nginx_modules_http_${module} && keepdir_list+=" ${NGINX_HOME_TMP}/${module}" |
1887 |
- done |
1888 |
- |
1889 |
- keepdir /var/log/nginx ${keepdir_list} |
1890 |
- |
1891 |
- # this solves a problem with SELinux where nginx doesn't see the directories |
1892 |
- # as root and tries to create them as nginx |
1893 |
- fperms 0750 "${NGINX_HOME_TMP}" |
1894 |
- fowners ${PN}:0 "${NGINX_HOME_TMP}" |
1895 |
- |
1896 |
- fperms 0700 ${keepdir_list} |
1897 |
- fowners ${PN}:${PN} ${keepdir_list} |
1898 |
- |
1899 |
- fperms 0710 /var/log/nginx |
1900 |
- fowners 0:${PN} /var/log/nginx |
1901 |
- |
1902 |
- # logrotate |
1903 |
- insinto /etc/logrotate.d |
1904 |
- newins "${FILESDIR}"/nginx.logrotate-r1 nginx |
1905 |
- |
1906 |
- # Don't create /run |
1907 |
- rm -rf "${ED%/}"/run || die |
1908 |
- |
1909 |
- if use luajit; then |
1910 |
- pax-mark m "${ED%/}/usr/sbin/nginx" |
1911 |
- fi |
1912 |
- |
1913 |
- if use nginx_modules_http_perl; then |
1914 |
- cd "${S}"/objs/src/http/modules/perl/ || die |
1915 |
- emake DESTDIR="${D}" INSTALLDIRS=vendor |
1916 |
- perl_delete_localpod |
1917 |
- cd "${S}" || die |
1918 |
- fi |
1919 |
- |
1920 |
- if use nginx_modules_http_cache_purge; then |
1921 |
- docinto ${HTTP_CACHE_PURGE_MODULE_P} |
1922 |
- dodoc "${HTTP_CACHE_PURGE_MODULE_WD}"/{CHANGES,README.md,TODO.md} |
1923 |
- fi |
1924 |
- |
1925 |
- if use nginx_modules_http_slowfs_cache; then |
1926 |
- docinto ${HTTP_SLOWFS_CACHE_MODULE_P} |
1927 |
- dodoc "${HTTP_SLOWFS_CACHE_MODULE_WD}"/{CHANGES,README.md} |
1928 |
- fi |
1929 |
- |
1930 |
- if use nginx_modules_http_fancyindex; then |
1931 |
- docinto ${HTTP_FANCYINDEX_MODULE_P} |
1932 |
- dodoc "${HTTP_FANCYINDEX_MODULE_WD}"/README.rst |
1933 |
- fi |
1934 |
- |
1935 |
- if use nginx_modules_http_lua; then |
1936 |
- docinto ${HTTP_LUA_MODULE_P} |
1937 |
- dodoc "${HTTP_LUA_MODULE_WD}"/README.markdown |
1938 |
- fi |
1939 |
- |
1940 |
- if use nginx_modules_http_auth_pam; then |
1941 |
- docinto ${HTTP_AUTH_PAM_MODULE_P} |
1942 |
- dodoc "${HTTP_AUTH_PAM_MODULE_WD}"/{README.md,ChangeLog} |
1943 |
- fi |
1944 |
- |
1945 |
- if use nginx_modules_http_upstream_check; then |
1946 |
- docinto ${HTTP_UPSTREAM_CHECK_MODULE_P} |
1947 |
- dodoc "${HTTP_UPSTREAM_CHECK_MODULE_WD}"/{README,CHANGES} |
1948 |
- fi |
1949 |
- |
1950 |
- if use nginx_modules_http_naxsi; then |
1951 |
- insinto /etc/nginx |
1952 |
- doins "${HTTP_NAXSI_MODULE_WD}"/../naxsi_config/naxsi_core.rules |
1953 |
- fi |
1954 |
- |
1955 |
- if use rtmp; then |
1956 |
- docinto ${RTMP_MODULE_P} |
1957 |
- dodoc "${RTMP_MODULE_WD}"/{AUTHORS,README.md,stat.xsl} |
1958 |
- fi |
1959 |
- |
1960 |
- if use nginx_modules_http_dav_ext; then |
1961 |
- docinto ${HTTP_DAV_EXT_MODULE_P} |
1962 |
- dodoc "${HTTP_DAV_EXT_MODULE_WD}"/README.rst |
1963 |
- fi |
1964 |
- |
1965 |
- if use nginx_modules_http_echo; then |
1966 |
- docinto ${HTTP_ECHO_MODULE_P} |
1967 |
- dodoc "${HTTP_ECHO_MODULE_WD}"/README.markdown |
1968 |
- fi |
1969 |
- |
1970 |
- if use nginx_modules_http_security; then |
1971 |
- docinto ${HTTP_SECURITY_MODULE_P} |
1972 |
- dodoc "${HTTP_SECURITY_MODULE_WD}"/{CHANGES,README.md,authors.txt} |
1973 |
- fi |
1974 |
- |
1975 |
- if use nginx_modules_http_push_stream; then |
1976 |
- docinto ${HTTP_PUSH_STREAM_MODULE_P} |
1977 |
- dodoc "${HTTP_PUSH_STREAM_MODULE_WD}"/{AUTHORS,CHANGELOG.textile,README.textile} |
1978 |
- fi |
1979 |
- |
1980 |
- if use nginx_modules_http_sticky; then |
1981 |
- docinto ${HTTP_STICKY_MODULE_P} |
1982 |
- dodoc "${HTTP_STICKY_MODULE_WD}"/{README.md,Changelog.txt,docs/sticky.pdf} |
1983 |
- fi |
1984 |
- |
1985 |
- if use nginx_modules_http_memc; then |
1986 |
- docinto ${HTTP_MEMC_MODULE_P} |
1987 |
- dodoc "${HTTP_MEMC_MODULE_WD}"/README.markdown |
1988 |
- fi |
1989 |
- |
1990 |
- if use nginx_modules_http_auth_ldap; then |
1991 |
- docinto ${HTTP_LDAP_MODULE_P} |
1992 |
- dodoc "${HTTP_LDAP_MODULE_WD}"/example.conf |
1993 |
- fi |
1994 |
-} |
1995 |
- |
1996 |
-pkg_postinst() { |
1997 |
- if use ssl; then |
1998 |
- if [[ ! -f "${EROOT}"etc/ssl/${PN}/${PN}.key ]]; then |
1999 |
- install_cert /etc/ssl/${PN}/${PN} |
2000 |
- use prefix || chown ${PN}:${PN} "${EROOT}"etc/ssl/${PN}/${PN}.{crt,csr,key,pem} |
2001 |
- fi |
2002 |
- fi |
2003 |
- |
2004 |
- if use nginx_modules_http_spdy; then |
2005 |
- ewarn "" |
2006 |
- ewarn "In nginx 1.9.5 the spdy module was superseded by http2." |
2007 |
- ewarn "Update your configs and package.use accordingly." |
2008 |
- fi |
2009 |
- |
2010 |
- if use nginx_modules_http_lua; then |
2011 |
- ewarn "" |
2012 |
- ewarn "While you can build lua 3rd party module against ${P}" |
2013 |
- ewarn "the author warns that >=${PN}-1.11.11 is still not an" |
2014 |
- ewarn "officially supported target yet. You are on your own." |
2015 |
- ewarn "Expect runtime failures, memory leaks and other problems!" |
2016 |
- fi |
2017 |
- |
2018 |
- if use nginx_modules_http_lua && use http2; then |
2019 |
- ewarn "" |
2020 |
- ewarn "Lua 3rd party module author warns against using ${P} with" |
2021 |
- ewarn "NGINX_MODULES_HTTP=\"lua http2\". For more info, see https://git.io/OldLsg" |
2022 |
- fi |
2023 |
- |
2024 |
- local _n_permission_layout_checks=0 |
2025 |
- local _has_to_adjust_permissions=0 |
2026 |
- local _has_to_show_permission_warning=0 |
2027 |
- |
2028 |
- # Defaults to 1 to inform people doing a fresh installation |
2029 |
- # that we ship modified {scgi,uwsgi,fastcgi}_params files |
2030 |
- local _has_to_show_httpoxy_mitigation_notice=1 |
2031 |
- |
2032 |
- local _replacing_version= |
2033 |
- for _replacing_version in ${REPLACING_VERSIONS}; do |
2034 |
- _n_permission_layout_checks=$((${_n_permission_layout_checks}+1)) |
2035 |
- |
2036 |
- if [[ ${_n_permission_layout_checks} -gt 1 ]]; then |
2037 |
- # Should never happen: |
2038 |
- # Package is abusing slots but doesn't allow multiple parallel installations. |
2039 |
- # If we run into this situation it is unsafe to automatically adjust any |
2040 |
- # permission... |
2041 |
- _has_to_show_permission_warning=1 |
2042 |
- |
2043 |
- ewarn "Replacing multiple ${PN}' versions is unsupported! " \ |
2044 |
- "You will have to adjust permissions on your own." |
2045 |
- |
2046 |
- break |
2047 |
- fi |
2048 |
- |
2049 |
- local _replacing_version_branch=$(get_version_component_range 1-2 "${_replacing_version}") |
2050 |
- debug-print "Updating an existing installation (v${_replacing_version}; branch '${_replacing_version_branch}') ..." |
2051 |
- |
2052 |
- # Do we need to adjust permissions to fix CVE-2013-0337 (bug #458726, #469094)? |
2053 |
- # This was before we introduced multiple nginx versions so we |
2054 |
- # do not need to distinguish between stable and mainline |
2055 |
- local _need_to_fix_CVE2013_0337=1 |
2056 |
- |
2057 |
- if version_is_at_least "1.4.1-r2" "${_replacing_version}"; then |
2058 |
- # We are updating an installation which should already be fixed |
2059 |
- _need_to_fix_CVE2013_0337=0 |
2060 |
- debug-print "Skipping CVE-2013-0337 ... existing installation should not be affected!" |
2061 |
- else |
2062 |
- _has_to_adjust_permissions=1 |
2063 |
- debug-print "Need to adjust permissions to fix CVE-2013-0337!" |
2064 |
- fi |
2065 |
- |
2066 |
- # Do we need to inform about HTTPoxy mitigation? |
2067 |
- # In repository since commit 8be44f76d4ac02cebcd1e0e6e6284bb72d054b0f |
2068 |
- if ! version_is_at_least "1.10" "${_replacing_version_branch}"; then |
2069 |
- # Updating from <1.10 |
2070 |
- _has_to_show_httpoxy_mitigation_notice=1 |
2071 |
- debug-print "Need to inform about HTTPoxy mitigation!" |
2072 |
- else |
2073 |
- # Updating from >=1.10 |
2074 |
- local _fixed_in_pvr= |
2075 |
- case "${_replacing_version_branch}" in |
2076 |
- "1.10") |
2077 |
- _fixed_in_pvr="1.10.1-r2" |
2078 |
- ;; |
2079 |
- "1.11") |
2080 |
- _fixed_in_pvr="1.11.3-r1" |
2081 |
- ;; |
2082 |
- *) |
2083 |
- # This should be any future branch. |
2084 |
- # If we run this code it is safe to assume that the user has |
2085 |
- # already seen the HTTPoxy mitigation notice because he/she is doing |
2086 |
- # an update from previous version where we have already shown |
2087 |
- # the warning. Otherwise, we wouldn't hit this code path ... |
2088 |
- _fixed_in_pvr= |
2089 |
- esac |
2090 |
- |
2091 |
- if [[ -z "${_fixed_in_pvr}" ]] || version_is_at_least "${_fixed_in_pvr}" "${_replacing_version}"; then |
2092 |
- # We are updating an installation where we already informed |
2093 |
- # that we are mitigating HTTPoxy per default |
2094 |
- _has_to_show_httpoxy_mitigation_notice=0 |
2095 |
- debug-print "No need to inform about HTTPoxy mitigation ... information was already shown for existing installation!" |
2096 |
- else |
2097 |
- _has_to_show_httpoxy_mitigation_notice=1 |
2098 |
- debug-print "Need to inform about HTTPoxy mitigation!" |
2099 |
- fi |
2100 |
- fi |
2101 |
- |
2102 |
- # Do we need to adjust permissions to fix CVE-2016-1247 (bug #605008)? |
2103 |
- # All branches up to 1.11 are affected |
2104 |
- local _need_to_fix_CVE2016_1247=1 |
2105 |
- |
2106 |
- if ! version_is_at_least "1.10" "${_replacing_version_branch}"; then |
2107 |
- # Updating from <1.10 |
2108 |
- _has_to_adjust_permissions=1 |
2109 |
- debug-print "Need to adjust permissions to fix CVE-2016-1247!" |
2110 |
- else |
2111 |
- # Updating from >=1.10 |
2112 |
- local _fixed_in_pvr= |
2113 |
- case "${_replacing_version_branch}" in |
2114 |
- "1.10") |
2115 |
- _fixed_in_pvr="1.10.2-r3" |
2116 |
- ;; |
2117 |
- "1.11") |
2118 |
- _fixed_in_pvr="1.11.6-r1" |
2119 |
- ;; |
2120 |
- *) |
2121 |
- # This should be any future branch. |
2122 |
- # If we run this code it is safe to assume that we have already |
2123 |
- # adjusted permissions or were never affected because user is |
2124 |
- # doing an update from previous version which was safe or did |
2125 |
- # the adjustments. Otherwise, we wouldn't hit this code path ... |
2126 |
- _fixed_in_pvr= |
2127 |
- esac |
2128 |
- |
2129 |
- if [[ -z "${_fixed_in_pvr}" ]] || version_is_at_least "${_fixed_in_pvr}" "${_replacing_version}"; then |
2130 |
- # We are updating an installation which should already be adjusted |
2131 |
- # or which was never affected |
2132 |
- _need_to_fix_CVE2016_1247=0 |
2133 |
- debug-print "Skipping CVE-2016-1247 ... existing installation should not be affected!" |
2134 |
- else |
2135 |
- _has_to_adjust_permissions=1 |
2136 |
- debug-print "Need to adjust permissions to fix CVE-2016-1247!" |
2137 |
- fi |
2138 |
- fi |
2139 |
- done |
2140 |
- |
2141 |
- if [[ ${_has_to_adjust_permissions} -eq 1 ]]; then |
2142 |
- # We do not DIE when chmod/chown commands are failing because |
2143 |
- # package is already merged on user's system at this stage |
2144 |
- # and we cannot retry without losing the information that |
2145 |
- # the existing installation needs to adjust permissions. |
2146 |
- # Instead we are going to a show a big warning ... |
2147 |
- |
2148 |
- if [[ ${_has_to_show_permission_warning} -eq 0 ]] && [[ ${_need_to_fix_CVE2013_0337} -eq 1 ]]; then |
2149 |
- ewarn "" |
2150 |
- ewarn "The world-readable bit (if set) has been removed from the" |
2151 |
- ewarn "following directories to mitigate a security bug" |
2152 |
- ewarn "(CVE-2013-0337, bug #458726):" |
2153 |
- ewarn "" |
2154 |
- ewarn " ${EPREFIX}/var/log/nginx" |
2155 |
- ewarn " ${EPREFIX}${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi}" |
2156 |
- ewarn "" |
2157 |
- ewarn "Check if this is correct for your setup before restarting nginx!" |
2158 |
- ewarn "This is a one-time change and will not happen on subsequent updates." |
2159 |
- ewarn "Furthermore nginx' temp directories got moved to '${EPREFIX}${NGINX_HOME_TMP}'" |
2160 |
- chmod o-rwx \ |
2161 |
- "${EPREFIX}"/var/log/nginx \ |
2162 |
- "${EPREFIX}"${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi} || \ |
2163 |
- _has_to_show_permission_warning=1 |
2164 |
- fi |
2165 |
- |
2166 |
- if [[ ${_has_to_show_permission_warning} -eq 0 ]] && [[ ${_need_to_fix_CVE2016_1247} -eq 1 ]]; then |
2167 |
- ewarn "" |
2168 |
- ewarn "The permissions on the following directory have been reset in" |
2169 |
- ewarn "order to mitigate a security bug (CVE-2016-1247, bug #605008):" |
2170 |
- ewarn "" |
2171 |
- ewarn " ${EPREFIX}/var/log/nginx" |
2172 |
- ewarn "" |
2173 |
- ewarn "Check if this is correct for your setup before restarting nginx!" |
2174 |
- ewarn "Also ensure that no other log directory used by any of your" |
2175 |
- ewarn "vhost(s) is not writeable for nginx user. Any of your log files" |
2176 |
- ewarn "used by nginx can be abused to escalate privileges!" |
2177 |
- ewarn "This is a one-time change and will not happen on subsequent updates." |
2178 |
- chown 0:nginx "${EPREFIX}"/var/log/nginx || _has_to_show_permission_warning=1 |
2179 |
- chmod 710 "${EPREFIX}"/var/log/nginx || _has_to_show_permission_warning=1 |
2180 |
- fi |
2181 |
- |
2182 |
- if [[ ${_has_to_show_permission_warning} -eq 1 ]]; then |
2183 |
- # Should never happen ... |
2184 |
- ewarn "" |
2185 |
- ewarn "*************************************************************" |
2186 |
- ewarn "*************** W A R N I N G ***************" |
2187 |
- ewarn "*************************************************************" |
2188 |
- ewarn "The one-time only attempt to adjust permissions of the" |
2189 |
- ewarn "existing nginx installation failed. Be aware that we will not" |
2190 |
- ewarn "try to adjust the same permissions again because now you are" |
2191 |
- ewarn "using a nginx version where we expect that the permissions" |
2192 |
- ewarn "are already adjusted or that you know what you are doing and" |
2193 |
- ewarn "want to keep custom permissions." |
2194 |
- ewarn "" |
2195 |
- fi |
2196 |
- fi |
2197 |
- |
2198 |
- # Sanity check for CVE-2016-1247 |
2199 |
- # Required to warn users who received the warning above and thought |
2200 |
- # they could fix it by unmerging and re-merging the package or have |
2201 |
- # unmerged a affected installation on purpose in the past leaving |
2202 |
- # /var/log/nginx on their system due to keepdir/non-empty folder |
2203 |
- # and are now installing the package again. |
2204 |
- local _sanity_check_testfile=$(mktemp --dry-run "${EPREFIX}"/var/log/nginx/.CVE-2016-1247.XXXXXXXXX) |
2205 |
- su -s /bin/sh -c "touch ${_sanity_check_testfile}" nginx >&/dev/null |
2206 |
- if [ $? -eq 0 ] ; then |
2207 |
- # Cleanup -- no reason to die here! |
2208 |
- rm -f "${_sanity_check_testfile}" |
2209 |
- |
2210 |
- ewarn "" |
2211 |
- ewarn "*************************************************************" |
2212 |
- ewarn "*************** W A R N I N G ***************" |
2213 |
- ewarn "*************************************************************" |
2214 |
- ewarn "Looks like your installation is vulnerable to CVE-2016-1247" |
2215 |
- ewarn "(bug #605008) because nginx user is able to create files in" |
2216 |
- ewarn "" |
2217 |
- ewarn " ${EPREFIX}/var/log/nginx" |
2218 |
- ewarn "" |
2219 |
- ewarn "Also ensure that no other log directory used by any of your" |
2220 |
- ewarn "vhost(s) is not writeable for nginx user. Any of your log files" |
2221 |
- ewarn "used by nginx can be abused to escalate privileges!" |
2222 |
- fi |
2223 |
- |
2224 |
- if [[ ${_has_to_show_httpoxy_mitigation_notice} -eq 1 ]]; then |
2225 |
- # HTTPoxy mitigation |
2226 |
- ewarn "" |
2227 |
- ewarn "This nginx installation comes with a mitigation for the HTTPoxy" |
2228 |
- ewarn "vulnerability for FastCGI, SCGI and uWSGI applications by setting" |
2229 |
- ewarn "the HTTP_PROXY parameter to an empty string per default when you" |
2230 |
- ewarn "are sourcing one of the default" |
2231 |
- ewarn "" |
2232 |
- ewarn " - 'fastcgi_params' or 'fastcgi.conf'" |
2233 |
- ewarn " - 'scgi_params'" |
2234 |
- ewarn " - 'uwsgi_params'" |
2235 |
- ewarn "" |
2236 |
- ewarn "files in your server block(s)." |
2237 |
- ewarn "" |
2238 |
- ewarn "If this is causing any problems for you make sure that you are sourcing the" |
2239 |
- ewarn "default parameters _before_ you set your own values." |
2240 |
- ewarn "If you are relying on user-supplied proxy values you have to remove the" |
2241 |
- ewarn "correlating lines from the file(s) mentioned above." |
2242 |
- ewarn "" |
2243 |
- fi |
2244 |
-} |