1 |
commit: 635781d2b0da5b0349f7b10c01376fdf292feed9 |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Oct 12 19:28:12 2016 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Oct 12 19:48:03 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=635781d2 |
7 |
|
8 |
www-servers/nginx: Bump to v1.11.5 mainline |
9 |
|
10 |
Ebuild changes: |
11 |
=============== |
12 |
- IPv6 support is now enabled per default due to upstream |
13 |
changeset 6724:a6d116645c51 |
14 |
|
15 |
- NAXSI updated to v0.55.1 |
16 |
|
17 |
- rtmp module updated to v1.1.10 |
18 |
|
19 |
- LDAP authentication module updated to commit dbcef31b to fix some |
20 |
segmentation faults |
21 |
|
22 |
Package-Manager: portage-2.3.2 |
23 |
|
24 |
profiles/desc/nginx_modules_stream.desc | 1 + |
25 |
www-servers/nginx/Manifest | 6 + |
26 |
.../files/http_upstream_check-nginx-1.11.5+.patch | 246 +++++++ |
27 |
www-servers/nginx/nginx-1.11.5.ebuild | 781 +++++++++++++++++++++ |
28 |
4 files changed, 1034 insertions(+) |
29 |
|
30 |
diff --git a/profiles/desc/nginx_modules_stream.desc b/profiles/desc/nginx_modules_stream.desc |
31 |
index 97d7ca6..694dae9 100644 |
32 |
--- a/profiles/desc/nginx_modules_stream.desc |
33 |
+++ b/profiles/desc/nginx_modules_stream.desc |
34 |
@@ -13,6 +13,7 @@ map - This module allows you to classify, or map a set of values into a differen |
35 |
realip - This module allows to change the client's IP address to value from request header (e. g. X-Real-IP or X-Forwarded-For). |
36 |
return - This module allows sending a specified value to the client and then closing the connection. |
37 |
split_clients - This module provides A/B testing support. |
38 |
+ssl_preread - This module allows extracting information from the ClientHello message without terminating SSL/TLS. |
39 |
upstream - This module is used to define groups of servers that can be referenced by the proxy_pass directive. |
40 |
upstream_hash - This module provides the ability to distribute upstream requests based on hashed key value. |
41 |
upstream_least_conn - This module provides the ability to distribute upstream requests using load balancing methods. |
42 |
|
43 |
diff --git a/www-servers/nginx/Manifest b/www-servers/nginx/Manifest |
44 |
index 71f95a8..6053301 100644 |
45 |
--- a/www-servers/nginx/Manifest |
46 |
+++ b/www-servers/nginx/Manifest |
47 |
@@ -2,7 +2,10 @@ DIST modsecurity-2.9.1.tar.gz 4261212 SHA256 958cc5a7a7430f93fac0fd6f8b9aa92fc18 |
48 |
DIST nginx-1.10.1.tar.gz 909077 SHA256 1fd35846566485e03c0e318989561c135c598323ff349c503a6c14826487a801 SHA512 fa1329d40e83340380332dd5e2ed66f08dd59cc7f7582dd0e0193c493353ba550e80dc80e5165c225d70532d4197abc49cc8c760e8ab72e48f630cb57c2803e1 WHIRLPOOL 6942f70c3279a28bd8d664d085dee68bf0d0526c8dcb636f3258c9de598268efc984af72e527efd86889bd13911b38b0bdb2de1e92eef69cabd02f7080f64eb6 |
49 |
DIST nginx-1.11.3.tar.gz 938045 SHA256 4a667f40f9f3917069db1dea1f2d5baa612f1fa19378aadf71502e846a424610 SHA512 b983aca61335facf5778675b80fc28341ec9cfee2190319ed130b9c5d5ceff8133677f4609ecafd5a782daa5962e41bb6cb6a857380bbbe9cee67cd0ab2026d4 WHIRLPOOL f197bc4f5e1ed234b26d625db5bf665a24c09da316e3cae3c0f394f0b4db116acad5db15add7fd92b5fe1428f95449538584f57272f8bad89b912fb38fbb2c7d |
50 |
DIST nginx-1.11.4.tar.gz 949793 SHA256 06221c1f43f643bc6bfe5b2c26d19e09f2588d5cde6c65bdb77dfcce7c026b3b SHA512 c6a03c440a274576434aa74932b3fa7cd49174d9e2d8c6e480838637f33f158e31b6f25cac97e158f386bb92f62ff9636c2d3ac1a552e27a860eb9448e2f3f94 WHIRLPOOL 53c371cb34bc55f28d0a0915e08a4fdeffcfcbc8571628db086e0a75627c926693f2faba8608f0c444bc79df244b7f321e6017eda0eb7710d2ccb6f25aac8b75 |
51 |
+DIST nginx-1.11.5.tar.gz 956517 SHA256 223f8a2345a75f891098cf26ccdf208b293350388f51ce69083674c9432db6f6 SHA512 f41b21b5d8c6b7fe7f8713e96fb6b1c40da49bf64ebb790fb5aa38f036a37b36fcf048ff72c2216552b2f75366b30c5fcdef26312bd4e5515b2476a1cd944b8c WHIRLPOOL fba49ae277ec2114b06eb0fdce87161ac7bd3e0ca90387dc58caf327c5f12056be07eeba677ff37c59e7d759054ec276ce4db647250774c57588619a1803592c |
52 |
+DIST nginx-auth-ldap-49a8b4d28fc4a518563c82e0b52821e5f37db1fc.tar.gz 17159 SHA256 3c11c32f05da04f1a4647dc4e35dd8d8aeacd5a2e763ba349feba3dba8663132 SHA512 323abd0ca8e90f5afcaf81a8ff1a8abe3dfcbff3d69f0dd4a1c005fe6436acbf3076c4c57a4df877b3d8e388cbea085d46301bb2df9c0752e2567817ff7cca92 WHIRLPOOL ad65e8182b2634db5fa06055ef7d91c7d8aabd0fa986d8402a4845977354d6edb329621b6f9f96c90ce2d158cff20e42ae50fba06a088a84de3e3f414205dbc2 |
53 |
DIST nginx-auth-ldap-dbcef31bebb2d54b6120422d0b178bbf78bc48f7.tar.gz 16998 SHA256 35c8f29581823be0f8bdbcf237d7fa5518c45eabe0ab9a695b131d32c8f1c264 SHA512 f47a9a6c5f93daa9260825261d2069bca5fc528221f94fc8ec98462f61774a36bce0238d931f8d0690544fd0144a83f942b6673c8376fe03f7834f8da9666671 WHIRLPOOL 26a2f67e715d13f785932f00e642c0864b5b7059d120f7fe7458017dbe02203f4873d1cfc4f0dd262834465438ad2b00ef4b49295e18a8e246abda6f7694ac70 |
54 |
+DIST nginx_http_sticky_module_ng-1.2.6-10-g08a395c66e42.tar.bz2 124047 SHA256 6f9102321d8c68df6d67e9bde145a8de3f45f99f6cb47c08735a86f003234d31 SHA512 6c1bfdcf89884b2855d51ae7da0f6e53a4ca3629e1aaf58433b70c07dcb2af797ba6e87d9b3eb4fe2fb6d4d697e862f2b4c2f8d8b3fdaea201740c97ec936529 WHIRLPOOL 38abe56e177e22dad68ac7d6570425ecd763d2e891627a75156a6f39bd7edc54f664c3d2f638e1ea57c743dadc6a8c9889be087abbdb4c98b5641c299f7fbc07 |
55 |
DIST nginx_http_sticky_module_ng-1.2.6.tar.bz2 124089 SHA256 e47b9fd435d7a5a3200f945a9745aaa7b9446495bda76df48f211129f88d6b26 SHA512 2632b04c94f523aa7c9726db182cba11d83e642c2db5798274e67fbef30de95d02e4e95cbfb98bc429d4244d630b5d9617405b43f728ae0117a5c134940c0ded WHIRLPOOL 1b754c02f834c6b4d4930e9c46b8c5accb6c9663718fb9296c92d79bc33206e66e49e4234ca4db9a5afcd42fa23273bdf0e675aa7b38927c4e46a85318c189eb |
56 |
DIST ngx_devel_kit-0.3.0-r1.tar.gz 66455 SHA256 88e05a99a8a7419066f5ae75966fb1efc409bad4522d14986da074554ae61619 SHA512 558764c9be913a4f61d0e277d07bf3c272e1ce086b3fadb85b693a7e92805cd9fca4da7a8d29c96e53fc0d23b331327d3b2561ff61f19d2330e7d5d35ac7d614 WHIRLPOOL 5f6ed4e6850d2ce7e8c65e0570a7e2c74a1fe360e167644ed405fff682ab178b09c722c99c1df9af552fb816219b9fc04dcdf638b3e4af68c688434cdb33aa59 |
57 |
DIST ngx_http_auth_pam-1.5.1.tar.gz 6863 SHA256 77676842919134af88a7b4bfca4470223e3a00d287d17c0dbdc9a114a685b6e7 SHA512 973b94874d8a58c0df0ac2d31571eafc1e80b11179cba33ec88421a826207fbf7e99b0387e135a1ca48d82daacb78f19a4c21d3a27b49b16dc86b4748bb72261 WHIRLPOOL 4fcaadee859f325c734aa16763702ee40284d1debcfbf5df1cb9aadf2bfc72c1e8d0e5b9d1495f34fc719f4d7fa3e653797fa7917f8fd0437fa2023a1930f667 |
58 |
@@ -17,14 +20,17 @@ DIST ngx_http_headers_more-0.31.tar.gz 27941 SHA256 b2e8162cce2d24861b1ed5bbb30f |
59 |
DIST ngx_http_lua-0.10.5.tar.gz 579793 SHA256 4f0292c37ab3d7cb980c994825040be1bda2c769cbd800e79c43eb37458347d4 SHA512 a02b8614fdcd063b1087a3114f05402c707343ff3bceabaca1fb98531ba30edea1a525fc45e2f5a49ff155de8d6f9e1155e8870e463476da5703acfd5f8fc3fc WHIRLPOOL 9c72353bc58a98fd3bae68bd9b13228d202167422a429aa4b455f7e280cb617b5c083131e4f372708e602342b24b150437ed8ebae9647a397bae8a88a13b385c |
60 |
DIST ngx_http_lua-0.10.6.tar.gz 597217 SHA256 b98c4f648589bbf3e2c3d5fd18664e7a7ef89ac083e96c8e984fa919e7a7c073 SHA512 202aaf39381d151d5f456e5cd61c87b65fa20ece997f7e517a3eb3912af3a153747a674ac004dbcc474728567ff58436cfb408accd5e922d805b1d697c34774c WHIRLPOOL c4fd64114d74afbaba02c3e7bb1c5562281636624a581c6535f6aa310886f766b9cf0e63a8921599c617d411d5ec920e4b08b54588bfac7cf4c24e8ffc13d26b |
61 |
DIST ngx_http_naxsi-0.54.tar.gz 163809 SHA256 9cc2c09405bc71f78ef26a8b6d70afcea3fccbe8125df70cb0cfc480133daba5 SHA512 91934bfd41495715269cc6e549d17f6da66f2bdd0c9a6821fa9096b694dd3927109c4aad2f8b327620ae7c34f76a0839ac16669cd8c65081bc01fa7f829c1d43 WHIRLPOOL ef68cfecc9849086527c3590744d3c0d73cec830c6cf1ebca63566a7444438757a85d0c79fa552c4763e0416a615f4cf8d99622e2f36d3713b7072138a82f5a8 |
62 |
+DIST ngx_http_naxsi-0.55.1.tar.gz 185997 SHA256 45dd0df7a6b0b6aa9c64eb8c39a8e294d659d87fb18e192cf58f1402f3cdb0a8 SHA512 aebda20e5b78e9111b7bac1e15829258e6b85b80e4ce333e4dba8caead36287b3f0fcb453c51d7c59f07d637fa62f5c6b23aecd3bf6a3c3da4abebf1a6689f14 WHIRLPOOL 36830d10a35b724b7ea15e3884e96e2e4dd84f2b81fc1c7122d3e2e83a1942227321b1a7141d829423788bc52a3e199a95ca2637369e17f84ea16eb0cb2e5e37 |
63 |
DIST ngx_http_push_stream-0.5.2.tar.gz 182008 SHA256 1d07f38acdb8194bd49344b0ba21de101070de9b8731d27a8d22e928850bc199 SHA512 ee8bf9ece652da6aa5a39879298bba70d1842696545259f3f5e302cc61397b35f016364805805f9ab1914fc39ed2f07c015e042155789073e3d1fdc02a0783de WHIRLPOOL d309cecbb1bb5b6c4f64712d44889e3ecca59140d845a31a3f605dc3cc2aa01622b0deadb8f6852baea3c211bebbe6ed7d7868399447ac1249c1b1b740fa3c27 |
64 |
DIST ngx_http_slowfs_cache-1.10.tar.gz 11809 SHA256 1e81453942e5b0877de1f1f06c56ae82918ea9818255cb935bcb673c95a758a1 SHA512 fbc9609a8d6913aeefe535f206b9e53477503f131934ead2ae5a6169e395af2f5fb54778704824d5eeb22a4ef40a11ebbcde580db62a631f70edcc2cfc06b15d WHIRLPOOL a02ed77422c47d9e476f8746186d19d632ddb953635d8d9dd51ff076225a78044286ee7e114478bc02e4b2a422e4fdc207154fc287629dd2cd7c3f9a634dad18 |
65 |
DIST ngx_http_upload_progress-0.9.1-r1.tar.gz 17166 SHA256 99ec072cca35cd7791e77c40a8ded41a7a8c1111e057be26e55fba2fdf105f43 SHA512 6c1e3776402b6e2cda50d9c48c4b578a85feffe15891c075443f6d9c7b9e2414e0614b50a8f417ddda9faf5f719957c77ade519c88b48caec970fc51fe12f0d1 WHIRLPOOL 12970d0f75ee3f0d8a97c4948b97fca2bd707a93e4e578c0e2ac0d18991986e620dd6b15c2ab5680ff726c0490671e3bc5e1ee6109baf81877d8baa6a5357825 |
66 |
DIST ngx_http_upload_progress-0.9.2-r1.tar.gz 17268 SHA256 b286689355442657650421d8e8398bd4abf9dbbaade65947bb0cb74a349cc497 SHA512 c31c46344d49704389722325a041b9cd170fa290acefe92cfc572c07f711cd3039de78f28df48ca7dcb79b2e4bbe442580aaaf4d92883fd3a14bf41d66dd9d8c WHIRLPOOL e847603f1445c7e1471a5570e2774a448be880eb71eeb21e27361586bcee9aae31cb0a8a80cd5abfc8d14e2c356fabfa7293e6a4d5f6782d41521a7bdc124066 |
67 |
DIST ngx_http_upstream_check-0.3.0-10-g10782ea.tar.gz 128297 SHA256 a5003e86908086f8607e76cfc01a56d56654982ab02cec918278c261ff1e8363 SHA512 2407d4375d8b94a808eb9e423615af700537b28fc88d37e790fb2a5ecdb02da94e7d1e271a6a81e8a55f8ce11e7db80fdd6de7feca08469dfaa26d717a1075a3 WHIRLPOOL 6b428940a07a7c18ba19cba07f43f1661484905a025f80fcb44908aeaeab9c8e854d3e104fe0339087a2e9029ad4722366c7d0a0fca7c73d92ece6ff2e494206 |
68 |
+DIST ngx_http_upstream_check-0.3.0-10-gf3bdb7b.tar.gz 129060 SHA256 9e0835e8c1550033e74c7eaeebf94d41ab1617cff152dd076da976e0eba30bfc SHA512 5b2ae6d305d24d0c64dc118fd3b0c23f5bf0e9a282e70e8d2c4eb946ed510263b5e845f64ca352784e34708cf9d98804cacf64b6c9efd712a395076dd0ba7c29 WHIRLPOOL 8dab8aa1bf3f7c9adbf2952148d76cc627682876b5e64dc789582b573a4b6fa73910043325fc664784b68966bcb1e8ba9ae6bfa457133bde0d52e39b7d3c09e0 |
69 |
DIST ngx_memc_module-0.17.tar.gz 36369 SHA256 25cbe3ff4931283a681260607bc91ae4a922075345d5770b293c6cd7f1e3bdcc SHA512 e6fdecb4bb629f0882868b78f4b3a2549fce4471efcc4f2c6fdc414435799be6ce41cf056a3170952f8a1f401ee1ca372c97f2d7f79fba79239599755ade8949 WHIRLPOOL 766d84e7a2dfb2a6f069fd846e19d635f4dbd36f78014e97bbd159312d0b38d671b4db989584ca2b5b449046483b5b90d09edbe1c4531b266d8592ad7bad3c3a |
70 |
DIST ngx_metrics-0.1.1.tar.gz 2964 SHA256 1c62ebb31e3caafad91720962770b0e7a4287f195520cf12471c262ac19b154e SHA512 d36a8fb0104c83b6b564e03b351aa750cab08650264c74d6f786af357bfb7006b531a93270dd961896ea8dafe27e5db8548ede714c5f52c4742876bc73af4b5e WHIRLPOOL 2796f5a97e76dfcc91133240e8e90ba493f0356f781a173d8cacdd09eba64b75ef531db398c0566fda395124700de8c991b771433e376ca0d5898c2ea6f82868 |
71 |
DIST ngx_mogilefs_module-1.0.4.tar.gz 11208 SHA256 7ac230d30907f013dff8d435a118619ea6168aa3714dba62c6962d350c6295ae SHA512 b8cb7eaf6274f4e2247dbcb39db05072d2b2d4361256a325fafab5533d7ce0c4ae9e2905b954dfcfa4789c9cab5cccf2ac1c3a1f02f6a327ed95b562d7773ed1 WHIRLPOOL 64c9b11ad938e6dbe5ba31298f1cd46f6e6bb4ba039c96b1e43bd85919d1606326f74b677f789ecabe0b0f4e0f08ac5aaf8148bf820de65aaa1e9966a28b9f61 |
72 |
+DIST ngx_rtmp-1.1.10.tar.gz 519877 SHA256 f9491dd24390b0d5d70dfe3553edf3d14efeb7c7a81b4d4a20c5cfeaefc1141c SHA512 bcc0aee3308af7c61bf01a5530fcf1dae938e6778306f6e3eb5995e6d0529f43d33b7ee2acb813d5a39acc92e4853d207a01e8e41b766a6e0dd07aade60cd98f WHIRLPOOL 655f4dcb02f928698ae14d29e5b7f60ad3fd71c757d67f1930c695a3501054d124a92f7ada7d4e605204f1e73e0779cad0b60102bc98d64764535581db0b1867 |
73 |
DIST ngx_rtmp-1.1.7.tar.gz 519735 SHA256 7922b0e3d5f3d9c4b275e4908cfb8f5fb1bfb3ac2df77f4c262cda56df21aab3 SHA512 9883462a04683f1e7af175da04b86d259ff6d677864667588fb073143f7130969eb2a5a5a48ddceda7a555b908580f179bdcacb7f0111413d51db5bfe43b396e WHIRLPOOL e9c1fc9c3c965ae7047657f76e0997d5da107aff7dd9e5cf3ddb5a2d8f388efd8439b82923e199dc36def449567b8529e06c80f69c36f42128236ac0be5719d5 |
74 |
DIST ngx_rtmp-1.1.8.tar.gz 519647 SHA256 de5866111a5b18c9dfb1c10f3a0e84b56af77f7005a41807368f7769b8a50965 SHA512 554249b1b8bb70952a0585dcc5c55c70daa63f2eba5ef35f8b1a4932fdfd6c95b0a48739857ba8dcab08ff1e91d048f3dc43bf65250890fd7a679cdabfed880a WHIRLPOOL a8cd4361419fbae97f199d788078c62ffc442158d0338aa677e5d6d21fb27a336da85e901ee6463ff6b33201092575237d5b6f20a1d80d924ac6591cbb75c9d7 |
75 |
DIST ngx_rtmp-1.1.9.tar.gz 519807 SHA256 46d914e3ba1f4c2353c1ef01a7423305255cb78226c84fac419586f849b7ea55 SHA512 888c268eb0371649e9bf971462e20472f819946f49ef5e50af97d0590a03df6d37c1fa8016eb7ea81faa0c212c429618d399102f513b029c66226d48e444f70c WHIRLPOOL 94fc496b059549a56338cd51e0bbf9a3b11b10640e1ef83e1e7cdb2845dfecde012e0951003665e02bff4ef45870b78e399d4194997cb082647dbcd638cc9716 |
76 |
|
77 |
diff --git a/www-servers/nginx/files/http_upstream_check-nginx-1.11.5+.patch b/www-servers/nginx/files/http_upstream_check-nginx-1.11.5+.patch |
78 |
new file mode 100644 |
79 |
index 00000000..a894bde |
80 |
--- /dev/null |
81 |
+++ b/www-servers/nginx/files/http_upstream_check-nginx-1.11.5+.patch |
82 |
@@ -0,0 +1,246 @@ |
83 |
+Upstream: https://github.com/yaoweibin/nginx_upstream_check_module/pull/119 |
84 |
+ |
85 |
+diff --git src/http/modules/ngx_http_upstream_hash_module.c src/http/modules/ngx_http_upstream_hash_module.c |
86 |
+index 6c28c64..a187887 100644 |
87 |
+--- src/http/modules/ngx_http_upstream_hash_module.c |
88 |
++++ src/http/modules/ngx_http_upstream_hash_module.c |
89 |
+@@ -9,6 +9,9 @@ |
90 |
+ #include <ngx_core.h> |
91 |
+ #include <ngx_http.h> |
92 |
+ |
93 |
++#if (NGX_HTTP_UPSTREAM_CHECK) |
94 |
++#include "ngx_http_upstream_check_module.h" |
95 |
++#endif |
96 |
+ |
97 |
+ typedef struct { |
98 |
+ uint32_t hash; |
99 |
+@@ -235,6 +238,16 @@ ngx_http_upstream_get_hash_peer(ngx_peer_connection_t *pc, void *data) |
100 |
+ goto next; |
101 |
+ } |
102 |
+ |
103 |
++#if (NGX_HTTP_UPSTREAM_CHECK) |
104 |
++ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0, |
105 |
++ "get hash peer, check_index: %ui", |
106 |
++ peer->check_index); |
107 |
++ if (ngx_http_upstream_check_peer_down(peer->check_index)) { |
108 |
++ goto next; |
109 |
++ } |
110 |
++#endif |
111 |
++ |
112 |
++ |
113 |
+ if (peer->max_fails |
114 |
+ && peer->fails >= peer->max_fails |
115 |
+ && now - peer->checked <= peer->fail_timeout) |
116 |
+@@ -538,6 +551,15 @@ ngx_http_upstream_get_chash_peer(ngx_peer_connection_t *pc, void *data) |
117 |
+ continue; |
118 |
+ } |
119 |
+ |
120 |
++#if (NGX_HTTP_UPSTREAM_CHECK) |
121 |
++ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0, |
122 |
++ "get consistent_hash peer, check_index: %ui", |
123 |
++ peer->check_index); |
124 |
++ if (ngx_http_upstream_check_peer_down(peer->check_index)) { |
125 |
++ continue; |
126 |
++ } |
127 |
++#endif |
128 |
++ |
129 |
+ if (peer->server.len != server->len |
130 |
+ || ngx_strncmp(peer->server.data, server->data, server->len) |
131 |
+ != 0) |
132 |
+diff --git src/http/modules/ngx_http_upstream_ip_hash_module.c src/http/modules/ngx_http_upstream_ip_hash_module.c |
133 |
+index 296108f..135ce5d 100644 |
134 |
+--- src/http/modules/ngx_http_upstream_ip_hash_module.c |
135 |
++++ src/http/modules/ngx_http_upstream_ip_hash_module.c |
136 |
+@@ -9,6 +9,9 @@ |
137 |
+ #include <ngx_core.h> |
138 |
+ #include <ngx_http.h> |
139 |
+ |
140 |
++#if (NGX_HTTP_UPSTREAM_CHECK) |
141 |
++#include "ngx_http_upstream_check_module.h" |
142 |
++#endif |
143 |
+ |
144 |
+ typedef struct { |
145 |
+ /* the round robin data must be first */ |
146 |
+@@ -205,6 +208,15 @@ ngx_http_upstream_get_ip_hash_peer(ngx_peer_connection_t *pc, void *data) |
147 |
+ goto next; |
148 |
+ } |
149 |
+ |
150 |
++#if (NGX_HTTP_UPSTREAM_CHECK) |
151 |
++ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0, |
152 |
++ "get ip_hash peer, check_index: %ui", |
153 |
++ peer->check_index); |
154 |
++ if (ngx_http_upstream_check_peer_down(peer->check_index)) { |
155 |
++ goto next; |
156 |
++ } |
157 |
++#endif |
158 |
++ |
159 |
+ if (peer->max_fails |
160 |
+ && peer->fails >= peer->max_fails |
161 |
+ && now - peer->checked <= peer->fail_timeout) |
162 |
+diff --git src/http/modules/ngx_http_upstream_least_conn_module.c src/http/modules/ngx_http_upstream_least_conn_module.c |
163 |
+index ebe0627..94f1883 100644 |
164 |
+--- src/http/modules/ngx_http_upstream_least_conn_module.c |
165 |
++++ src/http/modules/ngx_http_upstream_least_conn_module.c |
166 |
+@@ -9,6 +9,10 @@ |
167 |
+ #include <ngx_core.h> |
168 |
+ #include <ngx_http.h> |
169 |
+ |
170 |
++#if (NGX_HTTP_UPSTREAM_CHECK) |
171 |
++#include "ngx_http_upstream_check_module.h" |
172 |
++#endif |
173 |
++ |
174 |
+ |
175 |
+ static ngx_int_t ngx_http_upstream_init_least_conn_peer(ngx_http_request_t *r, |
176 |
+ ngx_http_upstream_srv_conf_t *us); |
177 |
+@@ -147,6 +151,16 @@ ngx_http_upstream_get_least_conn_peer(ngx_peer_connection_t *pc, void *data) |
178 |
+ continue; |
179 |
+ } |
180 |
+ |
181 |
++#if (NGX_HTTP_UPSTREAM_CHECK) |
182 |
++ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0, |
183 |
++ "get least_conn peer, check_index: %ui", |
184 |
++ peer->check_index); |
185 |
++ |
186 |
++ if (ngx_http_upstream_check_peer_down(peer->check_index)) { |
187 |
++ continue; |
188 |
++ } |
189 |
++#endif |
190 |
++ |
191 |
+ if (peer->max_fails |
192 |
+ && peer->fails >= peer->max_fails |
193 |
+ && now - peer->checked <= peer->fail_timeout) |
194 |
+@@ -202,6 +216,16 @@ ngx_http_upstream_get_least_conn_peer(ngx_peer_connection_t *pc, void *data) |
195 |
+ continue; |
196 |
+ } |
197 |
+ |
198 |
++#if (NGX_HTTP_UPSTREAM_CHECK) |
199 |
++ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0, |
200 |
++ "get least_conn peer, check_index: %ui", |
201 |
++ peer->check_index); |
202 |
++ |
203 |
++ if (ngx_http_upstream_check_peer_down(peer->check_index)) { |
204 |
++ continue; |
205 |
++ } |
206 |
++#endif |
207 |
++ |
208 |
+ if (peer->conns * best->weight != best->conns * peer->weight) { |
209 |
+ continue; |
210 |
+ } |
211 |
+diff --git src/http/ngx_http_upstream_round_robin.c src/http/ngx_http_upstream_round_robin.c |
212 |
+index 0137bf6..99f0923 100644 |
213 |
+--- src/http/ngx_http_upstream_round_robin.c |
214 |
++++ src/http/ngx_http_upstream_round_robin.c |
215 |
+@@ -9,6 +9,9 @@ |
216 |
+ #include <ngx_core.h> |
217 |
+ #include <ngx_http.h> |
218 |
+ |
219 |
++#if (NGX_HTTP_UPSTREAM_CHECK) |
220 |
++#include "ngx_http_upstream_check_module.h" |
221 |
++#endif |
222 |
+ |
223 |
+ #define ngx_http_upstream_tries(p) ((p)->number \ |
224 |
+ + ((p)->next ? (p)->next->number : 0)) |
225 |
+@@ -97,7 +100,14 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf, |
226 |
+ peer[n].fail_timeout = server[i].fail_timeout; |
227 |
+ peer[n].down = server[i].down; |
228 |
+ peer[n].server = server[i].name; |
229 |
+- |
230 |
++#if (NGX_HTTP_UPSTREAM_CHECK) |
231 |
++ if (!server[i].down) { |
232 |
++ peer[n].check_index = |
233 |
++ ngx_http_upstream_check_add_peer(cf, us, &server[i].addrs[j]); |
234 |
++ } else { |
235 |
++ peer[n].check_index = (ngx_uint_t) NGX_ERROR; |
236 |
++ } |
237 |
++#endif |
238 |
+ *peerp = &peer[n]; |
239 |
+ peerp = &peer[n].next; |
240 |
+ n++; |
241 |
+@@ -161,7 +171,15 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf, |
242 |
+ peer[n].fail_timeout = server[i].fail_timeout; |
243 |
+ peer[n].down = server[i].down; |
244 |
+ peer[n].server = server[i].name; |
245 |
+- |
246 |
++#if (NGX_HTTP_UPSTREAM_CHECK) |
247 |
++ if (!server[i].down) { |
248 |
++ peer[n].check_index = |
249 |
++ ngx_http_upstream_check_add_peer(cf, us, &server[i].addrs[j]); |
250 |
++ } |
251 |
++ else { |
252 |
++ peer[n].check_index = (ngx_uint_t) NGX_ERROR; |
253 |
++ } |
254 |
++#endif |
255 |
+ *peerp = &peer[n]; |
256 |
+ peerp = &peer[n].next; |
257 |
+ n++; |
258 |
+@@ -228,6 +246,9 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf, |
259 |
+ peer[i].max_conns = 0; |
260 |
+ peer[i].max_fails = 1; |
261 |
+ peer[i].fail_timeout = 10; |
262 |
++#if (NGX_HTTP_UPSTREAM_CHECK) |
263 |
++ peer[i].check_index = (ngx_uint_t) NGX_ERROR; |
264 |
++#endif |
265 |
+ *peerp = &peer[i]; |
266 |
+ peerp = &peer[i].next; |
267 |
+ } |
268 |
+@@ -344,6 +365,9 @@ ngx_http_upstream_create_round_robin_peer(ngx_http_request_t *r, |
269 |
+ peer[0].max_conns = 0; |
270 |
+ peer[0].max_fails = 1; |
271 |
+ peer[0].fail_timeout = 10; |
272 |
++#if (NGX_HTTP_UPSTREAM_CHECK) |
273 |
++ peer[0].check_index = (ngx_uint_t) NGX_ERROR; |
274 |
++#endif |
275 |
+ peers->peer = peer; |
276 |
+ |
277 |
+ } else { |
278 |
+@@ -378,6 +402,9 @@ ngx_http_upstream_create_round_robin_peer(ngx_http_request_t *r, |
279 |
+ peer[i].max_conns = 0; |
280 |
+ peer[i].max_fails = 1; |
281 |
+ peer[i].fail_timeout = 10; |
282 |
++#if (NGX_HTTP_UPSTREAM_CHECK) |
283 |
++ peer[i].check_index = (ngx_uint_t) NGX_ERROR; |
284 |
++#endif |
285 |
+ *peerp = &peer[i]; |
286 |
+ peerp = &peer[i].next; |
287 |
+ } |
288 |
+@@ -443,6 +470,12 @@ ngx_http_upstream_get_round_robin_peer(ngx_peer_connection_t *pc, void *data) |
289 |
+ goto failed; |
290 |
+ } |
291 |
+ |
292 |
++#if (NGX_HTTP_UPSTREAM_CHECK) |
293 |
++ if (ngx_http_upstream_check_peer_down(peer->check_index)) { |
294 |
++ goto failed; |
295 |
++ } |
296 |
++#endif |
297 |
++ |
298 |
+ rrp->current = peer; |
299 |
+ |
300 |
+ } else { |
301 |
+@@ -537,6 +570,12 @@ ngx_http_upstream_get_peer(ngx_http_upstream_rr_peer_data_t *rrp) |
302 |
+ continue; |
303 |
+ } |
304 |
+ |
305 |
++#if (NGX_HTTP_UPSTREAM_CHECK) |
306 |
++ if (ngx_http_upstream_check_peer_down(peer->check_index)) { |
307 |
++ continue; |
308 |
++ } |
309 |
++#endif |
310 |
++ |
311 |
+ if (peer->max_fails |
312 |
+ && peer->fails >= peer->max_fails |
313 |
+ && now - peer->checked <= peer->fail_timeout) |
314 |
+diff --git src/http/ngx_http_upstream_round_robin.h src/http/ngx_http_upstream_round_robin.h |
315 |
+index 45f258d..dee91d0 100644 |
316 |
+--- src/http/ngx_http_upstream_round_robin.h |
317 |
++++ src/http/ngx_http_upstream_round_robin.h |
318 |
+@@ -38,6 +38,10 @@ struct ngx_http_upstream_rr_peer_s { |
319 |
+ ngx_msec_t slow_start; |
320 |
+ ngx_msec_t start_time; |
321 |
+ |
322 |
++#if (NGX_HTTP_UPSTREAM_CHECK) |
323 |
++ ngx_uint_t check_index; |
324 |
++#endif |
325 |
++ |
326 |
+ ngx_uint_t down; |
327 |
+ |
328 |
+ #if (NGX_HTTP_SSL || NGX_COMPAT) |
329 |
|
330 |
diff --git a/www-servers/nginx/nginx-1.11.5.ebuild b/www-servers/nginx/nginx-1.11.5.ebuild |
331 |
new file mode 100644 |
332 |
index 00000000..3f951db |
333 |
--- /dev/null |
334 |
+++ b/www-servers/nginx/nginx-1.11.5.ebuild |
335 |
@@ -0,0 +1,781 @@ |
336 |
+# Copyright 1999-2016 Gentoo Foundation |
337 |
+# Distributed under the terms of the GNU General Public License v2 |
338 |
+# $Id$ |
339 |
+ |
340 |
+EAPI=6 |
341 |
+ |
342 |
+# Maintainer notes: |
343 |
+# - http_rewrite-independent pcre-support makes sense for matching locations without an actual rewrite |
344 |
+# - any http-module activates the main http-functionality and overrides USE=-http |
345 |
+# - keep the following requirements in mind before adding external modules: |
346 |
+# * alive upstream |
347 |
+# * sane packaging |
348 |
+# * builds cleanly |
349 |
+# * does not need a patch for nginx core |
350 |
+# - TODO: test the google-perftools module (included in vanilla tarball) |
351 |
+ |
352 |
+# prevent perl-module from adding automagic perl DEPENDs |
353 |
+GENTOO_DEPEND_ON_PERL="no" |
354 |
+ |
355 |
+# devel_kit (https://github.com/simpl/ngx_devel_kit, BSD license) |
356 |
+DEVEL_KIT_MODULE_PV="0.3.0" |
357 |
+DEVEL_KIT_MODULE_P="ngx_devel_kit-${DEVEL_KIT_MODULE_PV}-r1" |
358 |
+DEVEL_KIT_MODULE_URI="https://github.com/simpl/ngx_devel_kit/archive/v${DEVEL_KIT_MODULE_PV}.tar.gz" |
359 |
+DEVEL_KIT_MODULE_WD="${WORKDIR}/ngx_devel_kit-${DEVEL_KIT_MODULE_PV}" |
360 |
+ |
361 |
+# http_uploadprogress (https://github.com/masterzen/nginx-upload-progress-module, BSD-2 license) |
362 |
+HTTP_UPLOAD_PROGRESS_MODULE_PV="0.9.2" |
363 |
+HTTP_UPLOAD_PROGRESS_MODULE_P="ngx_http_upload_progress-${HTTP_UPLOAD_PROGRESS_MODULE_PV}-r1" |
364 |
+HTTP_UPLOAD_PROGRESS_MODULE_URI="https://github.com/masterzen/nginx-upload-progress-module/archive/v${HTTP_UPLOAD_PROGRESS_MODULE_PV}.tar.gz" |
365 |
+HTTP_UPLOAD_PROGRESS_MODULE_WD="${WORKDIR}/nginx-upload-progress-module-${HTTP_UPLOAD_PROGRESS_MODULE_PV}" |
366 |
+ |
367 |
+# http_headers_more (https://github.com/agentzh/headers-more-nginx-module, BSD license) |
368 |
+HTTP_HEADERS_MORE_MODULE_PV="0.31" |
369 |
+HTTP_HEADERS_MORE_MODULE_P="ngx_http_headers_more-${HTTP_HEADERS_MORE_MODULE_PV}" |
370 |
+HTTP_HEADERS_MORE_MODULE_URI="https://github.com/agentzh/headers-more-nginx-module/archive/v${HTTP_HEADERS_MORE_MODULE_PV}.tar.gz" |
371 |
+HTTP_HEADERS_MORE_MODULE_WD="${WORKDIR}/headers-more-nginx-module-${HTTP_HEADERS_MORE_MODULE_PV}" |
372 |
+ |
373 |
+# http_cache_purge (http://labs.frickle.com/nginx_ngx_cache_purge/, https://github.com/FRiCKLE/ngx_cache_purge, BSD-2 license) |
374 |
+HTTP_CACHE_PURGE_MODULE_PV="2.3" |
375 |
+HTTP_CACHE_PURGE_MODULE_P="ngx_http_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}" |
376 |
+HTTP_CACHE_PURGE_MODULE_URI="http://labs.frickle.com/files/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}.tar.gz" |
377 |
+HTTP_CACHE_PURGE_MODULE_WD="${WORKDIR}/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}" |
378 |
+ |
379 |
+# http_slowfs_cache (http://labs.frickle.com/nginx_ngx_slowfs_cache/, BSD-2 license) |
380 |
+HTTP_SLOWFS_CACHE_MODULE_PV="1.10" |
381 |
+HTTP_SLOWFS_CACHE_MODULE_P="ngx_http_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}" |
382 |
+HTTP_SLOWFS_CACHE_MODULE_URI="http://labs.frickle.com/files/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}.tar.gz" |
383 |
+HTTP_SLOWFS_CACHE_MODULE_WD="${WORKDIR}/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}" |
384 |
+ |
385 |
+# http_fancyindex (https://github.com/aperezdc/ngx-fancyindex, BSD license) |
386 |
+HTTP_FANCYINDEX_MODULE_PV="0.4.1" |
387 |
+HTTP_FANCYINDEX_MODULE_P="ngx_http_fancyindex-${HTTP_FANCYINDEX_MODULE_PV}" |
388 |
+HTTP_FANCYINDEX_MODULE_URI="https://github.com/aperezdc/ngx-fancyindex/archive/v${HTTP_FANCYINDEX_MODULE_PV}.tar.gz" |
389 |
+HTTP_FANCYINDEX_MODULE_WD="${WORKDIR}/ngx-fancyindex-${HTTP_FANCYINDEX_MODULE_PV}" |
390 |
+ |
391 |
+# http_lua (https://github.com/openresty/lua-nginx-module, BSD license) |
392 |
+HTTP_LUA_MODULE_PV="0.10.6" |
393 |
+HTTP_LUA_MODULE_P="ngx_http_lua-${HTTP_LUA_MODULE_PV}" |
394 |
+HTTP_LUA_MODULE_URI="https://github.com/openresty/lua-nginx-module/archive/v${HTTP_LUA_MODULE_PV}.tar.gz" |
395 |
+HTTP_LUA_MODULE_WD="${WORKDIR}/lua-nginx-module-${HTTP_LUA_MODULE_PV}" |
396 |
+ |
397 |
+# http_auth_pam (https://github.com/stogh/ngx_http_auth_pam_module/, http://web.iti.upv.es/~sto/nginx/, BSD-2 license) |
398 |
+HTTP_AUTH_PAM_MODULE_PV="1.5.1" |
399 |
+HTTP_AUTH_PAM_MODULE_P="ngx_http_auth_pam-${HTTP_AUTH_PAM_MODULE_PV}" |
400 |
+HTTP_AUTH_PAM_MODULE_URI="https://github.com/stogh/ngx_http_auth_pam_module/archive/v${HTTP_AUTH_PAM_MODULE_PV}.tar.gz" |
401 |
+HTTP_AUTH_PAM_MODULE_WD="${WORKDIR}/ngx_http_auth_pam_module-${HTTP_AUTH_PAM_MODULE_PV}" |
402 |
+ |
403 |
+# http_upstream_check (https://github.com/yaoweibin/nginx_upstream_check_module, BSD license) |
404 |
+HTTP_UPSTREAM_CHECK_MODULE_PV="0.3.0-10-gf3bdb7b" |
405 |
+HTTP_UPSTREAM_CHECK_MODULE_P="ngx_http_upstream_check-${HTTP_UPSTREAM_CHECK_MODULE_PV}" |
406 |
+HTTP_UPSTREAM_CHECK_MODULE_URI="https://github.com/yaoweibin/nginx_upstream_check_module/archive/v${HTTP_UPSTREAM_CHECK_MODULE_PV}.tar.gz" |
407 |
+HTTP_UPSTREAM_CHECK_MODULE_WD="${WORKDIR}/nginx_upstream_check_module-f3bdb7b85a194e2ad58e3c306c1d021ee76da2f5" |
408 |
+ |
409 |
+# http_metrics (https://github.com/zenops/ngx_metrics, BSD license) |
410 |
+HTTP_METRICS_MODULE_PV="0.1.1" |
411 |
+HTTP_METRICS_MODULE_P="ngx_metrics-${HTTP_METRICS_MODULE_PV}" |
412 |
+HTTP_METRICS_MODULE_URI="https://github.com/madvertise/ngx_metrics/archive/v${HTTP_METRICS_MODULE_PV}.tar.gz" |
413 |
+HTTP_METRICS_MODULE_WD="${WORKDIR}/ngx_metrics-${HTTP_METRICS_MODULE_PV}" |
414 |
+ |
415 |
+# naxsi-core (https://github.com/nbs-system/naxsi, GPLv2+) |
416 |
+HTTP_NAXSI_MODULE_PV="0.55.1" |
417 |
+HTTP_NAXSI_MODULE_P="ngx_http_naxsi-${HTTP_NAXSI_MODULE_PV}" |
418 |
+HTTP_NAXSI_MODULE_URI="https://github.com/nbs-system/naxsi/archive/${HTTP_NAXSI_MODULE_PV}.tar.gz" |
419 |
+HTTP_NAXSI_MODULE_WD="${WORKDIR}/naxsi-${HTTP_NAXSI_MODULE_PV}/naxsi_src" |
420 |
+ |
421 |
+# nginx-rtmp-module (https://github.com/arut/nginx-rtmp-module, BSD license) |
422 |
+RTMP_MODULE_PV="1.1.10" |
423 |
+RTMP_MODULE_P="ngx_rtmp-${RTMP_MODULE_PV}" |
424 |
+RTMP_MODULE_URI="https://github.com/arut/nginx-rtmp-module/archive/v${RTMP_MODULE_PV}.tar.gz" |
425 |
+RTMP_MODULE_WD="${WORKDIR}/nginx-rtmp-module-${RTMP_MODULE_PV}" |
426 |
+ |
427 |
+# nginx-dav-ext-module (https://github.com/arut/nginx-dav-ext-module, BSD license) |
428 |
+HTTP_DAV_EXT_MODULE_PV="0.0.3" |
429 |
+HTTP_DAV_EXT_MODULE_P="ngx_http_dav_ext-${HTTP_DAV_EXT_MODULE_PV}" |
430 |
+HTTP_DAV_EXT_MODULE_URI="https://github.com/arut/nginx-dav-ext-module/archive/v${HTTP_DAV_EXT_MODULE_PV}.tar.gz" |
431 |
+HTTP_DAV_EXT_MODULE_WD="${WORKDIR}/nginx-dav-ext-module-${HTTP_DAV_EXT_MODULE_PV}" |
432 |
+ |
433 |
+# echo-nginx-module (https://github.com/openresty/echo-nginx-module, BSD license) |
434 |
+HTTP_ECHO_MODULE_PV="0.60" |
435 |
+HTTP_ECHO_MODULE_P="ngx_http_echo-${HTTP_ECHO_MODULE_PV}" |
436 |
+HTTP_ECHO_MODULE_URI="https://github.com/openresty/echo-nginx-module/archive/v${HTTP_ECHO_MODULE_PV}.tar.gz" |
437 |
+HTTP_ECHO_MODULE_WD="${WORKDIR}/echo-nginx-module-${HTTP_ECHO_MODULE_PV}" |
438 |
+ |
439 |
+# mod_security for nginx (https://modsecurity.org/, Apache-2.0) |
440 |
+# keep the MODULE_P here consistent with upstream to avoid tarball duplication |
441 |
+HTTP_SECURITY_MODULE_PV="2.9.1" |
442 |
+HTTP_SECURITY_MODULE_P="modsecurity-${HTTP_SECURITY_MODULE_PV}" |
443 |
+HTTP_SECURITY_MODULE_URI="https://www.modsecurity.org/tarball/${HTTP_SECURITY_MODULE_PV}/${HTTP_SECURITY_MODULE_P}.tar.gz" |
444 |
+HTTP_SECURITY_MODULE_WD="${WORKDIR}/${HTTP_SECURITY_MODULE_P}" |
445 |
+ |
446 |
+# push-stream-module (http://www.nginxpushstream.com, https://github.com/wandenberg/nginx-push-stream-module, GPL-3) |
447 |
+HTTP_PUSH_STREAM_MODULE_PV="0.5.2" |
448 |
+HTTP_PUSH_STREAM_MODULE_P="ngx_http_push_stream-${HTTP_PUSH_STREAM_MODULE_PV}" |
449 |
+HTTP_PUSH_STREAM_MODULE_URI="https://github.com/wandenberg/nginx-push-stream-module/archive/${HTTP_PUSH_STREAM_MODULE_PV}.tar.gz" |
450 |
+HTTP_PUSH_STREAM_MODULE_WD="${WORKDIR}/nginx-push-stream-module-${HTTP_PUSH_STREAM_MODULE_PV}" |
451 |
+ |
452 |
+# sticky-module (https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng, BSD-2) |
453 |
+HTTP_STICKY_MODULE_PV="1.2.6-10-g08a395c66e42" |
454 |
+HTTP_STICKY_MODULE_P="nginx_http_sticky_module_ng-${HTTP_STICKY_MODULE_PV}" |
455 |
+HTTP_STICKY_MODULE_URI="https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/get/${HTTP_STICKY_MODULE_PV}.tar.bz2" |
456 |
+HTTP_STICKY_MODULE_WD="${WORKDIR}/nginx-goodies-nginx-sticky-module-ng-08a395c66e42" |
457 |
+ |
458 |
+# mogilefs-module (https://github.com/vkholodkov/nginx-mogilefs-module, BSD-2) |
459 |
+HTTP_MOGILEFS_MODULE_PV="1.0.4" |
460 |
+HTTP_MOGILEFS_MODULE_P="ngx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}" |
461 |
+HTTP_MOGILEFS_MODULE_URI="https://github.com/vkholodkov/nginx-mogilefs-module/archive/${HTTP_MOGILEFS_MODULE_PV}.tar.gz" |
462 |
+HTTP_MOGILEFS_MODULE_WD="${WORKDIR}/nginx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}" |
463 |
+ |
464 |
+# memc-module (https://github.com/openresty/memc-nginx-module, BSD-2) |
465 |
+HTTP_MEMC_MODULE_PV="0.17" |
466 |
+HTTP_MEMC_MODULE_P="ngx_memc_module-${HTTP_MEMC_MODULE_PV}" |
467 |
+HTTP_MEMC_MODULE_URI="https://github.com/openresty/memc-nginx-module/archive/v${HTTP_MEMC_MODULE_PV}.tar.gz" |
468 |
+HTTP_MEMC_MODULE_WD="${WORKDIR}/memc-nginx-module-${HTTP_MEMC_MODULE_PV}" |
469 |
+ |
470 |
+# nginx-ldap-auth-module (https://github.com/kvspb/nginx-auth-ldap, BSD-2) |
471 |
+HTTP_LDAP_MODULE_PV="49a8b4d28fc4a518563c82e0b52821e5f37db1fc" |
472 |
+HTTP_LDAP_MODULE_P="nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}" |
473 |
+HTTP_LDAP_MODULE_URI="https://github.com/kvspb/nginx-auth-ldap/archive/${HTTP_LDAP_MODULE_PV}.tar.gz" |
474 |
+HTTP_LDAP_MODULE_WD="${WORKDIR}/nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}" |
475 |
+ |
476 |
+# We handle deps below ourselves |
477 |
+SSL_DEPS_SKIP=1 |
478 |
+ |
479 |
+inherit ssl-cert toolchain-funcs perl-module flag-o-matic user systemd versionator multilib |
480 |
+ |
481 |
+DESCRIPTION="Robust, small and high performance http and reverse proxy server" |
482 |
+HOMEPAGE="http://nginx.org" |
483 |
+SRC_URI="http://nginx.org/download/${P}.tar.gz |
484 |
+ ${DEVEL_KIT_MODULE_URI} -> ${DEVEL_KIT_MODULE_P}.tar.gz |
485 |
+ nginx_modules_http_upload_progress? ( ${HTTP_UPLOAD_PROGRESS_MODULE_URI} -> ${HTTP_UPLOAD_PROGRESS_MODULE_P}.tar.gz ) |
486 |
+ nginx_modules_http_headers_more? ( ${HTTP_HEADERS_MORE_MODULE_URI} -> ${HTTP_HEADERS_MORE_MODULE_P}.tar.gz ) |
487 |
+ nginx_modules_http_cache_purge? ( ${HTTP_CACHE_PURGE_MODULE_URI} -> ${HTTP_CACHE_PURGE_MODULE_P}.tar.gz ) |
488 |
+ nginx_modules_http_slowfs_cache? ( ${HTTP_SLOWFS_CACHE_MODULE_URI} -> ${HTTP_SLOWFS_CACHE_MODULE_P}.tar.gz ) |
489 |
+ nginx_modules_http_fancyindex? ( ${HTTP_FANCYINDEX_MODULE_URI} -> ${HTTP_FANCYINDEX_MODULE_P}.tar.gz ) |
490 |
+ nginx_modules_http_lua? ( ${HTTP_LUA_MODULE_URI} -> ${HTTP_LUA_MODULE_P}.tar.gz ) |
491 |
+ nginx_modules_http_auth_pam? ( ${HTTP_AUTH_PAM_MODULE_URI} -> ${HTTP_AUTH_PAM_MODULE_P}.tar.gz ) |
492 |
+ nginx_modules_http_upstream_check? ( ${HTTP_UPSTREAM_CHECK_MODULE_URI} -> ${HTTP_UPSTREAM_CHECK_MODULE_P}.tar.gz ) |
493 |
+ nginx_modules_http_metrics? ( ${HTTP_METRICS_MODULE_URI} -> ${HTTP_METRICS_MODULE_P}.tar.gz ) |
494 |
+ nginx_modules_http_naxsi? ( ${HTTP_NAXSI_MODULE_URI} -> ${HTTP_NAXSI_MODULE_P}.tar.gz ) |
495 |
+ rtmp? ( ${RTMP_MODULE_URI} -> ${RTMP_MODULE_P}.tar.gz ) |
496 |
+ nginx_modules_http_dav_ext? ( ${HTTP_DAV_EXT_MODULE_URI} -> ${HTTP_DAV_EXT_MODULE_P}.tar.gz ) |
497 |
+ nginx_modules_http_echo? ( ${HTTP_ECHO_MODULE_URI} -> ${HTTP_ECHO_MODULE_P}.tar.gz ) |
498 |
+ nginx_modules_http_security? ( ${HTTP_SECURITY_MODULE_URI} -> ${HTTP_SECURITY_MODULE_P}.tar.gz ) |
499 |
+ nginx_modules_http_push_stream? ( ${HTTP_PUSH_STREAM_MODULE_URI} -> ${HTTP_PUSH_STREAM_MODULE_P}.tar.gz ) |
500 |
+ nginx_modules_http_sticky? ( ${HTTP_STICKY_MODULE_URI} -> ${HTTP_STICKY_MODULE_P}.tar.bz2 ) |
501 |
+ nginx_modules_http_mogilefs? ( ${HTTP_MOGILEFS_MODULE_URI} -> ${HTTP_MOGILEFS_MODULE_P}.tar.gz ) |
502 |
+ nginx_modules_http_memc? ( ${HTTP_MEMC_MODULE_URI} -> ${HTTP_MEMC_MODULE_P}.tar.gz ) |
503 |
+ nginx_modules_http_auth_ldap? ( ${HTTP_LDAP_MODULE_URI} -> ${HTTP_LDAP_MODULE_P}.tar.gz )" |
504 |
+ |
505 |
+LICENSE="BSD-2 BSD SSLeay MIT GPL-2 GPL-2+ |
506 |
+ nginx_modules_http_security? ( Apache-2.0 ) |
507 |
+ nginx_modules_http_push_stream? ( GPL-3 )" |
508 |
+ |
509 |
+SLOT="mainline" |
510 |
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux" |
511 |
+ |
512 |
+NGINX_MODULES_STD="access auth_basic autoindex browser charset empty_gif |
513 |
+ fastcgi geo gzip limit_req limit_conn map memcached proxy referer |
514 |
+ rewrite scgi ssi split_clients upstream_hash upstream_ip_hash |
515 |
+ upstream_keepalive upstream_least_conn upstream_zone userid uwsgi" |
516 |
+NGINX_MODULES_OPT="addition auth_request dav degradation flv geoip gunzip |
517 |
+ gzip_static image_filter mp4 perl random_index realip secure_link |
518 |
+ slice stub_status sub xslt" |
519 |
+NGINX_MODULES_STREAM_STD="access geo limit_conn map return split_clients |
520 |
+ upstream_hash upstream_least_conn upstream_zone" |
521 |
+NGINX_MODULES_STREAM_OPT="geoip realip ssl_preread" |
522 |
+NGINX_MODULES_MAIL="imap pop3 smtp" |
523 |
+NGINX_MODULES_3RD=" |
524 |
+ http_upload_progress |
525 |
+ http_headers_more |
526 |
+ http_cache_purge |
527 |
+ http_slowfs_cache |
528 |
+ http_fancyindex |
529 |
+ http_lua |
530 |
+ http_auth_pam |
531 |
+ http_upstream_check |
532 |
+ http_metrics |
533 |
+ http_naxsi |
534 |
+ http_dav_ext |
535 |
+ http_echo |
536 |
+ http_security |
537 |
+ http_push_stream |
538 |
+ http_sticky |
539 |
+ http_mogilefs |
540 |
+ http_memc |
541 |
+ http_auth_ldap" |
542 |
+ |
543 |
+IUSE="aio debug +http +http2 +http-cache +ipv6 libatomic libressl luajit +pcre |
544 |
+ pcre-jit rtmp selinux ssl threads userland_GNU vim-syntax" |
545 |
+ |
546 |
+for mod in $NGINX_MODULES_STD; do |
547 |
+ IUSE="${IUSE} +nginx_modules_http_${mod}" |
548 |
+done |
549 |
+ |
550 |
+for mod in $NGINX_MODULES_OPT; do |
551 |
+ IUSE="${IUSE} nginx_modules_http_${mod}" |
552 |
+done |
553 |
+ |
554 |
+for mod in $NGINX_MODULES_STREAM_STD; do |
555 |
+ IUSE="${IUSE} nginx_modules_stream_${mod}" |
556 |
+done |
557 |
+ |
558 |
+for mod in $NGINX_MODULES_STREAM_OPT; do |
559 |
+ IUSE="${IUSE} nginx_modules_stream_${mod}" |
560 |
+done |
561 |
+ |
562 |
+for mod in $NGINX_MODULES_MAIL; do |
563 |
+ IUSE="${IUSE} nginx_modules_mail_${mod}" |
564 |
+done |
565 |
+ |
566 |
+for mod in $NGINX_MODULES_3RD; do |
567 |
+ IUSE="${IUSE} nginx_modules_${mod}" |
568 |
+done |
569 |
+ |
570 |
+# Add so we can warn users updating about config changes |
571 |
+# @TODO: jbergstroem: remove on next release series |
572 |
+IUSE="${IUSE} nginx_modules_http_spdy" |
573 |
+ |
574 |
+CDEPEND=" |
575 |
+ pcre? ( >=dev-libs/libpcre-4.2 ) |
576 |
+ pcre-jit? ( >=dev-libs/libpcre-8.20[jit] ) |
577 |
+ ssl? ( |
578 |
+ !libressl? ( dev-libs/openssl:0= ) |
579 |
+ libressl? ( dev-libs/libressl:= ) |
580 |
+ ) |
581 |
+ http2? ( |
582 |
+ !libressl? ( >=dev-libs/openssl-1.0.1c:0= ) |
583 |
+ libressl? ( dev-libs/libressl:= ) |
584 |
+ ) |
585 |
+ http-cache? ( |
586 |
+ userland_GNU? ( |
587 |
+ !libressl? ( dev-libs/openssl:0= ) |
588 |
+ libressl? ( dev-libs/libressl:= ) |
589 |
+ ) |
590 |
+ ) |
591 |
+ nginx_modules_http_geoip? ( dev-libs/geoip ) |
592 |
+ nginx_modules_http_gunzip? ( sys-libs/zlib ) |
593 |
+ nginx_modules_http_gzip? ( sys-libs/zlib ) |
594 |
+ nginx_modules_http_gzip_static? ( sys-libs/zlib ) |
595 |
+ nginx_modules_http_image_filter? ( media-libs/gd[jpeg,png] ) |
596 |
+ nginx_modules_http_perl? ( >=dev-lang/perl-5.8 ) |
597 |
+ nginx_modules_http_rewrite? ( >=dev-libs/libpcre-4.2 ) |
598 |
+ nginx_modules_http_secure_link? ( |
599 |
+ userland_GNU? ( |
600 |
+ !libressl? ( dev-libs/openssl:0= ) |
601 |
+ libressl? ( dev-libs/libressl:= ) |
602 |
+ ) |
603 |
+ ) |
604 |
+ nginx_modules_http_xslt? ( dev-libs/libxml2 dev-libs/libxslt ) |
605 |
+ nginx_modules_http_lua? ( !luajit? ( dev-lang/lua:0= ) luajit? ( dev-lang/luajit:2= ) ) |
606 |
+ nginx_modules_http_auth_pam? ( virtual/pam ) |
607 |
+ nginx_modules_http_metrics? ( dev-libs/yajl ) |
608 |
+ nginx_modules_http_dav_ext? ( dev-libs/expat ) |
609 |
+ nginx_modules_http_security? ( >=dev-libs/libxml2-2.7.8 dev-libs/apr-util www-servers/apache ) |
610 |
+ nginx_modules_http_auth_ldap? ( net-nds/openldap[ssl?] )" |
611 |
+RDEPEND="${CDEPEND} |
612 |
+ selinux? ( sec-policy/selinux-nginx ) |
613 |
+ !www-servers/nginx:0" |
614 |
+DEPEND="${CDEPEND} |
615 |
+ arm? ( dev-libs/libatomic_ops ) |
616 |
+ libatomic? ( dev-libs/libatomic_ops )" |
617 |
+PDEPEND="vim-syntax? ( app-vim/nginx-syntax )" |
618 |
+ |
619 |
+REQUIRED_USE="pcre-jit? ( pcre ) |
620 |
+ nginx_modules_http_lua? ( nginx_modules_http_rewrite ) |
621 |
+ nginx_modules_http_naxsi? ( pcre ) |
622 |
+ nginx_modules_http_dav_ext? ( nginx_modules_http_dav ) |
623 |
+ nginx_modules_http_metrics? ( nginx_modules_http_stub_status ) |
624 |
+ nginx_modules_http_security? ( pcre ) |
625 |
+ nginx_modules_http_push_stream? ( ssl )" |
626 |
+ |
627 |
+pkg_setup() { |
628 |
+ NGINX_HOME="/var/lib/nginx" |
629 |
+ NGINX_HOME_TMP="${NGINX_HOME}/tmp" |
630 |
+ |
631 |
+ ebegin "Creating nginx user and group" |
632 |
+ enewgroup ${PN} |
633 |
+ enewuser ${PN} -1 -1 "${NGINX_HOME}" ${PN} |
634 |
+ eend $? |
635 |
+ |
636 |
+ if use libatomic; then |
637 |
+ ewarn "GCC 4.1+ features built-in atomic operations." |
638 |
+ ewarn "Using libatomic_ops is only needed if using" |
639 |
+ ewarn "a different compiler or a GCC prior to 4.1" |
640 |
+ fi |
641 |
+ |
642 |
+ if [[ -n $NGINX_ADD_MODULES ]]; then |
643 |
+ ewarn "You are building custom modules via \$NGINX_ADD_MODULES!" |
644 |
+ ewarn "This nginx installation is not supported!" |
645 |
+ ewarn "Make sure you can reproduce the bug without those modules" |
646 |
+ ewarn "_before_ reporting bugs." |
647 |
+ fi |
648 |
+ |
649 |
+ if use !http; then |
650 |
+ ewarn "To actually disable all http-functionality you also have to disable" |
651 |
+ ewarn "all nginx http modules." |
652 |
+ fi |
653 |
+ |
654 |
+ if use nginx_modules_http_mogilefs && use threads; then |
655 |
+ eerror "mogilefs won't compile with threads support." |
656 |
+ eerror "Please disable either flag and try again." |
657 |
+ die "Can't compile mogilefs with threads support" |
658 |
+ fi |
659 |
+} |
660 |
+ |
661 |
+src_prepare() { |
662 |
+ eapply "${FILESDIR}/${PN}-1.4.1-fix-perl-install-path.patch" |
663 |
+ eapply "${FILESDIR}/${PN}-httpoxy-mitigation-r1.patch" |
664 |
+ |
665 |
+ if use nginx_modules_http_upstream_check; then |
666 |
+ #eapply -p0 "${HTTP_UPSTREAM_CHECK_MODULE_WD}"/check_1.11.1+.patch |
667 |
+ eapply -p0 "${FILESDIR}"/http_upstream_check-nginx-1.11.5+.patch |
668 |
+ fi |
669 |
+ |
670 |
+ if use nginx_modules_http_lua; then |
671 |
+ sed -i -e 's/-llua5.1/-llua/' "${HTTP_LUA_MODULE_WD}/config" || die |
672 |
+ fi |
673 |
+ |
674 |
+ find auto/ -type f -print0 | xargs -0 sed -i 's:\&\& make:\&\& \\$(MAKE):' || die |
675 |
+ # We have config protection, don't rename etc files |
676 |
+ sed -i 's:.default::' auto/install || die |
677 |
+ # remove useless files |
678 |
+ sed -i -e '/koi-/d' -e '/win-/d' auto/install || die |
679 |
+ |
680 |
+ # don't install to /etc/nginx/ if not in use |
681 |
+ local module |
682 |
+ for module in fastcgi scgi uwsgi ; do |
683 |
+ if ! use nginx_modules_http_${module}; then |
684 |
+ sed -i -e "/${module}/d" auto/install || die |
685 |
+ fi |
686 |
+ done |
687 |
+ |
688 |
+ eapply_user |
689 |
+} |
690 |
+ |
691 |
+src_configure() { |
692 |
+ # mod_security needs to generate nginx/modsecurity/config before including it |
693 |
+ if use nginx_modules_http_security; then |
694 |
+ cd "${HTTP_SECURITY_MODULE_WD}" || die |
695 |
+ if use luajit ; then |
696 |
+ sed -i \ |
697 |
+ -e 's|^\(LUA_PKGNAMES\)=.*|\1="luajit"|' \ |
698 |
+ configure || die |
699 |
+ fi |
700 |
+ ./configure \ |
701 |
+ --enable-standalone-module \ |
702 |
+ $(use_enable pcre-jit) \ |
703 |
+ $(use_with nginx_modules_http_lua lua) || die "configure failed for mod_security" |
704 |
+ fi |
705 |
+ |
706 |
+ cd "${S}" || die |
707 |
+ |
708 |
+ local myconf=() http_enabled= mail_enabled= stream_enabled= |
709 |
+ |
710 |
+ use aio && myconf+=( --with-file-aio ) |
711 |
+ use debug && myconf+=( --with-debug ) |
712 |
+ use http2 && myconf+=( --with-http_v2_module ) |
713 |
+ use libatomic && myconf+=( --with-libatomic ) |
714 |
+ use pcre && myconf+=( --with-pcre ) |
715 |
+ use pcre-jit && myconf+=( --with-pcre-jit ) |
716 |
+ use threads && myconf+=( --with-threads ) |
717 |
+ |
718 |
+ # HTTP modules |
719 |
+ for mod in $NGINX_MODULES_STD; do |
720 |
+ if use nginx_modules_http_${mod}; then |
721 |
+ http_enabled=1 |
722 |
+ else |
723 |
+ myconf+=( --without-http_${mod}_module ) |
724 |
+ fi |
725 |
+ done |
726 |
+ |
727 |
+ for mod in $NGINX_MODULES_OPT; do |
728 |
+ if use nginx_modules_http_${mod}; then |
729 |
+ http_enabled=1 |
730 |
+ myconf+=( --with-http_${mod}_module ) |
731 |
+ fi |
732 |
+ done |
733 |
+ |
734 |
+ if use nginx_modules_http_fastcgi; then |
735 |
+ myconf+=( --with-http_realip_module ) |
736 |
+ fi |
737 |
+ |
738 |
+ # third-party modules |
739 |
+ if use nginx_modules_http_upload_progress; then |
740 |
+ http_enabled=1 |
741 |
+ myconf+=( --add-module=${HTTP_UPLOAD_PROGRESS_MODULE_WD} ) |
742 |
+ fi |
743 |
+ |
744 |
+ if use nginx_modules_http_headers_more; then |
745 |
+ http_enabled=1 |
746 |
+ myconf+=( --add-module=${HTTP_HEADERS_MORE_MODULE_WD} ) |
747 |
+ fi |
748 |
+ |
749 |
+ if use nginx_modules_http_cache_purge; then |
750 |
+ http_enabled=1 |
751 |
+ myconf+=( --add-module=${HTTP_CACHE_PURGE_MODULE_WD} ) |
752 |
+ fi |
753 |
+ |
754 |
+ if use nginx_modules_http_slowfs_cache; then |
755 |
+ http_enabled=1 |
756 |
+ myconf+=( --add-module=${HTTP_SLOWFS_CACHE_MODULE_WD} ) |
757 |
+ fi |
758 |
+ |
759 |
+ if use nginx_modules_http_fancyindex; then |
760 |
+ http_enabled=1 |
761 |
+ myconf+=( --add-module=${HTTP_FANCYINDEX_MODULE_WD} ) |
762 |
+ fi |
763 |
+ |
764 |
+ if use nginx_modules_http_lua; then |
765 |
+ http_enabled=1 |
766 |
+ if use luajit; then |
767 |
+ export LUAJIT_LIB=$(pkg-config --variable libdir luajit) |
768 |
+ export LUAJIT_INC=$(pkg-config --variable includedir luajit) |
769 |
+ else |
770 |
+ export LUA_LIB=$(pkg-config --variable libdir lua) |
771 |
+ export LUA_INC=$(pkg-config --variable includedir lua) |
772 |
+ fi |
773 |
+ myconf+=( --add-module=${DEVEL_KIT_MODULE_WD} ) |
774 |
+ myconf+=( --add-module=${HTTP_LUA_MODULE_WD} ) |
775 |
+ fi |
776 |
+ |
777 |
+ if use nginx_modules_http_auth_pam; then |
778 |
+ http_enabled=1 |
779 |
+ myconf+=( --add-module=${HTTP_AUTH_PAM_MODULE_WD} ) |
780 |
+ fi |
781 |
+ |
782 |
+ if use nginx_modules_http_upstream_check; then |
783 |
+ http_enabled=1 |
784 |
+ myconf+=( --add-module=${HTTP_UPSTREAM_CHECK_MODULE_WD} ) |
785 |
+ fi |
786 |
+ |
787 |
+ if use nginx_modules_http_metrics; then |
788 |
+ http_enabled=1 |
789 |
+ myconf+=( --add-module=${HTTP_METRICS_MODULE_WD} ) |
790 |
+ fi |
791 |
+ |
792 |
+ if use nginx_modules_http_naxsi ; then |
793 |
+ http_enabled=1 |
794 |
+ myconf+=( --add-module=${HTTP_NAXSI_MODULE_WD} ) |
795 |
+ fi |
796 |
+ |
797 |
+ if use rtmp ; then |
798 |
+ http_enabled=1 |
799 |
+ myconf+=( --add-module=${RTMP_MODULE_WD} ) |
800 |
+ fi |
801 |
+ |
802 |
+ if use nginx_modules_http_dav_ext ; then |
803 |
+ http_enabled=1 |
804 |
+ myconf+=( --add-module=${HTTP_DAV_EXT_MODULE_WD} ) |
805 |
+ fi |
806 |
+ |
807 |
+ if use nginx_modules_http_echo ; then |
808 |
+ http_enabled=1 |
809 |
+ myconf+=( --add-module=${HTTP_ECHO_MODULE_WD} ) |
810 |
+ fi |
811 |
+ |
812 |
+ if use nginx_modules_http_security ; then |
813 |
+ http_enabled=1 |
814 |
+ myconf+=( --add-module=${HTTP_SECURITY_MODULE_WD}/nginx/modsecurity ) |
815 |
+ fi |
816 |
+ |
817 |
+ if use nginx_modules_http_push_stream ; then |
818 |
+ http_enabled=1 |
819 |
+ myconf+=( --add-module=${HTTP_PUSH_STREAM_MODULE_WD} ) |
820 |
+ fi |
821 |
+ |
822 |
+ if use nginx_modules_http_sticky ; then |
823 |
+ http_enabled=1 |
824 |
+ myconf+=( --add-module=${HTTP_STICKY_MODULE_WD} ) |
825 |
+ fi |
826 |
+ |
827 |
+ if use nginx_modules_http_mogilefs ; then |
828 |
+ http_enabled=1 |
829 |
+ myconf+=( --add-module=${HTTP_MOGILEFS_MODULE_WD} ) |
830 |
+ fi |
831 |
+ |
832 |
+ if use nginx_modules_http_memc ; then |
833 |
+ http_enabled=1 |
834 |
+ myconf+=( --add-module=${HTTP_MEMC_MODULE_WD} ) |
835 |
+ fi |
836 |
+ |
837 |
+ if use nginx_modules_http_auth_ldap; then |
838 |
+ http_enabled=1 |
839 |
+ myconf+=( --add-module=${HTTP_LDAP_MODULE_WD} ) |
840 |
+ fi |
841 |
+ |
842 |
+ if use http || use http-cache || use http2; then |
843 |
+ http_enabled=1 |
844 |
+ fi |
845 |
+ |
846 |
+ if [ $http_enabled ]; then |
847 |
+ use http-cache || myconf+=( --without-http-cache ) |
848 |
+ use ssl && myconf+=( --with-http_ssl_module ) |
849 |
+ else |
850 |
+ myconf+=( --without-http --without-http-cache ) |
851 |
+ fi |
852 |
+ |
853 |
+ # Stream modules |
854 |
+ for mod in $NGINX_MODULES_STREAM_STD; do |
855 |
+ if use nginx_modules_stream_${mod}; then |
856 |
+ stream_enabled=1 |
857 |
+ else |
858 |
+ myconf+=( --without-stream_${mod}_module ) |
859 |
+ fi |
860 |
+ done |
861 |
+ |
862 |
+ for mod in $NGINX_MODULES_STREAM_OPT; do |
863 |
+ if use nginx_modules_stream_${mod}; then |
864 |
+ stream_enabled=1 |
865 |
+ myconf+=( --with-stream_${mod}_module ) |
866 |
+ fi |
867 |
+ done |
868 |
+ |
869 |
+ if [ $stream_enabled ]; then |
870 |
+ myconf+=( --with-stream ) |
871 |
+ use ssl && myconf+=( --with-stream_ssl_module ) |
872 |
+ fi |
873 |
+ |
874 |
+ # MAIL modules |
875 |
+ for mod in $NGINX_MODULES_MAIL; do |
876 |
+ if use nginx_modules_mail_${mod}; then |
877 |
+ mail_enabled=1 |
878 |
+ else |
879 |
+ myconf+=( --without-mail_${mod}_module ) |
880 |
+ fi |
881 |
+ done |
882 |
+ |
883 |
+ if [ $mail_enabled ]; then |
884 |
+ myconf+=( --with-mail ) |
885 |
+ use ssl && myconf+=( --with-mail_ssl_module ) |
886 |
+ fi |
887 |
+ |
888 |
+ # custom modules |
889 |
+ for mod in $NGINX_ADD_MODULES; do |
890 |
+ myconf+=( --add-module=${mod} ) |
891 |
+ done |
892 |
+ |
893 |
+ # https://bugs.gentoo.org/286772 |
894 |
+ export LANG=C LC_ALL=C |
895 |
+ tc-export CC |
896 |
+ |
897 |
+ if ! use prefix; then |
898 |
+ myconf+=( --user=${PN} ) |
899 |
+ myconf+=( --group=${PN} ) |
900 |
+ fi |
901 |
+ |
902 |
+ local WITHOUT_IPV6= |
903 |
+ if ! use ipv6; then |
904 |
+ WITHOUT_IPV6=" -DNGX_HAVE_INET6=0" |
905 |
+ fi |
906 |
+ |
907 |
+ ./configure \ |
908 |
+ --prefix="${EPREFIX}"/usr \ |
909 |
+ --conf-path="${EPREFIX}"/etc/${PN}/${PN}.conf \ |
910 |
+ --error-log-path="${EPREFIX}"/var/log/${PN}/error_log \ |
911 |
+ --pid-path="${EPREFIX}"/run/${PN}.pid \ |
912 |
+ --lock-path="${EPREFIX}"/run/lock/${PN}.lock \ |
913 |
+ --with-cc-opt="-I${EROOT}usr/include${WITHOUT_IPV6}" \ |
914 |
+ --with-ld-opt="-L${EROOT}usr/$(get_libdir)" \ |
915 |
+ --http-log-path="${EPREFIX}"/var/log/${PN}/access_log \ |
916 |
+ --http-client-body-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/client \ |
917 |
+ --http-proxy-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/proxy \ |
918 |
+ --http-fastcgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/fastcgi \ |
919 |
+ --http-scgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/scgi \ |
920 |
+ --http-uwsgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/uwsgi \ |
921 |
+ --with-compat \ |
922 |
+ "${myconf[@]}" || die "configure failed" |
923 |
+ |
924 |
+ # A purely cosmetic change that makes nginx -V more readable. This can be |
925 |
+ # good if people outside the gentoo community would troubleshoot and |
926 |
+ # question the users setup. |
927 |
+ sed -i -e "s|${WORKDIR}|external_module|g" objs/ngx_auto_config.h || die |
928 |
+} |
929 |
+ |
930 |
+src_compile() { |
931 |
+ use nginx_modules_http_security && emake -C "${HTTP_SECURITY_MODULE_WD}" |
932 |
+ |
933 |
+ # https://bugs.gentoo.org/286772 |
934 |
+ export LANG=C LC_ALL=C |
935 |
+ emake LINK="${CC} ${LDFLAGS}" OTHERLDFLAGS="${LDFLAGS}" |
936 |
+} |
937 |
+ |
938 |
+src_install() { |
939 |
+ emake DESTDIR="${D%/}" install |
940 |
+ |
941 |
+ cp "${FILESDIR}"/nginx.conf-r2 "${ED}"etc/nginx/nginx.conf || die |
942 |
+ |
943 |
+ newinitd "${FILESDIR}"/nginx.initd-r3 nginx |
944 |
+ |
945 |
+ systemd_newunit "${FILESDIR}"/nginx.service-r1 nginx.service |
946 |
+ |
947 |
+ doman man/nginx.8 |
948 |
+ dodoc CHANGES* README |
949 |
+ |
950 |
+ # just keepdir. do not copy the default htdocs files (bug #449136) |
951 |
+ keepdir /var/www/localhost |
952 |
+ rm -rf "${D}"usr/html || die |
953 |
+ |
954 |
+ # set up a list of directories to keep |
955 |
+ local keepdir_list="${NGINX_HOME_TMP}"/client |
956 |
+ local module |
957 |
+ for module in proxy fastcgi scgi uwsgi; do |
958 |
+ use nginx_modules_http_${module} && keepdir_list+=" ${NGINX_HOME_TMP}/${module}" |
959 |
+ done |
960 |
+ |
961 |
+ keepdir /var/log/nginx ${keepdir_list} |
962 |
+ |
963 |
+ # this solves a problem with SELinux where nginx doesn't see the directories |
964 |
+ # as root and tries to create them as nginx |
965 |
+ fperms 0750 "${NGINX_HOME_TMP}" |
966 |
+ fowners ${PN}:0 "${NGINX_HOME_TMP}" |
967 |
+ |
968 |
+ fperms 0700 /var/log/nginx ${keepdir_list} |
969 |
+ fowners ${PN}:${PN} /var/log/nginx ${keepdir_list} |
970 |
+ |
971 |
+ # logrotate |
972 |
+ insinto /etc/logrotate.d |
973 |
+ newins "${FILESDIR}"/nginx.logrotate-r1 nginx |
974 |
+ |
975 |
+ if use nginx_modules_http_perl; then |
976 |
+ cd "${S}"/objs/src/http/modules/perl/ || die |
977 |
+ emake DESTDIR="${D}" INSTALLDIRS=vendor |
978 |
+ perl_delete_localpod |
979 |
+ cd "${S}" || die |
980 |
+ fi |
981 |
+ |
982 |
+ if use nginx_modules_http_cache_purge; then |
983 |
+ docinto ${HTTP_CACHE_PURGE_MODULE_P} |
984 |
+ dodoc "${HTTP_CACHE_PURGE_MODULE_WD}"/{CHANGES,README.md,TODO.md} |
985 |
+ fi |
986 |
+ |
987 |
+ if use nginx_modules_http_slowfs_cache; then |
988 |
+ docinto ${HTTP_SLOWFS_CACHE_MODULE_P} |
989 |
+ dodoc "${HTTP_SLOWFS_CACHE_MODULE_WD}"/{CHANGES,README.md} |
990 |
+ fi |
991 |
+ |
992 |
+ if use nginx_modules_http_fancyindex; then |
993 |
+ docinto ${HTTP_FANCYINDEX_MODULE_P} |
994 |
+ dodoc "${HTTP_FANCYINDEX_MODULE_WD}"/README.rst |
995 |
+ fi |
996 |
+ |
997 |
+ if use nginx_modules_http_lua; then |
998 |
+ docinto ${HTTP_LUA_MODULE_P} |
999 |
+ dodoc "${HTTP_LUA_MODULE_WD}"/README.markdown |
1000 |
+ fi |
1001 |
+ |
1002 |
+ if use nginx_modules_http_auth_pam; then |
1003 |
+ docinto ${HTTP_AUTH_PAM_MODULE_P} |
1004 |
+ dodoc "${HTTP_AUTH_PAM_MODULE_WD}"/{README.md,ChangeLog} |
1005 |
+ fi |
1006 |
+ |
1007 |
+ if use nginx_modules_http_upstream_check; then |
1008 |
+ docinto ${HTTP_UPSTREAM_CHECK_MODULE_P} |
1009 |
+ dodoc "${HTTP_UPSTREAM_CHECK_MODULE_WD}"/{README,CHANGES} |
1010 |
+ fi |
1011 |
+ |
1012 |
+ if use nginx_modules_http_naxsi; then |
1013 |
+ insinto /etc/nginx |
1014 |
+ doins "${HTTP_NAXSI_MODULE_WD}"/../naxsi_config/naxsi_core.rules |
1015 |
+ fi |
1016 |
+ |
1017 |
+ if use rtmp; then |
1018 |
+ docinto ${RTMP_MODULE_P} |
1019 |
+ dodoc "${RTMP_MODULE_WD}"/{AUTHORS,README.md,stat.xsl} |
1020 |
+ fi |
1021 |
+ |
1022 |
+ if use nginx_modules_http_dav_ext; then |
1023 |
+ docinto ${HTTP_DAV_EXT_MODULE_P} |
1024 |
+ dodoc "${HTTP_DAV_EXT_MODULE_WD}"/README |
1025 |
+ fi |
1026 |
+ |
1027 |
+ if use nginx_modules_http_echo; then |
1028 |
+ docinto ${HTTP_ECHO_MODULE_P} |
1029 |
+ dodoc "${HTTP_ECHO_MODULE_WD}"/README.markdown |
1030 |
+ fi |
1031 |
+ |
1032 |
+ if use nginx_modules_http_security; then |
1033 |
+ docinto ${HTTP_SECURITY_MODULE_P} |
1034 |
+ dodoc "${HTTP_SECURITY_MODULE_WD}"/{CHANGES,README.TXT,authors.txt} |
1035 |
+ fi |
1036 |
+ |
1037 |
+ if use nginx_modules_http_push_stream; then |
1038 |
+ docinto ${HTTP_PUSH_STREAM_MODULE_P} |
1039 |
+ dodoc "${HTTP_PUSH_STREAM_MODULE_WD}"/{AUTHORS,CHANGELOG.textile,README.textile} |
1040 |
+ fi |
1041 |
+ |
1042 |
+ if use nginx_modules_http_sticky; then |
1043 |
+ docinto ${HTTP_STICKY_MODULE_P} |
1044 |
+ dodoc "${HTTP_STICKY_MODULE_WD}"/{README.md,Changelog.txt,docs/sticky.pdf} |
1045 |
+ fi |
1046 |
+ |
1047 |
+ if use nginx_modules_http_memc; then |
1048 |
+ docinto ${HTTP_MEMC_MODULE_P} |
1049 |
+ dodoc "${HTTP_MEMC_MODULE_WD}"/README.markdown |
1050 |
+ fi |
1051 |
+ |
1052 |
+ if use nginx_modules_http_auth_ldap; then |
1053 |
+ docinto ${HTTP_LDAP_MODULE_P} |
1054 |
+ dodoc "${HTTP_LDAP_MODULE_WD}"/example.conf |
1055 |
+ fi |
1056 |
+} |
1057 |
+ |
1058 |
+pkg_postinst() { |
1059 |
+ if use ssl; then |
1060 |
+ if [[ ! -f "${EROOT}"etc/ssl/${PN}/${PN}.key ]]; then |
1061 |
+ install_cert /etc/ssl/${PN}/${PN} |
1062 |
+ use prefix || chown ${PN}:${PN} "${EROOT}"etc/ssl/${PN}/${PN}.{crt,csr,key,pem} |
1063 |
+ fi |
1064 |
+ fi |
1065 |
+ |
1066 |
+ if use nginx_modules_http_spdy; then |
1067 |
+ ewarn "In nginx 1.9.5 the spdy module was superseded by http2." |
1068 |
+ ewarn "Update your configs and package.use accordingly." |
1069 |
+ fi |
1070 |
+ |
1071 |
+ if use nginx_modules_http_lua && use http2; then |
1072 |
+ ewarn "Lua 3rd party module author warns against using ${P} with" |
1073 |
+ ewarn "NGINX_MODULES_HTTP=\"lua http2\". For more info, see http://git.io/OldLsg" |
1074 |
+ fi |
1075 |
+ |
1076 |
+ # This is the proper fix for bug #458726/#469094, resp. CVE-2013-0337 for |
1077 |
+ # existing installations |
1078 |
+ local fix_perms=0 |
1079 |
+ |
1080 |
+ for rv in ${REPLACING_VERSIONS}; do |
1081 |
+ version_compare ${rv} 1.4.1-r2 |
1082 |
+ [[ $? -eq 1 ]] && fix_perms=1 |
1083 |
+ done |
1084 |
+ |
1085 |
+ if [[ $fix_perms -eq 1 ]] ; then |
1086 |
+ ewarn "To fix a security bug (CVE-2013-0337, bug #458726) had the following" |
1087 |
+ ewarn "directories the world-readable bit removed (if set):" |
1088 |
+ ewarn " ${EPREFIX}/var/log/nginx" |
1089 |
+ ewarn " ${EPREFIX}${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi}" |
1090 |
+ ewarn "Check if this is correct for your setup before restarting nginx!" |
1091 |
+ ewarn "This is a one-time change and will not happen on subsequent updates." |
1092 |
+ ewarn "Furthermore nginx' temp directories got moved to ${NGINX_HOME_TMP}" |
1093 |
+ chmod -f o-rwx "${EPREFIX}"/var/log/nginx "${EPREFIX}${NGINX_HOME_TMP}"/{,client,proxy,fastcgi,scgi,uwsgi} |
1094 |
+ fi |
1095 |
+ |
1096 |
+ # If the nginx user can't change into or read the dir, display a warning. |
1097 |
+ # If su is not available we display the warning nevertheless since we can't check properly |
1098 |
+ su -s /bin/sh -c 'cd /var/log/nginx/ && ls' nginx >&/dev/null |
1099 |
+ if [ $? -ne 0 ] ; then |
1100 |
+ ewarn "Please make sure that the nginx user or group has at least" |
1101 |
+ ewarn "'rx' permissions on /var/log/nginx (default on a fresh install)" |
1102 |
+ ewarn "Otherwise you end up with empty log files after a logrotate." |
1103 |
+ fi |
1104 |
+ |
1105 |
+ # HTTPoxy mitigation |
1106 |
+ ewarn "" |
1107 |
+ ewarn "This nginx installation comes with a mitigation for the HTTPoxy" |
1108 |
+ ewarn "vulnerability for FastCGI applications by setting the HTTP_PROXY FastCGI" |
1109 |
+ ewarn "parameter to an empty string per default when you are sourcing the default" |
1110 |
+ ewarn "'fastcgi_params' or 'fastcgi.conf' in your server block(s)." |
1111 |
+ ewarn "" |
1112 |
+ ewarn "If this is causing any problems for you make sure that you are sourcing the" |
1113 |
+ ewarn "default parameters _before_ you set your own values." |
1114 |
+ ewarn "If you are relying on user-supplied proxy values you have to remove the" |
1115 |
+ ewarn "correlating lines from 'fastcgi_params' and or 'fastcgi.conf'." |
1116 |
+} |