1 |
commit: 3a13764246668fb339da5f9445d4640284dc3d5b |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Dec 31 03:19:15 2019 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Dec 31 03:19:15 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3a137642 |
7 |
|
8 |
www-servers/nginx: drop old |
9 |
|
10 |
Package-Manager: Portage-2.3.84, Repoman-2.3.20 |
11 |
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> |
12 |
|
13 |
www-servers/nginx/Manifest | 5 - |
14 |
www-servers/nginx/nginx-1.17.3-r1.ebuild | 1089 ------------------------------ |
15 |
www-servers/nginx/nginx-1.17.4.ebuild | 1089 ------------------------------ |
16 |
www-servers/nginx/nginx-1.17.5.ebuild | 1089 ------------------------------ |
17 |
www-servers/nginx/nginx-1.17.6.ebuild | 1089 ------------------------------ |
18 |
5 files changed, 4361 deletions(-) |
19 |
|
20 |
diff --git a/www-servers/nginx/Manifest b/www-servers/nginx/Manifest |
21 |
index 87e5e504a38..055f4299fc7 100644 |
22 |
--- a/www-servers/nginx/Manifest |
23 |
+++ b/www-servers/nginx/Manifest |
24 |
@@ -1,9 +1,5 @@ |
25 |
DIST modsecurity-2.9.3.tar.gz 4307670 BLAKE2B 337ea15cc8805af7ab43aed8aecf4c72ccc586d0d7e9d9b91f036a61baa70d1ac8b4ad8045a2bb7a13515912a15fba7d3cdb9670ae6730de43b1e44ee90ded6d SHA512 4e1ea5dd8edadf8f630e4fe92a200d3a8e78963fce3128b5975a1e1ecd0e8bf9ceecd9905c95f8c508932ccd837f1d8ae8bb2ba423307718c3c6a4ae9b783ddd |
26 |
DIST nginx-1.16.1.tar.gz 1032630 BLAKE2B 838c5f08b56378dd3ef3940a979eb1449c4ed7ef5b4b112da2531c0996d121ae32ae4e94d3b4ba198fefcdc1b06683e4b0cfa0087db82fcab13bffb5f67f8aa4 SHA512 17e95b43fa47d4fef5e652dea587518e16ab5ec562c9c94355c356440166d4b6a6a41ee520d406e5a34791a327d2e3c46b3f9b105ac9ce07afdd495c49eca437 |
27 |
-DIST nginx-1.17.3.tar.gz 1034586 BLAKE2B 48d1c34cf345794bc345bedb96a6a194f175695b93ee5114095742d67384e81fe87cc1ec10553566a33dbabc2a784158bc1461e2001d67dda71af4a1f540a88d SHA512 b81e75c4c8c03ca2f0b40b9c2a1812cf168cb2319d7246b9b0cce838ef7dba81f3cd57a213ec8d58e457a0fa6b912adff2e5597e5ada7258cfe27f55b05205e2 |
28 |
-DIST nginx-1.17.4.tar.gz 1034845 BLAKE2B 59e32fc4a625ec91696d3c18beb270ab2980f3a33a2952e8f43ce24e5a6a7fecff774ee20b1377dbfc0cee58651c78bb6d2cd2505f32a96966a200dce9569267 SHA512 fb7275c47d2416b597415f736771f8f4f3cdbba33728d9ca8ddb56b8266076a5ec5e63c735215a8d022f685b67d663fdaaac0c95db465a82f79f01d502feaa82 |
29 |
-DIST nginx-1.17.5.tar.gz 1036056 BLAKE2B 7f5c804651011a28d0d6e166a13e082f74173c0e447a88f013fa505e32994f65c159d755c473fa50eb7dc293c554961da23e61b1d59a429985ca6fc82fe69145 SHA512 b6799ddce7135646aa1f0b4405bcdab41d5065fbadcdeeb875f6fae4953159aa57b9104afe815748b0aab0e4d532e7771ccce487d7c4519e423d110f3715da7c |
30 |
-DIST nginx-1.17.6.tar.gz 1037527 BLAKE2B b642ed0f6a072949d4eefc0676f51bd20b599d621c6d65b9567b2aebee680e2129987040eb1e3e4b8e1ff5e8ff3d215bc61e1ba3a8fe4255968ba5ad7715ffd6 SHA512 8ad6c3d066bf51f3fde3454bb93f2eeab0412d1c10eac0841fd50ec25b0f1204c85f15cb950c6bbe128c0ff72efe5b0bb804b5d66a8bf6234e0e4776aa67b9eb |
31 |
DIST nginx-1.17.7.tar.gz 1037747 BLAKE2B 066e20ae233f7e649868c77c80d03e55b5b35dc099aff9026a68479a4faf0091b3f8c9afa66fbbe4a0bb378d1211f103cd222b16e7262880b0bb313bbcada404 SHA512 e7132b90ac92e91def9b927c3b8c3a603d1bcb4a89ff422b284fb6e6cac52a74b33d9c7bbfc2f78467914d8ccd1cf2db9c486559abb739600605439521ff4f6b |
32 |
DIST nginx-auth-ldap-42d195d7a7575ebab1c369ad3fc5d78dc2c2669c.tar.gz 18457 BLAKE2B 22225ca9e5299b20ab5a93a001cac48e446bd86b3a24ac49e716bc975b128890bdb4b0dbbf5730fbaaeadfd958160093c7a6af798dd0e6de27062f149a760333 SHA512 ec59637fda5acac053e815cb1d04b545fc6b765e5ec63d8c2c9c301abad87afaa2698145acac08e9e14c91e1423ebff7aff0cca2b940b19ccccbf4cf53973269 |
33 |
DIST nginx_http_sticky_module_ng-1.2.6-10-g08a395c66e42.tar.bz2 124047 BLAKE2B d37ef9a15c91abe3c6258e420d1f99fa452f9d9966a0e13102174973314a3bac5413957a5fe632a9dcb1163b3be5df8116e05cc053ee061e19319ec25f341570 SHA512 6c1bfdcf89884b2855d51ae7da0f6e53a4ca3629e1aaf58433b70c07dcb2af797ba6e87d9b3eb4fe2fb6d4d697e862f2b4c2f8d8b3fdaea201740c97ec936529 |
34 |
@@ -28,5 +24,4 @@ DIST ngx_metrics-0.1.1.tar.gz 2964 BLAKE2B 95d71ea26c949c345b83e353bd66a20df18cc |
35 |
DIST ngx_mogilefs_module-1.0.4.tar.gz 11208 BLAKE2B e0729b66554c8890727190a624d4c9aef6499dfc2e301541a9bfc15690caf6d3155c8a4b8f7a1555a7655b47aa0cd1b797aeb8ba82efa92ab80808218a0bdcff SHA512 b8cb7eaf6274f4e2247dbcb39db05072d2b2d4361256a325fafab5533d7ce0c4ae9e2905b954dfcfa4789c9cab5cccf2ac1c3a1f02f6a327ed95b562d7773ed1 |
36 |
DIST ngx_rtmp-1.2.1.tar.gz 519919 BLAKE2B 744ccb8031eb9653f158f9eceba64fc9c8af7b9a42e64ef996ab3bbbe1402e5ffd3efcc8e4aaca437eb5e208e4b6f2d8643fcca953b32f32543eaa1ae4d9505c SHA512 4a0af5e9afa4deb0b53de8de7ddb2cfa6430d372e1ef9e421f01b509548bd134d427345442ac1ce667338cc2a1484dc2ab732e316e878ac7d3537dc527d5f922 |
37 |
DIST njs-0.3.5.tar.gz 339177 BLAKE2B 6327be0b7c8077870408722376782bca579a6cfdf1fe2a4950fc0d289311ad21f671bc2b47d06f70d95d4f68d99e8c70fd4598dcc167b79c57704d99a098d284 SHA512 236e0284f251856f74eb51d8251bb5be725d2ca90056f2feef7677eb636a4e97e203f3bba81fb6b677158d615dc2d6ffcb0dc1059fb678ab12b7d14cc4ea7241 |
38 |
-DIST njs-0.3.6.tar.gz 354475 BLAKE2B a2f3be7c83dd46bb8a7300460b580e053eaa78f2bcc835dd7b586457f045ea63eaa591873041648e3aa3aefce1d47a999b52667adfccadf0439066bfbff73673 SHA512 1973824bb434e9640626c132dac932da7615b534486ab76081a075be4f4e9fdf75a9a400c0d504750a5da341cebb20e6357710149e6de66ac8df8ee4cb1576bb |
39 |
DIST njs-0.3.7.tar.gz 360227 BLAKE2B b23e5105e3b9a0575e4da6a6e344983c2fed2081cdf0be9209fc86cd51c6e962ec5d855945d2c6972153de048dfead866686b2248b28660b41219a8e05fa939a SHA512 1975c38fab59a587045e1c6bebd527a4432c4e6bec5a62cb2e1bc5fef19275deffdb6c6558caa3f0dcc58716b702adc0eb89b0171acf5f70f275c593b16f4bfb |
40 |
|
41 |
diff --git a/www-servers/nginx/nginx-1.17.3-r1.ebuild b/www-servers/nginx/nginx-1.17.3-r1.ebuild |
42 |
deleted file mode 100644 |
43 |
index e855a007bab..00000000000 |
44 |
--- a/www-servers/nginx/nginx-1.17.3-r1.ebuild |
45 |
+++ /dev/null |
46 |
@@ -1,1089 +0,0 @@ |
47 |
-# Copyright 1999-2019 Gentoo Authors |
48 |
-# Distributed under the terms of the GNU General Public License v2 |
49 |
- |
50 |
-EAPI="6" |
51 |
- |
52 |
-# Maintainer notes: |
53 |
-# - http_rewrite-independent pcre-support makes sense for matching locations without an actual rewrite |
54 |
-# - any http-module activates the main http-functionality and overrides USE=-http |
55 |
-# - keep the following requirements in mind before adding external modules: |
56 |
-# * alive upstream |
57 |
-# * sane packaging |
58 |
-# * builds cleanly |
59 |
-# * does not need a patch for nginx core |
60 |
-# - TODO: test the google-perftools module (included in vanilla tarball) |
61 |
- |
62 |
-# prevent perl-module from adding automagic perl DEPENDs |
63 |
-GENTOO_DEPEND_ON_PERL="no" |
64 |
- |
65 |
-# devel_kit (https://github.com/simpl/ngx_devel_kit, BSD license) |
66 |
-DEVEL_KIT_MODULE_PV="0.3.1" |
67 |
-DEVEL_KIT_MODULE_P="ngx_devel_kit-${DEVEL_KIT_MODULE_PV}" |
68 |
-DEVEL_KIT_MODULE_URI="https://github.com/simpl/ngx_devel_kit/archive/v${DEVEL_KIT_MODULE_PV}.tar.gz" |
69 |
-DEVEL_KIT_MODULE_WD="${WORKDIR}/ngx_devel_kit-${DEVEL_KIT_MODULE_PV}" |
70 |
- |
71 |
-# ngx_brotli (https://github.com/eustas/ngx_brotli, BSD-2) |
72 |
-HTTP_BROTLI_MODULE_PV="8104036af9cff4b1d34f22d00ba857e2a93a243c" |
73 |
-HTTP_BROTLI_MODULE_P="ngx_brotli-${HTTP_BROTLI_MODULE_PV}" |
74 |
-HTTP_BROTLI_MODULE_URI="https://github.com/eustas/ngx_brotli/archive/${HTTP_BROTLI_MODULE_PV}.tar.gz" |
75 |
-HTTP_BROTLI_MODULE_WD="${WORKDIR}/ngx_brotli-${HTTP_BROTLI_MODULE_PV}" |
76 |
- |
77 |
-# http_uploadprogress (https://github.com/masterzen/nginx-upload-progress-module, BSD-2 license) |
78 |
-HTTP_UPLOAD_PROGRESS_MODULE_PV="0.9.2" |
79 |
-HTTP_UPLOAD_PROGRESS_MODULE_P="ngx_http_upload_progress-${HTTP_UPLOAD_PROGRESS_MODULE_PV}-r1" |
80 |
-HTTP_UPLOAD_PROGRESS_MODULE_URI="https://github.com/masterzen/nginx-upload-progress-module/archive/v${HTTP_UPLOAD_PROGRESS_MODULE_PV}.tar.gz" |
81 |
-HTTP_UPLOAD_PROGRESS_MODULE_WD="${WORKDIR}/nginx-upload-progress-module-${HTTP_UPLOAD_PROGRESS_MODULE_PV}" |
82 |
- |
83 |
-# http_headers_more (https://github.com/agentzh/headers-more-nginx-module, BSD license) |
84 |
-HTTP_HEADERS_MORE_MODULE_PV="0.33" |
85 |
-HTTP_HEADERS_MORE_MODULE_P="ngx_http_headers_more-${HTTP_HEADERS_MORE_MODULE_PV}" |
86 |
-HTTP_HEADERS_MORE_MODULE_URI="https://github.com/agentzh/headers-more-nginx-module/archive/v${HTTP_HEADERS_MORE_MODULE_PV}.tar.gz" |
87 |
-HTTP_HEADERS_MORE_MODULE_WD="${WORKDIR}/headers-more-nginx-module-${HTTP_HEADERS_MORE_MODULE_PV}" |
88 |
- |
89 |
-# http_cache_purge (http://labs.frickle.com/nginx_ngx_cache_purge/, https://github.com/FRiCKLE/ngx_cache_purge, BSD-2 license) |
90 |
-HTTP_CACHE_PURGE_MODULE_PV="2.3" |
91 |
-HTTP_CACHE_PURGE_MODULE_P="ngx_http_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}" |
92 |
-HTTP_CACHE_PURGE_MODULE_URI="http://labs.frickle.com/files/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}.tar.gz" |
93 |
-HTTP_CACHE_PURGE_MODULE_WD="${WORKDIR}/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}" |
94 |
- |
95 |
-# http_slowfs_cache (http://labs.frickle.com/nginx_ngx_slowfs_cache/, BSD-2 license) |
96 |
-HTTP_SLOWFS_CACHE_MODULE_PV="1.10" |
97 |
-HTTP_SLOWFS_CACHE_MODULE_P="ngx_http_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}" |
98 |
-HTTP_SLOWFS_CACHE_MODULE_URI="http://labs.frickle.com/files/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}.tar.gz" |
99 |
-HTTP_SLOWFS_CACHE_MODULE_WD="${WORKDIR}/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}" |
100 |
- |
101 |
-# http_fancyindex (https://github.com/aperezdc/ngx-fancyindex, BSD license) |
102 |
-HTTP_FANCYINDEX_MODULE_PV="0.4.3" |
103 |
-HTTP_FANCYINDEX_MODULE_P="ngx_http_fancyindex-${HTTP_FANCYINDEX_MODULE_PV}" |
104 |
-HTTP_FANCYINDEX_MODULE_URI="https://github.com/aperezdc/ngx-fancyindex/archive/v${HTTP_FANCYINDEX_MODULE_PV}.tar.gz" |
105 |
-HTTP_FANCYINDEX_MODULE_WD="${WORKDIR}/ngx-fancyindex-${HTTP_FANCYINDEX_MODULE_PV}" |
106 |
- |
107 |
-# http_lua (https://github.com/openresty/lua-nginx-module, BSD license) |
108 |
-HTTP_LUA_MODULE_PV="0.10.15" |
109 |
-HTTP_LUA_MODULE_P="ngx_http_lua-${HTTP_LUA_MODULE_PV}" |
110 |
-HTTP_LUA_MODULE_URI="https://github.com/openresty/lua-nginx-module/archive/v${HTTP_LUA_MODULE_PV}.tar.gz" |
111 |
-HTTP_LUA_MODULE_WD="${WORKDIR}/lua-nginx-module-${HTTP_LUA_MODULE_PV}" |
112 |
- |
113 |
-# http_auth_pam (https://github.com/stogh/ngx_http_auth_pam_module/, http://web.iti.upv.es/~sto/nginx/, BSD-2 license) |
114 |
-HTTP_AUTH_PAM_MODULE_PV="1.5.1" |
115 |
-HTTP_AUTH_PAM_MODULE_P="ngx_http_auth_pam-${HTTP_AUTH_PAM_MODULE_PV}" |
116 |
-HTTP_AUTH_PAM_MODULE_URI="https://github.com/stogh/ngx_http_auth_pam_module/archive/v${HTTP_AUTH_PAM_MODULE_PV}.tar.gz" |
117 |
-HTTP_AUTH_PAM_MODULE_WD="${WORKDIR}/ngx_http_auth_pam_module-${HTTP_AUTH_PAM_MODULE_PV}" |
118 |
- |
119 |
-# http_upstream_check (https://github.com/yaoweibin/nginx_upstream_check_module, BSD license) |
120 |
-HTTP_UPSTREAM_CHECK_MODULE_PV="9aecf15ec379fe98f62355c57b60c0bc83296f04" |
121 |
-HTTP_UPSTREAM_CHECK_MODULE_P="ngx_http_upstream_check-${HTTP_UPSTREAM_CHECK_MODULE_PV}" |
122 |
-HTTP_UPSTREAM_CHECK_MODULE_URI="https://github.com/yaoweibin/nginx_upstream_check_module/archive/${HTTP_UPSTREAM_CHECK_MODULE_PV}.tar.gz" |
123 |
-HTTP_UPSTREAM_CHECK_MODULE_WD="${WORKDIR}/nginx_upstream_check_module-${HTTP_UPSTREAM_CHECK_MODULE_PV}" |
124 |
- |
125 |
-# http_metrics (https://github.com/zenops/ngx_metrics, BSD license) |
126 |
-HTTP_METRICS_MODULE_PV="0.1.1" |
127 |
-HTTP_METRICS_MODULE_P="ngx_metrics-${HTTP_METRICS_MODULE_PV}" |
128 |
-HTTP_METRICS_MODULE_URI="https://github.com/madvertise/ngx_metrics/archive/v${HTTP_METRICS_MODULE_PV}.tar.gz" |
129 |
-HTTP_METRICS_MODULE_WD="${WORKDIR}/ngx_metrics-${HTTP_METRICS_MODULE_PV}" |
130 |
- |
131 |
-# http_vhost_traffic_status (https://github.com/vozlt/nginx-module-vts, BSD license) |
132 |
-HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV="46d85558e344dfe2b078ce757fd36c69a1ec2dd3" |
133 |
-HTTP_VHOST_TRAFFIC_STATUS_MODULE_P="ngx_http_vhost_traffic_status-${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}" |
134 |
-HTTP_VHOST_TRAFFIC_STATUS_MODULE_URI="https://github.com/vozlt/nginx-module-vts/archive/${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}.tar.gz" |
135 |
-HTTP_VHOST_TRAFFIC_STATUS_MODULE_WD="${WORKDIR}/nginx-module-vts-${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}" |
136 |
- |
137 |
-# naxsi-core (https://github.com/nbs-system/naxsi, GPLv2+) |
138 |
-HTTP_NAXSI_MODULE_PV="0.56" |
139 |
-HTTP_NAXSI_MODULE_P="ngx_http_naxsi-${HTTP_NAXSI_MODULE_PV}" |
140 |
-HTTP_NAXSI_MODULE_URI="https://github.com/nbs-system/naxsi/archive/${HTTP_NAXSI_MODULE_PV}.tar.gz" |
141 |
-HTTP_NAXSI_MODULE_WD="${WORKDIR}/naxsi-${HTTP_NAXSI_MODULE_PV}/naxsi_src" |
142 |
- |
143 |
-# nginx-rtmp-module (https://github.com/arut/nginx-rtmp-module, BSD license) |
144 |
-RTMP_MODULE_PV="1.2.1" |
145 |
-RTMP_MODULE_P="ngx_rtmp-${RTMP_MODULE_PV}" |
146 |
-RTMP_MODULE_URI="https://github.com/arut/nginx-rtmp-module/archive/v${RTMP_MODULE_PV}.tar.gz" |
147 |
-RTMP_MODULE_WD="${WORKDIR}/nginx-rtmp-module-${RTMP_MODULE_PV}" |
148 |
- |
149 |
-# nginx-dav-ext-module (https://github.com/arut/nginx-dav-ext-module, BSD license) |
150 |
-HTTP_DAV_EXT_MODULE_PV="3.0.0" |
151 |
-HTTP_DAV_EXT_MODULE_P="ngx_http_dav_ext-${HTTP_DAV_EXT_MODULE_PV}" |
152 |
-HTTP_DAV_EXT_MODULE_URI="https://github.com/arut/nginx-dav-ext-module/archive/v${HTTP_DAV_EXT_MODULE_PV}.tar.gz" |
153 |
-HTTP_DAV_EXT_MODULE_WD="${WORKDIR}/nginx-dav-ext-module-${HTTP_DAV_EXT_MODULE_PV}" |
154 |
- |
155 |
-# echo-nginx-module (https://github.com/openresty/echo-nginx-module, BSD license) |
156 |
-HTTP_ECHO_MODULE_PV="0.61" |
157 |
-HTTP_ECHO_MODULE_P="ngx_http_echo-${HTTP_ECHO_MODULE_PV}" |
158 |
-HTTP_ECHO_MODULE_URI="https://github.com/openresty/echo-nginx-module/archive/v${HTTP_ECHO_MODULE_PV}.tar.gz" |
159 |
-HTTP_ECHO_MODULE_WD="${WORKDIR}/echo-nginx-module-${HTTP_ECHO_MODULE_PV}" |
160 |
- |
161 |
-# mod_security for nginx (https://modsecurity.org/, Apache-2.0) |
162 |
-# keep the MODULE_P here consistent with upstream to avoid tarball duplication |
163 |
-HTTP_SECURITY_MODULE_PV="2.9.3" |
164 |
-HTTP_SECURITY_MODULE_P="modsecurity-${HTTP_SECURITY_MODULE_PV}" |
165 |
-HTTP_SECURITY_MODULE_URI="https://www.modsecurity.org/tarball/${HTTP_SECURITY_MODULE_PV}/${HTTP_SECURITY_MODULE_P}.tar.gz" |
166 |
-HTTP_SECURITY_MODULE_WD="${WORKDIR}/${HTTP_SECURITY_MODULE_P}" |
167 |
- |
168 |
-# push-stream-module (http://www.nginxpushstream.com, https://github.com/wandenberg/nginx-push-stream-module, GPL-3) |
169 |
-HTTP_PUSH_STREAM_MODULE_PV="0.5.4" |
170 |
-HTTP_PUSH_STREAM_MODULE_P="ngx_http_push_stream-${HTTP_PUSH_STREAM_MODULE_PV}" |
171 |
-HTTP_PUSH_STREAM_MODULE_URI="https://github.com/wandenberg/nginx-push-stream-module/archive/${HTTP_PUSH_STREAM_MODULE_PV}.tar.gz" |
172 |
-HTTP_PUSH_STREAM_MODULE_WD="${WORKDIR}/nginx-push-stream-module-${HTTP_PUSH_STREAM_MODULE_PV}" |
173 |
- |
174 |
-# sticky-module (https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng, BSD-2) |
175 |
-HTTP_STICKY_MODULE_PV="1.2.6-10-g08a395c66e42" |
176 |
-HTTP_STICKY_MODULE_P="nginx_http_sticky_module_ng-${HTTP_STICKY_MODULE_PV}" |
177 |
-HTTP_STICKY_MODULE_URI="https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/get/${HTTP_STICKY_MODULE_PV}.tar.bz2" |
178 |
-HTTP_STICKY_MODULE_WD="${WORKDIR}/nginx-goodies-nginx-sticky-module-ng-08a395c66e42" |
179 |
- |
180 |
-# mogilefs-module (https://github.com/vkholodkov/nginx-mogilefs-module, BSD-2) |
181 |
-HTTP_MOGILEFS_MODULE_PV="1.0.4" |
182 |
-HTTP_MOGILEFS_MODULE_P="ngx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}" |
183 |
-HTTP_MOGILEFS_MODULE_URI="https://github.com/vkholodkov/nginx-mogilefs-module/archive/${HTTP_MOGILEFS_MODULE_PV}.tar.gz" |
184 |
-HTTP_MOGILEFS_MODULE_WD="${WORKDIR}/nginx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}" |
185 |
- |
186 |
-# memc-module (https://github.com/openresty/memc-nginx-module, BSD-2) |
187 |
-HTTP_MEMC_MODULE_PV="0.19" |
188 |
-HTTP_MEMC_MODULE_P="ngx_memc_module-${HTTP_MEMC_MODULE_PV}" |
189 |
-HTTP_MEMC_MODULE_URI="https://github.com/openresty/memc-nginx-module/archive/v${HTTP_MEMC_MODULE_PV}.tar.gz" |
190 |
-HTTP_MEMC_MODULE_WD="${WORKDIR}/memc-nginx-module-${HTTP_MEMC_MODULE_PV}" |
191 |
- |
192 |
-# nginx-ldap-auth-module (https://github.com/kvspb/nginx-auth-ldap, BSD-2) |
193 |
-HTTP_LDAP_MODULE_PV="42d195d7a7575ebab1c369ad3fc5d78dc2c2669c" |
194 |
-HTTP_LDAP_MODULE_P="nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}" |
195 |
-HTTP_LDAP_MODULE_URI="https://github.com/kvspb/nginx-auth-ldap/archive/${HTTP_LDAP_MODULE_PV}.tar.gz" |
196 |
-HTTP_LDAP_MODULE_WD="${WORKDIR}/nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}" |
197 |
- |
198 |
-# geoip2 (https://github.com/leev/ngx_http_geoip2_module, BSD-2) |
199 |
-GEOIP2_MODULE_PV="3.2" |
200 |
-GEOIP2_MODULE_P="ngx_http_geoip2_module-${GEOIP2_MODULE_PV}" |
201 |
-GEOIP2_MODULE_URI="https://github.com/leev/ngx_http_geoip2_module/archive/${GEOIP2_MODULE_PV}.tar.gz" |
202 |
-GEOIP2_MODULE_WD="${WORKDIR}/ngx_http_geoip2_module-${GEOIP2_MODULE_PV}" |
203 |
- |
204 |
-# njs-module (https://github.com/nginx/njs, as-is) |
205 |
-NJS_MODULE_PV="0.3.5" |
206 |
-NJS_MODULE_P="njs-${NJS_MODULE_PV}" |
207 |
-NJS_MODULE_URI="https://github.com/nginx/njs/archive/${NJS_MODULE_PV}.tar.gz" |
208 |
-NJS_MODULE_WD="${WORKDIR}/njs-${NJS_MODULE_PV}" |
209 |
- |
210 |
-# We handle deps below ourselves |
211 |
-SSL_DEPS_SKIP=1 |
212 |
-AUTOTOOLS_AUTO_DEPEND="no" |
213 |
- |
214 |
-inherit autotools ssl-cert toolchain-funcs perl-module flag-o-matic user systemd versionator multilib pax-utils |
215 |
- |
216 |
-DESCRIPTION="Robust, small and high performance http and reverse proxy server" |
217 |
-HOMEPAGE="https://nginx.org" |
218 |
-SRC_URI="https://nginx.org/download/${P}.tar.gz |
219 |
- ${DEVEL_KIT_MODULE_URI} -> ${DEVEL_KIT_MODULE_P}.tar.gz |
220 |
- nginx_modules_http_auth_ldap? ( ${HTTP_LDAP_MODULE_URI} -> ${HTTP_LDAP_MODULE_P}.tar.gz ) |
221 |
- nginx_modules_http_auth_pam? ( ${HTTP_AUTH_PAM_MODULE_URI} -> ${HTTP_AUTH_PAM_MODULE_P}.tar.gz ) |
222 |
- nginx_modules_http_brotli? ( ${HTTP_BROTLI_MODULE_URI} -> ${HTTP_BROTLI_MODULE_P}.tar.gz ) |
223 |
- nginx_modules_http_cache_purge? ( ${HTTP_CACHE_PURGE_MODULE_URI} -> ${HTTP_CACHE_PURGE_MODULE_P}.tar.gz ) |
224 |
- nginx_modules_http_dav_ext? ( ${HTTP_DAV_EXT_MODULE_URI} -> ${HTTP_DAV_EXT_MODULE_P}.tar.gz ) |
225 |
- nginx_modules_http_echo? ( ${HTTP_ECHO_MODULE_URI} -> ${HTTP_ECHO_MODULE_P}.tar.gz ) |
226 |
- nginx_modules_http_fancyindex? ( ${HTTP_FANCYINDEX_MODULE_URI} -> ${HTTP_FANCYINDEX_MODULE_P}.tar.gz ) |
227 |
- nginx_modules_http_geoip2? ( ${GEOIP2_MODULE_URI} -> ${GEOIP2_MODULE_P}.tar.gz ) |
228 |
- nginx_modules_http_headers_more? ( ${HTTP_HEADERS_MORE_MODULE_URI} -> ${HTTP_HEADERS_MORE_MODULE_P}.tar.gz ) |
229 |
- nginx_modules_http_javascript? ( ${NJS_MODULE_URI} -> ${NJS_MODULE_P}.tar.gz ) |
230 |
- nginx_modules_http_lua? ( ${HTTP_LUA_MODULE_URI} -> ${HTTP_LUA_MODULE_P}.tar.gz ) |
231 |
- nginx_modules_http_memc? ( ${HTTP_MEMC_MODULE_URI} -> ${HTTP_MEMC_MODULE_P}.tar.gz ) |
232 |
- nginx_modules_http_metrics? ( ${HTTP_METRICS_MODULE_URI} -> ${HTTP_METRICS_MODULE_P}.tar.gz ) |
233 |
- nginx_modules_http_mogilefs? ( ${HTTP_MOGILEFS_MODULE_URI} -> ${HTTP_MOGILEFS_MODULE_P}.tar.gz ) |
234 |
- nginx_modules_http_naxsi? ( ${HTTP_NAXSI_MODULE_URI} -> ${HTTP_NAXSI_MODULE_P}.tar.gz ) |
235 |
- nginx_modules_http_push_stream? ( ${HTTP_PUSH_STREAM_MODULE_URI} -> ${HTTP_PUSH_STREAM_MODULE_P}.tar.gz ) |
236 |
- nginx_modules_http_security? ( ${HTTP_SECURITY_MODULE_URI} -> ${HTTP_SECURITY_MODULE_P}.tar.gz ) |
237 |
- nginx_modules_http_slowfs_cache? ( ${HTTP_SLOWFS_CACHE_MODULE_URI} -> ${HTTP_SLOWFS_CACHE_MODULE_P}.tar.gz ) |
238 |
- nginx_modules_http_sticky? ( ${HTTP_STICKY_MODULE_URI} -> ${HTTP_STICKY_MODULE_P}.tar.bz2 ) |
239 |
- nginx_modules_http_upload_progress? ( ${HTTP_UPLOAD_PROGRESS_MODULE_URI} -> ${HTTP_UPLOAD_PROGRESS_MODULE_P}.tar.gz ) |
240 |
- nginx_modules_http_upstream_check? ( ${HTTP_UPSTREAM_CHECK_MODULE_URI} -> ${HTTP_UPSTREAM_CHECK_MODULE_P}.tar.gz ) |
241 |
- nginx_modules_http_vhost_traffic_status? ( ${HTTP_VHOST_TRAFFIC_STATUS_MODULE_URI} -> ${HTTP_VHOST_TRAFFIC_STATUS_MODULE_P}.tar.gz ) |
242 |
- nginx_modules_stream_geoip2? ( ${GEOIP2_MODULE_URI} -> ${GEOIP2_MODULE_P}.tar.gz ) |
243 |
- nginx_modules_stream_javascript? ( ${NJS_MODULE_URI} -> ${NJS_MODULE_P}.tar.gz ) |
244 |
- rtmp? ( ${RTMP_MODULE_URI} -> ${RTMP_MODULE_P}.tar.gz )" |
245 |
- |
246 |
-LICENSE="BSD-2 BSD SSLeay MIT GPL-2 GPL-2+ |
247 |
- nginx_modules_http_security? ( Apache-2.0 ) |
248 |
- nginx_modules_http_push_stream? ( GPL-3 )" |
249 |
- |
250 |
-SLOT="mainline" |
251 |
-KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux" |
252 |
- |
253 |
-# Package doesn't provide a real test suite |
254 |
-RESTRICT="test" |
255 |
- |
256 |
-NGINX_MODULES_STD="access auth_basic autoindex browser charset empty_gif |
257 |
- fastcgi geo grpc gzip limit_req limit_conn map memcached mirror |
258 |
- proxy referer rewrite scgi ssi split_clients upstream_hash |
259 |
- upstream_ip_hash upstream_keepalive upstream_least_conn |
260 |
- upstream_zone userid uwsgi" |
261 |
-NGINX_MODULES_OPT="addition auth_request dav degradation flv geoip gunzip |
262 |
- gzip_static image_filter mp4 perl random_index realip secure_link |
263 |
- slice stub_status sub xslt" |
264 |
-NGINX_MODULES_STREAM_STD="access geo limit_conn map return split_clients |
265 |
- upstream_hash upstream_least_conn upstream_zone" |
266 |
-NGINX_MODULES_STREAM_OPT="geoip realip ssl_preread" |
267 |
-NGINX_MODULES_MAIL="imap pop3 smtp" |
268 |
-NGINX_MODULES_3RD=" |
269 |
- http_auth_ldap |
270 |
- http_auth_pam |
271 |
- http_brotli |
272 |
- http_cache_purge |
273 |
- http_dav_ext |
274 |
- http_echo |
275 |
- http_fancyindex |
276 |
- http_geoip2 |
277 |
- http_headers_more |
278 |
- http_javascript |
279 |
- http_lua |
280 |
- http_memc |
281 |
- http_metrics |
282 |
- http_mogilefs |
283 |
- http_naxsi |
284 |
- http_push_stream |
285 |
- http_security |
286 |
- http_slowfs_cache |
287 |
- http_sticky |
288 |
- http_upload_progress |
289 |
- http_upstream_check |
290 |
- http_vhost_traffic_status |
291 |
- stream_geoip2 |
292 |
- stream_javascript |
293 |
-" |
294 |
- |
295 |
-IUSE="aio debug +http +http2 +http-cache +ipv6 libatomic libressl luajit +pcre |
296 |
- pcre-jit rtmp selinux ssl threads userland_GNU vim-syntax" |
297 |
- |
298 |
-for mod in $NGINX_MODULES_STD; do |
299 |
- IUSE="${IUSE} +nginx_modules_http_${mod}" |
300 |
-done |
301 |
- |
302 |
-for mod in $NGINX_MODULES_OPT; do |
303 |
- IUSE="${IUSE} nginx_modules_http_${mod}" |
304 |
-done |
305 |
- |
306 |
-for mod in $NGINX_MODULES_STREAM_STD; do |
307 |
- IUSE="${IUSE} nginx_modules_stream_${mod}" |
308 |
-done |
309 |
- |
310 |
-for mod in $NGINX_MODULES_STREAM_OPT; do |
311 |
- IUSE="${IUSE} nginx_modules_stream_${mod}" |
312 |
-done |
313 |
- |
314 |
-for mod in $NGINX_MODULES_MAIL; do |
315 |
- IUSE="${IUSE} nginx_modules_mail_${mod}" |
316 |
-done |
317 |
- |
318 |
-for mod in $NGINX_MODULES_3RD; do |
319 |
- IUSE="${IUSE} nginx_modules_${mod}" |
320 |
-done |
321 |
- |
322 |
-# Add so we can warn users updating about config changes |
323 |
-# @TODO: jbergstroem: remove on next release series |
324 |
-IUSE="${IUSE} nginx_modules_http_spdy" |
325 |
- |
326 |
-CDEPEND=" |
327 |
- pcre? ( dev-libs/libpcre:= ) |
328 |
- pcre-jit? ( dev-libs/libpcre:=[jit] ) |
329 |
- ssl? ( |
330 |
- !libressl? ( dev-libs/openssl:0= ) |
331 |
- libressl? ( dev-libs/libressl:= ) |
332 |
- ) |
333 |
- http2? ( |
334 |
- !libressl? ( >=dev-libs/openssl-1.0.1c:0= ) |
335 |
- libressl? ( dev-libs/libressl:= ) |
336 |
- ) |
337 |
- http-cache? ( |
338 |
- userland_GNU? ( |
339 |
- !libressl? ( dev-libs/openssl:0= ) |
340 |
- libressl? ( dev-libs/libressl:= ) |
341 |
- ) |
342 |
- ) |
343 |
- nginx_modules_http_brotli? ( app-arch/brotli:= ) |
344 |
- nginx_modules_http_geoip? ( dev-libs/geoip ) |
345 |
- nginx_modules_http_geoip2? ( dev-libs/libmaxminddb:= ) |
346 |
- nginx_modules_http_gunzip? ( sys-libs/zlib ) |
347 |
- nginx_modules_http_gzip? ( sys-libs/zlib ) |
348 |
- nginx_modules_http_gzip_static? ( sys-libs/zlib ) |
349 |
- nginx_modules_http_image_filter? ( media-libs/gd:=[jpeg,png] ) |
350 |
- nginx_modules_http_perl? ( >=dev-lang/perl-5.8:= ) |
351 |
- nginx_modules_http_rewrite? ( dev-libs/libpcre:= ) |
352 |
- nginx_modules_http_secure_link? ( |
353 |
- userland_GNU? ( |
354 |
- !libressl? ( dev-libs/openssl:0= ) |
355 |
- libressl? ( dev-libs/libressl:= ) |
356 |
- ) |
357 |
- ) |
358 |
- nginx_modules_http_xslt? ( dev-libs/libxml2:= dev-libs/libxslt ) |
359 |
- nginx_modules_http_lua? ( dev-lang/luajit:2= ) |
360 |
- nginx_modules_http_auth_pam? ( sys-libs/pam ) |
361 |
- nginx_modules_http_metrics? ( dev-libs/yajl:= ) |
362 |
- nginx_modules_http_dav_ext? ( dev-libs/libxml2 ) |
363 |
- nginx_modules_http_security? ( |
364 |
- dev-libs/apr:= |
365 |
- dev-libs/apr-util:= |
366 |
- dev-libs/libxml2:= |
367 |
- net-misc/curl |
368 |
- www-servers/apache |
369 |
- ) |
370 |
- nginx_modules_http_auth_ldap? ( net-nds/openldap[ssl?] ) |
371 |
- nginx_modules_stream_geoip? ( dev-libs/geoip ) |
372 |
- nginx_modules_stream_geoip2? ( dev-libs/libmaxminddb:= )" |
373 |
-RDEPEND="${CDEPEND} |
374 |
- selinux? ( sec-policy/selinux-nginx ) |
375 |
- !www-servers/nginx:0" |
376 |
-DEPEND="${CDEPEND} |
377 |
- nginx_modules_http_brotli? ( virtual/pkgconfig ) |
378 |
- nginx_modules_http_security? ( ${AUTOTOOLS_DEPEND} ) |
379 |
- arm? ( dev-libs/libatomic_ops ) |
380 |
- libatomic? ( dev-libs/libatomic_ops )" |
381 |
-PDEPEND="vim-syntax? ( app-vim/nginx-syntax )" |
382 |
- |
383 |
-REQUIRED_USE="pcre-jit? ( pcre ) |
384 |
- nginx_modules_http_grpc? ( http2 ) |
385 |
- nginx_modules_http_lua? ( |
386 |
- luajit |
387 |
- nginx_modules_http_rewrite |
388 |
- ) |
389 |
- nginx_modules_http_naxsi? ( pcre ) |
390 |
- nginx_modules_http_dav_ext? ( nginx_modules_http_dav ) |
391 |
- nginx_modules_http_metrics? ( nginx_modules_http_stub_status ) |
392 |
- nginx_modules_http_security? ( pcre ) |
393 |
- nginx_modules_http_push_stream? ( ssl )" |
394 |
- |
395 |
-pkg_setup() { |
396 |
- NGINX_HOME="/var/lib/nginx" |
397 |
- NGINX_HOME_TMP="${NGINX_HOME}/tmp" |
398 |
- |
399 |
- ebegin "Creating nginx user and group" |
400 |
- enewgroup ${PN} |
401 |
- enewuser ${PN} -1 -1 "${NGINX_HOME}" ${PN} |
402 |
- eend $? |
403 |
- |
404 |
- if use libatomic; then |
405 |
- ewarn "GCC 4.1+ features built-in atomic operations." |
406 |
- ewarn "Using libatomic_ops is only needed if using" |
407 |
- ewarn "a different compiler or a GCC prior to 4.1" |
408 |
- fi |
409 |
- |
410 |
- if [[ -n $NGINX_ADD_MODULES ]]; then |
411 |
- ewarn "You are building custom modules via \$NGINX_ADD_MODULES!" |
412 |
- ewarn "This nginx installation is not supported!" |
413 |
- ewarn "Make sure you can reproduce the bug without those modules" |
414 |
- ewarn "_before_ reporting bugs." |
415 |
- fi |
416 |
- |
417 |
- if use !http; then |
418 |
- ewarn "To actually disable all http-functionality you also have to disable" |
419 |
- ewarn "all nginx http modules." |
420 |
- fi |
421 |
- |
422 |
- if use nginx_modules_http_mogilefs && use threads; then |
423 |
- eerror "mogilefs won't compile with threads support." |
424 |
- eerror "Please disable either flag and try again." |
425 |
- die "Can't compile mogilefs with threads support" |
426 |
- fi |
427 |
-} |
428 |
- |
429 |
-src_prepare() { |
430 |
- eapply "${FILESDIR}/${PN}-1.4.1-fix-perl-install-path.patch" |
431 |
- eapply "${FILESDIR}/${PN}-httpoxy-mitigation-r1.patch" |
432 |
- |
433 |
- if use nginx_modules_http_auth_pam; then |
434 |
- cd "${HTTP_AUTH_PAM_MODULE_WD}" || die |
435 |
- eapply "${FILESDIR}"/http_auth_pam-1.5.1-adjust-loglevel-for-authentication-failures.patch |
436 |
- cd "${S}" || die |
437 |
- fi |
438 |
- |
439 |
- if use nginx_modules_http_brotli; then |
440 |
- cd "${HTTP_BROTLI_MODULE_WD}" || die |
441 |
- eapply "${FILESDIR}"/http_brotli-detect-brotli-r2.patch |
442 |
- cd "${S}" || die |
443 |
- fi |
444 |
- |
445 |
- if use nginx_modules_http_upstream_check; then |
446 |
- eapply -p0 "${FILESDIR}"/http_upstream_check-nginx-1.11.5+.patch |
447 |
- fi |
448 |
- |
449 |
- if use nginx_modules_http_cache_purge; then |
450 |
- cd "${HTTP_CACHE_PURGE_MODULE_WD}" || die |
451 |
- eapply "${FILESDIR}"/http_cache_purge-1.11.6+.patch |
452 |
- cd "${S}" || die |
453 |
- fi |
454 |
- |
455 |
- if use nginx_modules_http_security; then |
456 |
- cd "${HTTP_SECURITY_MODULE_WD}" || die |
457 |
- |
458 |
- eautoreconf |
459 |
- |
460 |
- if use luajit ; then |
461 |
- sed -i \ |
462 |
- -e 's|^\(LUA_PKGNAMES\)=.*|\1="luajit"|' \ |
463 |
- configure || die |
464 |
- fi |
465 |
- |
466 |
- cd "${S}" || die |
467 |
- fi |
468 |
- |
469 |
- if use nginx_modules_http_upload_progress; then |
470 |
- cd "${HTTP_UPLOAD_PROGRESS_MODULE_WD}" || die |
471 |
- eapply "${FILESDIR}"/http_uploadprogress-issue_50-r1.patch |
472 |
- cd "${S}" || die |
473 |
- fi |
474 |
- |
475 |
- find auto/ -type f -print0 | xargs -0 sed -i 's:\&\& make:\&\& \\$(MAKE):' || die |
476 |
- # We have config protection, don't rename etc files |
477 |
- sed -i 's:.default::' auto/install || die |
478 |
- # remove useless files |
479 |
- sed -i -e '/koi-/d' -e '/win-/d' auto/install || die |
480 |
- |
481 |
- # don't install to /etc/nginx/ if not in use |
482 |
- local module |
483 |
- for module in fastcgi scgi uwsgi ; do |
484 |
- if ! use nginx_modules_http_${module}; then |
485 |
- sed -i -e "/${module}/d" auto/install || die |
486 |
- fi |
487 |
- done |
488 |
- |
489 |
- eapply_user |
490 |
-} |
491 |
- |
492 |
-src_configure() { |
493 |
- # mod_security needs to generate nginx/modsecurity/config before including it |
494 |
- if use nginx_modules_http_security; then |
495 |
- cd "${HTTP_SECURITY_MODULE_WD}" || die |
496 |
- |
497 |
- ./configure \ |
498 |
- --enable-standalone-module \ |
499 |
- --disable-mlogc \ |
500 |
- --with-ssdeep=no \ |
501 |
- $(use_enable pcre-jit) \ |
502 |
- $(use_with nginx_modules_http_lua lua) || die "configure failed for mod_security" |
503 |
- |
504 |
- cd "${S}" || die |
505 |
- fi |
506 |
- |
507 |
- local myconf=() http_enabled= mail_enabled= stream_enabled= |
508 |
- |
509 |
- use aio && myconf+=( --with-file-aio ) |
510 |
- use debug && myconf+=( --with-debug ) |
511 |
- use http2 && myconf+=( --with-http_v2_module ) |
512 |
- use libatomic && myconf+=( --with-libatomic ) |
513 |
- use pcre && myconf+=( --with-pcre ) |
514 |
- use pcre-jit && myconf+=( --with-pcre-jit ) |
515 |
- use threads && myconf+=( --with-threads ) |
516 |
- |
517 |
- # HTTP modules |
518 |
- for mod in $NGINX_MODULES_STD; do |
519 |
- if use nginx_modules_http_${mod}; then |
520 |
- http_enabled=1 |
521 |
- else |
522 |
- myconf+=( --without-http_${mod}_module ) |
523 |
- fi |
524 |
- done |
525 |
- |
526 |
- for mod in $NGINX_MODULES_OPT; do |
527 |
- if use nginx_modules_http_${mod}; then |
528 |
- http_enabled=1 |
529 |
- myconf+=( --with-http_${mod}_module ) |
530 |
- fi |
531 |
- done |
532 |
- |
533 |
- if use nginx_modules_http_fastcgi; then |
534 |
- myconf+=( --with-http_realip_module ) |
535 |
- fi |
536 |
- |
537 |
- # third-party modules |
538 |
- if use nginx_modules_http_upload_progress; then |
539 |
- http_enabled=1 |
540 |
- myconf+=( --add-module=${HTTP_UPLOAD_PROGRESS_MODULE_WD} ) |
541 |
- fi |
542 |
- |
543 |
- if use nginx_modules_http_headers_more; then |
544 |
- http_enabled=1 |
545 |
- myconf+=( --add-module=${HTTP_HEADERS_MORE_MODULE_WD} ) |
546 |
- fi |
547 |
- |
548 |
- if use nginx_modules_http_cache_purge; then |
549 |
- http_enabled=1 |
550 |
- myconf+=( --add-module=${HTTP_CACHE_PURGE_MODULE_WD} ) |
551 |
- fi |
552 |
- |
553 |
- if use nginx_modules_http_slowfs_cache; then |
554 |
- http_enabled=1 |
555 |
- myconf+=( --add-module=${HTTP_SLOWFS_CACHE_MODULE_WD} ) |
556 |
- fi |
557 |
- |
558 |
- if use nginx_modules_http_fancyindex; then |
559 |
- http_enabled=1 |
560 |
- myconf+=( --add-module=${HTTP_FANCYINDEX_MODULE_WD} ) |
561 |
- fi |
562 |
- |
563 |
- if use nginx_modules_http_lua; then |
564 |
- http_enabled=1 |
565 |
- export LUAJIT_LIB=$(pkg-config --variable libdir luajit) |
566 |
- export LUAJIT_INC=$(pkg-config --variable includedir luajit) |
567 |
- myconf+=( --add-module=${DEVEL_KIT_MODULE_WD} ) |
568 |
- myconf+=( --add-module=${HTTP_LUA_MODULE_WD} ) |
569 |
- fi |
570 |
- |
571 |
- if use nginx_modules_http_auth_pam; then |
572 |
- http_enabled=1 |
573 |
- myconf+=( --add-module=${HTTP_AUTH_PAM_MODULE_WD} ) |
574 |
- fi |
575 |
- |
576 |
- if use nginx_modules_http_upstream_check; then |
577 |
- http_enabled=1 |
578 |
- myconf+=( --add-module=${HTTP_UPSTREAM_CHECK_MODULE_WD} ) |
579 |
- fi |
580 |
- |
581 |
- if use nginx_modules_http_metrics; then |
582 |
- http_enabled=1 |
583 |
- myconf+=( --add-module=${HTTP_METRICS_MODULE_WD} ) |
584 |
- fi |
585 |
- |
586 |
- if use nginx_modules_http_naxsi ; then |
587 |
- http_enabled=1 |
588 |
- myconf+=( --add-module=${HTTP_NAXSI_MODULE_WD} ) |
589 |
- fi |
590 |
- |
591 |
- if use rtmp ; then |
592 |
- http_enabled=1 |
593 |
- myconf+=( --add-module=${RTMP_MODULE_WD} ) |
594 |
- fi |
595 |
- |
596 |
- if use nginx_modules_http_dav_ext ; then |
597 |
- http_enabled=1 |
598 |
- myconf+=( --add-module=${HTTP_DAV_EXT_MODULE_WD} ) |
599 |
- fi |
600 |
- |
601 |
- if use nginx_modules_http_echo ; then |
602 |
- http_enabled=1 |
603 |
- myconf+=( --add-module=${HTTP_ECHO_MODULE_WD} ) |
604 |
- fi |
605 |
- |
606 |
- if use nginx_modules_http_security ; then |
607 |
- http_enabled=1 |
608 |
- myconf+=( --add-module=${HTTP_SECURITY_MODULE_WD}/nginx/modsecurity ) |
609 |
- fi |
610 |
- |
611 |
- if use nginx_modules_http_push_stream ; then |
612 |
- http_enabled=1 |
613 |
- myconf+=( --add-module=${HTTP_PUSH_STREAM_MODULE_WD} ) |
614 |
- fi |
615 |
- |
616 |
- if use nginx_modules_http_sticky ; then |
617 |
- http_enabled=1 |
618 |
- myconf+=( --add-module=${HTTP_STICKY_MODULE_WD} ) |
619 |
- fi |
620 |
- |
621 |
- if use nginx_modules_http_mogilefs ; then |
622 |
- http_enabled=1 |
623 |
- myconf+=( --add-module=${HTTP_MOGILEFS_MODULE_WD} ) |
624 |
- fi |
625 |
- |
626 |
- if use nginx_modules_http_memc ; then |
627 |
- http_enabled=1 |
628 |
- myconf+=( --add-module=${HTTP_MEMC_MODULE_WD} ) |
629 |
- fi |
630 |
- |
631 |
- if use nginx_modules_http_auth_ldap; then |
632 |
- http_enabled=1 |
633 |
- myconf+=( --add-module=${HTTP_LDAP_MODULE_WD} ) |
634 |
- fi |
635 |
- |
636 |
- if use nginx_modules_http_vhost_traffic_status; then |
637 |
- http_enabled=1 |
638 |
- myconf+=( --add-module=${HTTP_VHOST_TRAFFIC_STATUS_MODULE_WD} ) |
639 |
- fi |
640 |
- |
641 |
- if use nginx_modules_http_geoip2 || use nginx_modules_stream_geoip2; then |
642 |
- myconf+=( --add-module=${GEOIP2_MODULE_WD} ) |
643 |
- fi |
644 |
- |
645 |
- if use nginx_modules_http_javascript || use nginx_modules_stream_javascript; then |
646 |
- myconf+=( --add-module="${NJS_MODULE_WD}/nginx" ) |
647 |
- fi |
648 |
- |
649 |
- if use nginx_modules_http_brotli; then |
650 |
- http_enabled=1 |
651 |
- myconf+=( --add-module=${HTTP_BROTLI_MODULE_WD} ) |
652 |
- fi |
653 |
- |
654 |
- if use http || use http-cache || use http2 || use nginx_modules_http_javascript; then |
655 |
- http_enabled=1 |
656 |
- fi |
657 |
- |
658 |
- if [ $http_enabled ]; then |
659 |
- use http-cache || myconf+=( --without-http-cache ) |
660 |
- use ssl && myconf+=( --with-http_ssl_module ) |
661 |
- else |
662 |
- myconf+=( --without-http --without-http-cache ) |
663 |
- fi |
664 |
- |
665 |
- # Stream modules |
666 |
- for mod in $NGINX_MODULES_STREAM_STD; do |
667 |
- if use nginx_modules_stream_${mod}; then |
668 |
- stream_enabled=1 |
669 |
- else |
670 |
- myconf+=( --without-stream_${mod}_module ) |
671 |
- fi |
672 |
- done |
673 |
- |
674 |
- for mod in $NGINX_MODULES_STREAM_OPT; do |
675 |
- if use nginx_modules_stream_${mod}; then |
676 |
- stream_enabled=1 |
677 |
- myconf+=( --with-stream_${mod}_module ) |
678 |
- fi |
679 |
- done |
680 |
- |
681 |
- if use nginx_modules_stream_geoip2 || use nginx_modules_stream_javascript; then |
682 |
- stream_enabled=1 |
683 |
- fi |
684 |
- |
685 |
- if [ $stream_enabled ]; then |
686 |
- myconf+=( --with-stream ) |
687 |
- use ssl && myconf+=( --with-stream_ssl_module ) |
688 |
- fi |
689 |
- |
690 |
- # MAIL modules |
691 |
- for mod in $NGINX_MODULES_MAIL; do |
692 |
- if use nginx_modules_mail_${mod}; then |
693 |
- mail_enabled=1 |
694 |
- else |
695 |
- myconf+=( --without-mail_${mod}_module ) |
696 |
- fi |
697 |
- done |
698 |
- |
699 |
- if [ $mail_enabled ]; then |
700 |
- myconf+=( --with-mail ) |
701 |
- use ssl && myconf+=( --with-mail_ssl_module ) |
702 |
- fi |
703 |
- |
704 |
- # custom modules |
705 |
- for mod in $NGINX_ADD_MODULES; do |
706 |
- myconf+=( --add-module=${mod} ) |
707 |
- done |
708 |
- |
709 |
- # https://bugs.gentoo.org/286772 |
710 |
- export LANG=C LC_ALL=C |
711 |
- tc-export CC |
712 |
- |
713 |
- if ! use prefix; then |
714 |
- myconf+=( --user=${PN} ) |
715 |
- myconf+=( --group=${PN} ) |
716 |
- fi |
717 |
- |
718 |
- local WITHOUT_IPV6= |
719 |
- if ! use ipv6; then |
720 |
- WITHOUT_IPV6=" -DNGX_HAVE_INET6=0" |
721 |
- fi |
722 |
- |
723 |
- if [[ -n "${EXTRA_ECONF}" ]]; then |
724 |
- myconf+=( ${EXTRA_ECONF} ) |
725 |
- ewarn "EXTRA_ECONF applied. Now you are on your own, good luck!" |
726 |
- fi |
727 |
- |
728 |
- ./configure \ |
729 |
- --prefix="${EPREFIX}"/usr \ |
730 |
- --conf-path="${EPREFIX}"/etc/${PN}/${PN}.conf \ |
731 |
- --error-log-path="${EPREFIX}"/var/log/${PN}/error_log \ |
732 |
- --pid-path="${EPREFIX}"/run/${PN}.pid \ |
733 |
- --lock-path="${EPREFIX}"/run/lock/${PN}.lock \ |
734 |
- --with-cc-opt="-I${EROOT}usr/include${WITHOUT_IPV6}" \ |
735 |
- --with-ld-opt="-L${EROOT}usr/$(get_libdir)" \ |
736 |
- --http-log-path="${EPREFIX}"/var/log/${PN}/access_log \ |
737 |
- --http-client-body-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/client \ |
738 |
- --http-proxy-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/proxy \ |
739 |
- --http-fastcgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/fastcgi \ |
740 |
- --http-scgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/scgi \ |
741 |
- --http-uwsgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/uwsgi \ |
742 |
- --with-compat \ |
743 |
- "${myconf[@]}" || die "configure failed" |
744 |
- |
745 |
- # A purely cosmetic change that makes nginx -V more readable. This can be |
746 |
- # good if people outside the gentoo community would troubleshoot and |
747 |
- # question the users setup. |
748 |
- sed -i -e "s|${WORKDIR}|external_module|g" objs/ngx_auto_config.h || die |
749 |
-} |
750 |
- |
751 |
-src_compile() { |
752 |
- use nginx_modules_http_security && emake -C "${HTTP_SECURITY_MODULE_WD}" |
753 |
- |
754 |
- # https://bugs.gentoo.org/286772 |
755 |
- export LANG=C LC_ALL=C |
756 |
- emake LINK="${CC} ${LDFLAGS}" OTHERLDFLAGS="${LDFLAGS}" |
757 |
-} |
758 |
- |
759 |
-src_install() { |
760 |
- emake DESTDIR="${D%/}" install |
761 |
- |
762 |
- cp "${FILESDIR}"/nginx.conf-r2 "${ED}"etc/nginx/nginx.conf || die |
763 |
- |
764 |
- newinitd "${FILESDIR}"/nginx.initd-r4 nginx |
765 |
- newconfd "${FILESDIR}"/nginx.confd nginx |
766 |
- |
767 |
- systemd_newunit "${FILESDIR}"/nginx.service-r1 nginx.service |
768 |
- |
769 |
- doman man/nginx.8 |
770 |
- dodoc CHANGES* README |
771 |
- |
772 |
- # just keepdir. do not copy the default htdocs files (bug #449136) |
773 |
- keepdir /var/www/localhost |
774 |
- rm -rf "${D}"usr/html || die |
775 |
- |
776 |
- # set up a list of directories to keep |
777 |
- local keepdir_list="${NGINX_HOME_TMP}"/client |
778 |
- local module |
779 |
- for module in proxy fastcgi scgi uwsgi; do |
780 |
- use nginx_modules_http_${module} && keepdir_list+=" ${NGINX_HOME_TMP}/${module}" |
781 |
- done |
782 |
- |
783 |
- keepdir /var/log/nginx ${keepdir_list} |
784 |
- |
785 |
- # this solves a problem with SELinux where nginx doesn't see the directories |
786 |
- # as root and tries to create them as nginx |
787 |
- fperms 0750 "${NGINX_HOME_TMP}" |
788 |
- fowners ${PN}:0 "${NGINX_HOME_TMP}" |
789 |
- |
790 |
- fperms 0700 ${keepdir_list} |
791 |
- fowners ${PN}:${PN} ${keepdir_list} |
792 |
- |
793 |
- fperms 0710 /var/log/nginx |
794 |
- fowners 0:${PN} /var/log/nginx |
795 |
- |
796 |
- # logrotate |
797 |
- insinto /etc/logrotate.d |
798 |
- newins "${FILESDIR}"/nginx.logrotate-r1 nginx |
799 |
- |
800 |
- if use luajit; then |
801 |
- pax-mark m "${ED%/}/usr/sbin/nginx" |
802 |
- fi |
803 |
- |
804 |
- if use nginx_modules_http_perl; then |
805 |
- cd "${S}"/objs/src/http/modules/perl/ || die |
806 |
- emake DESTDIR="${D}" INSTALLDIRS=vendor |
807 |
- perl_delete_localpod |
808 |
- cd "${S}" || die |
809 |
- fi |
810 |
- |
811 |
- if use nginx_modules_http_cache_purge; then |
812 |
- docinto ${HTTP_CACHE_PURGE_MODULE_P} |
813 |
- dodoc "${HTTP_CACHE_PURGE_MODULE_WD}"/{CHANGES,README.md,TODO.md} |
814 |
- fi |
815 |
- |
816 |
- if use nginx_modules_http_slowfs_cache; then |
817 |
- docinto ${HTTP_SLOWFS_CACHE_MODULE_P} |
818 |
- dodoc "${HTTP_SLOWFS_CACHE_MODULE_WD}"/{CHANGES,README.md} |
819 |
- fi |
820 |
- |
821 |
- if use nginx_modules_http_fancyindex; then |
822 |
- docinto ${HTTP_FANCYINDEX_MODULE_P} |
823 |
- dodoc "${HTTP_FANCYINDEX_MODULE_WD}"/README.rst |
824 |
- fi |
825 |
- |
826 |
- if use nginx_modules_http_lua; then |
827 |
- docinto ${HTTP_LUA_MODULE_P} |
828 |
- dodoc "${HTTP_LUA_MODULE_WD}"/README.markdown |
829 |
- fi |
830 |
- |
831 |
- if use nginx_modules_http_auth_pam; then |
832 |
- docinto ${HTTP_AUTH_PAM_MODULE_P} |
833 |
- dodoc "${HTTP_AUTH_PAM_MODULE_WD}"/{README.md,ChangeLog} |
834 |
- fi |
835 |
- |
836 |
- if use nginx_modules_http_upstream_check; then |
837 |
- docinto ${HTTP_UPSTREAM_CHECK_MODULE_P} |
838 |
- dodoc "${HTTP_UPSTREAM_CHECK_MODULE_WD}"/{README,CHANGES} |
839 |
- fi |
840 |
- |
841 |
- if use nginx_modules_http_naxsi; then |
842 |
- insinto /etc/nginx |
843 |
- doins "${HTTP_NAXSI_MODULE_WD}"/../naxsi_config/naxsi_core.rules |
844 |
- fi |
845 |
- |
846 |
- if use rtmp; then |
847 |
- docinto ${RTMP_MODULE_P} |
848 |
- dodoc "${RTMP_MODULE_WD}"/{AUTHORS,README.md,stat.xsl} |
849 |
- fi |
850 |
- |
851 |
- if use nginx_modules_http_dav_ext; then |
852 |
- docinto ${HTTP_DAV_EXT_MODULE_P} |
853 |
- dodoc "${HTTP_DAV_EXT_MODULE_WD}"/README.rst |
854 |
- fi |
855 |
- |
856 |
- if use nginx_modules_http_echo; then |
857 |
- docinto ${HTTP_ECHO_MODULE_P} |
858 |
- dodoc "${HTTP_ECHO_MODULE_WD}"/README.markdown |
859 |
- fi |
860 |
- |
861 |
- if use nginx_modules_http_security; then |
862 |
- docinto ${HTTP_SECURITY_MODULE_P} |
863 |
- dodoc "${HTTP_SECURITY_MODULE_WD}"/{CHANGES,README.md,authors.txt} |
864 |
- fi |
865 |
- |
866 |
- if use nginx_modules_http_push_stream; then |
867 |
- docinto ${HTTP_PUSH_STREAM_MODULE_P} |
868 |
- dodoc "${HTTP_PUSH_STREAM_MODULE_WD}"/{AUTHORS,CHANGELOG.textile,README.textile} |
869 |
- fi |
870 |
- |
871 |
- if use nginx_modules_http_sticky; then |
872 |
- docinto ${HTTP_STICKY_MODULE_P} |
873 |
- dodoc "${HTTP_STICKY_MODULE_WD}"/{README.md,Changelog.txt,docs/sticky.pdf} |
874 |
- fi |
875 |
- |
876 |
- if use nginx_modules_http_memc; then |
877 |
- docinto ${HTTP_MEMC_MODULE_P} |
878 |
- dodoc "${HTTP_MEMC_MODULE_WD}"/README.markdown |
879 |
- fi |
880 |
- |
881 |
- if use nginx_modules_http_auth_ldap; then |
882 |
- docinto ${HTTP_LDAP_MODULE_P} |
883 |
- dodoc "${HTTP_LDAP_MODULE_WD}"/example.conf |
884 |
- fi |
885 |
-} |
886 |
- |
887 |
-pkg_postinst() { |
888 |
- if use ssl; then |
889 |
- if [[ ! -f "${EROOT}"etc/ssl/${PN}/${PN}.key ]]; then |
890 |
- install_cert /etc/ssl/${PN}/${PN} |
891 |
- use prefix || chown ${PN}:${PN} "${EROOT}"etc/ssl/${PN}/${PN}.{crt,csr,key,pem} |
892 |
- fi |
893 |
- fi |
894 |
- |
895 |
- if use nginx_modules_http_spdy; then |
896 |
- ewarn "" |
897 |
- ewarn "In nginx 1.9.5 the spdy module was superseded by http2." |
898 |
- ewarn "Update your configs and package.use accordingly." |
899 |
- fi |
900 |
- |
901 |
- if use nginx_modules_http_lua; then |
902 |
- ewarn "" |
903 |
- ewarn "While you can build lua 3rd party module against ${P}" |
904 |
- ewarn "the author warns that >=${PN}-1.11.11 is still not an" |
905 |
- ewarn "officially supported target yet. You are on your own." |
906 |
- ewarn "Expect runtime failures, memory leaks and other problems!" |
907 |
- fi |
908 |
- |
909 |
- if use nginx_modules_http_lua && use http2; then |
910 |
- ewarn "" |
911 |
- ewarn "Lua 3rd party module author warns against using ${P} with" |
912 |
- ewarn "NGINX_MODULES_HTTP=\"lua http2\". For more info, see https://git.io/OldLsg" |
913 |
- fi |
914 |
- |
915 |
- local _n_permission_layout_checks=0 |
916 |
- local _has_to_adjust_permissions=0 |
917 |
- local _has_to_show_permission_warning=0 |
918 |
- |
919 |
- # Defaults to 1 to inform people doing a fresh installation |
920 |
- # that we ship modified {scgi,uwsgi,fastcgi}_params files |
921 |
- local _has_to_show_httpoxy_mitigation_notice=1 |
922 |
- |
923 |
- local _replacing_version= |
924 |
- for _replacing_version in ${REPLACING_VERSIONS}; do |
925 |
- _n_permission_layout_checks=$((${_n_permission_layout_checks}+1)) |
926 |
- |
927 |
- if [[ ${_n_permission_layout_checks} -gt 1 ]]; then |
928 |
- # Should never happen: |
929 |
- # Package is abusing slots but doesn't allow multiple parallel installations. |
930 |
- # If we run into this situation it is unsafe to automatically adjust any |
931 |
- # permission... |
932 |
- _has_to_show_permission_warning=1 |
933 |
- |
934 |
- ewarn "Replacing multiple ${PN}' versions is unsupported! " \ |
935 |
- "You will have to adjust permissions on your own." |
936 |
- |
937 |
- break |
938 |
- fi |
939 |
- |
940 |
- local _replacing_version_branch=$(get_version_component_range 1-2 "${_replacing_version}") |
941 |
- debug-print "Updating an existing installation (v${_replacing_version}; branch '${_replacing_version_branch}') ..." |
942 |
- |
943 |
- # Do we need to adjust permissions to fix CVE-2013-0337 (bug #458726, #469094)? |
944 |
- # This was before we introduced multiple nginx versions so we |
945 |
- # do not need to distinguish between stable and mainline |
946 |
- local _need_to_fix_CVE2013_0337=1 |
947 |
- |
948 |
- if version_is_at_least "1.4.1-r2" "${_replacing_version}"; then |
949 |
- # We are updating an installation which should already be fixed |
950 |
- _need_to_fix_CVE2013_0337=0 |
951 |
- debug-print "Skipping CVE-2013-0337 ... existing installation should not be affected!" |
952 |
- else |
953 |
- _has_to_adjust_permissions=1 |
954 |
- debug-print "Need to adjust permissions to fix CVE-2013-0337!" |
955 |
- fi |
956 |
- |
957 |
- # Do we need to inform about HTTPoxy mitigation? |
958 |
- # In repository since commit 8be44f76d4ac02cebcd1e0e6e6284bb72d054b0f |
959 |
- if ! version_is_at_least "1.10" "${_replacing_version_branch}"; then |
960 |
- # Updating from <1.10 |
961 |
- _has_to_show_httpoxy_mitigation_notice=1 |
962 |
- debug-print "Need to inform about HTTPoxy mitigation!" |
963 |
- else |
964 |
- # Updating from >=1.10 |
965 |
- local _fixed_in_pvr= |
966 |
- case "${_replacing_version_branch}" in |
967 |
- "1.10") |
968 |
- _fixed_in_pvr="1.10.1-r2" |
969 |
- ;; |
970 |
- "1.11") |
971 |
- _fixed_in_pvr="1.11.3-r1" |
972 |
- ;; |
973 |
- *) |
974 |
- # This should be any future branch. |
975 |
- # If we run this code it is safe to assume that the user has |
976 |
- # already seen the HTTPoxy mitigation notice because he/she is doing |
977 |
- # an update from previous version where we have already shown |
978 |
- # the warning. Otherwise, we wouldn't hit this code path ... |
979 |
- _fixed_in_pvr= |
980 |
- esac |
981 |
- |
982 |
- if [[ -z "${_fixed_in_pvr}" ]] || version_is_at_least "${_fixed_in_pvr}" "${_replacing_version}"; then |
983 |
- # We are updating an installation where we already informed |
984 |
- # that we are mitigating HTTPoxy per default |
985 |
- _has_to_show_httpoxy_mitigation_notice=0 |
986 |
- debug-print "No need to inform about HTTPoxy mitigation ... information was already shown for existing installation!" |
987 |
- else |
988 |
- _has_to_show_httpoxy_mitigation_notice=1 |
989 |
- debug-print "Need to inform about HTTPoxy mitigation!" |
990 |
- fi |
991 |
- fi |
992 |
- |
993 |
- # Do we need to adjust permissions to fix CVE-2016-1247 (bug #605008)? |
994 |
- # All branches up to 1.11 are affected |
995 |
- local _need_to_fix_CVE2016_1247=1 |
996 |
- |
997 |
- if ! version_is_at_least "1.10" "${_replacing_version_branch}"; then |
998 |
- # Updating from <1.10 |
999 |
- _has_to_adjust_permissions=1 |
1000 |
- debug-print "Need to adjust permissions to fix CVE-2016-1247!" |
1001 |
- else |
1002 |
- # Updating from >=1.10 |
1003 |
- local _fixed_in_pvr= |
1004 |
- case "${_replacing_version_branch}" in |
1005 |
- "1.10") |
1006 |
- _fixed_in_pvr="1.10.2-r3" |
1007 |
- ;; |
1008 |
- "1.11") |
1009 |
- _fixed_in_pvr="1.11.6-r1" |
1010 |
- ;; |
1011 |
- *) |
1012 |
- # This should be any future branch. |
1013 |
- # If we run this code it is safe to assume that we have already |
1014 |
- # adjusted permissions or were never affected because user is |
1015 |
- # doing an update from previous version which was safe or did |
1016 |
- # the adjustments. Otherwise, we wouldn't hit this code path ... |
1017 |
- _fixed_in_pvr= |
1018 |
- esac |
1019 |
- |
1020 |
- if [[ -z "${_fixed_in_pvr}" ]] || version_is_at_least "${_fixed_in_pvr}" "${_replacing_version}"; then |
1021 |
- # We are updating an installation which should already be adjusted |
1022 |
- # or which was never affected |
1023 |
- _need_to_fix_CVE2016_1247=0 |
1024 |
- debug-print "Skipping CVE-2016-1247 ... existing installation should not be affected!" |
1025 |
- else |
1026 |
- _has_to_adjust_permissions=1 |
1027 |
- debug-print "Need to adjust permissions to fix CVE-2016-1247!" |
1028 |
- fi |
1029 |
- fi |
1030 |
- done |
1031 |
- |
1032 |
- if [[ ${_has_to_adjust_permissions} -eq 1 ]]; then |
1033 |
- # We do not DIE when chmod/chown commands are failing because |
1034 |
- # package is already merged on user's system at this stage |
1035 |
- # and we cannot retry without losing the information that |
1036 |
- # the existing installation needs to adjust permissions. |
1037 |
- # Instead we are going to a show a big warning ... |
1038 |
- |
1039 |
- if [[ ${_has_to_show_permission_warning} -eq 0 ]] && [[ ${_need_to_fix_CVE2013_0337} -eq 1 ]]; then |
1040 |
- ewarn "" |
1041 |
- ewarn "The world-readable bit (if set) has been removed from the" |
1042 |
- ewarn "following directories to mitigate a security bug" |
1043 |
- ewarn "(CVE-2013-0337, bug #458726):" |
1044 |
- ewarn "" |
1045 |
- ewarn " ${EPREFIX%/}/var/log/nginx" |
1046 |
- ewarn " ${EPREFIX%/}${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi}" |
1047 |
- ewarn "" |
1048 |
- ewarn "Check if this is correct for your setup before restarting nginx!" |
1049 |
- ewarn "This is a one-time change and will not happen on subsequent updates." |
1050 |
- ewarn "Furthermore nginx' temp directories got moved to '${EPREFIX%/}${NGINX_HOME_TMP}'" |
1051 |
- chmod o-rwx \ |
1052 |
- "${EPREFIX%/}"/var/log/nginx \ |
1053 |
- "${EPREFIX%/}"${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi} || \ |
1054 |
- _has_to_show_permission_warning=1 |
1055 |
- fi |
1056 |
- |
1057 |
- if [[ ${_has_to_show_permission_warning} -eq 0 ]] && [[ ${_need_to_fix_CVE2016_1247} -eq 1 ]]; then |
1058 |
- ewarn "" |
1059 |
- ewarn "The permissions on the following directory have been reset in" |
1060 |
- ewarn "order to mitigate a security bug (CVE-2016-1247, bug #605008):" |
1061 |
- ewarn "" |
1062 |
- ewarn " ${EPREFIX%/}/var/log/nginx" |
1063 |
- ewarn "" |
1064 |
- ewarn "Check if this is correct for your setup before restarting nginx!" |
1065 |
- ewarn "Also ensure that no other log directory used by any of your" |
1066 |
- ewarn "vhost(s) is not writeable for nginx user. Any of your log files" |
1067 |
- ewarn "used by nginx can be abused to escalate privileges!" |
1068 |
- ewarn "This is a one-time change and will not happen on subsequent updates." |
1069 |
- chown 0:nginx "${EPREFIX%/}"/var/log/nginx || _has_to_show_permission_warning=1 |
1070 |
- chmod 710 "${EPREFIX%/}"/var/log/nginx || _has_to_show_permission_warning=1 |
1071 |
- fi |
1072 |
- |
1073 |
- if [[ ${_has_to_show_permission_warning} -eq 1 ]]; then |
1074 |
- # Should never happen ... |
1075 |
- ewarn "" |
1076 |
- ewarn "*************************************************************" |
1077 |
- ewarn "*************** W A R N I N G ***************" |
1078 |
- ewarn "*************************************************************" |
1079 |
- ewarn "The one-time only attempt to adjust permissions of the" |
1080 |
- ewarn "existing nginx installation failed. Be aware that we will not" |
1081 |
- ewarn "try to adjust the same permissions again because now you are" |
1082 |
- ewarn "using a nginx version where we expect that the permissions" |
1083 |
- ewarn "are already adjusted or that you know what you are doing and" |
1084 |
- ewarn "want to keep custom permissions." |
1085 |
- ewarn "" |
1086 |
- fi |
1087 |
- fi |
1088 |
- |
1089 |
- # Sanity check for CVE-2016-1247 |
1090 |
- # Required to warn users who received the warning above and thought |
1091 |
- # they could fix it by unmerging and re-merging the package or have |
1092 |
- # unmerged a affected installation on purpose in the past leaving |
1093 |
- # /var/log/nginx on their system due to keepdir/non-empty folder |
1094 |
- # and are now installing the package again. |
1095 |
- local _sanity_check_testfile=$(mktemp --dry-run "${EPREFIX%/}"/var/log/nginx/.CVE-2016-1247.XXXXXXXXX) |
1096 |
- su -s /bin/sh -c "touch ${_sanity_check_testfile}" nginx >&/dev/null |
1097 |
- if [ $? -eq 0 ] ; then |
1098 |
- # Cleanup -- no reason to die here! |
1099 |
- rm -f "${_sanity_check_testfile}" |
1100 |
- |
1101 |
- ewarn "" |
1102 |
- ewarn "*************************************************************" |
1103 |
- ewarn "*************** W A R N I N G ***************" |
1104 |
- ewarn "*************************************************************" |
1105 |
- ewarn "Looks like your installation is vulnerable to CVE-2016-1247" |
1106 |
- ewarn "(bug #605008) because nginx user is able to create files in" |
1107 |
- ewarn "" |
1108 |
- ewarn " ${EPREFIX%/}/var/log/nginx" |
1109 |
- ewarn "" |
1110 |
- ewarn "Also ensure that no other log directory used by any of your" |
1111 |
- ewarn "vhost(s) is not writeable for nginx user. Any of your log files" |
1112 |
- ewarn "used by nginx can be abused to escalate privileges!" |
1113 |
- fi |
1114 |
- |
1115 |
- if [[ ${_has_to_show_httpoxy_mitigation_notice} -eq 1 ]]; then |
1116 |
- # HTTPoxy mitigation |
1117 |
- ewarn "" |
1118 |
- ewarn "This nginx installation comes with a mitigation for the HTTPoxy" |
1119 |
- ewarn "vulnerability for FastCGI, SCGI and uWSGI applications by setting" |
1120 |
- ewarn "the HTTP_PROXY parameter to an empty string per default when you" |
1121 |
- ewarn "are sourcing one of the default" |
1122 |
- ewarn "" |
1123 |
- ewarn " - 'fastcgi_params' or 'fastcgi.conf'" |
1124 |
- ewarn " - 'scgi_params'" |
1125 |
- ewarn " - 'uwsgi_params'" |
1126 |
- ewarn "" |
1127 |
- ewarn "files in your server block(s)." |
1128 |
- ewarn "" |
1129 |
- ewarn "If this is causing any problems for you make sure that you are sourcing the" |
1130 |
- ewarn "default parameters _before_ you set your own values." |
1131 |
- ewarn "If you are relying on user-supplied proxy values you have to remove the" |
1132 |
- ewarn "correlating lines from the file(s) mentioned above." |
1133 |
- ewarn "" |
1134 |
- fi |
1135 |
-} |
1136 |
|
1137 |
diff --git a/www-servers/nginx/nginx-1.17.4.ebuild b/www-servers/nginx/nginx-1.17.4.ebuild |
1138 |
deleted file mode 100644 |
1139 |
index e855a007bab..00000000000 |
1140 |
--- a/www-servers/nginx/nginx-1.17.4.ebuild |
1141 |
+++ /dev/null |
1142 |
@@ -1,1089 +0,0 @@ |
1143 |
-# Copyright 1999-2019 Gentoo Authors |
1144 |
-# Distributed under the terms of the GNU General Public License v2 |
1145 |
- |
1146 |
-EAPI="6" |
1147 |
- |
1148 |
-# Maintainer notes: |
1149 |
-# - http_rewrite-independent pcre-support makes sense for matching locations without an actual rewrite |
1150 |
-# - any http-module activates the main http-functionality and overrides USE=-http |
1151 |
-# - keep the following requirements in mind before adding external modules: |
1152 |
-# * alive upstream |
1153 |
-# * sane packaging |
1154 |
-# * builds cleanly |
1155 |
-# * does not need a patch for nginx core |
1156 |
-# - TODO: test the google-perftools module (included in vanilla tarball) |
1157 |
- |
1158 |
-# prevent perl-module from adding automagic perl DEPENDs |
1159 |
-GENTOO_DEPEND_ON_PERL="no" |
1160 |
- |
1161 |
-# devel_kit (https://github.com/simpl/ngx_devel_kit, BSD license) |
1162 |
-DEVEL_KIT_MODULE_PV="0.3.1" |
1163 |
-DEVEL_KIT_MODULE_P="ngx_devel_kit-${DEVEL_KIT_MODULE_PV}" |
1164 |
-DEVEL_KIT_MODULE_URI="https://github.com/simpl/ngx_devel_kit/archive/v${DEVEL_KIT_MODULE_PV}.tar.gz" |
1165 |
-DEVEL_KIT_MODULE_WD="${WORKDIR}/ngx_devel_kit-${DEVEL_KIT_MODULE_PV}" |
1166 |
- |
1167 |
-# ngx_brotli (https://github.com/eustas/ngx_brotli, BSD-2) |
1168 |
-HTTP_BROTLI_MODULE_PV="8104036af9cff4b1d34f22d00ba857e2a93a243c" |
1169 |
-HTTP_BROTLI_MODULE_P="ngx_brotli-${HTTP_BROTLI_MODULE_PV}" |
1170 |
-HTTP_BROTLI_MODULE_URI="https://github.com/eustas/ngx_brotli/archive/${HTTP_BROTLI_MODULE_PV}.tar.gz" |
1171 |
-HTTP_BROTLI_MODULE_WD="${WORKDIR}/ngx_brotli-${HTTP_BROTLI_MODULE_PV}" |
1172 |
- |
1173 |
-# http_uploadprogress (https://github.com/masterzen/nginx-upload-progress-module, BSD-2 license) |
1174 |
-HTTP_UPLOAD_PROGRESS_MODULE_PV="0.9.2" |
1175 |
-HTTP_UPLOAD_PROGRESS_MODULE_P="ngx_http_upload_progress-${HTTP_UPLOAD_PROGRESS_MODULE_PV}-r1" |
1176 |
-HTTP_UPLOAD_PROGRESS_MODULE_URI="https://github.com/masterzen/nginx-upload-progress-module/archive/v${HTTP_UPLOAD_PROGRESS_MODULE_PV}.tar.gz" |
1177 |
-HTTP_UPLOAD_PROGRESS_MODULE_WD="${WORKDIR}/nginx-upload-progress-module-${HTTP_UPLOAD_PROGRESS_MODULE_PV}" |
1178 |
- |
1179 |
-# http_headers_more (https://github.com/agentzh/headers-more-nginx-module, BSD license) |
1180 |
-HTTP_HEADERS_MORE_MODULE_PV="0.33" |
1181 |
-HTTP_HEADERS_MORE_MODULE_P="ngx_http_headers_more-${HTTP_HEADERS_MORE_MODULE_PV}" |
1182 |
-HTTP_HEADERS_MORE_MODULE_URI="https://github.com/agentzh/headers-more-nginx-module/archive/v${HTTP_HEADERS_MORE_MODULE_PV}.tar.gz" |
1183 |
-HTTP_HEADERS_MORE_MODULE_WD="${WORKDIR}/headers-more-nginx-module-${HTTP_HEADERS_MORE_MODULE_PV}" |
1184 |
- |
1185 |
-# http_cache_purge (http://labs.frickle.com/nginx_ngx_cache_purge/, https://github.com/FRiCKLE/ngx_cache_purge, BSD-2 license) |
1186 |
-HTTP_CACHE_PURGE_MODULE_PV="2.3" |
1187 |
-HTTP_CACHE_PURGE_MODULE_P="ngx_http_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}" |
1188 |
-HTTP_CACHE_PURGE_MODULE_URI="http://labs.frickle.com/files/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}.tar.gz" |
1189 |
-HTTP_CACHE_PURGE_MODULE_WD="${WORKDIR}/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}" |
1190 |
- |
1191 |
-# http_slowfs_cache (http://labs.frickle.com/nginx_ngx_slowfs_cache/, BSD-2 license) |
1192 |
-HTTP_SLOWFS_CACHE_MODULE_PV="1.10" |
1193 |
-HTTP_SLOWFS_CACHE_MODULE_P="ngx_http_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}" |
1194 |
-HTTP_SLOWFS_CACHE_MODULE_URI="http://labs.frickle.com/files/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}.tar.gz" |
1195 |
-HTTP_SLOWFS_CACHE_MODULE_WD="${WORKDIR}/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}" |
1196 |
- |
1197 |
-# http_fancyindex (https://github.com/aperezdc/ngx-fancyindex, BSD license) |
1198 |
-HTTP_FANCYINDEX_MODULE_PV="0.4.3" |
1199 |
-HTTP_FANCYINDEX_MODULE_P="ngx_http_fancyindex-${HTTP_FANCYINDEX_MODULE_PV}" |
1200 |
-HTTP_FANCYINDEX_MODULE_URI="https://github.com/aperezdc/ngx-fancyindex/archive/v${HTTP_FANCYINDEX_MODULE_PV}.tar.gz" |
1201 |
-HTTP_FANCYINDEX_MODULE_WD="${WORKDIR}/ngx-fancyindex-${HTTP_FANCYINDEX_MODULE_PV}" |
1202 |
- |
1203 |
-# http_lua (https://github.com/openresty/lua-nginx-module, BSD license) |
1204 |
-HTTP_LUA_MODULE_PV="0.10.15" |
1205 |
-HTTP_LUA_MODULE_P="ngx_http_lua-${HTTP_LUA_MODULE_PV}" |
1206 |
-HTTP_LUA_MODULE_URI="https://github.com/openresty/lua-nginx-module/archive/v${HTTP_LUA_MODULE_PV}.tar.gz" |
1207 |
-HTTP_LUA_MODULE_WD="${WORKDIR}/lua-nginx-module-${HTTP_LUA_MODULE_PV}" |
1208 |
- |
1209 |
-# http_auth_pam (https://github.com/stogh/ngx_http_auth_pam_module/, http://web.iti.upv.es/~sto/nginx/, BSD-2 license) |
1210 |
-HTTP_AUTH_PAM_MODULE_PV="1.5.1" |
1211 |
-HTTP_AUTH_PAM_MODULE_P="ngx_http_auth_pam-${HTTP_AUTH_PAM_MODULE_PV}" |
1212 |
-HTTP_AUTH_PAM_MODULE_URI="https://github.com/stogh/ngx_http_auth_pam_module/archive/v${HTTP_AUTH_PAM_MODULE_PV}.tar.gz" |
1213 |
-HTTP_AUTH_PAM_MODULE_WD="${WORKDIR}/ngx_http_auth_pam_module-${HTTP_AUTH_PAM_MODULE_PV}" |
1214 |
- |
1215 |
-# http_upstream_check (https://github.com/yaoweibin/nginx_upstream_check_module, BSD license) |
1216 |
-HTTP_UPSTREAM_CHECK_MODULE_PV="9aecf15ec379fe98f62355c57b60c0bc83296f04" |
1217 |
-HTTP_UPSTREAM_CHECK_MODULE_P="ngx_http_upstream_check-${HTTP_UPSTREAM_CHECK_MODULE_PV}" |
1218 |
-HTTP_UPSTREAM_CHECK_MODULE_URI="https://github.com/yaoweibin/nginx_upstream_check_module/archive/${HTTP_UPSTREAM_CHECK_MODULE_PV}.tar.gz" |
1219 |
-HTTP_UPSTREAM_CHECK_MODULE_WD="${WORKDIR}/nginx_upstream_check_module-${HTTP_UPSTREAM_CHECK_MODULE_PV}" |
1220 |
- |
1221 |
-# http_metrics (https://github.com/zenops/ngx_metrics, BSD license) |
1222 |
-HTTP_METRICS_MODULE_PV="0.1.1" |
1223 |
-HTTP_METRICS_MODULE_P="ngx_metrics-${HTTP_METRICS_MODULE_PV}" |
1224 |
-HTTP_METRICS_MODULE_URI="https://github.com/madvertise/ngx_metrics/archive/v${HTTP_METRICS_MODULE_PV}.tar.gz" |
1225 |
-HTTP_METRICS_MODULE_WD="${WORKDIR}/ngx_metrics-${HTTP_METRICS_MODULE_PV}" |
1226 |
- |
1227 |
-# http_vhost_traffic_status (https://github.com/vozlt/nginx-module-vts, BSD license) |
1228 |
-HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV="46d85558e344dfe2b078ce757fd36c69a1ec2dd3" |
1229 |
-HTTP_VHOST_TRAFFIC_STATUS_MODULE_P="ngx_http_vhost_traffic_status-${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}" |
1230 |
-HTTP_VHOST_TRAFFIC_STATUS_MODULE_URI="https://github.com/vozlt/nginx-module-vts/archive/${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}.tar.gz" |
1231 |
-HTTP_VHOST_TRAFFIC_STATUS_MODULE_WD="${WORKDIR}/nginx-module-vts-${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}" |
1232 |
- |
1233 |
-# naxsi-core (https://github.com/nbs-system/naxsi, GPLv2+) |
1234 |
-HTTP_NAXSI_MODULE_PV="0.56" |
1235 |
-HTTP_NAXSI_MODULE_P="ngx_http_naxsi-${HTTP_NAXSI_MODULE_PV}" |
1236 |
-HTTP_NAXSI_MODULE_URI="https://github.com/nbs-system/naxsi/archive/${HTTP_NAXSI_MODULE_PV}.tar.gz" |
1237 |
-HTTP_NAXSI_MODULE_WD="${WORKDIR}/naxsi-${HTTP_NAXSI_MODULE_PV}/naxsi_src" |
1238 |
- |
1239 |
-# nginx-rtmp-module (https://github.com/arut/nginx-rtmp-module, BSD license) |
1240 |
-RTMP_MODULE_PV="1.2.1" |
1241 |
-RTMP_MODULE_P="ngx_rtmp-${RTMP_MODULE_PV}" |
1242 |
-RTMP_MODULE_URI="https://github.com/arut/nginx-rtmp-module/archive/v${RTMP_MODULE_PV}.tar.gz" |
1243 |
-RTMP_MODULE_WD="${WORKDIR}/nginx-rtmp-module-${RTMP_MODULE_PV}" |
1244 |
- |
1245 |
-# nginx-dav-ext-module (https://github.com/arut/nginx-dav-ext-module, BSD license) |
1246 |
-HTTP_DAV_EXT_MODULE_PV="3.0.0" |
1247 |
-HTTP_DAV_EXT_MODULE_P="ngx_http_dav_ext-${HTTP_DAV_EXT_MODULE_PV}" |
1248 |
-HTTP_DAV_EXT_MODULE_URI="https://github.com/arut/nginx-dav-ext-module/archive/v${HTTP_DAV_EXT_MODULE_PV}.tar.gz" |
1249 |
-HTTP_DAV_EXT_MODULE_WD="${WORKDIR}/nginx-dav-ext-module-${HTTP_DAV_EXT_MODULE_PV}" |
1250 |
- |
1251 |
-# echo-nginx-module (https://github.com/openresty/echo-nginx-module, BSD license) |
1252 |
-HTTP_ECHO_MODULE_PV="0.61" |
1253 |
-HTTP_ECHO_MODULE_P="ngx_http_echo-${HTTP_ECHO_MODULE_PV}" |
1254 |
-HTTP_ECHO_MODULE_URI="https://github.com/openresty/echo-nginx-module/archive/v${HTTP_ECHO_MODULE_PV}.tar.gz" |
1255 |
-HTTP_ECHO_MODULE_WD="${WORKDIR}/echo-nginx-module-${HTTP_ECHO_MODULE_PV}" |
1256 |
- |
1257 |
-# mod_security for nginx (https://modsecurity.org/, Apache-2.0) |
1258 |
-# keep the MODULE_P here consistent with upstream to avoid tarball duplication |
1259 |
-HTTP_SECURITY_MODULE_PV="2.9.3" |
1260 |
-HTTP_SECURITY_MODULE_P="modsecurity-${HTTP_SECURITY_MODULE_PV}" |
1261 |
-HTTP_SECURITY_MODULE_URI="https://www.modsecurity.org/tarball/${HTTP_SECURITY_MODULE_PV}/${HTTP_SECURITY_MODULE_P}.tar.gz" |
1262 |
-HTTP_SECURITY_MODULE_WD="${WORKDIR}/${HTTP_SECURITY_MODULE_P}" |
1263 |
- |
1264 |
-# push-stream-module (http://www.nginxpushstream.com, https://github.com/wandenberg/nginx-push-stream-module, GPL-3) |
1265 |
-HTTP_PUSH_STREAM_MODULE_PV="0.5.4" |
1266 |
-HTTP_PUSH_STREAM_MODULE_P="ngx_http_push_stream-${HTTP_PUSH_STREAM_MODULE_PV}" |
1267 |
-HTTP_PUSH_STREAM_MODULE_URI="https://github.com/wandenberg/nginx-push-stream-module/archive/${HTTP_PUSH_STREAM_MODULE_PV}.tar.gz" |
1268 |
-HTTP_PUSH_STREAM_MODULE_WD="${WORKDIR}/nginx-push-stream-module-${HTTP_PUSH_STREAM_MODULE_PV}" |
1269 |
- |
1270 |
-# sticky-module (https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng, BSD-2) |
1271 |
-HTTP_STICKY_MODULE_PV="1.2.6-10-g08a395c66e42" |
1272 |
-HTTP_STICKY_MODULE_P="nginx_http_sticky_module_ng-${HTTP_STICKY_MODULE_PV}" |
1273 |
-HTTP_STICKY_MODULE_URI="https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/get/${HTTP_STICKY_MODULE_PV}.tar.bz2" |
1274 |
-HTTP_STICKY_MODULE_WD="${WORKDIR}/nginx-goodies-nginx-sticky-module-ng-08a395c66e42" |
1275 |
- |
1276 |
-# mogilefs-module (https://github.com/vkholodkov/nginx-mogilefs-module, BSD-2) |
1277 |
-HTTP_MOGILEFS_MODULE_PV="1.0.4" |
1278 |
-HTTP_MOGILEFS_MODULE_P="ngx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}" |
1279 |
-HTTP_MOGILEFS_MODULE_URI="https://github.com/vkholodkov/nginx-mogilefs-module/archive/${HTTP_MOGILEFS_MODULE_PV}.tar.gz" |
1280 |
-HTTP_MOGILEFS_MODULE_WD="${WORKDIR}/nginx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}" |
1281 |
- |
1282 |
-# memc-module (https://github.com/openresty/memc-nginx-module, BSD-2) |
1283 |
-HTTP_MEMC_MODULE_PV="0.19" |
1284 |
-HTTP_MEMC_MODULE_P="ngx_memc_module-${HTTP_MEMC_MODULE_PV}" |
1285 |
-HTTP_MEMC_MODULE_URI="https://github.com/openresty/memc-nginx-module/archive/v${HTTP_MEMC_MODULE_PV}.tar.gz" |
1286 |
-HTTP_MEMC_MODULE_WD="${WORKDIR}/memc-nginx-module-${HTTP_MEMC_MODULE_PV}" |
1287 |
- |
1288 |
-# nginx-ldap-auth-module (https://github.com/kvspb/nginx-auth-ldap, BSD-2) |
1289 |
-HTTP_LDAP_MODULE_PV="42d195d7a7575ebab1c369ad3fc5d78dc2c2669c" |
1290 |
-HTTP_LDAP_MODULE_P="nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}" |
1291 |
-HTTP_LDAP_MODULE_URI="https://github.com/kvspb/nginx-auth-ldap/archive/${HTTP_LDAP_MODULE_PV}.tar.gz" |
1292 |
-HTTP_LDAP_MODULE_WD="${WORKDIR}/nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}" |
1293 |
- |
1294 |
-# geoip2 (https://github.com/leev/ngx_http_geoip2_module, BSD-2) |
1295 |
-GEOIP2_MODULE_PV="3.2" |
1296 |
-GEOIP2_MODULE_P="ngx_http_geoip2_module-${GEOIP2_MODULE_PV}" |
1297 |
-GEOIP2_MODULE_URI="https://github.com/leev/ngx_http_geoip2_module/archive/${GEOIP2_MODULE_PV}.tar.gz" |
1298 |
-GEOIP2_MODULE_WD="${WORKDIR}/ngx_http_geoip2_module-${GEOIP2_MODULE_PV}" |
1299 |
- |
1300 |
-# njs-module (https://github.com/nginx/njs, as-is) |
1301 |
-NJS_MODULE_PV="0.3.5" |
1302 |
-NJS_MODULE_P="njs-${NJS_MODULE_PV}" |
1303 |
-NJS_MODULE_URI="https://github.com/nginx/njs/archive/${NJS_MODULE_PV}.tar.gz" |
1304 |
-NJS_MODULE_WD="${WORKDIR}/njs-${NJS_MODULE_PV}" |
1305 |
- |
1306 |
-# We handle deps below ourselves |
1307 |
-SSL_DEPS_SKIP=1 |
1308 |
-AUTOTOOLS_AUTO_DEPEND="no" |
1309 |
- |
1310 |
-inherit autotools ssl-cert toolchain-funcs perl-module flag-o-matic user systemd versionator multilib pax-utils |
1311 |
- |
1312 |
-DESCRIPTION="Robust, small and high performance http and reverse proxy server" |
1313 |
-HOMEPAGE="https://nginx.org" |
1314 |
-SRC_URI="https://nginx.org/download/${P}.tar.gz |
1315 |
- ${DEVEL_KIT_MODULE_URI} -> ${DEVEL_KIT_MODULE_P}.tar.gz |
1316 |
- nginx_modules_http_auth_ldap? ( ${HTTP_LDAP_MODULE_URI} -> ${HTTP_LDAP_MODULE_P}.tar.gz ) |
1317 |
- nginx_modules_http_auth_pam? ( ${HTTP_AUTH_PAM_MODULE_URI} -> ${HTTP_AUTH_PAM_MODULE_P}.tar.gz ) |
1318 |
- nginx_modules_http_brotli? ( ${HTTP_BROTLI_MODULE_URI} -> ${HTTP_BROTLI_MODULE_P}.tar.gz ) |
1319 |
- nginx_modules_http_cache_purge? ( ${HTTP_CACHE_PURGE_MODULE_URI} -> ${HTTP_CACHE_PURGE_MODULE_P}.tar.gz ) |
1320 |
- nginx_modules_http_dav_ext? ( ${HTTP_DAV_EXT_MODULE_URI} -> ${HTTP_DAV_EXT_MODULE_P}.tar.gz ) |
1321 |
- nginx_modules_http_echo? ( ${HTTP_ECHO_MODULE_URI} -> ${HTTP_ECHO_MODULE_P}.tar.gz ) |
1322 |
- nginx_modules_http_fancyindex? ( ${HTTP_FANCYINDEX_MODULE_URI} -> ${HTTP_FANCYINDEX_MODULE_P}.tar.gz ) |
1323 |
- nginx_modules_http_geoip2? ( ${GEOIP2_MODULE_URI} -> ${GEOIP2_MODULE_P}.tar.gz ) |
1324 |
- nginx_modules_http_headers_more? ( ${HTTP_HEADERS_MORE_MODULE_URI} -> ${HTTP_HEADERS_MORE_MODULE_P}.tar.gz ) |
1325 |
- nginx_modules_http_javascript? ( ${NJS_MODULE_URI} -> ${NJS_MODULE_P}.tar.gz ) |
1326 |
- nginx_modules_http_lua? ( ${HTTP_LUA_MODULE_URI} -> ${HTTP_LUA_MODULE_P}.tar.gz ) |
1327 |
- nginx_modules_http_memc? ( ${HTTP_MEMC_MODULE_URI} -> ${HTTP_MEMC_MODULE_P}.tar.gz ) |
1328 |
- nginx_modules_http_metrics? ( ${HTTP_METRICS_MODULE_URI} -> ${HTTP_METRICS_MODULE_P}.tar.gz ) |
1329 |
- nginx_modules_http_mogilefs? ( ${HTTP_MOGILEFS_MODULE_URI} -> ${HTTP_MOGILEFS_MODULE_P}.tar.gz ) |
1330 |
- nginx_modules_http_naxsi? ( ${HTTP_NAXSI_MODULE_URI} -> ${HTTP_NAXSI_MODULE_P}.tar.gz ) |
1331 |
- nginx_modules_http_push_stream? ( ${HTTP_PUSH_STREAM_MODULE_URI} -> ${HTTP_PUSH_STREAM_MODULE_P}.tar.gz ) |
1332 |
- nginx_modules_http_security? ( ${HTTP_SECURITY_MODULE_URI} -> ${HTTP_SECURITY_MODULE_P}.tar.gz ) |
1333 |
- nginx_modules_http_slowfs_cache? ( ${HTTP_SLOWFS_CACHE_MODULE_URI} -> ${HTTP_SLOWFS_CACHE_MODULE_P}.tar.gz ) |
1334 |
- nginx_modules_http_sticky? ( ${HTTP_STICKY_MODULE_URI} -> ${HTTP_STICKY_MODULE_P}.tar.bz2 ) |
1335 |
- nginx_modules_http_upload_progress? ( ${HTTP_UPLOAD_PROGRESS_MODULE_URI} -> ${HTTP_UPLOAD_PROGRESS_MODULE_P}.tar.gz ) |
1336 |
- nginx_modules_http_upstream_check? ( ${HTTP_UPSTREAM_CHECK_MODULE_URI} -> ${HTTP_UPSTREAM_CHECK_MODULE_P}.tar.gz ) |
1337 |
- nginx_modules_http_vhost_traffic_status? ( ${HTTP_VHOST_TRAFFIC_STATUS_MODULE_URI} -> ${HTTP_VHOST_TRAFFIC_STATUS_MODULE_P}.tar.gz ) |
1338 |
- nginx_modules_stream_geoip2? ( ${GEOIP2_MODULE_URI} -> ${GEOIP2_MODULE_P}.tar.gz ) |
1339 |
- nginx_modules_stream_javascript? ( ${NJS_MODULE_URI} -> ${NJS_MODULE_P}.tar.gz ) |
1340 |
- rtmp? ( ${RTMP_MODULE_URI} -> ${RTMP_MODULE_P}.tar.gz )" |
1341 |
- |
1342 |
-LICENSE="BSD-2 BSD SSLeay MIT GPL-2 GPL-2+ |
1343 |
- nginx_modules_http_security? ( Apache-2.0 ) |
1344 |
- nginx_modules_http_push_stream? ( GPL-3 )" |
1345 |
- |
1346 |
-SLOT="mainline" |
1347 |
-KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux" |
1348 |
- |
1349 |
-# Package doesn't provide a real test suite |
1350 |
-RESTRICT="test" |
1351 |
- |
1352 |
-NGINX_MODULES_STD="access auth_basic autoindex browser charset empty_gif |
1353 |
- fastcgi geo grpc gzip limit_req limit_conn map memcached mirror |
1354 |
- proxy referer rewrite scgi ssi split_clients upstream_hash |
1355 |
- upstream_ip_hash upstream_keepalive upstream_least_conn |
1356 |
- upstream_zone userid uwsgi" |
1357 |
-NGINX_MODULES_OPT="addition auth_request dav degradation flv geoip gunzip |
1358 |
- gzip_static image_filter mp4 perl random_index realip secure_link |
1359 |
- slice stub_status sub xslt" |
1360 |
-NGINX_MODULES_STREAM_STD="access geo limit_conn map return split_clients |
1361 |
- upstream_hash upstream_least_conn upstream_zone" |
1362 |
-NGINX_MODULES_STREAM_OPT="geoip realip ssl_preread" |
1363 |
-NGINX_MODULES_MAIL="imap pop3 smtp" |
1364 |
-NGINX_MODULES_3RD=" |
1365 |
- http_auth_ldap |
1366 |
- http_auth_pam |
1367 |
- http_brotli |
1368 |
- http_cache_purge |
1369 |
- http_dav_ext |
1370 |
- http_echo |
1371 |
- http_fancyindex |
1372 |
- http_geoip2 |
1373 |
- http_headers_more |
1374 |
- http_javascript |
1375 |
- http_lua |
1376 |
- http_memc |
1377 |
- http_metrics |
1378 |
- http_mogilefs |
1379 |
- http_naxsi |
1380 |
- http_push_stream |
1381 |
- http_security |
1382 |
- http_slowfs_cache |
1383 |
- http_sticky |
1384 |
- http_upload_progress |
1385 |
- http_upstream_check |
1386 |
- http_vhost_traffic_status |
1387 |
- stream_geoip2 |
1388 |
- stream_javascript |
1389 |
-" |
1390 |
- |
1391 |
-IUSE="aio debug +http +http2 +http-cache +ipv6 libatomic libressl luajit +pcre |
1392 |
- pcre-jit rtmp selinux ssl threads userland_GNU vim-syntax" |
1393 |
- |
1394 |
-for mod in $NGINX_MODULES_STD; do |
1395 |
- IUSE="${IUSE} +nginx_modules_http_${mod}" |
1396 |
-done |
1397 |
- |
1398 |
-for mod in $NGINX_MODULES_OPT; do |
1399 |
- IUSE="${IUSE} nginx_modules_http_${mod}" |
1400 |
-done |
1401 |
- |
1402 |
-for mod in $NGINX_MODULES_STREAM_STD; do |
1403 |
- IUSE="${IUSE} nginx_modules_stream_${mod}" |
1404 |
-done |
1405 |
- |
1406 |
-for mod in $NGINX_MODULES_STREAM_OPT; do |
1407 |
- IUSE="${IUSE} nginx_modules_stream_${mod}" |
1408 |
-done |
1409 |
- |
1410 |
-for mod in $NGINX_MODULES_MAIL; do |
1411 |
- IUSE="${IUSE} nginx_modules_mail_${mod}" |
1412 |
-done |
1413 |
- |
1414 |
-for mod in $NGINX_MODULES_3RD; do |
1415 |
- IUSE="${IUSE} nginx_modules_${mod}" |
1416 |
-done |
1417 |
- |
1418 |
-# Add so we can warn users updating about config changes |
1419 |
-# @TODO: jbergstroem: remove on next release series |
1420 |
-IUSE="${IUSE} nginx_modules_http_spdy" |
1421 |
- |
1422 |
-CDEPEND=" |
1423 |
- pcre? ( dev-libs/libpcre:= ) |
1424 |
- pcre-jit? ( dev-libs/libpcre:=[jit] ) |
1425 |
- ssl? ( |
1426 |
- !libressl? ( dev-libs/openssl:0= ) |
1427 |
- libressl? ( dev-libs/libressl:= ) |
1428 |
- ) |
1429 |
- http2? ( |
1430 |
- !libressl? ( >=dev-libs/openssl-1.0.1c:0= ) |
1431 |
- libressl? ( dev-libs/libressl:= ) |
1432 |
- ) |
1433 |
- http-cache? ( |
1434 |
- userland_GNU? ( |
1435 |
- !libressl? ( dev-libs/openssl:0= ) |
1436 |
- libressl? ( dev-libs/libressl:= ) |
1437 |
- ) |
1438 |
- ) |
1439 |
- nginx_modules_http_brotli? ( app-arch/brotli:= ) |
1440 |
- nginx_modules_http_geoip? ( dev-libs/geoip ) |
1441 |
- nginx_modules_http_geoip2? ( dev-libs/libmaxminddb:= ) |
1442 |
- nginx_modules_http_gunzip? ( sys-libs/zlib ) |
1443 |
- nginx_modules_http_gzip? ( sys-libs/zlib ) |
1444 |
- nginx_modules_http_gzip_static? ( sys-libs/zlib ) |
1445 |
- nginx_modules_http_image_filter? ( media-libs/gd:=[jpeg,png] ) |
1446 |
- nginx_modules_http_perl? ( >=dev-lang/perl-5.8:= ) |
1447 |
- nginx_modules_http_rewrite? ( dev-libs/libpcre:= ) |
1448 |
- nginx_modules_http_secure_link? ( |
1449 |
- userland_GNU? ( |
1450 |
- !libressl? ( dev-libs/openssl:0= ) |
1451 |
- libressl? ( dev-libs/libressl:= ) |
1452 |
- ) |
1453 |
- ) |
1454 |
- nginx_modules_http_xslt? ( dev-libs/libxml2:= dev-libs/libxslt ) |
1455 |
- nginx_modules_http_lua? ( dev-lang/luajit:2= ) |
1456 |
- nginx_modules_http_auth_pam? ( sys-libs/pam ) |
1457 |
- nginx_modules_http_metrics? ( dev-libs/yajl:= ) |
1458 |
- nginx_modules_http_dav_ext? ( dev-libs/libxml2 ) |
1459 |
- nginx_modules_http_security? ( |
1460 |
- dev-libs/apr:= |
1461 |
- dev-libs/apr-util:= |
1462 |
- dev-libs/libxml2:= |
1463 |
- net-misc/curl |
1464 |
- www-servers/apache |
1465 |
- ) |
1466 |
- nginx_modules_http_auth_ldap? ( net-nds/openldap[ssl?] ) |
1467 |
- nginx_modules_stream_geoip? ( dev-libs/geoip ) |
1468 |
- nginx_modules_stream_geoip2? ( dev-libs/libmaxminddb:= )" |
1469 |
-RDEPEND="${CDEPEND} |
1470 |
- selinux? ( sec-policy/selinux-nginx ) |
1471 |
- !www-servers/nginx:0" |
1472 |
-DEPEND="${CDEPEND} |
1473 |
- nginx_modules_http_brotli? ( virtual/pkgconfig ) |
1474 |
- nginx_modules_http_security? ( ${AUTOTOOLS_DEPEND} ) |
1475 |
- arm? ( dev-libs/libatomic_ops ) |
1476 |
- libatomic? ( dev-libs/libatomic_ops )" |
1477 |
-PDEPEND="vim-syntax? ( app-vim/nginx-syntax )" |
1478 |
- |
1479 |
-REQUIRED_USE="pcre-jit? ( pcre ) |
1480 |
- nginx_modules_http_grpc? ( http2 ) |
1481 |
- nginx_modules_http_lua? ( |
1482 |
- luajit |
1483 |
- nginx_modules_http_rewrite |
1484 |
- ) |
1485 |
- nginx_modules_http_naxsi? ( pcre ) |
1486 |
- nginx_modules_http_dav_ext? ( nginx_modules_http_dav ) |
1487 |
- nginx_modules_http_metrics? ( nginx_modules_http_stub_status ) |
1488 |
- nginx_modules_http_security? ( pcre ) |
1489 |
- nginx_modules_http_push_stream? ( ssl )" |
1490 |
- |
1491 |
-pkg_setup() { |
1492 |
- NGINX_HOME="/var/lib/nginx" |
1493 |
- NGINX_HOME_TMP="${NGINX_HOME}/tmp" |
1494 |
- |
1495 |
- ebegin "Creating nginx user and group" |
1496 |
- enewgroup ${PN} |
1497 |
- enewuser ${PN} -1 -1 "${NGINX_HOME}" ${PN} |
1498 |
- eend $? |
1499 |
- |
1500 |
- if use libatomic; then |
1501 |
- ewarn "GCC 4.1+ features built-in atomic operations." |
1502 |
- ewarn "Using libatomic_ops is only needed if using" |
1503 |
- ewarn "a different compiler or a GCC prior to 4.1" |
1504 |
- fi |
1505 |
- |
1506 |
- if [[ -n $NGINX_ADD_MODULES ]]; then |
1507 |
- ewarn "You are building custom modules via \$NGINX_ADD_MODULES!" |
1508 |
- ewarn "This nginx installation is not supported!" |
1509 |
- ewarn "Make sure you can reproduce the bug without those modules" |
1510 |
- ewarn "_before_ reporting bugs." |
1511 |
- fi |
1512 |
- |
1513 |
- if use !http; then |
1514 |
- ewarn "To actually disable all http-functionality you also have to disable" |
1515 |
- ewarn "all nginx http modules." |
1516 |
- fi |
1517 |
- |
1518 |
- if use nginx_modules_http_mogilefs && use threads; then |
1519 |
- eerror "mogilefs won't compile with threads support." |
1520 |
- eerror "Please disable either flag and try again." |
1521 |
- die "Can't compile mogilefs with threads support" |
1522 |
- fi |
1523 |
-} |
1524 |
- |
1525 |
-src_prepare() { |
1526 |
- eapply "${FILESDIR}/${PN}-1.4.1-fix-perl-install-path.patch" |
1527 |
- eapply "${FILESDIR}/${PN}-httpoxy-mitigation-r1.patch" |
1528 |
- |
1529 |
- if use nginx_modules_http_auth_pam; then |
1530 |
- cd "${HTTP_AUTH_PAM_MODULE_WD}" || die |
1531 |
- eapply "${FILESDIR}"/http_auth_pam-1.5.1-adjust-loglevel-for-authentication-failures.patch |
1532 |
- cd "${S}" || die |
1533 |
- fi |
1534 |
- |
1535 |
- if use nginx_modules_http_brotli; then |
1536 |
- cd "${HTTP_BROTLI_MODULE_WD}" || die |
1537 |
- eapply "${FILESDIR}"/http_brotli-detect-brotli-r2.patch |
1538 |
- cd "${S}" || die |
1539 |
- fi |
1540 |
- |
1541 |
- if use nginx_modules_http_upstream_check; then |
1542 |
- eapply -p0 "${FILESDIR}"/http_upstream_check-nginx-1.11.5+.patch |
1543 |
- fi |
1544 |
- |
1545 |
- if use nginx_modules_http_cache_purge; then |
1546 |
- cd "${HTTP_CACHE_PURGE_MODULE_WD}" || die |
1547 |
- eapply "${FILESDIR}"/http_cache_purge-1.11.6+.patch |
1548 |
- cd "${S}" || die |
1549 |
- fi |
1550 |
- |
1551 |
- if use nginx_modules_http_security; then |
1552 |
- cd "${HTTP_SECURITY_MODULE_WD}" || die |
1553 |
- |
1554 |
- eautoreconf |
1555 |
- |
1556 |
- if use luajit ; then |
1557 |
- sed -i \ |
1558 |
- -e 's|^\(LUA_PKGNAMES\)=.*|\1="luajit"|' \ |
1559 |
- configure || die |
1560 |
- fi |
1561 |
- |
1562 |
- cd "${S}" || die |
1563 |
- fi |
1564 |
- |
1565 |
- if use nginx_modules_http_upload_progress; then |
1566 |
- cd "${HTTP_UPLOAD_PROGRESS_MODULE_WD}" || die |
1567 |
- eapply "${FILESDIR}"/http_uploadprogress-issue_50-r1.patch |
1568 |
- cd "${S}" || die |
1569 |
- fi |
1570 |
- |
1571 |
- find auto/ -type f -print0 | xargs -0 sed -i 's:\&\& make:\&\& \\$(MAKE):' || die |
1572 |
- # We have config protection, don't rename etc files |
1573 |
- sed -i 's:.default::' auto/install || die |
1574 |
- # remove useless files |
1575 |
- sed -i -e '/koi-/d' -e '/win-/d' auto/install || die |
1576 |
- |
1577 |
- # don't install to /etc/nginx/ if not in use |
1578 |
- local module |
1579 |
- for module in fastcgi scgi uwsgi ; do |
1580 |
- if ! use nginx_modules_http_${module}; then |
1581 |
- sed -i -e "/${module}/d" auto/install || die |
1582 |
- fi |
1583 |
- done |
1584 |
- |
1585 |
- eapply_user |
1586 |
-} |
1587 |
- |
1588 |
-src_configure() { |
1589 |
- # mod_security needs to generate nginx/modsecurity/config before including it |
1590 |
- if use nginx_modules_http_security; then |
1591 |
- cd "${HTTP_SECURITY_MODULE_WD}" || die |
1592 |
- |
1593 |
- ./configure \ |
1594 |
- --enable-standalone-module \ |
1595 |
- --disable-mlogc \ |
1596 |
- --with-ssdeep=no \ |
1597 |
- $(use_enable pcre-jit) \ |
1598 |
- $(use_with nginx_modules_http_lua lua) || die "configure failed for mod_security" |
1599 |
- |
1600 |
- cd "${S}" || die |
1601 |
- fi |
1602 |
- |
1603 |
- local myconf=() http_enabled= mail_enabled= stream_enabled= |
1604 |
- |
1605 |
- use aio && myconf+=( --with-file-aio ) |
1606 |
- use debug && myconf+=( --with-debug ) |
1607 |
- use http2 && myconf+=( --with-http_v2_module ) |
1608 |
- use libatomic && myconf+=( --with-libatomic ) |
1609 |
- use pcre && myconf+=( --with-pcre ) |
1610 |
- use pcre-jit && myconf+=( --with-pcre-jit ) |
1611 |
- use threads && myconf+=( --with-threads ) |
1612 |
- |
1613 |
- # HTTP modules |
1614 |
- for mod in $NGINX_MODULES_STD; do |
1615 |
- if use nginx_modules_http_${mod}; then |
1616 |
- http_enabled=1 |
1617 |
- else |
1618 |
- myconf+=( --without-http_${mod}_module ) |
1619 |
- fi |
1620 |
- done |
1621 |
- |
1622 |
- for mod in $NGINX_MODULES_OPT; do |
1623 |
- if use nginx_modules_http_${mod}; then |
1624 |
- http_enabled=1 |
1625 |
- myconf+=( --with-http_${mod}_module ) |
1626 |
- fi |
1627 |
- done |
1628 |
- |
1629 |
- if use nginx_modules_http_fastcgi; then |
1630 |
- myconf+=( --with-http_realip_module ) |
1631 |
- fi |
1632 |
- |
1633 |
- # third-party modules |
1634 |
- if use nginx_modules_http_upload_progress; then |
1635 |
- http_enabled=1 |
1636 |
- myconf+=( --add-module=${HTTP_UPLOAD_PROGRESS_MODULE_WD} ) |
1637 |
- fi |
1638 |
- |
1639 |
- if use nginx_modules_http_headers_more; then |
1640 |
- http_enabled=1 |
1641 |
- myconf+=( --add-module=${HTTP_HEADERS_MORE_MODULE_WD} ) |
1642 |
- fi |
1643 |
- |
1644 |
- if use nginx_modules_http_cache_purge; then |
1645 |
- http_enabled=1 |
1646 |
- myconf+=( --add-module=${HTTP_CACHE_PURGE_MODULE_WD} ) |
1647 |
- fi |
1648 |
- |
1649 |
- if use nginx_modules_http_slowfs_cache; then |
1650 |
- http_enabled=1 |
1651 |
- myconf+=( --add-module=${HTTP_SLOWFS_CACHE_MODULE_WD} ) |
1652 |
- fi |
1653 |
- |
1654 |
- if use nginx_modules_http_fancyindex; then |
1655 |
- http_enabled=1 |
1656 |
- myconf+=( --add-module=${HTTP_FANCYINDEX_MODULE_WD} ) |
1657 |
- fi |
1658 |
- |
1659 |
- if use nginx_modules_http_lua; then |
1660 |
- http_enabled=1 |
1661 |
- export LUAJIT_LIB=$(pkg-config --variable libdir luajit) |
1662 |
- export LUAJIT_INC=$(pkg-config --variable includedir luajit) |
1663 |
- myconf+=( --add-module=${DEVEL_KIT_MODULE_WD} ) |
1664 |
- myconf+=( --add-module=${HTTP_LUA_MODULE_WD} ) |
1665 |
- fi |
1666 |
- |
1667 |
- if use nginx_modules_http_auth_pam; then |
1668 |
- http_enabled=1 |
1669 |
- myconf+=( --add-module=${HTTP_AUTH_PAM_MODULE_WD} ) |
1670 |
- fi |
1671 |
- |
1672 |
- if use nginx_modules_http_upstream_check; then |
1673 |
- http_enabled=1 |
1674 |
- myconf+=( --add-module=${HTTP_UPSTREAM_CHECK_MODULE_WD} ) |
1675 |
- fi |
1676 |
- |
1677 |
- if use nginx_modules_http_metrics; then |
1678 |
- http_enabled=1 |
1679 |
- myconf+=( --add-module=${HTTP_METRICS_MODULE_WD} ) |
1680 |
- fi |
1681 |
- |
1682 |
- if use nginx_modules_http_naxsi ; then |
1683 |
- http_enabled=1 |
1684 |
- myconf+=( --add-module=${HTTP_NAXSI_MODULE_WD} ) |
1685 |
- fi |
1686 |
- |
1687 |
- if use rtmp ; then |
1688 |
- http_enabled=1 |
1689 |
- myconf+=( --add-module=${RTMP_MODULE_WD} ) |
1690 |
- fi |
1691 |
- |
1692 |
- if use nginx_modules_http_dav_ext ; then |
1693 |
- http_enabled=1 |
1694 |
- myconf+=( --add-module=${HTTP_DAV_EXT_MODULE_WD} ) |
1695 |
- fi |
1696 |
- |
1697 |
- if use nginx_modules_http_echo ; then |
1698 |
- http_enabled=1 |
1699 |
- myconf+=( --add-module=${HTTP_ECHO_MODULE_WD} ) |
1700 |
- fi |
1701 |
- |
1702 |
- if use nginx_modules_http_security ; then |
1703 |
- http_enabled=1 |
1704 |
- myconf+=( --add-module=${HTTP_SECURITY_MODULE_WD}/nginx/modsecurity ) |
1705 |
- fi |
1706 |
- |
1707 |
- if use nginx_modules_http_push_stream ; then |
1708 |
- http_enabled=1 |
1709 |
- myconf+=( --add-module=${HTTP_PUSH_STREAM_MODULE_WD} ) |
1710 |
- fi |
1711 |
- |
1712 |
- if use nginx_modules_http_sticky ; then |
1713 |
- http_enabled=1 |
1714 |
- myconf+=( --add-module=${HTTP_STICKY_MODULE_WD} ) |
1715 |
- fi |
1716 |
- |
1717 |
- if use nginx_modules_http_mogilefs ; then |
1718 |
- http_enabled=1 |
1719 |
- myconf+=( --add-module=${HTTP_MOGILEFS_MODULE_WD} ) |
1720 |
- fi |
1721 |
- |
1722 |
- if use nginx_modules_http_memc ; then |
1723 |
- http_enabled=1 |
1724 |
- myconf+=( --add-module=${HTTP_MEMC_MODULE_WD} ) |
1725 |
- fi |
1726 |
- |
1727 |
- if use nginx_modules_http_auth_ldap; then |
1728 |
- http_enabled=1 |
1729 |
- myconf+=( --add-module=${HTTP_LDAP_MODULE_WD} ) |
1730 |
- fi |
1731 |
- |
1732 |
- if use nginx_modules_http_vhost_traffic_status; then |
1733 |
- http_enabled=1 |
1734 |
- myconf+=( --add-module=${HTTP_VHOST_TRAFFIC_STATUS_MODULE_WD} ) |
1735 |
- fi |
1736 |
- |
1737 |
- if use nginx_modules_http_geoip2 || use nginx_modules_stream_geoip2; then |
1738 |
- myconf+=( --add-module=${GEOIP2_MODULE_WD} ) |
1739 |
- fi |
1740 |
- |
1741 |
- if use nginx_modules_http_javascript || use nginx_modules_stream_javascript; then |
1742 |
- myconf+=( --add-module="${NJS_MODULE_WD}/nginx" ) |
1743 |
- fi |
1744 |
- |
1745 |
- if use nginx_modules_http_brotli; then |
1746 |
- http_enabled=1 |
1747 |
- myconf+=( --add-module=${HTTP_BROTLI_MODULE_WD} ) |
1748 |
- fi |
1749 |
- |
1750 |
- if use http || use http-cache || use http2 || use nginx_modules_http_javascript; then |
1751 |
- http_enabled=1 |
1752 |
- fi |
1753 |
- |
1754 |
- if [ $http_enabled ]; then |
1755 |
- use http-cache || myconf+=( --without-http-cache ) |
1756 |
- use ssl && myconf+=( --with-http_ssl_module ) |
1757 |
- else |
1758 |
- myconf+=( --without-http --without-http-cache ) |
1759 |
- fi |
1760 |
- |
1761 |
- # Stream modules |
1762 |
- for mod in $NGINX_MODULES_STREAM_STD; do |
1763 |
- if use nginx_modules_stream_${mod}; then |
1764 |
- stream_enabled=1 |
1765 |
- else |
1766 |
- myconf+=( --without-stream_${mod}_module ) |
1767 |
- fi |
1768 |
- done |
1769 |
- |
1770 |
- for mod in $NGINX_MODULES_STREAM_OPT; do |
1771 |
- if use nginx_modules_stream_${mod}; then |
1772 |
- stream_enabled=1 |
1773 |
- myconf+=( --with-stream_${mod}_module ) |
1774 |
- fi |
1775 |
- done |
1776 |
- |
1777 |
- if use nginx_modules_stream_geoip2 || use nginx_modules_stream_javascript; then |
1778 |
- stream_enabled=1 |
1779 |
- fi |
1780 |
- |
1781 |
- if [ $stream_enabled ]; then |
1782 |
- myconf+=( --with-stream ) |
1783 |
- use ssl && myconf+=( --with-stream_ssl_module ) |
1784 |
- fi |
1785 |
- |
1786 |
- # MAIL modules |
1787 |
- for mod in $NGINX_MODULES_MAIL; do |
1788 |
- if use nginx_modules_mail_${mod}; then |
1789 |
- mail_enabled=1 |
1790 |
- else |
1791 |
- myconf+=( --without-mail_${mod}_module ) |
1792 |
- fi |
1793 |
- done |
1794 |
- |
1795 |
- if [ $mail_enabled ]; then |
1796 |
- myconf+=( --with-mail ) |
1797 |
- use ssl && myconf+=( --with-mail_ssl_module ) |
1798 |
- fi |
1799 |
- |
1800 |
- # custom modules |
1801 |
- for mod in $NGINX_ADD_MODULES; do |
1802 |
- myconf+=( --add-module=${mod} ) |
1803 |
- done |
1804 |
- |
1805 |
- # https://bugs.gentoo.org/286772 |
1806 |
- export LANG=C LC_ALL=C |
1807 |
- tc-export CC |
1808 |
- |
1809 |
- if ! use prefix; then |
1810 |
- myconf+=( --user=${PN} ) |
1811 |
- myconf+=( --group=${PN} ) |
1812 |
- fi |
1813 |
- |
1814 |
- local WITHOUT_IPV6= |
1815 |
- if ! use ipv6; then |
1816 |
- WITHOUT_IPV6=" -DNGX_HAVE_INET6=0" |
1817 |
- fi |
1818 |
- |
1819 |
- if [[ -n "${EXTRA_ECONF}" ]]; then |
1820 |
- myconf+=( ${EXTRA_ECONF} ) |
1821 |
- ewarn "EXTRA_ECONF applied. Now you are on your own, good luck!" |
1822 |
- fi |
1823 |
- |
1824 |
- ./configure \ |
1825 |
- --prefix="${EPREFIX}"/usr \ |
1826 |
- --conf-path="${EPREFIX}"/etc/${PN}/${PN}.conf \ |
1827 |
- --error-log-path="${EPREFIX}"/var/log/${PN}/error_log \ |
1828 |
- --pid-path="${EPREFIX}"/run/${PN}.pid \ |
1829 |
- --lock-path="${EPREFIX}"/run/lock/${PN}.lock \ |
1830 |
- --with-cc-opt="-I${EROOT}usr/include${WITHOUT_IPV6}" \ |
1831 |
- --with-ld-opt="-L${EROOT}usr/$(get_libdir)" \ |
1832 |
- --http-log-path="${EPREFIX}"/var/log/${PN}/access_log \ |
1833 |
- --http-client-body-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/client \ |
1834 |
- --http-proxy-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/proxy \ |
1835 |
- --http-fastcgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/fastcgi \ |
1836 |
- --http-scgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/scgi \ |
1837 |
- --http-uwsgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/uwsgi \ |
1838 |
- --with-compat \ |
1839 |
- "${myconf[@]}" || die "configure failed" |
1840 |
- |
1841 |
- # A purely cosmetic change that makes nginx -V more readable. This can be |
1842 |
- # good if people outside the gentoo community would troubleshoot and |
1843 |
- # question the users setup. |
1844 |
- sed -i -e "s|${WORKDIR}|external_module|g" objs/ngx_auto_config.h || die |
1845 |
-} |
1846 |
- |
1847 |
-src_compile() { |
1848 |
- use nginx_modules_http_security && emake -C "${HTTP_SECURITY_MODULE_WD}" |
1849 |
- |
1850 |
- # https://bugs.gentoo.org/286772 |
1851 |
- export LANG=C LC_ALL=C |
1852 |
- emake LINK="${CC} ${LDFLAGS}" OTHERLDFLAGS="${LDFLAGS}" |
1853 |
-} |
1854 |
- |
1855 |
-src_install() { |
1856 |
- emake DESTDIR="${D%/}" install |
1857 |
- |
1858 |
- cp "${FILESDIR}"/nginx.conf-r2 "${ED}"etc/nginx/nginx.conf || die |
1859 |
- |
1860 |
- newinitd "${FILESDIR}"/nginx.initd-r4 nginx |
1861 |
- newconfd "${FILESDIR}"/nginx.confd nginx |
1862 |
- |
1863 |
- systemd_newunit "${FILESDIR}"/nginx.service-r1 nginx.service |
1864 |
- |
1865 |
- doman man/nginx.8 |
1866 |
- dodoc CHANGES* README |
1867 |
- |
1868 |
- # just keepdir. do not copy the default htdocs files (bug #449136) |
1869 |
- keepdir /var/www/localhost |
1870 |
- rm -rf "${D}"usr/html || die |
1871 |
- |
1872 |
- # set up a list of directories to keep |
1873 |
- local keepdir_list="${NGINX_HOME_TMP}"/client |
1874 |
- local module |
1875 |
- for module in proxy fastcgi scgi uwsgi; do |
1876 |
- use nginx_modules_http_${module} && keepdir_list+=" ${NGINX_HOME_TMP}/${module}" |
1877 |
- done |
1878 |
- |
1879 |
- keepdir /var/log/nginx ${keepdir_list} |
1880 |
- |
1881 |
- # this solves a problem with SELinux where nginx doesn't see the directories |
1882 |
- # as root and tries to create them as nginx |
1883 |
- fperms 0750 "${NGINX_HOME_TMP}" |
1884 |
- fowners ${PN}:0 "${NGINX_HOME_TMP}" |
1885 |
- |
1886 |
- fperms 0700 ${keepdir_list} |
1887 |
- fowners ${PN}:${PN} ${keepdir_list} |
1888 |
- |
1889 |
- fperms 0710 /var/log/nginx |
1890 |
- fowners 0:${PN} /var/log/nginx |
1891 |
- |
1892 |
- # logrotate |
1893 |
- insinto /etc/logrotate.d |
1894 |
- newins "${FILESDIR}"/nginx.logrotate-r1 nginx |
1895 |
- |
1896 |
- if use luajit; then |
1897 |
- pax-mark m "${ED%/}/usr/sbin/nginx" |
1898 |
- fi |
1899 |
- |
1900 |
- if use nginx_modules_http_perl; then |
1901 |
- cd "${S}"/objs/src/http/modules/perl/ || die |
1902 |
- emake DESTDIR="${D}" INSTALLDIRS=vendor |
1903 |
- perl_delete_localpod |
1904 |
- cd "${S}" || die |
1905 |
- fi |
1906 |
- |
1907 |
- if use nginx_modules_http_cache_purge; then |
1908 |
- docinto ${HTTP_CACHE_PURGE_MODULE_P} |
1909 |
- dodoc "${HTTP_CACHE_PURGE_MODULE_WD}"/{CHANGES,README.md,TODO.md} |
1910 |
- fi |
1911 |
- |
1912 |
- if use nginx_modules_http_slowfs_cache; then |
1913 |
- docinto ${HTTP_SLOWFS_CACHE_MODULE_P} |
1914 |
- dodoc "${HTTP_SLOWFS_CACHE_MODULE_WD}"/{CHANGES,README.md} |
1915 |
- fi |
1916 |
- |
1917 |
- if use nginx_modules_http_fancyindex; then |
1918 |
- docinto ${HTTP_FANCYINDEX_MODULE_P} |
1919 |
- dodoc "${HTTP_FANCYINDEX_MODULE_WD}"/README.rst |
1920 |
- fi |
1921 |
- |
1922 |
- if use nginx_modules_http_lua; then |
1923 |
- docinto ${HTTP_LUA_MODULE_P} |
1924 |
- dodoc "${HTTP_LUA_MODULE_WD}"/README.markdown |
1925 |
- fi |
1926 |
- |
1927 |
- if use nginx_modules_http_auth_pam; then |
1928 |
- docinto ${HTTP_AUTH_PAM_MODULE_P} |
1929 |
- dodoc "${HTTP_AUTH_PAM_MODULE_WD}"/{README.md,ChangeLog} |
1930 |
- fi |
1931 |
- |
1932 |
- if use nginx_modules_http_upstream_check; then |
1933 |
- docinto ${HTTP_UPSTREAM_CHECK_MODULE_P} |
1934 |
- dodoc "${HTTP_UPSTREAM_CHECK_MODULE_WD}"/{README,CHANGES} |
1935 |
- fi |
1936 |
- |
1937 |
- if use nginx_modules_http_naxsi; then |
1938 |
- insinto /etc/nginx |
1939 |
- doins "${HTTP_NAXSI_MODULE_WD}"/../naxsi_config/naxsi_core.rules |
1940 |
- fi |
1941 |
- |
1942 |
- if use rtmp; then |
1943 |
- docinto ${RTMP_MODULE_P} |
1944 |
- dodoc "${RTMP_MODULE_WD}"/{AUTHORS,README.md,stat.xsl} |
1945 |
- fi |
1946 |
- |
1947 |
- if use nginx_modules_http_dav_ext; then |
1948 |
- docinto ${HTTP_DAV_EXT_MODULE_P} |
1949 |
- dodoc "${HTTP_DAV_EXT_MODULE_WD}"/README.rst |
1950 |
- fi |
1951 |
- |
1952 |
- if use nginx_modules_http_echo; then |
1953 |
- docinto ${HTTP_ECHO_MODULE_P} |
1954 |
- dodoc "${HTTP_ECHO_MODULE_WD}"/README.markdown |
1955 |
- fi |
1956 |
- |
1957 |
- if use nginx_modules_http_security; then |
1958 |
- docinto ${HTTP_SECURITY_MODULE_P} |
1959 |
- dodoc "${HTTP_SECURITY_MODULE_WD}"/{CHANGES,README.md,authors.txt} |
1960 |
- fi |
1961 |
- |
1962 |
- if use nginx_modules_http_push_stream; then |
1963 |
- docinto ${HTTP_PUSH_STREAM_MODULE_P} |
1964 |
- dodoc "${HTTP_PUSH_STREAM_MODULE_WD}"/{AUTHORS,CHANGELOG.textile,README.textile} |
1965 |
- fi |
1966 |
- |
1967 |
- if use nginx_modules_http_sticky; then |
1968 |
- docinto ${HTTP_STICKY_MODULE_P} |
1969 |
- dodoc "${HTTP_STICKY_MODULE_WD}"/{README.md,Changelog.txt,docs/sticky.pdf} |
1970 |
- fi |
1971 |
- |
1972 |
- if use nginx_modules_http_memc; then |
1973 |
- docinto ${HTTP_MEMC_MODULE_P} |
1974 |
- dodoc "${HTTP_MEMC_MODULE_WD}"/README.markdown |
1975 |
- fi |
1976 |
- |
1977 |
- if use nginx_modules_http_auth_ldap; then |
1978 |
- docinto ${HTTP_LDAP_MODULE_P} |
1979 |
- dodoc "${HTTP_LDAP_MODULE_WD}"/example.conf |
1980 |
- fi |
1981 |
-} |
1982 |
- |
1983 |
-pkg_postinst() { |
1984 |
- if use ssl; then |
1985 |
- if [[ ! -f "${EROOT}"etc/ssl/${PN}/${PN}.key ]]; then |
1986 |
- install_cert /etc/ssl/${PN}/${PN} |
1987 |
- use prefix || chown ${PN}:${PN} "${EROOT}"etc/ssl/${PN}/${PN}.{crt,csr,key,pem} |
1988 |
- fi |
1989 |
- fi |
1990 |
- |
1991 |
- if use nginx_modules_http_spdy; then |
1992 |
- ewarn "" |
1993 |
- ewarn "In nginx 1.9.5 the spdy module was superseded by http2." |
1994 |
- ewarn "Update your configs and package.use accordingly." |
1995 |
- fi |
1996 |
- |
1997 |
- if use nginx_modules_http_lua; then |
1998 |
- ewarn "" |
1999 |
- ewarn "While you can build lua 3rd party module against ${P}" |
2000 |
- ewarn "the author warns that >=${PN}-1.11.11 is still not an" |
2001 |
- ewarn "officially supported target yet. You are on your own." |
2002 |
- ewarn "Expect runtime failures, memory leaks and other problems!" |
2003 |
- fi |
2004 |
- |
2005 |
- if use nginx_modules_http_lua && use http2; then |
2006 |
- ewarn "" |
2007 |
- ewarn "Lua 3rd party module author warns against using ${P} with" |
2008 |
- ewarn "NGINX_MODULES_HTTP=\"lua http2\". For more info, see https://git.io/OldLsg" |
2009 |
- fi |
2010 |
- |
2011 |
- local _n_permission_layout_checks=0 |
2012 |
- local _has_to_adjust_permissions=0 |
2013 |
- local _has_to_show_permission_warning=0 |
2014 |
- |
2015 |
- # Defaults to 1 to inform people doing a fresh installation |
2016 |
- # that we ship modified {scgi,uwsgi,fastcgi}_params files |
2017 |
- local _has_to_show_httpoxy_mitigation_notice=1 |
2018 |
- |
2019 |
- local _replacing_version= |
2020 |
- for _replacing_version in ${REPLACING_VERSIONS}; do |
2021 |
- _n_permission_layout_checks=$((${_n_permission_layout_checks}+1)) |
2022 |
- |
2023 |
- if [[ ${_n_permission_layout_checks} -gt 1 ]]; then |
2024 |
- # Should never happen: |
2025 |
- # Package is abusing slots but doesn't allow multiple parallel installations. |
2026 |
- # If we run into this situation it is unsafe to automatically adjust any |
2027 |
- # permission... |
2028 |
- _has_to_show_permission_warning=1 |
2029 |
- |
2030 |
- ewarn "Replacing multiple ${PN}' versions is unsupported! " \ |
2031 |
- "You will have to adjust permissions on your own." |
2032 |
- |
2033 |
- break |
2034 |
- fi |
2035 |
- |
2036 |
- local _replacing_version_branch=$(get_version_component_range 1-2 "${_replacing_version}") |
2037 |
- debug-print "Updating an existing installation (v${_replacing_version}; branch '${_replacing_version_branch}') ..." |
2038 |
- |
2039 |
- # Do we need to adjust permissions to fix CVE-2013-0337 (bug #458726, #469094)? |
2040 |
- # This was before we introduced multiple nginx versions so we |
2041 |
- # do not need to distinguish between stable and mainline |
2042 |
- local _need_to_fix_CVE2013_0337=1 |
2043 |
- |
2044 |
- if version_is_at_least "1.4.1-r2" "${_replacing_version}"; then |
2045 |
- # We are updating an installation which should already be fixed |
2046 |
- _need_to_fix_CVE2013_0337=0 |
2047 |
- debug-print "Skipping CVE-2013-0337 ... existing installation should not be affected!" |
2048 |
- else |
2049 |
- _has_to_adjust_permissions=1 |
2050 |
- debug-print "Need to adjust permissions to fix CVE-2013-0337!" |
2051 |
- fi |
2052 |
- |
2053 |
- # Do we need to inform about HTTPoxy mitigation? |
2054 |
- # In repository since commit 8be44f76d4ac02cebcd1e0e6e6284bb72d054b0f |
2055 |
- if ! version_is_at_least "1.10" "${_replacing_version_branch}"; then |
2056 |
- # Updating from <1.10 |
2057 |
- _has_to_show_httpoxy_mitigation_notice=1 |
2058 |
- debug-print "Need to inform about HTTPoxy mitigation!" |
2059 |
- else |
2060 |
- # Updating from >=1.10 |
2061 |
- local _fixed_in_pvr= |
2062 |
- case "${_replacing_version_branch}" in |
2063 |
- "1.10") |
2064 |
- _fixed_in_pvr="1.10.1-r2" |
2065 |
- ;; |
2066 |
- "1.11") |
2067 |
- _fixed_in_pvr="1.11.3-r1" |
2068 |
- ;; |
2069 |
- *) |
2070 |
- # This should be any future branch. |
2071 |
- # If we run this code it is safe to assume that the user has |
2072 |
- # already seen the HTTPoxy mitigation notice because he/she is doing |
2073 |
- # an update from previous version where we have already shown |
2074 |
- # the warning. Otherwise, we wouldn't hit this code path ... |
2075 |
- _fixed_in_pvr= |
2076 |
- esac |
2077 |
- |
2078 |
- if [[ -z "${_fixed_in_pvr}" ]] || version_is_at_least "${_fixed_in_pvr}" "${_replacing_version}"; then |
2079 |
- # We are updating an installation where we already informed |
2080 |
- # that we are mitigating HTTPoxy per default |
2081 |
- _has_to_show_httpoxy_mitigation_notice=0 |
2082 |
- debug-print "No need to inform about HTTPoxy mitigation ... information was already shown for existing installation!" |
2083 |
- else |
2084 |
- _has_to_show_httpoxy_mitigation_notice=1 |
2085 |
- debug-print "Need to inform about HTTPoxy mitigation!" |
2086 |
- fi |
2087 |
- fi |
2088 |
- |
2089 |
- # Do we need to adjust permissions to fix CVE-2016-1247 (bug #605008)? |
2090 |
- # All branches up to 1.11 are affected |
2091 |
- local _need_to_fix_CVE2016_1247=1 |
2092 |
- |
2093 |
- if ! version_is_at_least "1.10" "${_replacing_version_branch}"; then |
2094 |
- # Updating from <1.10 |
2095 |
- _has_to_adjust_permissions=1 |
2096 |
- debug-print "Need to adjust permissions to fix CVE-2016-1247!" |
2097 |
- else |
2098 |
- # Updating from >=1.10 |
2099 |
- local _fixed_in_pvr= |
2100 |
- case "${_replacing_version_branch}" in |
2101 |
- "1.10") |
2102 |
- _fixed_in_pvr="1.10.2-r3" |
2103 |
- ;; |
2104 |
- "1.11") |
2105 |
- _fixed_in_pvr="1.11.6-r1" |
2106 |
- ;; |
2107 |
- *) |
2108 |
- # This should be any future branch. |
2109 |
- # If we run this code it is safe to assume that we have already |
2110 |
- # adjusted permissions or were never affected because user is |
2111 |
- # doing an update from previous version which was safe or did |
2112 |
- # the adjustments. Otherwise, we wouldn't hit this code path ... |
2113 |
- _fixed_in_pvr= |
2114 |
- esac |
2115 |
- |
2116 |
- if [[ -z "${_fixed_in_pvr}" ]] || version_is_at_least "${_fixed_in_pvr}" "${_replacing_version}"; then |
2117 |
- # We are updating an installation which should already be adjusted |
2118 |
- # or which was never affected |
2119 |
- _need_to_fix_CVE2016_1247=0 |
2120 |
- debug-print "Skipping CVE-2016-1247 ... existing installation should not be affected!" |
2121 |
- else |
2122 |
- _has_to_adjust_permissions=1 |
2123 |
- debug-print "Need to adjust permissions to fix CVE-2016-1247!" |
2124 |
- fi |
2125 |
- fi |
2126 |
- done |
2127 |
- |
2128 |
- if [[ ${_has_to_adjust_permissions} -eq 1 ]]; then |
2129 |
- # We do not DIE when chmod/chown commands are failing because |
2130 |
- # package is already merged on user's system at this stage |
2131 |
- # and we cannot retry without losing the information that |
2132 |
- # the existing installation needs to adjust permissions. |
2133 |
- # Instead we are going to a show a big warning ... |
2134 |
- |
2135 |
- if [[ ${_has_to_show_permission_warning} -eq 0 ]] && [[ ${_need_to_fix_CVE2013_0337} -eq 1 ]]; then |
2136 |
- ewarn "" |
2137 |
- ewarn "The world-readable bit (if set) has been removed from the" |
2138 |
- ewarn "following directories to mitigate a security bug" |
2139 |
- ewarn "(CVE-2013-0337, bug #458726):" |
2140 |
- ewarn "" |
2141 |
- ewarn " ${EPREFIX%/}/var/log/nginx" |
2142 |
- ewarn " ${EPREFIX%/}${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi}" |
2143 |
- ewarn "" |
2144 |
- ewarn "Check if this is correct for your setup before restarting nginx!" |
2145 |
- ewarn "This is a one-time change and will not happen on subsequent updates." |
2146 |
- ewarn "Furthermore nginx' temp directories got moved to '${EPREFIX%/}${NGINX_HOME_TMP}'" |
2147 |
- chmod o-rwx \ |
2148 |
- "${EPREFIX%/}"/var/log/nginx \ |
2149 |
- "${EPREFIX%/}"${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi} || \ |
2150 |
- _has_to_show_permission_warning=1 |
2151 |
- fi |
2152 |
- |
2153 |
- if [[ ${_has_to_show_permission_warning} -eq 0 ]] && [[ ${_need_to_fix_CVE2016_1247} -eq 1 ]]; then |
2154 |
- ewarn "" |
2155 |
- ewarn "The permissions on the following directory have been reset in" |
2156 |
- ewarn "order to mitigate a security bug (CVE-2016-1247, bug #605008):" |
2157 |
- ewarn "" |
2158 |
- ewarn " ${EPREFIX%/}/var/log/nginx" |
2159 |
- ewarn "" |
2160 |
- ewarn "Check if this is correct for your setup before restarting nginx!" |
2161 |
- ewarn "Also ensure that no other log directory used by any of your" |
2162 |
- ewarn "vhost(s) is not writeable for nginx user. Any of your log files" |
2163 |
- ewarn "used by nginx can be abused to escalate privileges!" |
2164 |
- ewarn "This is a one-time change and will not happen on subsequent updates." |
2165 |
- chown 0:nginx "${EPREFIX%/}"/var/log/nginx || _has_to_show_permission_warning=1 |
2166 |
- chmod 710 "${EPREFIX%/}"/var/log/nginx || _has_to_show_permission_warning=1 |
2167 |
- fi |
2168 |
- |
2169 |
- if [[ ${_has_to_show_permission_warning} -eq 1 ]]; then |
2170 |
- # Should never happen ... |
2171 |
- ewarn "" |
2172 |
- ewarn "*************************************************************" |
2173 |
- ewarn "*************** W A R N I N G ***************" |
2174 |
- ewarn "*************************************************************" |
2175 |
- ewarn "The one-time only attempt to adjust permissions of the" |
2176 |
- ewarn "existing nginx installation failed. Be aware that we will not" |
2177 |
- ewarn "try to adjust the same permissions again because now you are" |
2178 |
- ewarn "using a nginx version where we expect that the permissions" |
2179 |
- ewarn "are already adjusted or that you know what you are doing and" |
2180 |
- ewarn "want to keep custom permissions." |
2181 |
- ewarn "" |
2182 |
- fi |
2183 |
- fi |
2184 |
- |
2185 |
- # Sanity check for CVE-2016-1247 |
2186 |
- # Required to warn users who received the warning above and thought |
2187 |
- # they could fix it by unmerging and re-merging the package or have |
2188 |
- # unmerged a affected installation on purpose in the past leaving |
2189 |
- # /var/log/nginx on their system due to keepdir/non-empty folder |
2190 |
- # and are now installing the package again. |
2191 |
- local _sanity_check_testfile=$(mktemp --dry-run "${EPREFIX%/}"/var/log/nginx/.CVE-2016-1247.XXXXXXXXX) |
2192 |
- su -s /bin/sh -c "touch ${_sanity_check_testfile}" nginx >&/dev/null |
2193 |
- if [ $? -eq 0 ] ; then |
2194 |
- # Cleanup -- no reason to die here! |
2195 |
- rm -f "${_sanity_check_testfile}" |
2196 |
- |
2197 |
- ewarn "" |
2198 |
- ewarn "*************************************************************" |
2199 |
- ewarn "*************** W A R N I N G ***************" |
2200 |
- ewarn "*************************************************************" |
2201 |
- ewarn "Looks like your installation is vulnerable to CVE-2016-1247" |
2202 |
- ewarn "(bug #605008) because nginx user is able to create files in" |
2203 |
- ewarn "" |
2204 |
- ewarn " ${EPREFIX%/}/var/log/nginx" |
2205 |
- ewarn "" |
2206 |
- ewarn "Also ensure that no other log directory used by any of your" |
2207 |
- ewarn "vhost(s) is not writeable for nginx user. Any of your log files" |
2208 |
- ewarn "used by nginx can be abused to escalate privileges!" |
2209 |
- fi |
2210 |
- |
2211 |
- if [[ ${_has_to_show_httpoxy_mitigation_notice} -eq 1 ]]; then |
2212 |
- # HTTPoxy mitigation |
2213 |
- ewarn "" |
2214 |
- ewarn "This nginx installation comes with a mitigation for the HTTPoxy" |
2215 |
- ewarn "vulnerability for FastCGI, SCGI and uWSGI applications by setting" |
2216 |
- ewarn "the HTTP_PROXY parameter to an empty string per default when you" |
2217 |
- ewarn "are sourcing one of the default" |
2218 |
- ewarn "" |
2219 |
- ewarn " - 'fastcgi_params' or 'fastcgi.conf'" |
2220 |
- ewarn " - 'scgi_params'" |
2221 |
- ewarn " - 'uwsgi_params'" |
2222 |
- ewarn "" |
2223 |
- ewarn "files in your server block(s)." |
2224 |
- ewarn "" |
2225 |
- ewarn "If this is causing any problems for you make sure that you are sourcing the" |
2226 |
- ewarn "default parameters _before_ you set your own values." |
2227 |
- ewarn "If you are relying on user-supplied proxy values you have to remove the" |
2228 |
- ewarn "correlating lines from the file(s) mentioned above." |
2229 |
- ewarn "" |
2230 |
- fi |
2231 |
-} |
2232 |
|
2233 |
diff --git a/www-servers/nginx/nginx-1.17.5.ebuild b/www-servers/nginx/nginx-1.17.5.ebuild |
2234 |
deleted file mode 100644 |
2235 |
index 881ff630472..00000000000 |
2236 |
--- a/www-servers/nginx/nginx-1.17.5.ebuild |
2237 |
+++ /dev/null |
2238 |
@@ -1,1089 +0,0 @@ |
2239 |
-# Copyright 1999-2019 Gentoo Authors |
2240 |
-# Distributed under the terms of the GNU General Public License v2 |
2241 |
- |
2242 |
-EAPI="6" |
2243 |
- |
2244 |
-# Maintainer notes: |
2245 |
-# - http_rewrite-independent pcre-support makes sense for matching locations without an actual rewrite |
2246 |
-# - any http-module activates the main http-functionality and overrides USE=-http |
2247 |
-# - keep the following requirements in mind before adding external modules: |
2248 |
-# * alive upstream |
2249 |
-# * sane packaging |
2250 |
-# * builds cleanly |
2251 |
-# * does not need a patch for nginx core |
2252 |
-# - TODO: test the google-perftools module (included in vanilla tarball) |
2253 |
- |
2254 |
-# prevent perl-module from adding automagic perl DEPENDs |
2255 |
-GENTOO_DEPEND_ON_PERL="no" |
2256 |
- |
2257 |
-# devel_kit (https://github.com/simpl/ngx_devel_kit, BSD license) |
2258 |
-DEVEL_KIT_MODULE_PV="0.3.1" |
2259 |
-DEVEL_KIT_MODULE_P="ngx_devel_kit-${DEVEL_KIT_MODULE_PV}" |
2260 |
-DEVEL_KIT_MODULE_URI="https://github.com/simpl/ngx_devel_kit/archive/v${DEVEL_KIT_MODULE_PV}.tar.gz" |
2261 |
-DEVEL_KIT_MODULE_WD="${WORKDIR}/ngx_devel_kit-${DEVEL_KIT_MODULE_PV}" |
2262 |
- |
2263 |
-# ngx_brotli (https://github.com/eustas/ngx_brotli, BSD-2) |
2264 |
-HTTP_BROTLI_MODULE_PV="8104036af9cff4b1d34f22d00ba857e2a93a243c" |
2265 |
-HTTP_BROTLI_MODULE_P="ngx_brotli-${HTTP_BROTLI_MODULE_PV}" |
2266 |
-HTTP_BROTLI_MODULE_URI="https://github.com/eustas/ngx_brotli/archive/${HTTP_BROTLI_MODULE_PV}.tar.gz" |
2267 |
-HTTP_BROTLI_MODULE_WD="${WORKDIR}/ngx_brotli-${HTTP_BROTLI_MODULE_PV}" |
2268 |
- |
2269 |
-# http_uploadprogress (https://github.com/masterzen/nginx-upload-progress-module, BSD-2 license) |
2270 |
-HTTP_UPLOAD_PROGRESS_MODULE_PV="0.9.2" |
2271 |
-HTTP_UPLOAD_PROGRESS_MODULE_P="ngx_http_upload_progress-${HTTP_UPLOAD_PROGRESS_MODULE_PV}-r1" |
2272 |
-HTTP_UPLOAD_PROGRESS_MODULE_URI="https://github.com/masterzen/nginx-upload-progress-module/archive/v${HTTP_UPLOAD_PROGRESS_MODULE_PV}.tar.gz" |
2273 |
-HTTP_UPLOAD_PROGRESS_MODULE_WD="${WORKDIR}/nginx-upload-progress-module-${HTTP_UPLOAD_PROGRESS_MODULE_PV}" |
2274 |
- |
2275 |
-# http_headers_more (https://github.com/agentzh/headers-more-nginx-module, BSD license) |
2276 |
-HTTP_HEADERS_MORE_MODULE_PV="0.33" |
2277 |
-HTTP_HEADERS_MORE_MODULE_P="ngx_http_headers_more-${HTTP_HEADERS_MORE_MODULE_PV}" |
2278 |
-HTTP_HEADERS_MORE_MODULE_URI="https://github.com/agentzh/headers-more-nginx-module/archive/v${HTTP_HEADERS_MORE_MODULE_PV}.tar.gz" |
2279 |
-HTTP_HEADERS_MORE_MODULE_WD="${WORKDIR}/headers-more-nginx-module-${HTTP_HEADERS_MORE_MODULE_PV}" |
2280 |
- |
2281 |
-# http_cache_purge (http://labs.frickle.com/nginx_ngx_cache_purge/, https://github.com/FRiCKLE/ngx_cache_purge, BSD-2 license) |
2282 |
-HTTP_CACHE_PURGE_MODULE_PV="2.3" |
2283 |
-HTTP_CACHE_PURGE_MODULE_P="ngx_http_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}" |
2284 |
-HTTP_CACHE_PURGE_MODULE_URI="http://labs.frickle.com/files/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}.tar.gz" |
2285 |
-HTTP_CACHE_PURGE_MODULE_WD="${WORKDIR}/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}" |
2286 |
- |
2287 |
-# http_slowfs_cache (http://labs.frickle.com/nginx_ngx_slowfs_cache/, BSD-2 license) |
2288 |
-HTTP_SLOWFS_CACHE_MODULE_PV="1.10" |
2289 |
-HTTP_SLOWFS_CACHE_MODULE_P="ngx_http_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}" |
2290 |
-HTTP_SLOWFS_CACHE_MODULE_URI="http://labs.frickle.com/files/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}.tar.gz" |
2291 |
-HTTP_SLOWFS_CACHE_MODULE_WD="${WORKDIR}/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}" |
2292 |
- |
2293 |
-# http_fancyindex (https://github.com/aperezdc/ngx-fancyindex, BSD license) |
2294 |
-HTTP_FANCYINDEX_MODULE_PV="0.4.3" |
2295 |
-HTTP_FANCYINDEX_MODULE_P="ngx_http_fancyindex-${HTTP_FANCYINDEX_MODULE_PV}" |
2296 |
-HTTP_FANCYINDEX_MODULE_URI="https://github.com/aperezdc/ngx-fancyindex/archive/v${HTTP_FANCYINDEX_MODULE_PV}.tar.gz" |
2297 |
-HTTP_FANCYINDEX_MODULE_WD="${WORKDIR}/ngx-fancyindex-${HTTP_FANCYINDEX_MODULE_PV}" |
2298 |
- |
2299 |
-# http_lua (https://github.com/openresty/lua-nginx-module, BSD license) |
2300 |
-HTTP_LUA_MODULE_PV="0.10.15" |
2301 |
-HTTP_LUA_MODULE_P="ngx_http_lua-${HTTP_LUA_MODULE_PV}" |
2302 |
-HTTP_LUA_MODULE_URI="https://github.com/openresty/lua-nginx-module/archive/v${HTTP_LUA_MODULE_PV}.tar.gz" |
2303 |
-HTTP_LUA_MODULE_WD="${WORKDIR}/lua-nginx-module-${HTTP_LUA_MODULE_PV}" |
2304 |
- |
2305 |
-# http_auth_pam (https://github.com/stogh/ngx_http_auth_pam_module/, http://web.iti.upv.es/~sto/nginx/, BSD-2 license) |
2306 |
-HTTP_AUTH_PAM_MODULE_PV="1.5.1" |
2307 |
-HTTP_AUTH_PAM_MODULE_P="ngx_http_auth_pam-${HTTP_AUTH_PAM_MODULE_PV}" |
2308 |
-HTTP_AUTH_PAM_MODULE_URI="https://github.com/stogh/ngx_http_auth_pam_module/archive/v${HTTP_AUTH_PAM_MODULE_PV}.tar.gz" |
2309 |
-HTTP_AUTH_PAM_MODULE_WD="${WORKDIR}/ngx_http_auth_pam_module-${HTTP_AUTH_PAM_MODULE_PV}" |
2310 |
- |
2311 |
-# http_upstream_check (https://github.com/yaoweibin/nginx_upstream_check_module, BSD license) |
2312 |
-HTTP_UPSTREAM_CHECK_MODULE_PV="9aecf15ec379fe98f62355c57b60c0bc83296f04" |
2313 |
-HTTP_UPSTREAM_CHECK_MODULE_P="ngx_http_upstream_check-${HTTP_UPSTREAM_CHECK_MODULE_PV}" |
2314 |
-HTTP_UPSTREAM_CHECK_MODULE_URI="https://github.com/yaoweibin/nginx_upstream_check_module/archive/${HTTP_UPSTREAM_CHECK_MODULE_PV}.tar.gz" |
2315 |
-HTTP_UPSTREAM_CHECK_MODULE_WD="${WORKDIR}/nginx_upstream_check_module-${HTTP_UPSTREAM_CHECK_MODULE_PV}" |
2316 |
- |
2317 |
-# http_metrics (https://github.com/zenops/ngx_metrics, BSD license) |
2318 |
-HTTP_METRICS_MODULE_PV="0.1.1" |
2319 |
-HTTP_METRICS_MODULE_P="ngx_metrics-${HTTP_METRICS_MODULE_PV}" |
2320 |
-HTTP_METRICS_MODULE_URI="https://github.com/madvertise/ngx_metrics/archive/v${HTTP_METRICS_MODULE_PV}.tar.gz" |
2321 |
-HTTP_METRICS_MODULE_WD="${WORKDIR}/ngx_metrics-${HTTP_METRICS_MODULE_PV}" |
2322 |
- |
2323 |
-# http_vhost_traffic_status (https://github.com/vozlt/nginx-module-vts, BSD license) |
2324 |
-HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV="46d85558e344dfe2b078ce757fd36c69a1ec2dd3" |
2325 |
-HTTP_VHOST_TRAFFIC_STATUS_MODULE_P="ngx_http_vhost_traffic_status-${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}" |
2326 |
-HTTP_VHOST_TRAFFIC_STATUS_MODULE_URI="https://github.com/vozlt/nginx-module-vts/archive/${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}.tar.gz" |
2327 |
-HTTP_VHOST_TRAFFIC_STATUS_MODULE_WD="${WORKDIR}/nginx-module-vts-${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}" |
2328 |
- |
2329 |
-# naxsi-core (https://github.com/nbs-system/naxsi, GPLv2+) |
2330 |
-HTTP_NAXSI_MODULE_PV="0.56" |
2331 |
-HTTP_NAXSI_MODULE_P="ngx_http_naxsi-${HTTP_NAXSI_MODULE_PV}" |
2332 |
-HTTP_NAXSI_MODULE_URI="https://github.com/nbs-system/naxsi/archive/${HTTP_NAXSI_MODULE_PV}.tar.gz" |
2333 |
-HTTP_NAXSI_MODULE_WD="${WORKDIR}/naxsi-${HTTP_NAXSI_MODULE_PV}/naxsi_src" |
2334 |
- |
2335 |
-# nginx-rtmp-module (https://github.com/arut/nginx-rtmp-module, BSD license) |
2336 |
-RTMP_MODULE_PV="1.2.1" |
2337 |
-RTMP_MODULE_P="ngx_rtmp-${RTMP_MODULE_PV}" |
2338 |
-RTMP_MODULE_URI="https://github.com/arut/nginx-rtmp-module/archive/v${RTMP_MODULE_PV}.tar.gz" |
2339 |
-RTMP_MODULE_WD="${WORKDIR}/nginx-rtmp-module-${RTMP_MODULE_PV}" |
2340 |
- |
2341 |
-# nginx-dav-ext-module (https://github.com/arut/nginx-dav-ext-module, BSD license) |
2342 |
-HTTP_DAV_EXT_MODULE_PV="3.0.0" |
2343 |
-HTTP_DAV_EXT_MODULE_P="ngx_http_dav_ext-${HTTP_DAV_EXT_MODULE_PV}" |
2344 |
-HTTP_DAV_EXT_MODULE_URI="https://github.com/arut/nginx-dav-ext-module/archive/v${HTTP_DAV_EXT_MODULE_PV}.tar.gz" |
2345 |
-HTTP_DAV_EXT_MODULE_WD="${WORKDIR}/nginx-dav-ext-module-${HTTP_DAV_EXT_MODULE_PV}" |
2346 |
- |
2347 |
-# echo-nginx-module (https://github.com/openresty/echo-nginx-module, BSD license) |
2348 |
-HTTP_ECHO_MODULE_PV="0.61" |
2349 |
-HTTP_ECHO_MODULE_P="ngx_http_echo-${HTTP_ECHO_MODULE_PV}" |
2350 |
-HTTP_ECHO_MODULE_URI="https://github.com/openresty/echo-nginx-module/archive/v${HTTP_ECHO_MODULE_PV}.tar.gz" |
2351 |
-HTTP_ECHO_MODULE_WD="${WORKDIR}/echo-nginx-module-${HTTP_ECHO_MODULE_PV}" |
2352 |
- |
2353 |
-# mod_security for nginx (https://modsecurity.org/, Apache-2.0) |
2354 |
-# keep the MODULE_P here consistent with upstream to avoid tarball duplication |
2355 |
-HTTP_SECURITY_MODULE_PV="2.9.3" |
2356 |
-HTTP_SECURITY_MODULE_P="modsecurity-${HTTP_SECURITY_MODULE_PV}" |
2357 |
-HTTP_SECURITY_MODULE_URI="https://www.modsecurity.org/tarball/${HTTP_SECURITY_MODULE_PV}/${HTTP_SECURITY_MODULE_P}.tar.gz" |
2358 |
-HTTP_SECURITY_MODULE_WD="${WORKDIR}/${HTTP_SECURITY_MODULE_P}" |
2359 |
- |
2360 |
-# push-stream-module (http://www.nginxpushstream.com, https://github.com/wandenberg/nginx-push-stream-module, GPL-3) |
2361 |
-HTTP_PUSH_STREAM_MODULE_PV="0.5.4" |
2362 |
-HTTP_PUSH_STREAM_MODULE_P="ngx_http_push_stream-${HTTP_PUSH_STREAM_MODULE_PV}" |
2363 |
-HTTP_PUSH_STREAM_MODULE_URI="https://github.com/wandenberg/nginx-push-stream-module/archive/${HTTP_PUSH_STREAM_MODULE_PV}.tar.gz" |
2364 |
-HTTP_PUSH_STREAM_MODULE_WD="${WORKDIR}/nginx-push-stream-module-${HTTP_PUSH_STREAM_MODULE_PV}" |
2365 |
- |
2366 |
-# sticky-module (https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng, BSD-2) |
2367 |
-HTTP_STICKY_MODULE_PV="1.2.6-10-g08a395c66e42" |
2368 |
-HTTP_STICKY_MODULE_P="nginx_http_sticky_module_ng-${HTTP_STICKY_MODULE_PV}" |
2369 |
-HTTP_STICKY_MODULE_URI="https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/get/${HTTP_STICKY_MODULE_PV}.tar.bz2" |
2370 |
-HTTP_STICKY_MODULE_WD="${WORKDIR}/nginx-goodies-nginx-sticky-module-ng-08a395c66e42" |
2371 |
- |
2372 |
-# mogilefs-module (https://github.com/vkholodkov/nginx-mogilefs-module, BSD-2) |
2373 |
-HTTP_MOGILEFS_MODULE_PV="1.0.4" |
2374 |
-HTTP_MOGILEFS_MODULE_P="ngx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}" |
2375 |
-HTTP_MOGILEFS_MODULE_URI="https://github.com/vkholodkov/nginx-mogilefs-module/archive/${HTTP_MOGILEFS_MODULE_PV}.tar.gz" |
2376 |
-HTTP_MOGILEFS_MODULE_WD="${WORKDIR}/nginx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}" |
2377 |
- |
2378 |
-# memc-module (https://github.com/openresty/memc-nginx-module, BSD-2) |
2379 |
-HTTP_MEMC_MODULE_PV="0.19" |
2380 |
-HTTP_MEMC_MODULE_P="ngx_memc_module-${HTTP_MEMC_MODULE_PV}" |
2381 |
-HTTP_MEMC_MODULE_URI="https://github.com/openresty/memc-nginx-module/archive/v${HTTP_MEMC_MODULE_PV}.tar.gz" |
2382 |
-HTTP_MEMC_MODULE_WD="${WORKDIR}/memc-nginx-module-${HTTP_MEMC_MODULE_PV}" |
2383 |
- |
2384 |
-# nginx-ldap-auth-module (https://github.com/kvspb/nginx-auth-ldap, BSD-2) |
2385 |
-HTTP_LDAP_MODULE_PV="42d195d7a7575ebab1c369ad3fc5d78dc2c2669c" |
2386 |
-HTTP_LDAP_MODULE_P="nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}" |
2387 |
-HTTP_LDAP_MODULE_URI="https://github.com/kvspb/nginx-auth-ldap/archive/${HTTP_LDAP_MODULE_PV}.tar.gz" |
2388 |
-HTTP_LDAP_MODULE_WD="${WORKDIR}/nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}" |
2389 |
- |
2390 |
-# geoip2 (https://github.com/leev/ngx_http_geoip2_module, BSD-2) |
2391 |
-GEOIP2_MODULE_PV="3.2" |
2392 |
-GEOIP2_MODULE_P="ngx_http_geoip2_module-${GEOIP2_MODULE_PV}" |
2393 |
-GEOIP2_MODULE_URI="https://github.com/leev/ngx_http_geoip2_module/archive/${GEOIP2_MODULE_PV}.tar.gz" |
2394 |
-GEOIP2_MODULE_WD="${WORKDIR}/ngx_http_geoip2_module-${GEOIP2_MODULE_PV}" |
2395 |
- |
2396 |
-# njs-module (https://github.com/nginx/njs, as-is) |
2397 |
-NJS_MODULE_PV="0.3.6" |
2398 |
-NJS_MODULE_P="njs-${NJS_MODULE_PV}" |
2399 |
-NJS_MODULE_URI="https://github.com/nginx/njs/archive/${NJS_MODULE_PV}.tar.gz" |
2400 |
-NJS_MODULE_WD="${WORKDIR}/njs-${NJS_MODULE_PV}" |
2401 |
- |
2402 |
-# We handle deps below ourselves |
2403 |
-SSL_DEPS_SKIP=1 |
2404 |
-AUTOTOOLS_AUTO_DEPEND="no" |
2405 |
- |
2406 |
-inherit autotools ssl-cert toolchain-funcs perl-module flag-o-matic user systemd versionator multilib pax-utils |
2407 |
- |
2408 |
-DESCRIPTION="Robust, small and high performance http and reverse proxy server" |
2409 |
-HOMEPAGE="https://nginx.org" |
2410 |
-SRC_URI="https://nginx.org/download/${P}.tar.gz |
2411 |
- ${DEVEL_KIT_MODULE_URI} -> ${DEVEL_KIT_MODULE_P}.tar.gz |
2412 |
- nginx_modules_http_auth_ldap? ( ${HTTP_LDAP_MODULE_URI} -> ${HTTP_LDAP_MODULE_P}.tar.gz ) |
2413 |
- nginx_modules_http_auth_pam? ( ${HTTP_AUTH_PAM_MODULE_URI} -> ${HTTP_AUTH_PAM_MODULE_P}.tar.gz ) |
2414 |
- nginx_modules_http_brotli? ( ${HTTP_BROTLI_MODULE_URI} -> ${HTTP_BROTLI_MODULE_P}.tar.gz ) |
2415 |
- nginx_modules_http_cache_purge? ( ${HTTP_CACHE_PURGE_MODULE_URI} -> ${HTTP_CACHE_PURGE_MODULE_P}.tar.gz ) |
2416 |
- nginx_modules_http_dav_ext? ( ${HTTP_DAV_EXT_MODULE_URI} -> ${HTTP_DAV_EXT_MODULE_P}.tar.gz ) |
2417 |
- nginx_modules_http_echo? ( ${HTTP_ECHO_MODULE_URI} -> ${HTTP_ECHO_MODULE_P}.tar.gz ) |
2418 |
- nginx_modules_http_fancyindex? ( ${HTTP_FANCYINDEX_MODULE_URI} -> ${HTTP_FANCYINDEX_MODULE_P}.tar.gz ) |
2419 |
- nginx_modules_http_geoip2? ( ${GEOIP2_MODULE_URI} -> ${GEOIP2_MODULE_P}.tar.gz ) |
2420 |
- nginx_modules_http_headers_more? ( ${HTTP_HEADERS_MORE_MODULE_URI} -> ${HTTP_HEADERS_MORE_MODULE_P}.tar.gz ) |
2421 |
- nginx_modules_http_javascript? ( ${NJS_MODULE_URI} -> ${NJS_MODULE_P}.tar.gz ) |
2422 |
- nginx_modules_http_lua? ( ${HTTP_LUA_MODULE_URI} -> ${HTTP_LUA_MODULE_P}.tar.gz ) |
2423 |
- nginx_modules_http_memc? ( ${HTTP_MEMC_MODULE_URI} -> ${HTTP_MEMC_MODULE_P}.tar.gz ) |
2424 |
- nginx_modules_http_metrics? ( ${HTTP_METRICS_MODULE_URI} -> ${HTTP_METRICS_MODULE_P}.tar.gz ) |
2425 |
- nginx_modules_http_mogilefs? ( ${HTTP_MOGILEFS_MODULE_URI} -> ${HTTP_MOGILEFS_MODULE_P}.tar.gz ) |
2426 |
- nginx_modules_http_naxsi? ( ${HTTP_NAXSI_MODULE_URI} -> ${HTTP_NAXSI_MODULE_P}.tar.gz ) |
2427 |
- nginx_modules_http_push_stream? ( ${HTTP_PUSH_STREAM_MODULE_URI} -> ${HTTP_PUSH_STREAM_MODULE_P}.tar.gz ) |
2428 |
- nginx_modules_http_security? ( ${HTTP_SECURITY_MODULE_URI} -> ${HTTP_SECURITY_MODULE_P}.tar.gz ) |
2429 |
- nginx_modules_http_slowfs_cache? ( ${HTTP_SLOWFS_CACHE_MODULE_URI} -> ${HTTP_SLOWFS_CACHE_MODULE_P}.tar.gz ) |
2430 |
- nginx_modules_http_sticky? ( ${HTTP_STICKY_MODULE_URI} -> ${HTTP_STICKY_MODULE_P}.tar.bz2 ) |
2431 |
- nginx_modules_http_upload_progress? ( ${HTTP_UPLOAD_PROGRESS_MODULE_URI} -> ${HTTP_UPLOAD_PROGRESS_MODULE_P}.tar.gz ) |
2432 |
- nginx_modules_http_upstream_check? ( ${HTTP_UPSTREAM_CHECK_MODULE_URI} -> ${HTTP_UPSTREAM_CHECK_MODULE_P}.tar.gz ) |
2433 |
- nginx_modules_http_vhost_traffic_status? ( ${HTTP_VHOST_TRAFFIC_STATUS_MODULE_URI} -> ${HTTP_VHOST_TRAFFIC_STATUS_MODULE_P}.tar.gz ) |
2434 |
- nginx_modules_stream_geoip2? ( ${GEOIP2_MODULE_URI} -> ${GEOIP2_MODULE_P}.tar.gz ) |
2435 |
- nginx_modules_stream_javascript? ( ${NJS_MODULE_URI} -> ${NJS_MODULE_P}.tar.gz ) |
2436 |
- rtmp? ( ${RTMP_MODULE_URI} -> ${RTMP_MODULE_P}.tar.gz )" |
2437 |
- |
2438 |
-LICENSE="BSD-2 BSD SSLeay MIT GPL-2 GPL-2+ |
2439 |
- nginx_modules_http_security? ( Apache-2.0 ) |
2440 |
- nginx_modules_http_push_stream? ( GPL-3 )" |
2441 |
- |
2442 |
-SLOT="mainline" |
2443 |
-KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux" |
2444 |
- |
2445 |
-# Package doesn't provide a real test suite |
2446 |
-RESTRICT="test" |
2447 |
- |
2448 |
-NGINX_MODULES_STD="access auth_basic autoindex browser charset empty_gif |
2449 |
- fastcgi geo grpc gzip limit_req limit_conn map memcached mirror |
2450 |
- proxy referer rewrite scgi ssi split_clients upstream_hash |
2451 |
- upstream_ip_hash upstream_keepalive upstream_least_conn |
2452 |
- upstream_zone userid uwsgi" |
2453 |
-NGINX_MODULES_OPT="addition auth_request dav degradation flv geoip gunzip |
2454 |
- gzip_static image_filter mp4 perl random_index realip secure_link |
2455 |
- slice stub_status sub xslt" |
2456 |
-NGINX_MODULES_STREAM_STD="access geo limit_conn map return split_clients |
2457 |
- upstream_hash upstream_least_conn upstream_zone" |
2458 |
-NGINX_MODULES_STREAM_OPT="geoip realip ssl_preread" |
2459 |
-NGINX_MODULES_MAIL="imap pop3 smtp" |
2460 |
-NGINX_MODULES_3RD=" |
2461 |
- http_auth_ldap |
2462 |
- http_auth_pam |
2463 |
- http_brotli |
2464 |
- http_cache_purge |
2465 |
- http_dav_ext |
2466 |
- http_echo |
2467 |
- http_fancyindex |
2468 |
- http_geoip2 |
2469 |
- http_headers_more |
2470 |
- http_javascript |
2471 |
- http_lua |
2472 |
- http_memc |
2473 |
- http_metrics |
2474 |
- http_mogilefs |
2475 |
- http_naxsi |
2476 |
- http_push_stream |
2477 |
- http_security |
2478 |
- http_slowfs_cache |
2479 |
- http_sticky |
2480 |
- http_upload_progress |
2481 |
- http_upstream_check |
2482 |
- http_vhost_traffic_status |
2483 |
- stream_geoip2 |
2484 |
- stream_javascript |
2485 |
-" |
2486 |
- |
2487 |
-IUSE="aio debug +http +http2 +http-cache +ipv6 libatomic libressl luajit +pcre |
2488 |
- pcre-jit rtmp selinux ssl threads userland_GNU vim-syntax" |
2489 |
- |
2490 |
-for mod in $NGINX_MODULES_STD; do |
2491 |
- IUSE="${IUSE} +nginx_modules_http_${mod}" |
2492 |
-done |
2493 |
- |
2494 |
-for mod in $NGINX_MODULES_OPT; do |
2495 |
- IUSE="${IUSE} nginx_modules_http_${mod}" |
2496 |
-done |
2497 |
- |
2498 |
-for mod in $NGINX_MODULES_STREAM_STD; do |
2499 |
- IUSE="${IUSE} nginx_modules_stream_${mod}" |
2500 |
-done |
2501 |
- |
2502 |
-for mod in $NGINX_MODULES_STREAM_OPT; do |
2503 |
- IUSE="${IUSE} nginx_modules_stream_${mod}" |
2504 |
-done |
2505 |
- |
2506 |
-for mod in $NGINX_MODULES_MAIL; do |
2507 |
- IUSE="${IUSE} nginx_modules_mail_${mod}" |
2508 |
-done |
2509 |
- |
2510 |
-for mod in $NGINX_MODULES_3RD; do |
2511 |
- IUSE="${IUSE} nginx_modules_${mod}" |
2512 |
-done |
2513 |
- |
2514 |
-# Add so we can warn users updating about config changes |
2515 |
-# @TODO: jbergstroem: remove on next release series |
2516 |
-IUSE="${IUSE} nginx_modules_http_spdy" |
2517 |
- |
2518 |
-CDEPEND=" |
2519 |
- pcre? ( dev-libs/libpcre:= ) |
2520 |
- pcre-jit? ( dev-libs/libpcre:=[jit] ) |
2521 |
- ssl? ( |
2522 |
- !libressl? ( dev-libs/openssl:0= ) |
2523 |
- libressl? ( dev-libs/libressl:= ) |
2524 |
- ) |
2525 |
- http2? ( |
2526 |
- !libressl? ( >=dev-libs/openssl-1.0.1c:0= ) |
2527 |
- libressl? ( dev-libs/libressl:= ) |
2528 |
- ) |
2529 |
- http-cache? ( |
2530 |
- userland_GNU? ( |
2531 |
- !libressl? ( dev-libs/openssl:0= ) |
2532 |
- libressl? ( dev-libs/libressl:= ) |
2533 |
- ) |
2534 |
- ) |
2535 |
- nginx_modules_http_brotli? ( app-arch/brotli:= ) |
2536 |
- nginx_modules_http_geoip? ( dev-libs/geoip ) |
2537 |
- nginx_modules_http_geoip2? ( dev-libs/libmaxminddb:= ) |
2538 |
- nginx_modules_http_gunzip? ( sys-libs/zlib ) |
2539 |
- nginx_modules_http_gzip? ( sys-libs/zlib ) |
2540 |
- nginx_modules_http_gzip_static? ( sys-libs/zlib ) |
2541 |
- nginx_modules_http_image_filter? ( media-libs/gd:=[jpeg,png] ) |
2542 |
- nginx_modules_http_perl? ( >=dev-lang/perl-5.8:= ) |
2543 |
- nginx_modules_http_rewrite? ( dev-libs/libpcre:= ) |
2544 |
- nginx_modules_http_secure_link? ( |
2545 |
- userland_GNU? ( |
2546 |
- !libressl? ( dev-libs/openssl:0= ) |
2547 |
- libressl? ( dev-libs/libressl:= ) |
2548 |
- ) |
2549 |
- ) |
2550 |
- nginx_modules_http_xslt? ( dev-libs/libxml2:= dev-libs/libxslt ) |
2551 |
- nginx_modules_http_lua? ( dev-lang/luajit:2= ) |
2552 |
- nginx_modules_http_auth_pam? ( sys-libs/pam ) |
2553 |
- nginx_modules_http_metrics? ( dev-libs/yajl:= ) |
2554 |
- nginx_modules_http_dav_ext? ( dev-libs/libxml2 ) |
2555 |
- nginx_modules_http_security? ( |
2556 |
- dev-libs/apr:= |
2557 |
- dev-libs/apr-util:= |
2558 |
- dev-libs/libxml2:= |
2559 |
- net-misc/curl |
2560 |
- www-servers/apache |
2561 |
- ) |
2562 |
- nginx_modules_http_auth_ldap? ( net-nds/openldap[ssl?] ) |
2563 |
- nginx_modules_stream_geoip? ( dev-libs/geoip ) |
2564 |
- nginx_modules_stream_geoip2? ( dev-libs/libmaxminddb:= )" |
2565 |
-RDEPEND="${CDEPEND} |
2566 |
- selinux? ( sec-policy/selinux-nginx ) |
2567 |
- !www-servers/nginx:0" |
2568 |
-DEPEND="${CDEPEND} |
2569 |
- nginx_modules_http_brotli? ( virtual/pkgconfig ) |
2570 |
- nginx_modules_http_security? ( ${AUTOTOOLS_DEPEND} ) |
2571 |
- arm? ( dev-libs/libatomic_ops ) |
2572 |
- libatomic? ( dev-libs/libatomic_ops )" |
2573 |
-PDEPEND="vim-syntax? ( app-vim/nginx-syntax )" |
2574 |
- |
2575 |
-REQUIRED_USE="pcre-jit? ( pcre ) |
2576 |
- nginx_modules_http_grpc? ( http2 ) |
2577 |
- nginx_modules_http_lua? ( |
2578 |
- luajit |
2579 |
- nginx_modules_http_rewrite |
2580 |
- ) |
2581 |
- nginx_modules_http_naxsi? ( pcre ) |
2582 |
- nginx_modules_http_dav_ext? ( nginx_modules_http_dav ) |
2583 |
- nginx_modules_http_metrics? ( nginx_modules_http_stub_status ) |
2584 |
- nginx_modules_http_security? ( pcre ) |
2585 |
- nginx_modules_http_push_stream? ( ssl )" |
2586 |
- |
2587 |
-pkg_setup() { |
2588 |
- NGINX_HOME="/var/lib/nginx" |
2589 |
- NGINX_HOME_TMP="${NGINX_HOME}/tmp" |
2590 |
- |
2591 |
- ebegin "Creating nginx user and group" |
2592 |
- enewgroup ${PN} |
2593 |
- enewuser ${PN} -1 -1 "${NGINX_HOME}" ${PN} |
2594 |
- eend $? |
2595 |
- |
2596 |
- if use libatomic; then |
2597 |
- ewarn "GCC 4.1+ features built-in atomic operations." |
2598 |
- ewarn "Using libatomic_ops is only needed if using" |
2599 |
- ewarn "a different compiler or a GCC prior to 4.1" |
2600 |
- fi |
2601 |
- |
2602 |
- if [[ -n $NGINX_ADD_MODULES ]]; then |
2603 |
- ewarn "You are building custom modules via \$NGINX_ADD_MODULES!" |
2604 |
- ewarn "This nginx installation is not supported!" |
2605 |
- ewarn "Make sure you can reproduce the bug without those modules" |
2606 |
- ewarn "_before_ reporting bugs." |
2607 |
- fi |
2608 |
- |
2609 |
- if use !http; then |
2610 |
- ewarn "To actually disable all http-functionality you also have to disable" |
2611 |
- ewarn "all nginx http modules." |
2612 |
- fi |
2613 |
- |
2614 |
- if use nginx_modules_http_mogilefs && use threads; then |
2615 |
- eerror "mogilefs won't compile with threads support." |
2616 |
- eerror "Please disable either flag and try again." |
2617 |
- die "Can't compile mogilefs with threads support" |
2618 |
- fi |
2619 |
-} |
2620 |
- |
2621 |
-src_prepare() { |
2622 |
- eapply "${FILESDIR}/${PN}-1.4.1-fix-perl-install-path.patch" |
2623 |
- eapply "${FILESDIR}/${PN}-httpoxy-mitigation-r1.patch" |
2624 |
- |
2625 |
- if use nginx_modules_http_auth_pam; then |
2626 |
- cd "${HTTP_AUTH_PAM_MODULE_WD}" || die |
2627 |
- eapply "${FILESDIR}"/http_auth_pam-1.5.1-adjust-loglevel-for-authentication-failures.patch |
2628 |
- cd "${S}" || die |
2629 |
- fi |
2630 |
- |
2631 |
- if use nginx_modules_http_brotli; then |
2632 |
- cd "${HTTP_BROTLI_MODULE_WD}" || die |
2633 |
- eapply "${FILESDIR}"/http_brotli-detect-brotli-r2.patch |
2634 |
- cd "${S}" || die |
2635 |
- fi |
2636 |
- |
2637 |
- if use nginx_modules_http_upstream_check; then |
2638 |
- eapply -p0 "${FILESDIR}"/http_upstream_check-nginx-1.11.5+.patch |
2639 |
- fi |
2640 |
- |
2641 |
- if use nginx_modules_http_cache_purge; then |
2642 |
- cd "${HTTP_CACHE_PURGE_MODULE_WD}" || die |
2643 |
- eapply "${FILESDIR}"/http_cache_purge-1.11.6+.patch |
2644 |
- cd "${S}" || die |
2645 |
- fi |
2646 |
- |
2647 |
- if use nginx_modules_http_security; then |
2648 |
- cd "${HTTP_SECURITY_MODULE_WD}" || die |
2649 |
- |
2650 |
- eautoreconf |
2651 |
- |
2652 |
- if use luajit ; then |
2653 |
- sed -i \ |
2654 |
- -e 's|^\(LUA_PKGNAMES\)=.*|\1="luajit"|' \ |
2655 |
- configure || die |
2656 |
- fi |
2657 |
- |
2658 |
- cd "${S}" || die |
2659 |
- fi |
2660 |
- |
2661 |
- if use nginx_modules_http_upload_progress; then |
2662 |
- cd "${HTTP_UPLOAD_PROGRESS_MODULE_WD}" || die |
2663 |
- eapply "${FILESDIR}"/http_uploadprogress-issue_50-r1.patch |
2664 |
- cd "${S}" || die |
2665 |
- fi |
2666 |
- |
2667 |
- find auto/ -type f -print0 | xargs -0 sed -i 's:\&\& make:\&\& \\$(MAKE):' || die |
2668 |
- # We have config protection, don't rename etc files |
2669 |
- sed -i 's:.default::' auto/install || die |
2670 |
- # remove useless files |
2671 |
- sed -i -e '/koi-/d' -e '/win-/d' auto/install || die |
2672 |
- |
2673 |
- # don't install to /etc/nginx/ if not in use |
2674 |
- local module |
2675 |
- for module in fastcgi scgi uwsgi ; do |
2676 |
- if ! use nginx_modules_http_${module}; then |
2677 |
- sed -i -e "/${module}/d" auto/install || die |
2678 |
- fi |
2679 |
- done |
2680 |
- |
2681 |
- eapply_user |
2682 |
-} |
2683 |
- |
2684 |
-src_configure() { |
2685 |
- # mod_security needs to generate nginx/modsecurity/config before including it |
2686 |
- if use nginx_modules_http_security; then |
2687 |
- cd "${HTTP_SECURITY_MODULE_WD}" || die |
2688 |
- |
2689 |
- ./configure \ |
2690 |
- --enable-standalone-module \ |
2691 |
- --disable-mlogc \ |
2692 |
- --with-ssdeep=no \ |
2693 |
- $(use_enable pcre-jit) \ |
2694 |
- $(use_with nginx_modules_http_lua lua) || die "configure failed for mod_security" |
2695 |
- |
2696 |
- cd "${S}" || die |
2697 |
- fi |
2698 |
- |
2699 |
- local myconf=() http_enabled= mail_enabled= stream_enabled= |
2700 |
- |
2701 |
- use aio && myconf+=( --with-file-aio ) |
2702 |
- use debug && myconf+=( --with-debug ) |
2703 |
- use http2 && myconf+=( --with-http_v2_module ) |
2704 |
- use libatomic && myconf+=( --with-libatomic ) |
2705 |
- use pcre && myconf+=( --with-pcre ) |
2706 |
- use pcre-jit && myconf+=( --with-pcre-jit ) |
2707 |
- use threads && myconf+=( --with-threads ) |
2708 |
- |
2709 |
- # HTTP modules |
2710 |
- for mod in $NGINX_MODULES_STD; do |
2711 |
- if use nginx_modules_http_${mod}; then |
2712 |
- http_enabled=1 |
2713 |
- else |
2714 |
- myconf+=( --without-http_${mod}_module ) |
2715 |
- fi |
2716 |
- done |
2717 |
- |
2718 |
- for mod in $NGINX_MODULES_OPT; do |
2719 |
- if use nginx_modules_http_${mod}; then |
2720 |
- http_enabled=1 |
2721 |
- myconf+=( --with-http_${mod}_module ) |
2722 |
- fi |
2723 |
- done |
2724 |
- |
2725 |
- if use nginx_modules_http_fastcgi; then |
2726 |
- myconf+=( --with-http_realip_module ) |
2727 |
- fi |
2728 |
- |
2729 |
- # third-party modules |
2730 |
- if use nginx_modules_http_upload_progress; then |
2731 |
- http_enabled=1 |
2732 |
- myconf+=( --add-module=${HTTP_UPLOAD_PROGRESS_MODULE_WD} ) |
2733 |
- fi |
2734 |
- |
2735 |
- if use nginx_modules_http_headers_more; then |
2736 |
- http_enabled=1 |
2737 |
- myconf+=( --add-module=${HTTP_HEADERS_MORE_MODULE_WD} ) |
2738 |
- fi |
2739 |
- |
2740 |
- if use nginx_modules_http_cache_purge; then |
2741 |
- http_enabled=1 |
2742 |
- myconf+=( --add-module=${HTTP_CACHE_PURGE_MODULE_WD} ) |
2743 |
- fi |
2744 |
- |
2745 |
- if use nginx_modules_http_slowfs_cache; then |
2746 |
- http_enabled=1 |
2747 |
- myconf+=( --add-module=${HTTP_SLOWFS_CACHE_MODULE_WD} ) |
2748 |
- fi |
2749 |
- |
2750 |
- if use nginx_modules_http_fancyindex; then |
2751 |
- http_enabled=1 |
2752 |
- myconf+=( --add-module=${HTTP_FANCYINDEX_MODULE_WD} ) |
2753 |
- fi |
2754 |
- |
2755 |
- if use nginx_modules_http_lua; then |
2756 |
- http_enabled=1 |
2757 |
- export LUAJIT_LIB=$(pkg-config --variable libdir luajit) |
2758 |
- export LUAJIT_INC=$(pkg-config --variable includedir luajit) |
2759 |
- myconf+=( --add-module=${DEVEL_KIT_MODULE_WD} ) |
2760 |
- myconf+=( --add-module=${HTTP_LUA_MODULE_WD} ) |
2761 |
- fi |
2762 |
- |
2763 |
- if use nginx_modules_http_auth_pam; then |
2764 |
- http_enabled=1 |
2765 |
- myconf+=( --add-module=${HTTP_AUTH_PAM_MODULE_WD} ) |
2766 |
- fi |
2767 |
- |
2768 |
- if use nginx_modules_http_upstream_check; then |
2769 |
- http_enabled=1 |
2770 |
- myconf+=( --add-module=${HTTP_UPSTREAM_CHECK_MODULE_WD} ) |
2771 |
- fi |
2772 |
- |
2773 |
- if use nginx_modules_http_metrics; then |
2774 |
- http_enabled=1 |
2775 |
- myconf+=( --add-module=${HTTP_METRICS_MODULE_WD} ) |
2776 |
- fi |
2777 |
- |
2778 |
- if use nginx_modules_http_naxsi ; then |
2779 |
- http_enabled=1 |
2780 |
- myconf+=( --add-module=${HTTP_NAXSI_MODULE_WD} ) |
2781 |
- fi |
2782 |
- |
2783 |
- if use rtmp ; then |
2784 |
- http_enabled=1 |
2785 |
- myconf+=( --add-module=${RTMP_MODULE_WD} ) |
2786 |
- fi |
2787 |
- |
2788 |
- if use nginx_modules_http_dav_ext ; then |
2789 |
- http_enabled=1 |
2790 |
- myconf+=( --add-module=${HTTP_DAV_EXT_MODULE_WD} ) |
2791 |
- fi |
2792 |
- |
2793 |
- if use nginx_modules_http_echo ; then |
2794 |
- http_enabled=1 |
2795 |
- myconf+=( --add-module=${HTTP_ECHO_MODULE_WD} ) |
2796 |
- fi |
2797 |
- |
2798 |
- if use nginx_modules_http_security ; then |
2799 |
- http_enabled=1 |
2800 |
- myconf+=( --add-module=${HTTP_SECURITY_MODULE_WD}/nginx/modsecurity ) |
2801 |
- fi |
2802 |
- |
2803 |
- if use nginx_modules_http_push_stream ; then |
2804 |
- http_enabled=1 |
2805 |
- myconf+=( --add-module=${HTTP_PUSH_STREAM_MODULE_WD} ) |
2806 |
- fi |
2807 |
- |
2808 |
- if use nginx_modules_http_sticky ; then |
2809 |
- http_enabled=1 |
2810 |
- myconf+=( --add-module=${HTTP_STICKY_MODULE_WD} ) |
2811 |
- fi |
2812 |
- |
2813 |
- if use nginx_modules_http_mogilefs ; then |
2814 |
- http_enabled=1 |
2815 |
- myconf+=( --add-module=${HTTP_MOGILEFS_MODULE_WD} ) |
2816 |
- fi |
2817 |
- |
2818 |
- if use nginx_modules_http_memc ; then |
2819 |
- http_enabled=1 |
2820 |
- myconf+=( --add-module=${HTTP_MEMC_MODULE_WD} ) |
2821 |
- fi |
2822 |
- |
2823 |
- if use nginx_modules_http_auth_ldap; then |
2824 |
- http_enabled=1 |
2825 |
- myconf+=( --add-module=${HTTP_LDAP_MODULE_WD} ) |
2826 |
- fi |
2827 |
- |
2828 |
- if use nginx_modules_http_vhost_traffic_status; then |
2829 |
- http_enabled=1 |
2830 |
- myconf+=( --add-module=${HTTP_VHOST_TRAFFIC_STATUS_MODULE_WD} ) |
2831 |
- fi |
2832 |
- |
2833 |
- if use nginx_modules_http_geoip2 || use nginx_modules_stream_geoip2; then |
2834 |
- myconf+=( --add-module=${GEOIP2_MODULE_WD} ) |
2835 |
- fi |
2836 |
- |
2837 |
- if use nginx_modules_http_javascript || use nginx_modules_stream_javascript; then |
2838 |
- myconf+=( --add-module="${NJS_MODULE_WD}/nginx" ) |
2839 |
- fi |
2840 |
- |
2841 |
- if use nginx_modules_http_brotli; then |
2842 |
- http_enabled=1 |
2843 |
- myconf+=( --add-module=${HTTP_BROTLI_MODULE_WD} ) |
2844 |
- fi |
2845 |
- |
2846 |
- if use http || use http-cache || use http2 || use nginx_modules_http_javascript; then |
2847 |
- http_enabled=1 |
2848 |
- fi |
2849 |
- |
2850 |
- if [ $http_enabled ]; then |
2851 |
- use http-cache || myconf+=( --without-http-cache ) |
2852 |
- use ssl && myconf+=( --with-http_ssl_module ) |
2853 |
- else |
2854 |
- myconf+=( --without-http --without-http-cache ) |
2855 |
- fi |
2856 |
- |
2857 |
- # Stream modules |
2858 |
- for mod in $NGINX_MODULES_STREAM_STD; do |
2859 |
- if use nginx_modules_stream_${mod}; then |
2860 |
- stream_enabled=1 |
2861 |
- else |
2862 |
- myconf+=( --without-stream_${mod}_module ) |
2863 |
- fi |
2864 |
- done |
2865 |
- |
2866 |
- for mod in $NGINX_MODULES_STREAM_OPT; do |
2867 |
- if use nginx_modules_stream_${mod}; then |
2868 |
- stream_enabled=1 |
2869 |
- myconf+=( --with-stream_${mod}_module ) |
2870 |
- fi |
2871 |
- done |
2872 |
- |
2873 |
- if use nginx_modules_stream_geoip2 || use nginx_modules_stream_javascript; then |
2874 |
- stream_enabled=1 |
2875 |
- fi |
2876 |
- |
2877 |
- if [ $stream_enabled ]; then |
2878 |
- myconf+=( --with-stream ) |
2879 |
- use ssl && myconf+=( --with-stream_ssl_module ) |
2880 |
- fi |
2881 |
- |
2882 |
- # MAIL modules |
2883 |
- for mod in $NGINX_MODULES_MAIL; do |
2884 |
- if use nginx_modules_mail_${mod}; then |
2885 |
- mail_enabled=1 |
2886 |
- else |
2887 |
- myconf+=( --without-mail_${mod}_module ) |
2888 |
- fi |
2889 |
- done |
2890 |
- |
2891 |
- if [ $mail_enabled ]; then |
2892 |
- myconf+=( --with-mail ) |
2893 |
- use ssl && myconf+=( --with-mail_ssl_module ) |
2894 |
- fi |
2895 |
- |
2896 |
- # custom modules |
2897 |
- for mod in $NGINX_ADD_MODULES; do |
2898 |
- myconf+=( --add-module=${mod} ) |
2899 |
- done |
2900 |
- |
2901 |
- # https://bugs.gentoo.org/286772 |
2902 |
- export LANG=C LC_ALL=C |
2903 |
- tc-export CC |
2904 |
- |
2905 |
- if ! use prefix; then |
2906 |
- myconf+=( --user=${PN} ) |
2907 |
- myconf+=( --group=${PN} ) |
2908 |
- fi |
2909 |
- |
2910 |
- local WITHOUT_IPV6= |
2911 |
- if ! use ipv6; then |
2912 |
- WITHOUT_IPV6=" -DNGX_HAVE_INET6=0" |
2913 |
- fi |
2914 |
- |
2915 |
- if [[ -n "${EXTRA_ECONF}" ]]; then |
2916 |
- myconf+=( ${EXTRA_ECONF} ) |
2917 |
- ewarn "EXTRA_ECONF applied. Now you are on your own, good luck!" |
2918 |
- fi |
2919 |
- |
2920 |
- ./configure \ |
2921 |
- --prefix="${EPREFIX}"/usr \ |
2922 |
- --conf-path="${EPREFIX}"/etc/${PN}/${PN}.conf \ |
2923 |
- --error-log-path="${EPREFIX}"/var/log/${PN}/error_log \ |
2924 |
- --pid-path="${EPREFIX}"/run/${PN}.pid \ |
2925 |
- --lock-path="${EPREFIX}"/run/lock/${PN}.lock \ |
2926 |
- --with-cc-opt="-I${EROOT}usr/include${WITHOUT_IPV6}" \ |
2927 |
- --with-ld-opt="-L${EROOT}usr/$(get_libdir)" \ |
2928 |
- --http-log-path="${EPREFIX}"/var/log/${PN}/access_log \ |
2929 |
- --http-client-body-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/client \ |
2930 |
- --http-proxy-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/proxy \ |
2931 |
- --http-fastcgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/fastcgi \ |
2932 |
- --http-scgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/scgi \ |
2933 |
- --http-uwsgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/uwsgi \ |
2934 |
- --with-compat \ |
2935 |
- "${myconf[@]}" || die "configure failed" |
2936 |
- |
2937 |
- # A purely cosmetic change that makes nginx -V more readable. This can be |
2938 |
- # good if people outside the gentoo community would troubleshoot and |
2939 |
- # question the users setup. |
2940 |
- sed -i -e "s|${WORKDIR}|external_module|g" objs/ngx_auto_config.h || die |
2941 |
-} |
2942 |
- |
2943 |
-src_compile() { |
2944 |
- use nginx_modules_http_security && emake -C "${HTTP_SECURITY_MODULE_WD}" |
2945 |
- |
2946 |
- # https://bugs.gentoo.org/286772 |
2947 |
- export LANG=C LC_ALL=C |
2948 |
- emake LINK="${CC} ${LDFLAGS}" OTHERLDFLAGS="${LDFLAGS}" |
2949 |
-} |
2950 |
- |
2951 |
-src_install() { |
2952 |
- emake DESTDIR="${D%/}" install |
2953 |
- |
2954 |
- cp "${FILESDIR}"/nginx.conf-r2 "${ED}"etc/nginx/nginx.conf || die |
2955 |
- |
2956 |
- newinitd "${FILESDIR}"/nginx.initd-r4 nginx |
2957 |
- newconfd "${FILESDIR}"/nginx.confd nginx |
2958 |
- |
2959 |
- systemd_newunit "${FILESDIR}"/nginx.service-r1 nginx.service |
2960 |
- |
2961 |
- doman man/nginx.8 |
2962 |
- dodoc CHANGES* README |
2963 |
- |
2964 |
- # just keepdir. do not copy the default htdocs files (bug #449136) |
2965 |
- keepdir /var/www/localhost |
2966 |
- rm -rf "${D}"usr/html || die |
2967 |
- |
2968 |
- # set up a list of directories to keep |
2969 |
- local keepdir_list="${NGINX_HOME_TMP}"/client |
2970 |
- local module |
2971 |
- for module in proxy fastcgi scgi uwsgi; do |
2972 |
- use nginx_modules_http_${module} && keepdir_list+=" ${NGINX_HOME_TMP}/${module}" |
2973 |
- done |
2974 |
- |
2975 |
- keepdir /var/log/nginx ${keepdir_list} |
2976 |
- |
2977 |
- # this solves a problem with SELinux where nginx doesn't see the directories |
2978 |
- # as root and tries to create them as nginx |
2979 |
- fperms 0750 "${NGINX_HOME_TMP}" |
2980 |
- fowners ${PN}:0 "${NGINX_HOME_TMP}" |
2981 |
- |
2982 |
- fperms 0700 ${keepdir_list} |
2983 |
- fowners ${PN}:${PN} ${keepdir_list} |
2984 |
- |
2985 |
- fperms 0710 /var/log/nginx |
2986 |
- fowners 0:${PN} /var/log/nginx |
2987 |
- |
2988 |
- # logrotate |
2989 |
- insinto /etc/logrotate.d |
2990 |
- newins "${FILESDIR}"/nginx.logrotate-r1 nginx |
2991 |
- |
2992 |
- if use luajit; then |
2993 |
- pax-mark m "${ED%/}/usr/sbin/nginx" |
2994 |
- fi |
2995 |
- |
2996 |
- if use nginx_modules_http_perl; then |
2997 |
- cd "${S}"/objs/src/http/modules/perl/ || die |
2998 |
- emake DESTDIR="${D}" INSTALLDIRS=vendor |
2999 |
- perl_delete_localpod |
3000 |
- cd "${S}" || die |
3001 |
- fi |
3002 |
- |
3003 |
- if use nginx_modules_http_cache_purge; then |
3004 |
- docinto ${HTTP_CACHE_PURGE_MODULE_P} |
3005 |
- dodoc "${HTTP_CACHE_PURGE_MODULE_WD}"/{CHANGES,README.md,TODO.md} |
3006 |
- fi |
3007 |
- |
3008 |
- if use nginx_modules_http_slowfs_cache; then |
3009 |
- docinto ${HTTP_SLOWFS_CACHE_MODULE_P} |
3010 |
- dodoc "${HTTP_SLOWFS_CACHE_MODULE_WD}"/{CHANGES,README.md} |
3011 |
- fi |
3012 |
- |
3013 |
- if use nginx_modules_http_fancyindex; then |
3014 |
- docinto ${HTTP_FANCYINDEX_MODULE_P} |
3015 |
- dodoc "${HTTP_FANCYINDEX_MODULE_WD}"/README.rst |
3016 |
- fi |
3017 |
- |
3018 |
- if use nginx_modules_http_lua; then |
3019 |
- docinto ${HTTP_LUA_MODULE_P} |
3020 |
- dodoc "${HTTP_LUA_MODULE_WD}"/README.markdown |
3021 |
- fi |
3022 |
- |
3023 |
- if use nginx_modules_http_auth_pam; then |
3024 |
- docinto ${HTTP_AUTH_PAM_MODULE_P} |
3025 |
- dodoc "${HTTP_AUTH_PAM_MODULE_WD}"/{README.md,ChangeLog} |
3026 |
- fi |
3027 |
- |
3028 |
- if use nginx_modules_http_upstream_check; then |
3029 |
- docinto ${HTTP_UPSTREAM_CHECK_MODULE_P} |
3030 |
- dodoc "${HTTP_UPSTREAM_CHECK_MODULE_WD}"/{README,CHANGES} |
3031 |
- fi |
3032 |
- |
3033 |
- if use nginx_modules_http_naxsi; then |
3034 |
- insinto /etc/nginx |
3035 |
- doins "${HTTP_NAXSI_MODULE_WD}"/../naxsi_config/naxsi_core.rules |
3036 |
- fi |
3037 |
- |
3038 |
- if use rtmp; then |
3039 |
- docinto ${RTMP_MODULE_P} |
3040 |
- dodoc "${RTMP_MODULE_WD}"/{AUTHORS,README.md,stat.xsl} |
3041 |
- fi |
3042 |
- |
3043 |
- if use nginx_modules_http_dav_ext; then |
3044 |
- docinto ${HTTP_DAV_EXT_MODULE_P} |
3045 |
- dodoc "${HTTP_DAV_EXT_MODULE_WD}"/README.rst |
3046 |
- fi |
3047 |
- |
3048 |
- if use nginx_modules_http_echo; then |
3049 |
- docinto ${HTTP_ECHO_MODULE_P} |
3050 |
- dodoc "${HTTP_ECHO_MODULE_WD}"/README.markdown |
3051 |
- fi |
3052 |
- |
3053 |
- if use nginx_modules_http_security; then |
3054 |
- docinto ${HTTP_SECURITY_MODULE_P} |
3055 |
- dodoc "${HTTP_SECURITY_MODULE_WD}"/{CHANGES,README.md,authors.txt} |
3056 |
- fi |
3057 |
- |
3058 |
- if use nginx_modules_http_push_stream; then |
3059 |
- docinto ${HTTP_PUSH_STREAM_MODULE_P} |
3060 |
- dodoc "${HTTP_PUSH_STREAM_MODULE_WD}"/{AUTHORS,CHANGELOG.textile,README.textile} |
3061 |
- fi |
3062 |
- |
3063 |
- if use nginx_modules_http_sticky; then |
3064 |
- docinto ${HTTP_STICKY_MODULE_P} |
3065 |
- dodoc "${HTTP_STICKY_MODULE_WD}"/{README.md,Changelog.txt,docs/sticky.pdf} |
3066 |
- fi |
3067 |
- |
3068 |
- if use nginx_modules_http_memc; then |
3069 |
- docinto ${HTTP_MEMC_MODULE_P} |
3070 |
- dodoc "${HTTP_MEMC_MODULE_WD}"/README.markdown |
3071 |
- fi |
3072 |
- |
3073 |
- if use nginx_modules_http_auth_ldap; then |
3074 |
- docinto ${HTTP_LDAP_MODULE_P} |
3075 |
- dodoc "${HTTP_LDAP_MODULE_WD}"/example.conf |
3076 |
- fi |
3077 |
-} |
3078 |
- |
3079 |
-pkg_postinst() { |
3080 |
- if use ssl; then |
3081 |
- if [[ ! -f "${EROOT}"etc/ssl/${PN}/${PN}.key ]]; then |
3082 |
- install_cert /etc/ssl/${PN}/${PN} |
3083 |
- use prefix || chown ${PN}:${PN} "${EROOT}"etc/ssl/${PN}/${PN}.{crt,csr,key,pem} |
3084 |
- fi |
3085 |
- fi |
3086 |
- |
3087 |
- if use nginx_modules_http_spdy; then |
3088 |
- ewarn "" |
3089 |
- ewarn "In nginx 1.9.5 the spdy module was superseded by http2." |
3090 |
- ewarn "Update your configs and package.use accordingly." |
3091 |
- fi |
3092 |
- |
3093 |
- if use nginx_modules_http_lua; then |
3094 |
- ewarn "" |
3095 |
- ewarn "While you can build lua 3rd party module against ${P}" |
3096 |
- ewarn "the author warns that >=${PN}-1.11.11 is still not an" |
3097 |
- ewarn "officially supported target yet. You are on your own." |
3098 |
- ewarn "Expect runtime failures, memory leaks and other problems!" |
3099 |
- fi |
3100 |
- |
3101 |
- if use nginx_modules_http_lua && use http2; then |
3102 |
- ewarn "" |
3103 |
- ewarn "Lua 3rd party module author warns against using ${P} with" |
3104 |
- ewarn "NGINX_MODULES_HTTP=\"lua http2\". For more info, see https://git.io/OldLsg" |
3105 |
- fi |
3106 |
- |
3107 |
- local _n_permission_layout_checks=0 |
3108 |
- local _has_to_adjust_permissions=0 |
3109 |
- local _has_to_show_permission_warning=0 |
3110 |
- |
3111 |
- # Defaults to 1 to inform people doing a fresh installation |
3112 |
- # that we ship modified {scgi,uwsgi,fastcgi}_params files |
3113 |
- local _has_to_show_httpoxy_mitigation_notice=1 |
3114 |
- |
3115 |
- local _replacing_version= |
3116 |
- for _replacing_version in ${REPLACING_VERSIONS}; do |
3117 |
- _n_permission_layout_checks=$((${_n_permission_layout_checks}+1)) |
3118 |
- |
3119 |
- if [[ ${_n_permission_layout_checks} -gt 1 ]]; then |
3120 |
- # Should never happen: |
3121 |
- # Package is abusing slots but doesn't allow multiple parallel installations. |
3122 |
- # If we run into this situation it is unsafe to automatically adjust any |
3123 |
- # permission... |
3124 |
- _has_to_show_permission_warning=1 |
3125 |
- |
3126 |
- ewarn "Replacing multiple ${PN}' versions is unsupported! " \ |
3127 |
- "You will have to adjust permissions on your own." |
3128 |
- |
3129 |
- break |
3130 |
- fi |
3131 |
- |
3132 |
- local _replacing_version_branch=$(get_version_component_range 1-2 "${_replacing_version}") |
3133 |
- debug-print "Updating an existing installation (v${_replacing_version}; branch '${_replacing_version_branch}') ..." |
3134 |
- |
3135 |
- # Do we need to adjust permissions to fix CVE-2013-0337 (bug #458726, #469094)? |
3136 |
- # This was before we introduced multiple nginx versions so we |
3137 |
- # do not need to distinguish between stable and mainline |
3138 |
- local _need_to_fix_CVE2013_0337=1 |
3139 |
- |
3140 |
- if version_is_at_least "1.4.1-r2" "${_replacing_version}"; then |
3141 |
- # We are updating an installation which should already be fixed |
3142 |
- _need_to_fix_CVE2013_0337=0 |
3143 |
- debug-print "Skipping CVE-2013-0337 ... existing installation should not be affected!" |
3144 |
- else |
3145 |
- _has_to_adjust_permissions=1 |
3146 |
- debug-print "Need to adjust permissions to fix CVE-2013-0337!" |
3147 |
- fi |
3148 |
- |
3149 |
- # Do we need to inform about HTTPoxy mitigation? |
3150 |
- # In repository since commit 8be44f76d4ac02cebcd1e0e6e6284bb72d054b0f |
3151 |
- if ! version_is_at_least "1.10" "${_replacing_version_branch}"; then |
3152 |
- # Updating from <1.10 |
3153 |
- _has_to_show_httpoxy_mitigation_notice=1 |
3154 |
- debug-print "Need to inform about HTTPoxy mitigation!" |
3155 |
- else |
3156 |
- # Updating from >=1.10 |
3157 |
- local _fixed_in_pvr= |
3158 |
- case "${_replacing_version_branch}" in |
3159 |
- "1.10") |
3160 |
- _fixed_in_pvr="1.10.1-r2" |
3161 |
- ;; |
3162 |
- "1.11") |
3163 |
- _fixed_in_pvr="1.11.3-r1" |
3164 |
- ;; |
3165 |
- *) |
3166 |
- # This should be any future branch. |
3167 |
- # If we run this code it is safe to assume that the user has |
3168 |
- # already seen the HTTPoxy mitigation notice because he/she is doing |
3169 |
- # an update from previous version where we have already shown |
3170 |
- # the warning. Otherwise, we wouldn't hit this code path ... |
3171 |
- _fixed_in_pvr= |
3172 |
- esac |
3173 |
- |
3174 |
- if [[ -z "${_fixed_in_pvr}" ]] || version_is_at_least "${_fixed_in_pvr}" "${_replacing_version}"; then |
3175 |
- # We are updating an installation where we already informed |
3176 |
- # that we are mitigating HTTPoxy per default |
3177 |
- _has_to_show_httpoxy_mitigation_notice=0 |
3178 |
- debug-print "No need to inform about HTTPoxy mitigation ... information was already shown for existing installation!" |
3179 |
- else |
3180 |
- _has_to_show_httpoxy_mitigation_notice=1 |
3181 |
- debug-print "Need to inform about HTTPoxy mitigation!" |
3182 |
- fi |
3183 |
- fi |
3184 |
- |
3185 |
- # Do we need to adjust permissions to fix CVE-2016-1247 (bug #605008)? |
3186 |
- # All branches up to 1.11 are affected |
3187 |
- local _need_to_fix_CVE2016_1247=1 |
3188 |
- |
3189 |
- if ! version_is_at_least "1.10" "${_replacing_version_branch}"; then |
3190 |
- # Updating from <1.10 |
3191 |
- _has_to_adjust_permissions=1 |
3192 |
- debug-print "Need to adjust permissions to fix CVE-2016-1247!" |
3193 |
- else |
3194 |
- # Updating from >=1.10 |
3195 |
- local _fixed_in_pvr= |
3196 |
- case "${_replacing_version_branch}" in |
3197 |
- "1.10") |
3198 |
- _fixed_in_pvr="1.10.2-r3" |
3199 |
- ;; |
3200 |
- "1.11") |
3201 |
- _fixed_in_pvr="1.11.6-r1" |
3202 |
- ;; |
3203 |
- *) |
3204 |
- # This should be any future branch. |
3205 |
- # If we run this code it is safe to assume that we have already |
3206 |
- # adjusted permissions or were never affected because user is |
3207 |
- # doing an update from previous version which was safe or did |
3208 |
- # the adjustments. Otherwise, we wouldn't hit this code path ... |
3209 |
- _fixed_in_pvr= |
3210 |
- esac |
3211 |
- |
3212 |
- if [[ -z "${_fixed_in_pvr}" ]] || version_is_at_least "${_fixed_in_pvr}" "${_replacing_version}"; then |
3213 |
- # We are updating an installation which should already be adjusted |
3214 |
- # or which was never affected |
3215 |
- _need_to_fix_CVE2016_1247=0 |
3216 |
- debug-print "Skipping CVE-2016-1247 ... existing installation should not be affected!" |
3217 |
- else |
3218 |
- _has_to_adjust_permissions=1 |
3219 |
- debug-print "Need to adjust permissions to fix CVE-2016-1247!" |
3220 |
- fi |
3221 |
- fi |
3222 |
- done |
3223 |
- |
3224 |
- if [[ ${_has_to_adjust_permissions} -eq 1 ]]; then |
3225 |
- # We do not DIE when chmod/chown commands are failing because |
3226 |
- # package is already merged on user's system at this stage |
3227 |
- # and we cannot retry without losing the information that |
3228 |
- # the existing installation needs to adjust permissions. |
3229 |
- # Instead we are going to a show a big warning ... |
3230 |
- |
3231 |
- if [[ ${_has_to_show_permission_warning} -eq 0 ]] && [[ ${_need_to_fix_CVE2013_0337} -eq 1 ]]; then |
3232 |
- ewarn "" |
3233 |
- ewarn "The world-readable bit (if set) has been removed from the" |
3234 |
- ewarn "following directories to mitigate a security bug" |
3235 |
- ewarn "(CVE-2013-0337, bug #458726):" |
3236 |
- ewarn "" |
3237 |
- ewarn " ${EPREFIX%/}/var/log/nginx" |
3238 |
- ewarn " ${EPREFIX%/}${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi}" |
3239 |
- ewarn "" |
3240 |
- ewarn "Check if this is correct for your setup before restarting nginx!" |
3241 |
- ewarn "This is a one-time change and will not happen on subsequent updates." |
3242 |
- ewarn "Furthermore nginx' temp directories got moved to '${EPREFIX%/}${NGINX_HOME_TMP}'" |
3243 |
- chmod o-rwx \ |
3244 |
- "${EPREFIX%/}"/var/log/nginx \ |
3245 |
- "${EPREFIX%/}"${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi} || \ |
3246 |
- _has_to_show_permission_warning=1 |
3247 |
- fi |
3248 |
- |
3249 |
- if [[ ${_has_to_show_permission_warning} -eq 0 ]] && [[ ${_need_to_fix_CVE2016_1247} -eq 1 ]]; then |
3250 |
- ewarn "" |
3251 |
- ewarn "The permissions on the following directory have been reset in" |
3252 |
- ewarn "order to mitigate a security bug (CVE-2016-1247, bug #605008):" |
3253 |
- ewarn "" |
3254 |
- ewarn " ${EPREFIX%/}/var/log/nginx" |
3255 |
- ewarn "" |
3256 |
- ewarn "Check if this is correct for your setup before restarting nginx!" |
3257 |
- ewarn "Also ensure that no other log directory used by any of your" |
3258 |
- ewarn "vhost(s) is not writeable for nginx user. Any of your log files" |
3259 |
- ewarn "used by nginx can be abused to escalate privileges!" |
3260 |
- ewarn "This is a one-time change and will not happen on subsequent updates." |
3261 |
- chown 0:nginx "${EPREFIX%/}"/var/log/nginx || _has_to_show_permission_warning=1 |
3262 |
- chmod 710 "${EPREFIX%/}"/var/log/nginx || _has_to_show_permission_warning=1 |
3263 |
- fi |
3264 |
- |
3265 |
- if [[ ${_has_to_show_permission_warning} -eq 1 ]]; then |
3266 |
- # Should never happen ... |
3267 |
- ewarn "" |
3268 |
- ewarn "*************************************************************" |
3269 |
- ewarn "*************** W A R N I N G ***************" |
3270 |
- ewarn "*************************************************************" |
3271 |
- ewarn "The one-time only attempt to adjust permissions of the" |
3272 |
- ewarn "existing nginx installation failed. Be aware that we will not" |
3273 |
- ewarn "try to adjust the same permissions again because now you are" |
3274 |
- ewarn "using a nginx version where we expect that the permissions" |
3275 |
- ewarn "are already adjusted or that you know what you are doing and" |
3276 |
- ewarn "want to keep custom permissions." |
3277 |
- ewarn "" |
3278 |
- fi |
3279 |
- fi |
3280 |
- |
3281 |
- # Sanity check for CVE-2016-1247 |
3282 |
- # Required to warn users who received the warning above and thought |
3283 |
- # they could fix it by unmerging and re-merging the package or have |
3284 |
- # unmerged a affected installation on purpose in the past leaving |
3285 |
- # /var/log/nginx on their system due to keepdir/non-empty folder |
3286 |
- # and are now installing the package again. |
3287 |
- local _sanity_check_testfile=$(mktemp --dry-run "${EPREFIX%/}"/var/log/nginx/.CVE-2016-1247.XXXXXXXXX) |
3288 |
- su -s /bin/sh -c "touch ${_sanity_check_testfile}" nginx >&/dev/null |
3289 |
- if [ $? -eq 0 ] ; then |
3290 |
- # Cleanup -- no reason to die here! |
3291 |
- rm -f "${_sanity_check_testfile}" |
3292 |
- |
3293 |
- ewarn "" |
3294 |
- ewarn "*************************************************************" |
3295 |
- ewarn "*************** W A R N I N G ***************" |
3296 |
- ewarn "*************************************************************" |
3297 |
- ewarn "Looks like your installation is vulnerable to CVE-2016-1247" |
3298 |
- ewarn "(bug #605008) because nginx user is able to create files in" |
3299 |
- ewarn "" |
3300 |
- ewarn " ${EPREFIX%/}/var/log/nginx" |
3301 |
- ewarn "" |
3302 |
- ewarn "Also ensure that no other log directory used by any of your" |
3303 |
- ewarn "vhost(s) is not writeable for nginx user. Any of your log files" |
3304 |
- ewarn "used by nginx can be abused to escalate privileges!" |
3305 |
- fi |
3306 |
- |
3307 |
- if [[ ${_has_to_show_httpoxy_mitigation_notice} -eq 1 ]]; then |
3308 |
- # HTTPoxy mitigation |
3309 |
- ewarn "" |
3310 |
- ewarn "This nginx installation comes with a mitigation for the HTTPoxy" |
3311 |
- ewarn "vulnerability for FastCGI, SCGI and uWSGI applications by setting" |
3312 |
- ewarn "the HTTP_PROXY parameter to an empty string per default when you" |
3313 |
- ewarn "are sourcing one of the default" |
3314 |
- ewarn "" |
3315 |
- ewarn " - 'fastcgi_params' or 'fastcgi.conf'" |
3316 |
- ewarn " - 'scgi_params'" |
3317 |
- ewarn " - 'uwsgi_params'" |
3318 |
- ewarn "" |
3319 |
- ewarn "files in your server block(s)." |
3320 |
- ewarn "" |
3321 |
- ewarn "If this is causing any problems for you make sure that you are sourcing the" |
3322 |
- ewarn "default parameters _before_ you set your own values." |
3323 |
- ewarn "If you are relying on user-supplied proxy values you have to remove the" |
3324 |
- ewarn "correlating lines from the file(s) mentioned above." |
3325 |
- ewarn "" |
3326 |
- fi |
3327 |
-} |
3328 |
|
3329 |
diff --git a/www-servers/nginx/nginx-1.17.6.ebuild b/www-servers/nginx/nginx-1.17.6.ebuild |
3330 |
deleted file mode 100644 |
3331 |
index 9b7d6b814db..00000000000 |
3332 |
--- a/www-servers/nginx/nginx-1.17.6.ebuild |
3333 |
+++ /dev/null |
3334 |
@@ -1,1089 +0,0 @@ |
3335 |
-# Copyright 1999-2019 Gentoo Authors |
3336 |
-# Distributed under the terms of the GNU General Public License v2 |
3337 |
- |
3338 |
-EAPI="6" |
3339 |
- |
3340 |
-# Maintainer notes: |
3341 |
-# - http_rewrite-independent pcre-support makes sense for matching locations without an actual rewrite |
3342 |
-# - any http-module activates the main http-functionality and overrides USE=-http |
3343 |
-# - keep the following requirements in mind before adding external modules: |
3344 |
-# * alive upstream |
3345 |
-# * sane packaging |
3346 |
-# * builds cleanly |
3347 |
-# * does not need a patch for nginx core |
3348 |
-# - TODO: test the google-perftools module (included in vanilla tarball) |
3349 |
- |
3350 |
-# prevent perl-module from adding automagic perl DEPENDs |
3351 |
-GENTOO_DEPEND_ON_PERL="no" |
3352 |
- |
3353 |
-# devel_kit (https://github.com/simpl/ngx_devel_kit, BSD license) |
3354 |
-DEVEL_KIT_MODULE_PV="0.3.1" |
3355 |
-DEVEL_KIT_MODULE_P="ngx_devel_kit-${DEVEL_KIT_MODULE_PV}" |
3356 |
-DEVEL_KIT_MODULE_URI="https://github.com/simpl/ngx_devel_kit/archive/v${DEVEL_KIT_MODULE_PV}.tar.gz" |
3357 |
-DEVEL_KIT_MODULE_WD="${WORKDIR}/ngx_devel_kit-${DEVEL_KIT_MODULE_PV}" |
3358 |
- |
3359 |
-# ngx_brotli (https://github.com/eustas/ngx_brotli, BSD-2) |
3360 |
-HTTP_BROTLI_MODULE_PV="8104036af9cff4b1d34f22d00ba857e2a93a243c" |
3361 |
-HTTP_BROTLI_MODULE_P="ngx_brotli-${HTTP_BROTLI_MODULE_PV}" |
3362 |
-HTTP_BROTLI_MODULE_URI="https://github.com/eustas/ngx_brotli/archive/${HTTP_BROTLI_MODULE_PV}.tar.gz" |
3363 |
-HTTP_BROTLI_MODULE_WD="${WORKDIR}/ngx_brotli-${HTTP_BROTLI_MODULE_PV}" |
3364 |
- |
3365 |
-# http_uploadprogress (https://github.com/masterzen/nginx-upload-progress-module, BSD-2 license) |
3366 |
-HTTP_UPLOAD_PROGRESS_MODULE_PV="0.9.2" |
3367 |
-HTTP_UPLOAD_PROGRESS_MODULE_P="ngx_http_upload_progress-${HTTP_UPLOAD_PROGRESS_MODULE_PV}-r1" |
3368 |
-HTTP_UPLOAD_PROGRESS_MODULE_URI="https://github.com/masterzen/nginx-upload-progress-module/archive/v${HTTP_UPLOAD_PROGRESS_MODULE_PV}.tar.gz" |
3369 |
-HTTP_UPLOAD_PROGRESS_MODULE_WD="${WORKDIR}/nginx-upload-progress-module-${HTTP_UPLOAD_PROGRESS_MODULE_PV}" |
3370 |
- |
3371 |
-# http_headers_more (https://github.com/agentzh/headers-more-nginx-module, BSD license) |
3372 |
-HTTP_HEADERS_MORE_MODULE_PV="0.33" |
3373 |
-HTTP_HEADERS_MORE_MODULE_P="ngx_http_headers_more-${HTTP_HEADERS_MORE_MODULE_PV}" |
3374 |
-HTTP_HEADERS_MORE_MODULE_URI="https://github.com/agentzh/headers-more-nginx-module/archive/v${HTTP_HEADERS_MORE_MODULE_PV}.tar.gz" |
3375 |
-HTTP_HEADERS_MORE_MODULE_WD="${WORKDIR}/headers-more-nginx-module-${HTTP_HEADERS_MORE_MODULE_PV}" |
3376 |
- |
3377 |
-# http_cache_purge (http://labs.frickle.com/nginx_ngx_cache_purge/, https://github.com/FRiCKLE/ngx_cache_purge, BSD-2 license) |
3378 |
-HTTP_CACHE_PURGE_MODULE_PV="2.3" |
3379 |
-HTTP_CACHE_PURGE_MODULE_P="ngx_http_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}" |
3380 |
-HTTP_CACHE_PURGE_MODULE_URI="http://labs.frickle.com/files/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}.tar.gz" |
3381 |
-HTTP_CACHE_PURGE_MODULE_WD="${WORKDIR}/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}" |
3382 |
- |
3383 |
-# http_slowfs_cache (http://labs.frickle.com/nginx_ngx_slowfs_cache/, BSD-2 license) |
3384 |
-HTTP_SLOWFS_CACHE_MODULE_PV="1.10" |
3385 |
-HTTP_SLOWFS_CACHE_MODULE_P="ngx_http_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}" |
3386 |
-HTTP_SLOWFS_CACHE_MODULE_URI="http://labs.frickle.com/files/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}.tar.gz" |
3387 |
-HTTP_SLOWFS_CACHE_MODULE_WD="${WORKDIR}/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}" |
3388 |
- |
3389 |
-# http_fancyindex (https://github.com/aperezdc/ngx-fancyindex, BSD license) |
3390 |
-HTTP_FANCYINDEX_MODULE_PV="0.4.3" |
3391 |
-HTTP_FANCYINDEX_MODULE_P="ngx_http_fancyindex-${HTTP_FANCYINDEX_MODULE_PV}" |
3392 |
-HTTP_FANCYINDEX_MODULE_URI="https://github.com/aperezdc/ngx-fancyindex/archive/v${HTTP_FANCYINDEX_MODULE_PV}.tar.gz" |
3393 |
-HTTP_FANCYINDEX_MODULE_WD="${WORKDIR}/ngx-fancyindex-${HTTP_FANCYINDEX_MODULE_PV}" |
3394 |
- |
3395 |
-# http_lua (https://github.com/openresty/lua-nginx-module, BSD license) |
3396 |
-HTTP_LUA_MODULE_PV="0.10.15" |
3397 |
-HTTP_LUA_MODULE_P="ngx_http_lua-${HTTP_LUA_MODULE_PV}" |
3398 |
-HTTP_LUA_MODULE_URI="https://github.com/openresty/lua-nginx-module/archive/v${HTTP_LUA_MODULE_PV}.tar.gz" |
3399 |
-HTTP_LUA_MODULE_WD="${WORKDIR}/lua-nginx-module-${HTTP_LUA_MODULE_PV}" |
3400 |
- |
3401 |
-# http_auth_pam (https://github.com/stogh/ngx_http_auth_pam_module/, http://web.iti.upv.es/~sto/nginx/, BSD-2 license) |
3402 |
-HTTP_AUTH_PAM_MODULE_PV="1.5.1" |
3403 |
-HTTP_AUTH_PAM_MODULE_P="ngx_http_auth_pam-${HTTP_AUTH_PAM_MODULE_PV}" |
3404 |
-HTTP_AUTH_PAM_MODULE_URI="https://github.com/stogh/ngx_http_auth_pam_module/archive/v${HTTP_AUTH_PAM_MODULE_PV}.tar.gz" |
3405 |
-HTTP_AUTH_PAM_MODULE_WD="${WORKDIR}/ngx_http_auth_pam_module-${HTTP_AUTH_PAM_MODULE_PV}" |
3406 |
- |
3407 |
-# http_upstream_check (https://github.com/yaoweibin/nginx_upstream_check_module, BSD license) |
3408 |
-HTTP_UPSTREAM_CHECK_MODULE_PV="9aecf15ec379fe98f62355c57b60c0bc83296f04" |
3409 |
-HTTP_UPSTREAM_CHECK_MODULE_P="ngx_http_upstream_check-${HTTP_UPSTREAM_CHECK_MODULE_PV}" |
3410 |
-HTTP_UPSTREAM_CHECK_MODULE_URI="https://github.com/yaoweibin/nginx_upstream_check_module/archive/${HTTP_UPSTREAM_CHECK_MODULE_PV}.tar.gz" |
3411 |
-HTTP_UPSTREAM_CHECK_MODULE_WD="${WORKDIR}/nginx_upstream_check_module-${HTTP_UPSTREAM_CHECK_MODULE_PV}" |
3412 |
- |
3413 |
-# http_metrics (https://github.com/zenops/ngx_metrics, BSD license) |
3414 |
-HTTP_METRICS_MODULE_PV="0.1.1" |
3415 |
-HTTP_METRICS_MODULE_P="ngx_metrics-${HTTP_METRICS_MODULE_PV}" |
3416 |
-HTTP_METRICS_MODULE_URI="https://github.com/madvertise/ngx_metrics/archive/v${HTTP_METRICS_MODULE_PV}.tar.gz" |
3417 |
-HTTP_METRICS_MODULE_WD="${WORKDIR}/ngx_metrics-${HTTP_METRICS_MODULE_PV}" |
3418 |
- |
3419 |
-# http_vhost_traffic_status (https://github.com/vozlt/nginx-module-vts, BSD license) |
3420 |
-HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV="46d85558e344dfe2b078ce757fd36c69a1ec2dd3" |
3421 |
-HTTP_VHOST_TRAFFIC_STATUS_MODULE_P="ngx_http_vhost_traffic_status-${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}" |
3422 |
-HTTP_VHOST_TRAFFIC_STATUS_MODULE_URI="https://github.com/vozlt/nginx-module-vts/archive/${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}.tar.gz" |
3423 |
-HTTP_VHOST_TRAFFIC_STATUS_MODULE_WD="${WORKDIR}/nginx-module-vts-${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}" |
3424 |
- |
3425 |
-# naxsi-core (https://github.com/nbs-system/naxsi, GPLv2+) |
3426 |
-HTTP_NAXSI_MODULE_PV="0.56" |
3427 |
-HTTP_NAXSI_MODULE_P="ngx_http_naxsi-${HTTP_NAXSI_MODULE_PV}" |
3428 |
-HTTP_NAXSI_MODULE_URI="https://github.com/nbs-system/naxsi/archive/${HTTP_NAXSI_MODULE_PV}.tar.gz" |
3429 |
-HTTP_NAXSI_MODULE_WD="${WORKDIR}/naxsi-${HTTP_NAXSI_MODULE_PV}/naxsi_src" |
3430 |
- |
3431 |
-# nginx-rtmp-module (https://github.com/arut/nginx-rtmp-module, BSD license) |
3432 |
-RTMP_MODULE_PV="1.2.1" |
3433 |
-RTMP_MODULE_P="ngx_rtmp-${RTMP_MODULE_PV}" |
3434 |
-RTMP_MODULE_URI="https://github.com/arut/nginx-rtmp-module/archive/v${RTMP_MODULE_PV}.tar.gz" |
3435 |
-RTMP_MODULE_WD="${WORKDIR}/nginx-rtmp-module-${RTMP_MODULE_PV}" |
3436 |
- |
3437 |
-# nginx-dav-ext-module (https://github.com/arut/nginx-dav-ext-module, BSD license) |
3438 |
-HTTP_DAV_EXT_MODULE_PV="3.0.0" |
3439 |
-HTTP_DAV_EXT_MODULE_P="ngx_http_dav_ext-${HTTP_DAV_EXT_MODULE_PV}" |
3440 |
-HTTP_DAV_EXT_MODULE_URI="https://github.com/arut/nginx-dav-ext-module/archive/v${HTTP_DAV_EXT_MODULE_PV}.tar.gz" |
3441 |
-HTTP_DAV_EXT_MODULE_WD="${WORKDIR}/nginx-dav-ext-module-${HTTP_DAV_EXT_MODULE_PV}" |
3442 |
- |
3443 |
-# echo-nginx-module (https://github.com/openresty/echo-nginx-module, BSD license) |
3444 |
-HTTP_ECHO_MODULE_PV="0.61" |
3445 |
-HTTP_ECHO_MODULE_P="ngx_http_echo-${HTTP_ECHO_MODULE_PV}" |
3446 |
-HTTP_ECHO_MODULE_URI="https://github.com/openresty/echo-nginx-module/archive/v${HTTP_ECHO_MODULE_PV}.tar.gz" |
3447 |
-HTTP_ECHO_MODULE_WD="${WORKDIR}/echo-nginx-module-${HTTP_ECHO_MODULE_PV}" |
3448 |
- |
3449 |
-# mod_security for nginx (https://modsecurity.org/, Apache-2.0) |
3450 |
-# keep the MODULE_P here consistent with upstream to avoid tarball duplication |
3451 |
-HTTP_SECURITY_MODULE_PV="2.9.3" |
3452 |
-HTTP_SECURITY_MODULE_P="modsecurity-${HTTP_SECURITY_MODULE_PV}" |
3453 |
-HTTP_SECURITY_MODULE_URI="https://www.modsecurity.org/tarball/${HTTP_SECURITY_MODULE_PV}/${HTTP_SECURITY_MODULE_P}.tar.gz" |
3454 |
-HTTP_SECURITY_MODULE_WD="${WORKDIR}/${HTTP_SECURITY_MODULE_P}" |
3455 |
- |
3456 |
-# push-stream-module (http://www.nginxpushstream.com, https://github.com/wandenberg/nginx-push-stream-module, GPL-3) |
3457 |
-HTTP_PUSH_STREAM_MODULE_PV="0.5.4" |
3458 |
-HTTP_PUSH_STREAM_MODULE_P="ngx_http_push_stream-${HTTP_PUSH_STREAM_MODULE_PV}" |
3459 |
-HTTP_PUSH_STREAM_MODULE_URI="https://github.com/wandenberg/nginx-push-stream-module/archive/${HTTP_PUSH_STREAM_MODULE_PV}.tar.gz" |
3460 |
-HTTP_PUSH_STREAM_MODULE_WD="${WORKDIR}/nginx-push-stream-module-${HTTP_PUSH_STREAM_MODULE_PV}" |
3461 |
- |
3462 |
-# sticky-module (https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng, BSD-2) |
3463 |
-HTTP_STICKY_MODULE_PV="1.2.6-10-g08a395c66e42" |
3464 |
-HTTP_STICKY_MODULE_P="nginx_http_sticky_module_ng-${HTTP_STICKY_MODULE_PV}" |
3465 |
-HTTP_STICKY_MODULE_URI="https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/get/${HTTP_STICKY_MODULE_PV}.tar.bz2" |
3466 |
-HTTP_STICKY_MODULE_WD="${WORKDIR}/nginx-goodies-nginx-sticky-module-ng-08a395c66e42" |
3467 |
- |
3468 |
-# mogilefs-module (https://github.com/vkholodkov/nginx-mogilefs-module, BSD-2) |
3469 |
-HTTP_MOGILEFS_MODULE_PV="1.0.4" |
3470 |
-HTTP_MOGILEFS_MODULE_P="ngx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}" |
3471 |
-HTTP_MOGILEFS_MODULE_URI="https://github.com/vkholodkov/nginx-mogilefs-module/archive/${HTTP_MOGILEFS_MODULE_PV}.tar.gz" |
3472 |
-HTTP_MOGILEFS_MODULE_WD="${WORKDIR}/nginx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}" |
3473 |
- |
3474 |
-# memc-module (https://github.com/openresty/memc-nginx-module, BSD-2) |
3475 |
-HTTP_MEMC_MODULE_PV="0.19" |
3476 |
-HTTP_MEMC_MODULE_P="ngx_memc_module-${HTTP_MEMC_MODULE_PV}" |
3477 |
-HTTP_MEMC_MODULE_URI="https://github.com/openresty/memc-nginx-module/archive/v${HTTP_MEMC_MODULE_PV}.tar.gz" |
3478 |
-HTTP_MEMC_MODULE_WD="${WORKDIR}/memc-nginx-module-${HTTP_MEMC_MODULE_PV}" |
3479 |
- |
3480 |
-# nginx-ldap-auth-module (https://github.com/kvspb/nginx-auth-ldap, BSD-2) |
3481 |
-HTTP_LDAP_MODULE_PV="42d195d7a7575ebab1c369ad3fc5d78dc2c2669c" |
3482 |
-HTTP_LDAP_MODULE_P="nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}" |
3483 |
-HTTP_LDAP_MODULE_URI="https://github.com/kvspb/nginx-auth-ldap/archive/${HTTP_LDAP_MODULE_PV}.tar.gz" |
3484 |
-HTTP_LDAP_MODULE_WD="${WORKDIR}/nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}" |
3485 |
- |
3486 |
-# geoip2 (https://github.com/leev/ngx_http_geoip2_module, BSD-2) |
3487 |
-GEOIP2_MODULE_PV="3.2" |
3488 |
-GEOIP2_MODULE_P="ngx_http_geoip2_module-${GEOIP2_MODULE_PV}" |
3489 |
-GEOIP2_MODULE_URI="https://github.com/leev/ngx_http_geoip2_module/archive/${GEOIP2_MODULE_PV}.tar.gz" |
3490 |
-GEOIP2_MODULE_WD="${WORKDIR}/ngx_http_geoip2_module-${GEOIP2_MODULE_PV}" |
3491 |
- |
3492 |
-# njs-module (https://github.com/nginx/njs, as-is) |
3493 |
-NJS_MODULE_PV="0.3.7" |
3494 |
-NJS_MODULE_P="njs-${NJS_MODULE_PV}" |
3495 |
-NJS_MODULE_URI="https://github.com/nginx/njs/archive/${NJS_MODULE_PV}.tar.gz" |
3496 |
-NJS_MODULE_WD="${WORKDIR}/njs-${NJS_MODULE_PV}" |
3497 |
- |
3498 |
-# We handle deps below ourselves |
3499 |
-SSL_DEPS_SKIP=1 |
3500 |
-AUTOTOOLS_AUTO_DEPEND="no" |
3501 |
- |
3502 |
-inherit autotools ssl-cert toolchain-funcs perl-module flag-o-matic user systemd versionator multilib pax-utils |
3503 |
- |
3504 |
-DESCRIPTION="Robust, small and high performance http and reverse proxy server" |
3505 |
-HOMEPAGE="https://nginx.org" |
3506 |
-SRC_URI="https://nginx.org/download/${P}.tar.gz |
3507 |
- ${DEVEL_KIT_MODULE_URI} -> ${DEVEL_KIT_MODULE_P}.tar.gz |
3508 |
- nginx_modules_http_auth_ldap? ( ${HTTP_LDAP_MODULE_URI} -> ${HTTP_LDAP_MODULE_P}.tar.gz ) |
3509 |
- nginx_modules_http_auth_pam? ( ${HTTP_AUTH_PAM_MODULE_URI} -> ${HTTP_AUTH_PAM_MODULE_P}.tar.gz ) |
3510 |
- nginx_modules_http_brotli? ( ${HTTP_BROTLI_MODULE_URI} -> ${HTTP_BROTLI_MODULE_P}.tar.gz ) |
3511 |
- nginx_modules_http_cache_purge? ( ${HTTP_CACHE_PURGE_MODULE_URI} -> ${HTTP_CACHE_PURGE_MODULE_P}.tar.gz ) |
3512 |
- nginx_modules_http_dav_ext? ( ${HTTP_DAV_EXT_MODULE_URI} -> ${HTTP_DAV_EXT_MODULE_P}.tar.gz ) |
3513 |
- nginx_modules_http_echo? ( ${HTTP_ECHO_MODULE_URI} -> ${HTTP_ECHO_MODULE_P}.tar.gz ) |
3514 |
- nginx_modules_http_fancyindex? ( ${HTTP_FANCYINDEX_MODULE_URI} -> ${HTTP_FANCYINDEX_MODULE_P}.tar.gz ) |
3515 |
- nginx_modules_http_geoip2? ( ${GEOIP2_MODULE_URI} -> ${GEOIP2_MODULE_P}.tar.gz ) |
3516 |
- nginx_modules_http_headers_more? ( ${HTTP_HEADERS_MORE_MODULE_URI} -> ${HTTP_HEADERS_MORE_MODULE_P}.tar.gz ) |
3517 |
- nginx_modules_http_javascript? ( ${NJS_MODULE_URI} -> ${NJS_MODULE_P}.tar.gz ) |
3518 |
- nginx_modules_http_lua? ( ${HTTP_LUA_MODULE_URI} -> ${HTTP_LUA_MODULE_P}.tar.gz ) |
3519 |
- nginx_modules_http_memc? ( ${HTTP_MEMC_MODULE_URI} -> ${HTTP_MEMC_MODULE_P}.tar.gz ) |
3520 |
- nginx_modules_http_metrics? ( ${HTTP_METRICS_MODULE_URI} -> ${HTTP_METRICS_MODULE_P}.tar.gz ) |
3521 |
- nginx_modules_http_mogilefs? ( ${HTTP_MOGILEFS_MODULE_URI} -> ${HTTP_MOGILEFS_MODULE_P}.tar.gz ) |
3522 |
- nginx_modules_http_naxsi? ( ${HTTP_NAXSI_MODULE_URI} -> ${HTTP_NAXSI_MODULE_P}.tar.gz ) |
3523 |
- nginx_modules_http_push_stream? ( ${HTTP_PUSH_STREAM_MODULE_URI} -> ${HTTP_PUSH_STREAM_MODULE_P}.tar.gz ) |
3524 |
- nginx_modules_http_security? ( ${HTTP_SECURITY_MODULE_URI} -> ${HTTP_SECURITY_MODULE_P}.tar.gz ) |
3525 |
- nginx_modules_http_slowfs_cache? ( ${HTTP_SLOWFS_CACHE_MODULE_URI} -> ${HTTP_SLOWFS_CACHE_MODULE_P}.tar.gz ) |
3526 |
- nginx_modules_http_sticky? ( ${HTTP_STICKY_MODULE_URI} -> ${HTTP_STICKY_MODULE_P}.tar.bz2 ) |
3527 |
- nginx_modules_http_upload_progress? ( ${HTTP_UPLOAD_PROGRESS_MODULE_URI} -> ${HTTP_UPLOAD_PROGRESS_MODULE_P}.tar.gz ) |
3528 |
- nginx_modules_http_upstream_check? ( ${HTTP_UPSTREAM_CHECK_MODULE_URI} -> ${HTTP_UPSTREAM_CHECK_MODULE_P}.tar.gz ) |
3529 |
- nginx_modules_http_vhost_traffic_status? ( ${HTTP_VHOST_TRAFFIC_STATUS_MODULE_URI} -> ${HTTP_VHOST_TRAFFIC_STATUS_MODULE_P}.tar.gz ) |
3530 |
- nginx_modules_stream_geoip2? ( ${GEOIP2_MODULE_URI} -> ${GEOIP2_MODULE_P}.tar.gz ) |
3531 |
- nginx_modules_stream_javascript? ( ${NJS_MODULE_URI} -> ${NJS_MODULE_P}.tar.gz ) |
3532 |
- rtmp? ( ${RTMP_MODULE_URI} -> ${RTMP_MODULE_P}.tar.gz )" |
3533 |
- |
3534 |
-LICENSE="BSD-2 BSD SSLeay MIT GPL-2 GPL-2+ |
3535 |
- nginx_modules_http_security? ( Apache-2.0 ) |
3536 |
- nginx_modules_http_push_stream? ( GPL-3 )" |
3537 |
- |
3538 |
-SLOT="mainline" |
3539 |
-KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux" |
3540 |
- |
3541 |
-# Package doesn't provide a real test suite |
3542 |
-RESTRICT="test" |
3543 |
- |
3544 |
-NGINX_MODULES_STD="access auth_basic autoindex browser charset empty_gif |
3545 |
- fastcgi geo grpc gzip limit_req limit_conn map memcached mirror |
3546 |
- proxy referer rewrite scgi ssi split_clients upstream_hash |
3547 |
- upstream_ip_hash upstream_keepalive upstream_least_conn |
3548 |
- upstream_zone userid uwsgi" |
3549 |
-NGINX_MODULES_OPT="addition auth_request dav degradation flv geoip gunzip |
3550 |
- gzip_static image_filter mp4 perl random_index realip secure_link |
3551 |
- slice stub_status sub xslt" |
3552 |
-NGINX_MODULES_STREAM_STD="access geo limit_conn map return split_clients |
3553 |
- upstream_hash upstream_least_conn upstream_zone" |
3554 |
-NGINX_MODULES_STREAM_OPT="geoip realip ssl_preread" |
3555 |
-NGINX_MODULES_MAIL="imap pop3 smtp" |
3556 |
-NGINX_MODULES_3RD=" |
3557 |
- http_auth_ldap |
3558 |
- http_auth_pam |
3559 |
- http_brotli |
3560 |
- http_cache_purge |
3561 |
- http_dav_ext |
3562 |
- http_echo |
3563 |
- http_fancyindex |
3564 |
- http_geoip2 |
3565 |
- http_headers_more |
3566 |
- http_javascript |
3567 |
- http_lua |
3568 |
- http_memc |
3569 |
- http_metrics |
3570 |
- http_mogilefs |
3571 |
- http_naxsi |
3572 |
- http_push_stream |
3573 |
- http_security |
3574 |
- http_slowfs_cache |
3575 |
- http_sticky |
3576 |
- http_upload_progress |
3577 |
- http_upstream_check |
3578 |
- http_vhost_traffic_status |
3579 |
- stream_geoip2 |
3580 |
- stream_javascript |
3581 |
-" |
3582 |
- |
3583 |
-IUSE="aio debug +http +http2 +http-cache +ipv6 libatomic libressl luajit +pcre |
3584 |
- pcre-jit rtmp selinux ssl threads userland_GNU vim-syntax" |
3585 |
- |
3586 |
-for mod in $NGINX_MODULES_STD; do |
3587 |
- IUSE="${IUSE} +nginx_modules_http_${mod}" |
3588 |
-done |
3589 |
- |
3590 |
-for mod in $NGINX_MODULES_OPT; do |
3591 |
- IUSE="${IUSE} nginx_modules_http_${mod}" |
3592 |
-done |
3593 |
- |
3594 |
-for mod in $NGINX_MODULES_STREAM_STD; do |
3595 |
- IUSE="${IUSE} nginx_modules_stream_${mod}" |
3596 |
-done |
3597 |
- |
3598 |
-for mod in $NGINX_MODULES_STREAM_OPT; do |
3599 |
- IUSE="${IUSE} nginx_modules_stream_${mod}" |
3600 |
-done |
3601 |
- |
3602 |
-for mod in $NGINX_MODULES_MAIL; do |
3603 |
- IUSE="${IUSE} nginx_modules_mail_${mod}" |
3604 |
-done |
3605 |
- |
3606 |
-for mod in $NGINX_MODULES_3RD; do |
3607 |
- IUSE="${IUSE} nginx_modules_${mod}" |
3608 |
-done |
3609 |
- |
3610 |
-# Add so we can warn users updating about config changes |
3611 |
-# @TODO: jbergstroem: remove on next release series |
3612 |
-IUSE="${IUSE} nginx_modules_http_spdy" |
3613 |
- |
3614 |
-CDEPEND=" |
3615 |
- pcre? ( dev-libs/libpcre:= ) |
3616 |
- pcre-jit? ( dev-libs/libpcre:=[jit] ) |
3617 |
- ssl? ( |
3618 |
- !libressl? ( dev-libs/openssl:0= ) |
3619 |
- libressl? ( dev-libs/libressl:= ) |
3620 |
- ) |
3621 |
- http2? ( |
3622 |
- !libressl? ( >=dev-libs/openssl-1.0.1c:0= ) |
3623 |
- libressl? ( dev-libs/libressl:= ) |
3624 |
- ) |
3625 |
- http-cache? ( |
3626 |
- userland_GNU? ( |
3627 |
- !libressl? ( dev-libs/openssl:0= ) |
3628 |
- libressl? ( dev-libs/libressl:= ) |
3629 |
- ) |
3630 |
- ) |
3631 |
- nginx_modules_http_brotli? ( app-arch/brotli:= ) |
3632 |
- nginx_modules_http_geoip? ( dev-libs/geoip ) |
3633 |
- nginx_modules_http_geoip2? ( dev-libs/libmaxminddb:= ) |
3634 |
- nginx_modules_http_gunzip? ( sys-libs/zlib ) |
3635 |
- nginx_modules_http_gzip? ( sys-libs/zlib ) |
3636 |
- nginx_modules_http_gzip_static? ( sys-libs/zlib ) |
3637 |
- nginx_modules_http_image_filter? ( media-libs/gd:=[jpeg,png] ) |
3638 |
- nginx_modules_http_perl? ( >=dev-lang/perl-5.8:= ) |
3639 |
- nginx_modules_http_rewrite? ( dev-libs/libpcre:= ) |
3640 |
- nginx_modules_http_secure_link? ( |
3641 |
- userland_GNU? ( |
3642 |
- !libressl? ( dev-libs/openssl:0= ) |
3643 |
- libressl? ( dev-libs/libressl:= ) |
3644 |
- ) |
3645 |
- ) |
3646 |
- nginx_modules_http_xslt? ( dev-libs/libxml2:= dev-libs/libxslt ) |
3647 |
- nginx_modules_http_lua? ( dev-lang/luajit:2= ) |
3648 |
- nginx_modules_http_auth_pam? ( sys-libs/pam ) |
3649 |
- nginx_modules_http_metrics? ( dev-libs/yajl:= ) |
3650 |
- nginx_modules_http_dav_ext? ( dev-libs/libxml2 ) |
3651 |
- nginx_modules_http_security? ( |
3652 |
- dev-libs/apr:= |
3653 |
- dev-libs/apr-util:= |
3654 |
- dev-libs/libxml2:= |
3655 |
- net-misc/curl |
3656 |
- www-servers/apache |
3657 |
- ) |
3658 |
- nginx_modules_http_auth_ldap? ( net-nds/openldap[ssl?] ) |
3659 |
- nginx_modules_stream_geoip? ( dev-libs/geoip ) |
3660 |
- nginx_modules_stream_geoip2? ( dev-libs/libmaxminddb:= )" |
3661 |
-RDEPEND="${CDEPEND} |
3662 |
- selinux? ( sec-policy/selinux-nginx ) |
3663 |
- !www-servers/nginx:0" |
3664 |
-DEPEND="${CDEPEND} |
3665 |
- nginx_modules_http_brotli? ( virtual/pkgconfig ) |
3666 |
- nginx_modules_http_security? ( ${AUTOTOOLS_DEPEND} ) |
3667 |
- arm? ( dev-libs/libatomic_ops ) |
3668 |
- libatomic? ( dev-libs/libatomic_ops )" |
3669 |
-PDEPEND="vim-syntax? ( app-vim/nginx-syntax )" |
3670 |
- |
3671 |
-REQUIRED_USE="pcre-jit? ( pcre ) |
3672 |
- nginx_modules_http_grpc? ( http2 ) |
3673 |
- nginx_modules_http_lua? ( |
3674 |
- luajit |
3675 |
- nginx_modules_http_rewrite |
3676 |
- ) |
3677 |
- nginx_modules_http_naxsi? ( pcre ) |
3678 |
- nginx_modules_http_dav_ext? ( nginx_modules_http_dav ) |
3679 |
- nginx_modules_http_metrics? ( nginx_modules_http_stub_status ) |
3680 |
- nginx_modules_http_security? ( pcre ) |
3681 |
- nginx_modules_http_push_stream? ( ssl )" |
3682 |
- |
3683 |
-pkg_setup() { |
3684 |
- NGINX_HOME="/var/lib/nginx" |
3685 |
- NGINX_HOME_TMP="${NGINX_HOME}/tmp" |
3686 |
- |
3687 |
- ebegin "Creating nginx user and group" |
3688 |
- enewgroup ${PN} |
3689 |
- enewuser ${PN} -1 -1 "${NGINX_HOME}" ${PN} |
3690 |
- eend $? |
3691 |
- |
3692 |
- if use libatomic; then |
3693 |
- ewarn "GCC 4.1+ features built-in atomic operations." |
3694 |
- ewarn "Using libatomic_ops is only needed if using" |
3695 |
- ewarn "a different compiler or a GCC prior to 4.1" |
3696 |
- fi |
3697 |
- |
3698 |
- if [[ -n $NGINX_ADD_MODULES ]]; then |
3699 |
- ewarn "You are building custom modules via \$NGINX_ADD_MODULES!" |
3700 |
- ewarn "This nginx installation is not supported!" |
3701 |
- ewarn "Make sure you can reproduce the bug without those modules" |
3702 |
- ewarn "_before_ reporting bugs." |
3703 |
- fi |
3704 |
- |
3705 |
- if use !http; then |
3706 |
- ewarn "To actually disable all http-functionality you also have to disable" |
3707 |
- ewarn "all nginx http modules." |
3708 |
- fi |
3709 |
- |
3710 |
- if use nginx_modules_http_mogilefs && use threads; then |
3711 |
- eerror "mogilefs won't compile with threads support." |
3712 |
- eerror "Please disable either flag and try again." |
3713 |
- die "Can't compile mogilefs with threads support" |
3714 |
- fi |
3715 |
-} |
3716 |
- |
3717 |
-src_prepare() { |
3718 |
- eapply "${FILESDIR}/${PN}-1.4.1-fix-perl-install-path.patch" |
3719 |
- eapply "${FILESDIR}/${PN}-httpoxy-mitigation-r1.patch" |
3720 |
- |
3721 |
- if use nginx_modules_http_auth_pam; then |
3722 |
- cd "${HTTP_AUTH_PAM_MODULE_WD}" || die |
3723 |
- eapply "${FILESDIR}"/http_auth_pam-1.5.1-adjust-loglevel-for-authentication-failures.patch |
3724 |
- cd "${S}" || die |
3725 |
- fi |
3726 |
- |
3727 |
- if use nginx_modules_http_brotli; then |
3728 |
- cd "${HTTP_BROTLI_MODULE_WD}" || die |
3729 |
- eapply "${FILESDIR}"/http_brotli-detect-brotli-r2.patch |
3730 |
- cd "${S}" || die |
3731 |
- fi |
3732 |
- |
3733 |
- if use nginx_modules_http_upstream_check; then |
3734 |
- eapply -p0 "${FILESDIR}"/http_upstream_check-nginx-1.11.5+.patch |
3735 |
- fi |
3736 |
- |
3737 |
- if use nginx_modules_http_cache_purge; then |
3738 |
- cd "${HTTP_CACHE_PURGE_MODULE_WD}" || die |
3739 |
- eapply "${FILESDIR}"/http_cache_purge-1.11.6+.patch |
3740 |
- cd "${S}" || die |
3741 |
- fi |
3742 |
- |
3743 |
- if use nginx_modules_http_security; then |
3744 |
- cd "${HTTP_SECURITY_MODULE_WD}" || die |
3745 |
- |
3746 |
- eautoreconf |
3747 |
- |
3748 |
- if use luajit ; then |
3749 |
- sed -i \ |
3750 |
- -e 's|^\(LUA_PKGNAMES\)=.*|\1="luajit"|' \ |
3751 |
- configure || die |
3752 |
- fi |
3753 |
- |
3754 |
- cd "${S}" || die |
3755 |
- fi |
3756 |
- |
3757 |
- if use nginx_modules_http_upload_progress; then |
3758 |
- cd "${HTTP_UPLOAD_PROGRESS_MODULE_WD}" || die |
3759 |
- eapply "${FILESDIR}"/http_uploadprogress-issue_50-r1.patch |
3760 |
- cd "${S}" || die |
3761 |
- fi |
3762 |
- |
3763 |
- find auto/ -type f -print0 | xargs -0 sed -i 's:\&\& make:\&\& \\$(MAKE):' || die |
3764 |
- # We have config protection, don't rename etc files |
3765 |
- sed -i 's:.default::' auto/install || die |
3766 |
- # remove useless files |
3767 |
- sed -i -e '/koi-/d' -e '/win-/d' auto/install || die |
3768 |
- |
3769 |
- # don't install to /etc/nginx/ if not in use |
3770 |
- local module |
3771 |
- for module in fastcgi scgi uwsgi ; do |
3772 |
- if ! use nginx_modules_http_${module}; then |
3773 |
- sed -i -e "/${module}/d" auto/install || die |
3774 |
- fi |
3775 |
- done |
3776 |
- |
3777 |
- eapply_user |
3778 |
-} |
3779 |
- |
3780 |
-src_configure() { |
3781 |
- # mod_security needs to generate nginx/modsecurity/config before including it |
3782 |
- if use nginx_modules_http_security; then |
3783 |
- cd "${HTTP_SECURITY_MODULE_WD}" || die |
3784 |
- |
3785 |
- ./configure \ |
3786 |
- --enable-standalone-module \ |
3787 |
- --disable-mlogc \ |
3788 |
- --with-ssdeep=no \ |
3789 |
- $(use_enable pcre-jit) \ |
3790 |
- $(use_with nginx_modules_http_lua lua) || die "configure failed for mod_security" |
3791 |
- |
3792 |
- cd "${S}" || die |
3793 |
- fi |
3794 |
- |
3795 |
- local myconf=() http_enabled= mail_enabled= stream_enabled= |
3796 |
- |
3797 |
- use aio && myconf+=( --with-file-aio ) |
3798 |
- use debug && myconf+=( --with-debug ) |
3799 |
- use http2 && myconf+=( --with-http_v2_module ) |
3800 |
- use libatomic && myconf+=( --with-libatomic ) |
3801 |
- use pcre && myconf+=( --with-pcre ) |
3802 |
- use pcre-jit && myconf+=( --with-pcre-jit ) |
3803 |
- use threads && myconf+=( --with-threads ) |
3804 |
- |
3805 |
- # HTTP modules |
3806 |
- for mod in $NGINX_MODULES_STD; do |
3807 |
- if use nginx_modules_http_${mod}; then |
3808 |
- http_enabled=1 |
3809 |
- else |
3810 |
- myconf+=( --without-http_${mod}_module ) |
3811 |
- fi |
3812 |
- done |
3813 |
- |
3814 |
- for mod in $NGINX_MODULES_OPT; do |
3815 |
- if use nginx_modules_http_${mod}; then |
3816 |
- http_enabled=1 |
3817 |
- myconf+=( --with-http_${mod}_module ) |
3818 |
- fi |
3819 |
- done |
3820 |
- |
3821 |
- if use nginx_modules_http_fastcgi; then |
3822 |
- myconf+=( --with-http_realip_module ) |
3823 |
- fi |
3824 |
- |
3825 |
- # third-party modules |
3826 |
- if use nginx_modules_http_upload_progress; then |
3827 |
- http_enabled=1 |
3828 |
- myconf+=( --add-module=${HTTP_UPLOAD_PROGRESS_MODULE_WD} ) |
3829 |
- fi |
3830 |
- |
3831 |
- if use nginx_modules_http_headers_more; then |
3832 |
- http_enabled=1 |
3833 |
- myconf+=( --add-module=${HTTP_HEADERS_MORE_MODULE_WD} ) |
3834 |
- fi |
3835 |
- |
3836 |
- if use nginx_modules_http_cache_purge; then |
3837 |
- http_enabled=1 |
3838 |
- myconf+=( --add-module=${HTTP_CACHE_PURGE_MODULE_WD} ) |
3839 |
- fi |
3840 |
- |
3841 |
- if use nginx_modules_http_slowfs_cache; then |
3842 |
- http_enabled=1 |
3843 |
- myconf+=( --add-module=${HTTP_SLOWFS_CACHE_MODULE_WD} ) |
3844 |
- fi |
3845 |
- |
3846 |
- if use nginx_modules_http_fancyindex; then |
3847 |
- http_enabled=1 |
3848 |
- myconf+=( --add-module=${HTTP_FANCYINDEX_MODULE_WD} ) |
3849 |
- fi |
3850 |
- |
3851 |
- if use nginx_modules_http_lua; then |
3852 |
- http_enabled=1 |
3853 |
- export LUAJIT_LIB=$(pkg-config --variable libdir luajit) |
3854 |
- export LUAJIT_INC=$(pkg-config --variable includedir luajit) |
3855 |
- myconf+=( --add-module=${DEVEL_KIT_MODULE_WD} ) |
3856 |
- myconf+=( --add-module=${HTTP_LUA_MODULE_WD} ) |
3857 |
- fi |
3858 |
- |
3859 |
- if use nginx_modules_http_auth_pam; then |
3860 |
- http_enabled=1 |
3861 |
- myconf+=( --add-module=${HTTP_AUTH_PAM_MODULE_WD} ) |
3862 |
- fi |
3863 |
- |
3864 |
- if use nginx_modules_http_upstream_check; then |
3865 |
- http_enabled=1 |
3866 |
- myconf+=( --add-module=${HTTP_UPSTREAM_CHECK_MODULE_WD} ) |
3867 |
- fi |
3868 |
- |
3869 |
- if use nginx_modules_http_metrics; then |
3870 |
- http_enabled=1 |
3871 |
- myconf+=( --add-module=${HTTP_METRICS_MODULE_WD} ) |
3872 |
- fi |
3873 |
- |
3874 |
- if use nginx_modules_http_naxsi ; then |
3875 |
- http_enabled=1 |
3876 |
- myconf+=( --add-module=${HTTP_NAXSI_MODULE_WD} ) |
3877 |
- fi |
3878 |
- |
3879 |
- if use rtmp ; then |
3880 |
- http_enabled=1 |
3881 |
- myconf+=( --add-module=${RTMP_MODULE_WD} ) |
3882 |
- fi |
3883 |
- |
3884 |
- if use nginx_modules_http_dav_ext ; then |
3885 |
- http_enabled=1 |
3886 |
- myconf+=( --add-module=${HTTP_DAV_EXT_MODULE_WD} ) |
3887 |
- fi |
3888 |
- |
3889 |
- if use nginx_modules_http_echo ; then |
3890 |
- http_enabled=1 |
3891 |
- myconf+=( --add-module=${HTTP_ECHO_MODULE_WD} ) |
3892 |
- fi |
3893 |
- |
3894 |
- if use nginx_modules_http_security ; then |
3895 |
- http_enabled=1 |
3896 |
- myconf+=( --add-module=${HTTP_SECURITY_MODULE_WD}/nginx/modsecurity ) |
3897 |
- fi |
3898 |
- |
3899 |
- if use nginx_modules_http_push_stream ; then |
3900 |
- http_enabled=1 |
3901 |
- myconf+=( --add-module=${HTTP_PUSH_STREAM_MODULE_WD} ) |
3902 |
- fi |
3903 |
- |
3904 |
- if use nginx_modules_http_sticky ; then |
3905 |
- http_enabled=1 |
3906 |
- myconf+=( --add-module=${HTTP_STICKY_MODULE_WD} ) |
3907 |
- fi |
3908 |
- |
3909 |
- if use nginx_modules_http_mogilefs ; then |
3910 |
- http_enabled=1 |
3911 |
- myconf+=( --add-module=${HTTP_MOGILEFS_MODULE_WD} ) |
3912 |
- fi |
3913 |
- |
3914 |
- if use nginx_modules_http_memc ; then |
3915 |
- http_enabled=1 |
3916 |
- myconf+=( --add-module=${HTTP_MEMC_MODULE_WD} ) |
3917 |
- fi |
3918 |
- |
3919 |
- if use nginx_modules_http_auth_ldap; then |
3920 |
- http_enabled=1 |
3921 |
- myconf+=( --add-module=${HTTP_LDAP_MODULE_WD} ) |
3922 |
- fi |
3923 |
- |
3924 |
- if use nginx_modules_http_vhost_traffic_status; then |
3925 |
- http_enabled=1 |
3926 |
- myconf+=( --add-module=${HTTP_VHOST_TRAFFIC_STATUS_MODULE_WD} ) |
3927 |
- fi |
3928 |
- |
3929 |
- if use nginx_modules_http_geoip2 || use nginx_modules_stream_geoip2; then |
3930 |
- myconf+=( --add-module=${GEOIP2_MODULE_WD} ) |
3931 |
- fi |
3932 |
- |
3933 |
- if use nginx_modules_http_javascript || use nginx_modules_stream_javascript; then |
3934 |
- myconf+=( --add-module="${NJS_MODULE_WD}/nginx" ) |
3935 |
- fi |
3936 |
- |
3937 |
- if use nginx_modules_http_brotli; then |
3938 |
- http_enabled=1 |
3939 |
- myconf+=( --add-module=${HTTP_BROTLI_MODULE_WD} ) |
3940 |
- fi |
3941 |
- |
3942 |
- if use http || use http-cache || use http2 || use nginx_modules_http_javascript; then |
3943 |
- http_enabled=1 |
3944 |
- fi |
3945 |
- |
3946 |
- if [ $http_enabled ]; then |
3947 |
- use http-cache || myconf+=( --without-http-cache ) |
3948 |
- use ssl && myconf+=( --with-http_ssl_module ) |
3949 |
- else |
3950 |
- myconf+=( --without-http --without-http-cache ) |
3951 |
- fi |
3952 |
- |
3953 |
- # Stream modules |
3954 |
- for mod in $NGINX_MODULES_STREAM_STD; do |
3955 |
- if use nginx_modules_stream_${mod}; then |
3956 |
- stream_enabled=1 |
3957 |
- else |
3958 |
- myconf+=( --without-stream_${mod}_module ) |
3959 |
- fi |
3960 |
- done |
3961 |
- |
3962 |
- for mod in $NGINX_MODULES_STREAM_OPT; do |
3963 |
- if use nginx_modules_stream_${mod}; then |
3964 |
- stream_enabled=1 |
3965 |
- myconf+=( --with-stream_${mod}_module ) |
3966 |
- fi |
3967 |
- done |
3968 |
- |
3969 |
- if use nginx_modules_stream_geoip2 || use nginx_modules_stream_javascript; then |
3970 |
- stream_enabled=1 |
3971 |
- fi |
3972 |
- |
3973 |
- if [ $stream_enabled ]; then |
3974 |
- myconf+=( --with-stream ) |
3975 |
- use ssl && myconf+=( --with-stream_ssl_module ) |
3976 |
- fi |
3977 |
- |
3978 |
- # MAIL modules |
3979 |
- for mod in $NGINX_MODULES_MAIL; do |
3980 |
- if use nginx_modules_mail_${mod}; then |
3981 |
- mail_enabled=1 |
3982 |
- else |
3983 |
- myconf+=( --without-mail_${mod}_module ) |
3984 |
- fi |
3985 |
- done |
3986 |
- |
3987 |
- if [ $mail_enabled ]; then |
3988 |
- myconf+=( --with-mail ) |
3989 |
- use ssl && myconf+=( --with-mail_ssl_module ) |
3990 |
- fi |
3991 |
- |
3992 |
- # custom modules |
3993 |
- for mod in $NGINX_ADD_MODULES; do |
3994 |
- myconf+=( --add-module=${mod} ) |
3995 |
- done |
3996 |
- |
3997 |
- # https://bugs.gentoo.org/286772 |
3998 |
- export LANG=C LC_ALL=C |
3999 |
- tc-export CC |
4000 |
- |
4001 |
- if ! use prefix; then |
4002 |
- myconf+=( --user=${PN} ) |
4003 |
- myconf+=( --group=${PN} ) |
4004 |
- fi |
4005 |
- |
4006 |
- local WITHOUT_IPV6= |
4007 |
- if ! use ipv6; then |
4008 |
- WITHOUT_IPV6=" -DNGX_HAVE_INET6=0" |
4009 |
- fi |
4010 |
- |
4011 |
- if [[ -n "${EXTRA_ECONF}" ]]; then |
4012 |
- myconf+=( ${EXTRA_ECONF} ) |
4013 |
- ewarn "EXTRA_ECONF applied. Now you are on your own, good luck!" |
4014 |
- fi |
4015 |
- |
4016 |
- ./configure \ |
4017 |
- --prefix="${EPREFIX}"/usr \ |
4018 |
- --conf-path="${EPREFIX}"/etc/${PN}/${PN}.conf \ |
4019 |
- --error-log-path="${EPREFIX}"/var/log/${PN}/error_log \ |
4020 |
- --pid-path="${EPREFIX}"/run/${PN}.pid \ |
4021 |
- --lock-path="${EPREFIX}"/run/lock/${PN}.lock \ |
4022 |
- --with-cc-opt="-I${EROOT}usr/include${WITHOUT_IPV6}" \ |
4023 |
- --with-ld-opt="-L${EROOT}usr/$(get_libdir)" \ |
4024 |
- --http-log-path="${EPREFIX}"/var/log/${PN}/access_log \ |
4025 |
- --http-client-body-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/client \ |
4026 |
- --http-proxy-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/proxy \ |
4027 |
- --http-fastcgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/fastcgi \ |
4028 |
- --http-scgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/scgi \ |
4029 |
- --http-uwsgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/uwsgi \ |
4030 |
- --with-compat \ |
4031 |
- "${myconf[@]}" || die "configure failed" |
4032 |
- |
4033 |
- # A purely cosmetic change that makes nginx -V more readable. This can be |
4034 |
- # good if people outside the gentoo community would troubleshoot and |
4035 |
- # question the users setup. |
4036 |
- sed -i -e "s|${WORKDIR}|external_module|g" objs/ngx_auto_config.h || die |
4037 |
-} |
4038 |
- |
4039 |
-src_compile() { |
4040 |
- use nginx_modules_http_security && emake -C "${HTTP_SECURITY_MODULE_WD}" |
4041 |
- |
4042 |
- # https://bugs.gentoo.org/286772 |
4043 |
- export LANG=C LC_ALL=C |
4044 |
- emake LINK="${CC} ${LDFLAGS}" OTHERLDFLAGS="${LDFLAGS}" |
4045 |
-} |
4046 |
- |
4047 |
-src_install() { |
4048 |
- emake DESTDIR="${D%/}" install |
4049 |
- |
4050 |
- cp "${FILESDIR}"/nginx.conf-r2 "${ED}"etc/nginx/nginx.conf || die |
4051 |
- |
4052 |
- newinitd "${FILESDIR}"/nginx.initd-r4 nginx |
4053 |
- newconfd "${FILESDIR}"/nginx.confd nginx |
4054 |
- |
4055 |
- systemd_newunit "${FILESDIR}"/nginx.service-r1 nginx.service |
4056 |
- |
4057 |
- doman man/nginx.8 |
4058 |
- dodoc CHANGES* README |
4059 |
- |
4060 |
- # just keepdir. do not copy the default htdocs files (bug #449136) |
4061 |
- keepdir /var/www/localhost |
4062 |
- rm -rf "${D}"usr/html || die |
4063 |
- |
4064 |
- # set up a list of directories to keep |
4065 |
- local keepdir_list="${NGINX_HOME_TMP}"/client |
4066 |
- local module |
4067 |
- for module in proxy fastcgi scgi uwsgi; do |
4068 |
- use nginx_modules_http_${module} && keepdir_list+=" ${NGINX_HOME_TMP}/${module}" |
4069 |
- done |
4070 |
- |
4071 |
- keepdir /var/log/nginx ${keepdir_list} |
4072 |
- |
4073 |
- # this solves a problem with SELinux where nginx doesn't see the directories |
4074 |
- # as root and tries to create them as nginx |
4075 |
- fperms 0750 "${NGINX_HOME_TMP}" |
4076 |
- fowners ${PN}:0 "${NGINX_HOME_TMP}" |
4077 |
- |
4078 |
- fperms 0700 ${keepdir_list} |
4079 |
- fowners ${PN}:${PN} ${keepdir_list} |
4080 |
- |
4081 |
- fperms 0710 /var/log/nginx |
4082 |
- fowners 0:${PN} /var/log/nginx |
4083 |
- |
4084 |
- # logrotate |
4085 |
- insinto /etc/logrotate.d |
4086 |
- newins "${FILESDIR}"/nginx.logrotate-r1 nginx |
4087 |
- |
4088 |
- if use luajit; then |
4089 |
- pax-mark m "${ED%/}/usr/sbin/nginx" |
4090 |
- fi |
4091 |
- |
4092 |
- if use nginx_modules_http_perl; then |
4093 |
- cd "${S}"/objs/src/http/modules/perl/ || die |
4094 |
- emake DESTDIR="${D}" INSTALLDIRS=vendor |
4095 |
- perl_delete_localpod |
4096 |
- cd "${S}" || die |
4097 |
- fi |
4098 |
- |
4099 |
- if use nginx_modules_http_cache_purge; then |
4100 |
- docinto ${HTTP_CACHE_PURGE_MODULE_P} |
4101 |
- dodoc "${HTTP_CACHE_PURGE_MODULE_WD}"/{CHANGES,README.md,TODO.md} |
4102 |
- fi |
4103 |
- |
4104 |
- if use nginx_modules_http_slowfs_cache; then |
4105 |
- docinto ${HTTP_SLOWFS_CACHE_MODULE_P} |
4106 |
- dodoc "${HTTP_SLOWFS_CACHE_MODULE_WD}"/{CHANGES,README.md} |
4107 |
- fi |
4108 |
- |
4109 |
- if use nginx_modules_http_fancyindex; then |
4110 |
- docinto ${HTTP_FANCYINDEX_MODULE_P} |
4111 |
- dodoc "${HTTP_FANCYINDEX_MODULE_WD}"/README.rst |
4112 |
- fi |
4113 |
- |
4114 |
- if use nginx_modules_http_lua; then |
4115 |
- docinto ${HTTP_LUA_MODULE_P} |
4116 |
- dodoc "${HTTP_LUA_MODULE_WD}"/README.markdown |
4117 |
- fi |
4118 |
- |
4119 |
- if use nginx_modules_http_auth_pam; then |
4120 |
- docinto ${HTTP_AUTH_PAM_MODULE_P} |
4121 |
- dodoc "${HTTP_AUTH_PAM_MODULE_WD}"/{README.md,ChangeLog} |
4122 |
- fi |
4123 |
- |
4124 |
- if use nginx_modules_http_upstream_check; then |
4125 |
- docinto ${HTTP_UPSTREAM_CHECK_MODULE_P} |
4126 |
- dodoc "${HTTP_UPSTREAM_CHECK_MODULE_WD}"/{README,CHANGES} |
4127 |
- fi |
4128 |
- |
4129 |
- if use nginx_modules_http_naxsi; then |
4130 |
- insinto /etc/nginx |
4131 |
- doins "${HTTP_NAXSI_MODULE_WD}"/../naxsi_config/naxsi_core.rules |
4132 |
- fi |
4133 |
- |
4134 |
- if use rtmp; then |
4135 |
- docinto ${RTMP_MODULE_P} |
4136 |
- dodoc "${RTMP_MODULE_WD}"/{AUTHORS,README.md,stat.xsl} |
4137 |
- fi |
4138 |
- |
4139 |
- if use nginx_modules_http_dav_ext; then |
4140 |
- docinto ${HTTP_DAV_EXT_MODULE_P} |
4141 |
- dodoc "${HTTP_DAV_EXT_MODULE_WD}"/README.rst |
4142 |
- fi |
4143 |
- |
4144 |
- if use nginx_modules_http_echo; then |
4145 |
- docinto ${HTTP_ECHO_MODULE_P} |
4146 |
- dodoc "${HTTP_ECHO_MODULE_WD}"/README.markdown |
4147 |
- fi |
4148 |
- |
4149 |
- if use nginx_modules_http_security; then |
4150 |
- docinto ${HTTP_SECURITY_MODULE_P} |
4151 |
- dodoc "${HTTP_SECURITY_MODULE_WD}"/{CHANGES,README.md,authors.txt} |
4152 |
- fi |
4153 |
- |
4154 |
- if use nginx_modules_http_push_stream; then |
4155 |
- docinto ${HTTP_PUSH_STREAM_MODULE_P} |
4156 |
- dodoc "${HTTP_PUSH_STREAM_MODULE_WD}"/{AUTHORS,CHANGELOG.textile,README.textile} |
4157 |
- fi |
4158 |
- |
4159 |
- if use nginx_modules_http_sticky; then |
4160 |
- docinto ${HTTP_STICKY_MODULE_P} |
4161 |
- dodoc "${HTTP_STICKY_MODULE_WD}"/{README.md,Changelog.txt,docs/sticky.pdf} |
4162 |
- fi |
4163 |
- |
4164 |
- if use nginx_modules_http_memc; then |
4165 |
- docinto ${HTTP_MEMC_MODULE_P} |
4166 |
- dodoc "${HTTP_MEMC_MODULE_WD}"/README.markdown |
4167 |
- fi |
4168 |
- |
4169 |
- if use nginx_modules_http_auth_ldap; then |
4170 |
- docinto ${HTTP_LDAP_MODULE_P} |
4171 |
- dodoc "${HTTP_LDAP_MODULE_WD}"/example.conf |
4172 |
- fi |
4173 |
-} |
4174 |
- |
4175 |
-pkg_postinst() { |
4176 |
- if use ssl; then |
4177 |
- if [[ ! -f "${EROOT}"etc/ssl/${PN}/${PN}.key ]]; then |
4178 |
- install_cert /etc/ssl/${PN}/${PN} |
4179 |
- use prefix || chown ${PN}:${PN} "${EROOT}"etc/ssl/${PN}/${PN}.{crt,csr,key,pem} |
4180 |
- fi |
4181 |
- fi |
4182 |
- |
4183 |
- if use nginx_modules_http_spdy; then |
4184 |
- ewarn "" |
4185 |
- ewarn "In nginx 1.9.5 the spdy module was superseded by http2." |
4186 |
- ewarn "Update your configs and package.use accordingly." |
4187 |
- fi |
4188 |
- |
4189 |
- if use nginx_modules_http_lua; then |
4190 |
- ewarn "" |
4191 |
- ewarn "While you can build lua 3rd party module against ${P}" |
4192 |
- ewarn "the author warns that >=${PN}-1.11.11 is still not an" |
4193 |
- ewarn "officially supported target yet. You are on your own." |
4194 |
- ewarn "Expect runtime failures, memory leaks and other problems!" |
4195 |
- fi |
4196 |
- |
4197 |
- if use nginx_modules_http_lua && use http2; then |
4198 |
- ewarn "" |
4199 |
- ewarn "Lua 3rd party module author warns against using ${P} with" |
4200 |
- ewarn "NGINX_MODULES_HTTP=\"lua http2\". For more info, see https://git.io/OldLsg" |
4201 |
- fi |
4202 |
- |
4203 |
- local _n_permission_layout_checks=0 |
4204 |
- local _has_to_adjust_permissions=0 |
4205 |
- local _has_to_show_permission_warning=0 |
4206 |
- |
4207 |
- # Defaults to 1 to inform people doing a fresh installation |
4208 |
- # that we ship modified {scgi,uwsgi,fastcgi}_params files |
4209 |
- local _has_to_show_httpoxy_mitigation_notice=1 |
4210 |
- |
4211 |
- local _replacing_version= |
4212 |
- for _replacing_version in ${REPLACING_VERSIONS}; do |
4213 |
- _n_permission_layout_checks=$((${_n_permission_layout_checks}+1)) |
4214 |
- |
4215 |
- if [[ ${_n_permission_layout_checks} -gt 1 ]]; then |
4216 |
- # Should never happen: |
4217 |
- # Package is abusing slots but doesn't allow multiple parallel installations. |
4218 |
- # If we run into this situation it is unsafe to automatically adjust any |
4219 |
- # permission... |
4220 |
- _has_to_show_permission_warning=1 |
4221 |
- |
4222 |
- ewarn "Replacing multiple ${PN}' versions is unsupported! " \ |
4223 |
- "You will have to adjust permissions on your own." |
4224 |
- |
4225 |
- break |
4226 |
- fi |
4227 |
- |
4228 |
- local _replacing_version_branch=$(get_version_component_range 1-2 "${_replacing_version}") |
4229 |
- debug-print "Updating an existing installation (v${_replacing_version}; branch '${_replacing_version_branch}') ..." |
4230 |
- |
4231 |
- # Do we need to adjust permissions to fix CVE-2013-0337 (bug #458726, #469094)? |
4232 |
- # This was before we introduced multiple nginx versions so we |
4233 |
- # do not need to distinguish between stable and mainline |
4234 |
- local _need_to_fix_CVE2013_0337=1 |
4235 |
- |
4236 |
- if version_is_at_least "1.4.1-r2" "${_replacing_version}"; then |
4237 |
- # We are updating an installation which should already be fixed |
4238 |
- _need_to_fix_CVE2013_0337=0 |
4239 |
- debug-print "Skipping CVE-2013-0337 ... existing installation should not be affected!" |
4240 |
- else |
4241 |
- _has_to_adjust_permissions=1 |
4242 |
- debug-print "Need to adjust permissions to fix CVE-2013-0337!" |
4243 |
- fi |
4244 |
- |
4245 |
- # Do we need to inform about HTTPoxy mitigation? |
4246 |
- # In repository since commit 8be44f76d4ac02cebcd1e0e6e6284bb72d054b0f |
4247 |
- if ! version_is_at_least "1.10" "${_replacing_version_branch}"; then |
4248 |
- # Updating from <1.10 |
4249 |
- _has_to_show_httpoxy_mitigation_notice=1 |
4250 |
- debug-print "Need to inform about HTTPoxy mitigation!" |
4251 |
- else |
4252 |
- # Updating from >=1.10 |
4253 |
- local _fixed_in_pvr= |
4254 |
- case "${_replacing_version_branch}" in |
4255 |
- "1.10") |
4256 |
- _fixed_in_pvr="1.10.1-r2" |
4257 |
- ;; |
4258 |
- "1.11") |
4259 |
- _fixed_in_pvr="1.11.3-r1" |
4260 |
- ;; |
4261 |
- *) |
4262 |
- # This should be any future branch. |
4263 |
- # If we run this code it is safe to assume that the user has |
4264 |
- # already seen the HTTPoxy mitigation notice because he/she is doing |
4265 |
- # an update from previous version where we have already shown |
4266 |
- # the warning. Otherwise, we wouldn't hit this code path ... |
4267 |
- _fixed_in_pvr= |
4268 |
- esac |
4269 |
- |
4270 |
- if [[ -z "${_fixed_in_pvr}" ]] || version_is_at_least "${_fixed_in_pvr}" "${_replacing_version}"; then |
4271 |
- # We are updating an installation where we already informed |
4272 |
- # that we are mitigating HTTPoxy per default |
4273 |
- _has_to_show_httpoxy_mitigation_notice=0 |
4274 |
- debug-print "No need to inform about HTTPoxy mitigation ... information was already shown for existing installation!" |
4275 |
- else |
4276 |
- _has_to_show_httpoxy_mitigation_notice=1 |
4277 |
- debug-print "Need to inform about HTTPoxy mitigation!" |
4278 |
- fi |
4279 |
- fi |
4280 |
- |
4281 |
- # Do we need to adjust permissions to fix CVE-2016-1247 (bug #605008)? |
4282 |
- # All branches up to 1.11 are affected |
4283 |
- local _need_to_fix_CVE2016_1247=1 |
4284 |
- |
4285 |
- if ! version_is_at_least "1.10" "${_replacing_version_branch}"; then |
4286 |
- # Updating from <1.10 |
4287 |
- _has_to_adjust_permissions=1 |
4288 |
- debug-print "Need to adjust permissions to fix CVE-2016-1247!" |
4289 |
- else |
4290 |
- # Updating from >=1.10 |
4291 |
- local _fixed_in_pvr= |
4292 |
- case "${_replacing_version_branch}" in |
4293 |
- "1.10") |
4294 |
- _fixed_in_pvr="1.10.2-r3" |
4295 |
- ;; |
4296 |
- "1.11") |
4297 |
- _fixed_in_pvr="1.11.6-r1" |
4298 |
- ;; |
4299 |
- *) |
4300 |
- # This should be any future branch. |
4301 |
- # If we run this code it is safe to assume that we have already |
4302 |
- # adjusted permissions or were never affected because user is |
4303 |
- # doing an update from previous version which was safe or did |
4304 |
- # the adjustments. Otherwise, we wouldn't hit this code path ... |
4305 |
- _fixed_in_pvr= |
4306 |
- esac |
4307 |
- |
4308 |
- if [[ -z "${_fixed_in_pvr}" ]] || version_is_at_least "${_fixed_in_pvr}" "${_replacing_version}"; then |
4309 |
- # We are updating an installation which should already be adjusted |
4310 |
- # or which was never affected |
4311 |
- _need_to_fix_CVE2016_1247=0 |
4312 |
- debug-print "Skipping CVE-2016-1247 ... existing installation should not be affected!" |
4313 |
- else |
4314 |
- _has_to_adjust_permissions=1 |
4315 |
- debug-print "Need to adjust permissions to fix CVE-2016-1247!" |
4316 |
- fi |
4317 |
- fi |
4318 |
- done |
4319 |
- |
4320 |
- if [[ ${_has_to_adjust_permissions} -eq 1 ]]; then |
4321 |
- # We do not DIE when chmod/chown commands are failing because |
4322 |
- # package is already merged on user's system at this stage |
4323 |
- # and we cannot retry without losing the information that |
4324 |
- # the existing installation needs to adjust permissions. |
4325 |
- # Instead we are going to a show a big warning ... |
4326 |
- |
4327 |
- if [[ ${_has_to_show_permission_warning} -eq 0 ]] && [[ ${_need_to_fix_CVE2013_0337} -eq 1 ]]; then |
4328 |
- ewarn "" |
4329 |
- ewarn "The world-readable bit (if set) has been removed from the" |
4330 |
- ewarn "following directories to mitigate a security bug" |
4331 |
- ewarn "(CVE-2013-0337, bug #458726):" |
4332 |
- ewarn "" |
4333 |
- ewarn " ${EPREFIX%/}/var/log/nginx" |
4334 |
- ewarn " ${EPREFIX%/}${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi}" |
4335 |
- ewarn "" |
4336 |
- ewarn "Check if this is correct for your setup before restarting nginx!" |
4337 |
- ewarn "This is a one-time change and will not happen on subsequent updates." |
4338 |
- ewarn "Furthermore nginx' temp directories got moved to '${EPREFIX%/}${NGINX_HOME_TMP}'" |
4339 |
- chmod o-rwx \ |
4340 |
- "${EPREFIX%/}"/var/log/nginx \ |
4341 |
- "${EPREFIX%/}"${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi} || \ |
4342 |
- _has_to_show_permission_warning=1 |
4343 |
- fi |
4344 |
- |
4345 |
- if [[ ${_has_to_show_permission_warning} -eq 0 ]] && [[ ${_need_to_fix_CVE2016_1247} -eq 1 ]]; then |
4346 |
- ewarn "" |
4347 |
- ewarn "The permissions on the following directory have been reset in" |
4348 |
- ewarn "order to mitigate a security bug (CVE-2016-1247, bug #605008):" |
4349 |
- ewarn "" |
4350 |
- ewarn " ${EPREFIX%/}/var/log/nginx" |
4351 |
- ewarn "" |
4352 |
- ewarn "Check if this is correct for your setup before restarting nginx!" |
4353 |
- ewarn "Also ensure that no other log directory used by any of your" |
4354 |
- ewarn "vhost(s) is not writeable for nginx user. Any of your log files" |
4355 |
- ewarn "used by nginx can be abused to escalate privileges!" |
4356 |
- ewarn "This is a one-time change and will not happen on subsequent updates." |
4357 |
- chown 0:nginx "${EPREFIX%/}"/var/log/nginx || _has_to_show_permission_warning=1 |
4358 |
- chmod 710 "${EPREFIX%/}"/var/log/nginx || _has_to_show_permission_warning=1 |
4359 |
- fi |
4360 |
- |
4361 |
- if [[ ${_has_to_show_permission_warning} -eq 1 ]]; then |
4362 |
- # Should never happen ... |
4363 |
- ewarn "" |
4364 |
- ewarn "*************************************************************" |
4365 |
- ewarn "*************** W A R N I N G ***************" |
4366 |
- ewarn "*************************************************************" |
4367 |
- ewarn "The one-time only attempt to adjust permissions of the" |
4368 |
- ewarn "existing nginx installation failed. Be aware that we will not" |
4369 |
- ewarn "try to adjust the same permissions again because now you are" |
4370 |
- ewarn "using a nginx version where we expect that the permissions" |
4371 |
- ewarn "are already adjusted or that you know what you are doing and" |
4372 |
- ewarn "want to keep custom permissions." |
4373 |
- ewarn "" |
4374 |
- fi |
4375 |
- fi |
4376 |
- |
4377 |
- # Sanity check for CVE-2016-1247 |
4378 |
- # Required to warn users who received the warning above and thought |
4379 |
- # they could fix it by unmerging and re-merging the package or have |
4380 |
- # unmerged a affected installation on purpose in the past leaving |
4381 |
- # /var/log/nginx on their system due to keepdir/non-empty folder |
4382 |
- # and are now installing the package again. |
4383 |
- local _sanity_check_testfile=$(mktemp --dry-run "${EPREFIX%/}"/var/log/nginx/.CVE-2016-1247.XXXXXXXXX) |
4384 |
- su -s /bin/sh -c "touch ${_sanity_check_testfile}" nginx >&/dev/null |
4385 |
- if [ $? -eq 0 ] ; then |
4386 |
- # Cleanup -- no reason to die here! |
4387 |
- rm -f "${_sanity_check_testfile}" |
4388 |
- |
4389 |
- ewarn "" |
4390 |
- ewarn "*************************************************************" |
4391 |
- ewarn "*************** W A R N I N G ***************" |
4392 |
- ewarn "*************************************************************" |
4393 |
- ewarn "Looks like your installation is vulnerable to CVE-2016-1247" |
4394 |
- ewarn "(bug #605008) because nginx user is able to create files in" |
4395 |
- ewarn "" |
4396 |
- ewarn " ${EPREFIX%/}/var/log/nginx" |
4397 |
- ewarn "" |
4398 |
- ewarn "Also ensure that no other log directory used by any of your" |
4399 |
- ewarn "vhost(s) is not writeable for nginx user. Any of your log files" |
4400 |
- ewarn "used by nginx can be abused to escalate privileges!" |
4401 |
- fi |
4402 |
- |
4403 |
- if [[ ${_has_to_show_httpoxy_mitigation_notice} -eq 1 ]]; then |
4404 |
- # HTTPoxy mitigation |
4405 |
- ewarn "" |
4406 |
- ewarn "This nginx installation comes with a mitigation for the HTTPoxy" |
4407 |
- ewarn "vulnerability for FastCGI, SCGI and uWSGI applications by setting" |
4408 |
- ewarn "the HTTP_PROXY parameter to an empty string per default when you" |
4409 |
- ewarn "are sourcing one of the default" |
4410 |
- ewarn "" |
4411 |
- ewarn " - 'fastcgi_params' or 'fastcgi.conf'" |
4412 |
- ewarn " - 'scgi_params'" |
4413 |
- ewarn " - 'uwsgi_params'" |
4414 |
- ewarn "" |
4415 |
- ewarn "files in your server block(s)." |
4416 |
- ewarn "" |
4417 |
- ewarn "If this is causing any problems for you make sure that you are sourcing the" |
4418 |
- ewarn "default parameters _before_ you set your own values." |
4419 |
- ewarn "If you are relying on user-supplied proxy values you have to remove the" |
4420 |
- ewarn "correlating lines from the file(s) mentioned above." |
4421 |
- ewarn "" |
4422 |
- fi |
4423 |
-} |