[incubator-apisix-dashboard] 01/01: change the style of html license.

2019-10-30 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix-dashboard.git

commit 091d213ee7f1e075d1f1c7f62e2f42a195f4f847
Merge: fbe4c47 f89ad78
Author: WenMing 
AuthorDate: Wed Oct 30 14:40:59 2019 +0800

change the style of html license.

 travis/LICENSE_HTML | 32 +---
 1 file changed, 17 insertions(+), 15 deletions(-)



[incubator-apisix-dashboard] branch master updated (fbe4c47 -> 091d213)

2019-10-30 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch master
in repository 
https://gitbox.apache.org/repos/asf/incubator-apisix-dashboard.git.


from fbe4c47  Rename license to LICENSE
 add f89ad78  change the style of html license.
 new 091d213  change the style of html license.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 travis/LICENSE_HTML | 32 +---
 1 file changed, 17 insertions(+), 15 deletions(-)



[incubator-apisix-dashboard] branch html-license created (now f89ad78)

2019-10-30 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch html-license
in repository 
https://gitbox.apache.org/repos/asf/incubator-apisix-dashboard.git.


  at f89ad78  change the style of html license.

This branch includes the following new commits:

 new f89ad78  change the style of html license.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[incubator-apisix-dashboard] 01/01: change the style of html license.

2019-10-30 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch html-license
in repository https://gitbox.apache.org/repos/asf/incubator-apisix-dashboard.git

commit f89ad78e13579a2f38013d1102a0b7007146f795
Author: WenMing 
AuthorDate: Wed Oct 30 14:25:45 2019 +0800

change the style of html license.
---
 travis/LICENSE_HTML | 32 +---
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/travis/LICENSE_HTML b/travis/LICENSE_HTML
index 9e6ba4b..c474814 100644
--- a/travis/LICENSE_HTML
+++ b/travis/LICENSE_HTML
@@ -1,16 +1,18 @@
-



[incubator-apisix-dashboard] branch notice-update2 created (now 3c183f2)

2019-11-01 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch notice-update2
in repository 
https://gitbox.apache.org/repos/asf/incubator-apisix-dashboard.git.


  at 3c183f2  license: moved  License information to LICENSE.

This branch includes the following new commits:

 new 3c183f2  license: moved  License information to LICENSE.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[incubator-apisix-dashboard] 01/01: license: moved License information to LICENSE.

2019-11-01 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch notice-update2
in repository https://gitbox.apache.org/repos/asf/incubator-apisix-dashboard.git

commit 3c183f2743b56d612f5d006813a65a2021732b04
Author: WenMing 
AuthorDate: Sat Nov 2 07:51:40 2019 +0800

license: moved  License information to LICENSE.
---
 LICENSE | 7 +++
 NOTICE  | 5 -
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/LICENSE b/LICENSE
index 261eeb9..90c4de5 100644
--- a/LICENSE
+++ b/LICENSE
@@ -199,3 +199,10 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+
+===
+
+The Apache APISIX project bundles the following dependencies under the MIT 
license. (https://opensource.org/licenses/MIT)
+See bundled license files for details.
+
+- vue-element-admin: https://github.com/PanJiaChen/vue-element-admin
diff --git a/NOTICE b/NOTICE
index 382c98e..c63a855 100644
--- a/NOTICE
+++ b/NOTICE
@@ -3,8 +3,3 @@ Copyright 2019 The Apache Software Foundation
 
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).
-
-This project bundles the following dependencies under the MIT license. 
(https://opensource.org/licenses/MIT)
-See bundled license files for details.
-
-- vue-element-admin: https://github.com/PanJiaChen/vue-element-admin



[incubator-apisix] branch master updated: bugfix: skipped to init etcd if use local file as config center. (#737)

2019-11-01 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new a1c56ce  bugfix: skipped to init etcd if use local file as config 
center. (#737)
a1c56ce is described below

commit a1c56ceb5364ae21705f031afde186b6e08223e8
Author: YuanSheng Wang 
AuthorDate: Sat Nov 2 07:59:59 2019 +0800

bugfix: skipped to init etcd if use local file as config center. (#737)
---
 bin/apisix |  4 
 conf/apisix.yaml   | 25 
 lua/apisix/admin/init.lua  |  1 -
 lua/apisix/admin/node_status.lua   | 41 -
 lua/apisix/plugins/heartbeat.lua   | 23 ++-
 lua/apisix/plugins/node-status.lua | 47 --
 t/plugin/node-status.t | 27 +-
 7 files changed, 52 insertions(+), 116 deletions(-)

diff --git a/bin/apisix b/bin/apisix
index a9010a3..3f69dd2 100755
--- a/bin/apisix
+++ b/bin/apisix
@@ -536,6 +536,10 @@ local function init_etcd(show_output)
 error("failed to read local yaml config of apisix: " .. err)
 end
 
+if yaml_conf.apisix.config_center ~= "etcd" then
+return true
+end
+
 local etcd_conf = yaml_conf.etcd
 local uri = etcd_conf.host .. "/v2/keys" .. (etcd_conf.prefix or "")
 
diff --git a/conf/apisix.yaml b/conf/apisix.yaml
new file mode 100644
index 000..1a406ae
--- /dev/null
+++ b/conf/apisix.yaml
@@ -0,0 +1,25 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# example
+routes:
+  -
+uri: /hello
+upstream:
+nodes:
+"127.0.0.1:1980": 1
+type: roundrobin
+#END
diff --git a/lua/apisix/admin/init.lua b/lua/apisix/admin/init.lua
index 2c035c0..128340f 100644
--- a/lua/apisix/admin/init.lua
+++ b/lua/apisix/admin/init.lua
@@ -36,7 +36,6 @@ local resources = {
 proto   = require("apisix.admin.proto"),
 global_rules= require("apisix.admin.global_rules"),
 stream_routes   = require("apisix.admin.stream_routes"),
-node_status = require("apisix.admin.node_status"),
 }
 
 
diff --git a/lua/apisix/admin/node_status.lua b/lua/apisix/admin/node_status.lua
deleted file mode 100644
index a5d42af..000
--- a/lua/apisix/admin/node_status.lua
+++ /dev/null
@@ -1,41 +0,0 @@
---
--- Licensed to the Apache Software Foundation (ASF) under one or more
--- contributor license agreements.  See the NOTICE file distributed with
--- this work for additional information regarding copyright ownership.
--- The ASF licenses this file to You under the Apache License, Version 2.0
--- (the "License"); you may not use this file except in compliance with
--- the License.  You may obtain a copy of the License at
---
--- http://www.apache.org/licenses/LICENSE-2.0
---
--- Unless required by applicable law or agreed to in writing, software
--- distributed under the License is distributed on an "AS IS" BASIS,
--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--- See the License for the specific language governing permissions and
--- limitations under the License.
---
-local core = require("apisix.core")
-
-
-local _M = {
-version = 0.1,
-}
-
-
-function _M.get(id)
-local key = "/node_status"
-if id then
-key = key .. "/" .. id
-end
-
-local res, err = core.etcd.get(key)
-if not res then
-core.log.error("failed to get route[", key, "]: ", err)
-return 500, {error_msg = err}
-end
-
-return res.status, res.body
-end
-
-
-return _M
diff --git a/lua/apisix/plugins/heartbeat.lua b/lua/apisix/plugins/heartbeat.lua
index fca021d..b9275c3 100644
--- a/lua/apisix/plugins/heartbeat.lua
+++ b/lua/apisix/plugins/heartbeat.lua
@@ -63,15 +63,26 @@ end
 
 local function report()
 -- ngx.sleep(3)
-local etcd_version, err = core.etcd.server_version()
-

[incubator-apisix] branch master updated: bugfix: support more built-in parameters when set chash balancer (#775)

2019-11-03 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new b119a5c  bugfix: support more built-in parameters when set chash 
balancer (#775)
b119a5c is described below

commit b119a5c94b6ea59eb263f5f353944d3ebf00e81c
Author: Lien 
AuthorDate: Sun Nov 3 18:25:51 2019 +0800

bugfix: support more built-in parameters when set chash balancer (#775)
---
 doc/architecture-design-cn.md |   2 +-
 doc/architecture-design.md|   2 +-
 lua/apisix/schema_def.lua |   3 +-
 t/admin/upstream.t| 182 ++
 t/node/chash-balance.t| 156 
 5 files changed, 342 insertions(+), 3 deletions(-)

diff --git a/doc/architecture-design-cn.md b/doc/architecture-design-cn.md
index fcf4670..552bdd0 100644
--- a/doc/architecture-design-cn.md
+++ b/doc/architecture-design-cn.md
@@ -237,7 +237,7 @@ APISIX 的 Upstream 除了基本的复杂均衡算法选择外,还支持对上
 |--- |-|--|
 |type|必需|`roundrobin` 支持权重的负载,`chash` 一致性哈希,两者是二选一的|
 |nodes   |必需|哈希表,内部元素的 key 是上游机器地址列表,格式为`地址 + Port`,其中地址部分可以是 IP 
也可以是域名,比如 `192.168.1.100:80`、`foo.com:80`等。value 则是节点的权重,特别的,当权重值为 `0` 
有特殊含义,通常代表该上游节点失效,永远不希望被选中。|
-|key |必需|该选项只有类型是 `chash` 才有效。根据 `key` 来查找对应的 node `id`,相同的 `key` 
在同一个对象中,永远返回相同 id|
+|key |必需|该选项只有类型是 `chash` 才有效。根据 `key` 来查找对应的 node `id`,相同的 `key` 
在同一个对象中,永远返回相同 id,目前支持的 Nginx 内置变量有 `uri, server_name, server_addr, 
request_uri, remote_port, remote_addr, query_string, host, hostname, 
arg_***`,其中 `arg_***` 是来自URL的请求参数,[Nginx 
变量列表](http://nginx.org/en/docs/varindex.html)|
 |checks  |可选|配置健康检查的参数,详细可参考[health-check](health-check.md)|
 |retries |可选|使用底层的 Nginx 重试机制将请求传递给下一个上游,默认不启用重试机制|
 
diff --git a/doc/architecture-design.md b/doc/architecture-design.md
index a4aaf6c..c225322 100644
--- a/doc/architecture-design.md
+++ b/doc/architecture-design.md
@@ -230,7 +230,7 @@ In addition to the basic complex equalization algorithm 
selection, APISIX's Upst
 |--- |-|--|
 |type|required|`roundrobin` supports the weight of the load, 
`chash` consistency hash, pick one of them.|
 |nodes   |required|Hash table, the key of the internal element is the 
upstream machine address list, the format is `Address + Port`, where the 
address part can be IP or domain name, such as `192.168.1.100:80`, 
`foo.com:80`, etc. Value is the weight of the node. In particular, when the 
weight value is `0`, it has a special meaning, which usually means that the 
upstream node is invalid and never wants to be selected.|
-|key |required|This option is only valid if the type is `chash`. 
Find the corresponding node `id` according to `key`, the same `key` in the same 
object, always return the same id.|
+|key |required|This option is only valid if the type is `chash`. 
Find the corresponding node `id` according to `key`, the same `key` in the same 
object, always return the same id. For now, it support nginx built-in variables 
like `uri, server_name, server_addr, request_uri, remote_port, remote_addr, 
query_string, host, hostname, arg_***`, `arg_***` is arguments in the request 
line, [Nginx variables list](http://nginx.org/en/docs/varindex.html)|
 |checks  |optional|Configure the parameters of the health check. For 
details, refer to [health-check](health-check.md).|
 |retries |optional|Pass the request to the next upstream using the 
underlying Nginx retry mechanism, the retry mechanism is not enabled by 
default.|
 
diff --git a/lua/apisix/schema_def.lua b/lua/apisix/schema_def.lua
index 6784ced..fc70770 100644
--- a/lua/apisix/schema_def.lua
+++ b/lua/apisix/schema_def.lua
@@ -252,7 +252,8 @@ local upstream_schema = {
 key = {
 description = "the key of chash for dynamic load balancing",
 type = "string",
-enum = {"remote_addr"},
+pattern = 
[[^((uri|server_name|server_addr|request_uri|remote_port]]
+  .. 
[[|remote_addr|query_string|host|hostname)|arg_[0-9a-zA-z_-]+)$]],
 },
 desc = {type = "string", maxLength = 256},
 id = id_schema
diff --git a/t/admin/upstream.t b/t/admin/upstream.t
index b5bc94b..1453275 100644
--- a/t/admin/upstream.t
+++ b/t/admin/upstream.t
@@ -798,3 +798,185 @@ GET /t
 passed
 --- no_error_log
 [error]
+
+
+
+=== TEST 24: set upstream(type: chash)
+--- config
+location /t {
+content_by_lua_block {
+local t = require("lib.test_admin").test
+local code, body = t('/apisix/admin/upstreams/1',
+ ngx.HTTP_PUT,
+ [[{
+"key": "server_name",
+ 

[incubator-apisix] branch 0.9-rc1 updated (8c56dc6 -> 19678ba)

2019-11-11 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch 0.9-rc1
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git.


 discard 8c56dc6  bugfix: key-auth plugin cannot run accurately in the case of 
multiple consumers (#826)
 discard 900563e  dashboard: update dashboard. (#828)
 add 8b67dfe  dashboard: update dashboard. (#828)
 add 7d33fb6  bugfix: key-auth plugin cannot run accurately in the case of 
multiple consumers (#826)
 add 5e85e93  change: don't strip square brackets from the IPv6 (#822)
 add 19678ba  change: update v0.9.0-rc1 changelog. (#832)

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (8c56dc6)
\
 N -- N -- N   refs/heads/0.9-rc1 (19678ba)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:
 CHANGELOG.md   | 39 ++
 CHANGELOG_CN.md| 39 ++
 lua/apisix/core/utils.lua  |  8 ++---
 rockspec/apisix-master-0.rockspec  |  1 +
 t/APISIX.pm|  8 +
 t/core/utils.t |  8 +++--
 ...hcheck-multiple-worker.t => healthcheck-ipv6.t} | 28 
 t/node/remote-addr-ipv6.t  |  7 ++--
 t/node/{upstream-domain.t => upstream-ipv6.t}  | 20 ---
 9 files changed, 136 insertions(+), 22 deletions(-)
 copy t/node/{healthcheck-multiple-worker.t => healthcheck-ipv6.t} (85%)
 copy t/node/{upstream-domain.t => upstream-ipv6.t} (85%)



[incubator-apisix] branch master updated: doc: update FAQ, add one about slow luarocks (#813)

2019-11-08 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new c8934b2  doc: update FAQ, add one about slow luarocks (#813)
c8934b2 is described below

commit c8934b26413477fb2c1de17f06ae4621a4af4928
Author: 周晶 <15134559...@163.com>
AuthorDate: Sat Nov 9 09:21:47 2019 +0800

doc: update FAQ, add one about slow luarocks (#813)
---
 CHANGELOG_CN.md |  4 ++--
 FAQ.md  | 12 
 FAQ_CN.md   | 14 ++
 bin/apisix  |  2 +-
 4 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG_CN.md b/CHANGELOG_CN.md
index 54ee8de..0e6336d 100644
--- a/CHANGELOG_CN.md
+++ b/CHANGELOG_CN.md
@@ -34,7 +34,7 @@
 - :sunrise: **[支持 stream 
代理](https://github.com/apache/incubator-apisix/blob/master/doc/stream-proxy-cn.md)**.
 [#513](https://github.com/apache/incubator-apisix/pull/513)
 - :sunrise: 支持[在 consumer 
上绑定插件](https://github.com/apache/incubator-apisix/blob/master/doc/architecture-design-cn.md#consumer).
 [#544](https://github.com/apache/incubator-apisix/pull/544)
 - 上游增加对域名的支持,而不仅是 
IP。[#522](https://github.com/apache/incubator-apisix/pull/522)
-- 当上游节点的权重为 0 是自动忽略。[#536](https://github.com/apache/incubator-apisix/pull/536)
+- 当上游节点的权重为 0 时自动忽略。[#536](https://github.com/apache/incubator-apisix/pull/536)
 
 ### Plugins
 - :sunrise: **[MQTT 
代理](https://github.com/apache/incubator-apisix/blob/master/doc/plugins/mqtt-proxy-cn.md)**:
 支持用 `client_id` 对 MQTT 进行负载均衡,同时支持 MQTT 3.1 和 5.0 两个协议标准。 
[#513](https://github.com/apache/incubator-apisix/pull/513)
@@ -54,7 +54,7 @@
 
 
 ### Bugfix
-- 健康检查: 修复在多 worker 下运行的话,健康检查 checker 的名字错误。 
[#568](https://github.com/apache/incubator-apisix/issues/568)
+- 健康检查: 修复在多 worker 下运行时健康检查 checker 的名字错误。 
[#568](https://github.com/apache/incubator-apisix/issues/568)
 
 ### Dependencies
 - 把 `lua-tinyyaml` 从源码中移除,通过 Luarocks 来安装。
diff --git a/FAQ.md b/FAQ.md
index 46782ca..a0e6b82 100644
--- a/FAQ.md
+++ b/FAQ.md
@@ -56,3 +56,15 @@ For the configuration center, configuration storage is only 
the most basic funct
 5. High Performance
 
 See more [etcd 
why](https://github.com/etcd-io/etcd/blob/master/Documentation/learning/why.md#comparison-chart).
+
+## Why is it that installing APISIX dependencies with Luarocks causes timeout, 
slow or unsuccessful installation?
+
+There are two possibilities when encountering slow luarocks:
+
+1. Server used for luarocks installation is blocked
+2. There is a place between your network and github server to block the 'git' 
protocol
+
+For the first problem, you can use https_proxy or use the `--server` option to 
specify a luarocks server that you can access or access faster.
+Run the `luarocks config rocks_servers` command(this command is supported 
after luarocks 3.0) to see which server are available.
+
+If using a proxy doesn't solve this problem, you can add `--verbose` option 
during installation to see exactly how slow it is. Excluding the first case, 
only the second that the `git` protocol is blocked. Then we can run `git config 
--global url."https://".insteadOf git://` to using the 'HTTPS' protocol instead 
of `git`.
diff --git a/FAQ_CN.md b/FAQ_CN.md
index 7546171..e1cf4d0 100644
--- a/FAQ_CN.md
+++ b/FAQ_CN.md
@@ -56,3 +56,17 @@ APISIX 是当前性能最好的 API 网关,单核 QPS 达到 2.3 万,平均
 5. 高性能
 
 APISIX 需要一个配置中心,上面提到的很多功能是传统关系型数据库和KV数据库是无法提供的。与 etcd 同类软件还有 
Consul、ZooKeeper等,更详细比较可以参考这里:[etcd 
why](https://github.com/etcd-io/etcd/blob/master/Documentation/learning/why.md#comparison-chart),在将来也许会支持其他配置存储方案。
+
+## 为什么在用 Luarocks 安装 APISIX 依赖时会遇到超时,很慢或者不成功的情况?
+
+遇到 luarocks 慢的问题,有以下两种可能:
+
+1. luarocks 安装所使用的服务器不能访问
+2. 你所在的网络到 github 服务器之间有地方对 `git` 协议进行封锁
+
+针对第一个问题,你可以使用 https_proxy 或者使用 `--server` 选项来指定一个你可以访问或者访问更快的
+luarocks 服务。 运行 `luarocks config rocks_servers` 命令(这个命令在 luarocks 3.0 版本后开始支持)
+可以查看有哪些可用服务。
+
+如果使用代理仍然解决不了这个问题,那可以在安装的过程中添加 `--verbose` 选项来查看具体是慢在什么地方。排除前面的
+第一种情况,只可能是第二种,`git` 协议被封。这个时候可以执行 `git config --global 
url."https://".insteadOf git://` 命令使用 `https` 协议替代。
diff --git a/bin/apisix b/bin/apisix
index a1f7564..3a097d0 100755
--- a/bin/apisix
+++ b/bin/apisix
@@ -497,7 +497,7 @@ local function init()
 with_module_status = false
 end
 
--- -- Using template.render
+-- Using template.render
 local sys_conf = {
 lua_path = package.path,
 lua_cpath = package.cpath,



[incubator-apisix-dashboard] branch bugfix-license created (now 829fee7)

2019-11-09 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch bugfix-license
in repository 
https://gitbox.apache.org/repos/asf/incubator-apisix-dashboard.git.


  at 829fee7  license: fixed wrong repo name.

This branch includes the following new commits:

 new 829fee7  license: fixed wrong repo name.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[incubator-apisix-dashboard] 01/01: license: fixed wrong repo name.

2019-11-09 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch bugfix-license
in repository https://gitbox.apache.org/repos/asf/incubator-apisix-dashboard.git

commit 829fee7753d67300bf96408c23101dc7f9c2f56c
Author: WenMing 
AuthorDate: Sat Nov 9 22:17:18 2019 +0800

license: fixed wrong repo name.
---
 LICENSE   | 4 ++--
 ...ICENSE.vue-element-admin => LICENSE.vue-typescript-admin-template} | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/LICENSE b/LICENSE
index a0cd50e..6da9712 100644
--- a/LICENSE
+++ b/LICENSE
@@ -202,5 +202,5 @@
 
 ===
 
-The Apache APISIX project bundles vue-element-admin under the MIT license.
-For details, see licenses/LICENSE.vue-element-admin.
+The Apache APISIX project bundles vue-typescript-admin-template under the MIT 
license.
+For details, see licenses/LICENSE.vue-typescript-admin-template.
diff --git a/licenses/LICENSE.vue-element-admin 
b/licenses/LICENSE.vue-typescript-admin-template
similarity index 96%
rename from licenses/LICENSE.vue-element-admin
rename to licenses/LICENSE.vue-typescript-admin-template
index 6151575..7c3565d 100644
--- a/licenses/LICENSE.vue-element-admin
+++ b/licenses/LICENSE.vue-typescript-admin-template
@@ -1,6 +1,6 @@
 MIT License
 
-Copyright (c) 2017-present PanJiaChen
+Copyright (c) 2018 Chong Guo
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal



[incubator-apisix-dashboard] branch master updated (29eca5a -> 7c42edc)

2019-11-09 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch master
in repository 
https://gitbox.apache.org/repos/asf/incubator-apisix-dashboard.git.


from 29eca5a  license: Update License Header.
 add 829fee7  license: fixed wrong repo name.
 new 7c42edc  license: fixed wrong repo name.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 LICENSE   | 4 ++--
 ...ICENSE.vue-element-admin => LICENSE.vue-typescript-admin-template} | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
 rename licenses/{LICENSE.vue-element-admin => 
LICENSE.vue-typescript-admin-template} (96%)



[incubator-apisix-dashboard] 01/01: license: fixed wrong repo name.

2019-11-09 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix-dashboard.git

commit 7c42edcd04945179e9756e868ef9201e24efe309
Merge: 29eca5a 829fee7
Author: WenMing 
AuthorDate: Sat Nov 9 22:22:15 2019 +0800

license: fixed wrong repo name.

 LICENSE   | 4 ++--
 ...ICENSE.vue-element-admin => LICENSE.vue-typescript-admin-template} | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)



[incubator-apisix-dashboard] 01/01: license: Update License Header.

2019-11-09 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix-dashboard.git

commit 29eca5ab930796ec2078c4c5e050b6ebcd31031a
Merge: 5fc1cec bbc247b
Author: WenMing 
AuthorDate: Sat Nov 9 22:06:33 2019 +0800

license: Update License Header.

 package.json  |  7 ++---
 public/index.html | 33 -
 src/api/types.d.ts|  1 -
 src/components/Breadcrumb/index.vue   | 31 
 src/components/Hamburger/index.vue| 31 
 src/components/HeaderSearch/index.vue | 31 
 src/components/LangSelect/index.vue   | 31 
 src/components/Pagination/index.vue   | 31 
 src/components/PluginDialog/index.vue | 32 -
 src/components/Screenfull/index.vue   | 31 
 src/icons/README.md   | 31 
 src/icons/components/404.ts   | 33 -
 src/icons/components/back-top.ts  | 33 -
 src/icons/components/bug.ts   | 33 -
 src/icons/components/chart.ts | 33 -
 src/icons/components/component.ts | 33 -
 src/icons/components/dashboard.ts | 33 -
 src/icons/components/documentation.ts | 33 -
 src/icons/components/drag.ts  | 33 -
 src/icons/components/edit.ts  | 33 -
 src/icons/components/education.ts | 33 -
 src/icons/components/email.ts | 33 -
 src/icons/components/exit-fullscreen.ts   | 33 -
 src/icons/components/eye-off.ts   | 33 -
 src/icons/components/eye-on.ts| 33 -
 src/icons/components/form.ts  | 33 -
 src/icons/components/fullscreen.ts| 33 -
 src/icons/components/guide-2.ts   | 33 -
 src/icons/components/guide.ts | 33 -
 src/icons/components/hamburger.ts | 33 -
 src/icons/components/icon.ts  | 33 -
 src/icons/components/index.ts | 33 -
 src/icons/components/international.ts | 33 -
 src/icons/components/language.ts  | 33 -
 src/icons/components/like.ts  | 33 -
 src/icons/components/link.ts  | 33 -
 src/icons/components/list.ts  | 33 -
 src/icons/components/lock.ts  | 33 -
 src/icons/components/message.ts   | 33 -
 src/icons/components/money.ts | 33 -
 src/icons/components/password.ts  | 33 -
 src/icons/components/pdf.ts   | 33 -
 src/icons/components/people.ts| 33 -
 src/icons/components/peoples.ts   | 33 -
 src/icons/components/qq.ts| 33 -
 src/icons/components/search.ts| 33 -
 src/icons/components/shopping.ts  | 33 -
 src/icons/components/size.ts  | 33 -
 src/icons/components/skill.ts | 33 -
 src/icons/components/star.ts  | 33 -
 src/icons/components/tab.ts   | 33 -
 src/icons/components/table.ts | 33 -
 src/icons/components/theme.ts | 33 -
 src/icons/components/tree-table.ts| 33 -
 src/icons/components/tree.ts  | 33 -
 src/icons/components/user.ts  | 33 -
 src/icons/components/wechat.ts| 33 -
 src/lang/en.ts| 35 ++-
 src/lang/index.ts | 35 ++-
 src/lang/zh.ts| 35

[incubator-apisix-dashboard] branch master updated (5fc1cec -> 29eca5a)

2019-11-09 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch master
in repository 
https://gitbox.apache.org/repos/asf/incubator-apisix-dashboard.git.


from 5fc1cec  fix:add regexp for uris and host filter when create route 
(#70)
 add 13d18b6  update package
 add 8a362d2  update original files' license to MIT
 add bd26137  update html MIT header
 add 257a0ec  update trailing spaces
 add bbc247b  remove author
 new 29eca5a  license: Update License Header.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 package.json  |  7 ++---
 public/index.html | 33 -
 src/api/types.d.ts|  1 -
 src/components/Breadcrumb/index.vue   | 31 
 src/components/Hamburger/index.vue| 31 
 src/components/HeaderSearch/index.vue | 31 
 src/components/LangSelect/index.vue   | 31 
 src/components/Pagination/index.vue   | 31 
 src/components/PluginDialog/index.vue | 32 -
 src/components/Screenfull/index.vue   | 31 
 src/icons/README.md   | 31 
 src/icons/components/404.ts   | 33 -
 src/icons/components/back-top.ts  | 33 -
 src/icons/components/bug.ts   | 33 -
 src/icons/components/chart.ts | 33 -
 src/icons/components/component.ts | 33 -
 src/icons/components/dashboard.ts | 33 -
 src/icons/components/documentation.ts | 33 -
 src/icons/components/drag.ts  | 33 -
 src/icons/components/edit.ts  | 33 -
 src/icons/components/education.ts | 33 -
 src/icons/components/email.ts | 33 -
 src/icons/components/exit-fullscreen.ts   | 33 -
 src/icons/components/eye-off.ts   | 33 -
 src/icons/components/eye-on.ts| 33 -
 src/icons/components/form.ts  | 33 -
 src/icons/components/fullscreen.ts| 33 -
 src/icons/components/guide-2.ts   | 33 -
 src/icons/components/guide.ts | 33 -
 src/icons/components/hamburger.ts | 33 -
 src/icons/components/icon.ts  | 33 -
 src/icons/components/index.ts | 33 -
 src/icons/components/international.ts | 33 -
 src/icons/components/language.ts  | 33 -
 src/icons/components/like.ts  | 33 -
 src/icons/components/link.ts  | 33 -
 src/icons/components/list.ts  | 33 -
 src/icons/components/lock.ts  | 33 -
 src/icons/components/message.ts   | 33 -
 src/icons/components/money.ts | 33 -
 src/icons/components/password.ts  | 33 -
 src/icons/components/pdf.ts   | 33 -
 src/icons/components/people.ts| 33 -
 src/icons/components/peoples.ts   | 33 -
 src/icons/components/qq.ts| 33 -
 src/icons/components/search.ts| 33 -
 src/icons/components/shopping.ts  | 33 -
 src/icons/components/size.ts  | 33 -
 src/icons/components/skill.ts | 33 -
 src/icons/components/star.ts  | 33 -
 src/icons/components/tab.ts   | 33 -
 src/icons/components/table.ts | 33 -
 src/icons/components/theme.ts | 33 -
 src/icons/components/tree-table.ts| 33 -
 src/icon

[incubator-apisix] branch 0.9-rc1 created (now 31a545a)

2019-11-10 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch 0.9-rc1
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git.


  at 31a545a  version: updated version to 0.9-rc1. (#827)

No new revisions were added by this update.



[incubator-apisix-dashboard] branch notice-update created (now 1f900b6)

2019-10-31 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch notice-update
in repository 
https://gitbox.apache.org/repos/asf/incubator-apisix-dashboard.git.


  at 1f900b6  license: add apache Copyright in NOTICE.

This branch includes the following new commits:

 new 1f900b6  license: add apache Copyright in NOTICE.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[incubator-apisix-dashboard] branch master updated (5a22392 -> 31cac84)

2019-10-31 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch master
in repository 
https://gitbox.apache.org/repos/asf/incubator-apisix-dashboard.git.


from 5a22392  Fix plugin has oneOf prop (#52)
 add 1f900b6  license: add apache Copyright in NOTICE.
 new 31cac84  license: add apache copyright in NOTICE.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 NOTICE | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)



[incubator-apisix-dashboard] 01/01: license: add apache copyright in NOTICE.

2019-10-31 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix-dashboard.git

commit 31cac84fc5f569f4c6b70e048c2bb6e9271bf3a2
Merge: 5a22392 1f900b6
Author: WenMing 
AuthorDate: Fri Nov 1 13:58:08 2019 +0800

license: add apache copyright in NOTICE.

 NOTICE | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)



[incubator-apisix] branch master updated (5c0cb17 -> 71f49a4)

2019-10-31 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git.


from 5c0cb17  ASF: added license header. (#781)
 add 71f49a4  CLI: update Makefile to throw an error when OpenResty does 
not exist in PATH (#778)

No new revisions were added by this update.

Summary of changes:
 Makefile | 12 
 1 file changed, 12 insertions(+)



[incubator-apisix] branch master updated (4ad4cdb -> 3930456)

2019-10-31 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git.


from 4ad4cdb  change: delete duplicate code. (#769)
 add 3930456  test case: added test cases for upstream priority. (#774)

No new revisions were added by this update.

Summary of changes:
 t/config-center-yaml/route-service.t  | 135 ++
 t/config-center-yaml/route-upstream.t |  26 +++
 2 files changed, 161 insertions(+)



[incubator-apisix] branch master updated (b3b0924 -> 12a2b01)

2019-10-30 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git.


from b3b0924  optimize(core): avoid useless comparisons in  log.lua (#767)
 add 12a2b01  license: add ASF header. (#743)

No new revisions were added by this update.

Summary of changes:
 .travis/ASF-Release.cfg| 99 ++
 .travis/ASFLicenseHeaderMarkdown.txt   | 18 
 .travis/linux_runner.sh| 27 --
 .travis/osx_runner.sh  | 25 --
 CHANGELOG.md   | 19 +
 CHANGELOG_CN.md| 19 +
 CODE_OF_CONDUCT.md | 19 +
 CODE_STYLE.md  | 19 +
 Contributing.md| 19 +
 FAQ.md | 19 +
 FAQ_CN.md  | 19 +
 Makefile   | 18 
 README.md  | 19 +
 README_CN.md   | 21 -
 benchmark/fake-apisix/conf/cert/openssl.conf   | 16 
 benchmark/fake-apisix/conf/nginx.conf  | 16 
 benchmark/fake-apisix/lua/apisix.lua   | 16 
 benchmark/run.sh   | 17 
 benchmark/server/conf/nginx.conf   | 16 
 bin/apisix | 17 
 conf/cert/openssl.conf | 16 
 conf/config.yaml   | 16 
 conf/debug.yaml| 16 
 conf/nginx.conf| 16 
 dashboard  |  2 +-
 doc/README.md  | 18 
 doc/README_CN.md   | 18 
 doc/admin-api-cn.md| 19 +
 doc/architecture-design-cn.md  | 19 +
 doc/architecture-design.md | 19 +
 doc/benchmark-cn.md| 19 +
 doc/benchmark.md   | 19 +
 doc/dev-manual-cn.md   | 19 +
 doc/dev-manual.md  | 19 +
 doc/health-check.md| 19 +
 doc/https-cn.md| 19 +
 doc/https.md   | 19 +
 doc/install-dependencies.md| 21 -
 doc/plugins-cn.md  | 19 +
 doc/plugins.md | 19 +
 doc/plugins/grpc-transcoding-cn.md | 19 +
 doc/plugins/grpc-transcoding.md| 19 +
 doc/plugins/ip-restriction-cn.md   | 19 +
 doc/plugins/ip-restriction.md  | 19 +
 doc/plugins/jwt-auth-cn.md | 19 +
 doc/plugins/jwt-auth.md| 19 +
 doc/plugins/key-auth-cn.md | 19 +
 doc/plugins/key-auth.md| 19 +
 doc/plugins/limit-conn-cn.md   | 19 +
 doc/plugins/limit-conn.md  | 19 +
 doc/plugins/limit-count-cn.md  | 19 +
 doc/plugins/limit-count.md | 19 +
 doc/plugins/limit-req-cn.md| 19 +
 doc/plugins/limit-req.md   | 19 +
 doc/plugins/mqtt-proxy-cn.md   | 22 -
 doc/plugins/mqtt-proxy.md  | 19 +
 doc/plugins/prometheus-cn.md   | 22 -
 doc/plugins/prometheus.md  | 21 -
 doc/plugins/proxy-rewrite-cn.md| 19 +
 doc/plugins/proxy-rewrite.md   | 19 +
 doc/plugins/serverless-cn.md   | 19 +
 doc/plugins/serverless.md  | 19 +
 doc/plugins/zipkin-cn.md   | 19 +
 doc/plugins/zipkin.md  | 19 +
 doc/powered-by.md  | 19 +
 doc/router-radixtree.md| 19 +
 doc/stand-alone-cn.md  | 19 +
 doc/stand-alone.md | 19 +
 doc/stream-proxy-cn.md | 24 +-
 doc/stream-proxy.md| 19 +
 lua/apisix.lua | 18 +++-
 lua/apisix/admin/consumers.lua | 16 
 lua/apisix/admin/global_rules.lua  | 16 
 lua/apisix/admin

[incubator-apisix] branch master updated (89f2fcd -> da85370)

2019-10-30 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git.


from 89f2fcd  doc: add redirect-cn.md (#739)
 add da85370  feature: supported `redirect` plugin. (#732)

No new revisions were added by this update.

Summary of changes:
 conf/config.yaml|   1 +
 doc/README.md   |   1 +
 doc/README_CN.md|   1 +
 doc/plugins/redirect.md | 100 
 lua/apisix/plugins/redirect.lua | 119 ++
 t/admin/plugins.t   |   2 +-
 t/debug/debug-mode.t|   1 +
 t/plugin/redirect.t | 332 
 8 files changed, 556 insertions(+), 1 deletion(-)
 create mode 100644 doc/plugins/redirect.md
 create mode 100644 lua/apisix/plugins/redirect.lua
 create mode 100644 t/plugin/redirect.t



[incubator-apisix] branch master updated (12a2b01 -> 89f2fcd)

2019-10-30 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git.


from 12a2b01  license: add ASF header. (#743)
 add 89f2fcd  doc: add redirect-cn.md (#739)

No new revisions were added by this update.

Summary of changes:
 doc/plugins/redirect-cn.md | 96 ++
 1 file changed, 96 insertions(+)
 create mode 100644 doc/plugins/redirect-cn.md



[incubator-apisix] branch master updated (da85370 -> b3fb7ae)

2019-10-30 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git.


from da85370  feature: supported `redirect` plugin. (#732)
 add b3fb7ae  license: ingore grpc_server_example dir for check license. 
(#770)

No new revisions were added by this update.

Summary of changes:
 .travis/ASF-Release.cfg |  1 +
 doc/plugins/redirect-cn.md  | 19 +++
 doc/plugins/redirect.md | 19 +++
 lua/apisix/plugins/redirect.lua | 16 
 t/plugin/redirect.t | 16 
 5 files changed, 71 insertions(+)



[incubator-apisix] branch v0.9 created (now 027da04)

2019-11-13 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch v0.9
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git.


  at 027da04  doc: added doc about "How to compile the Openresty". (#831)

No new revisions were added by this update.



[incubator-apisix] branch master updated (553f4e9 -> 35416e9)

2019-11-13 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git.


from 553f4e9  test: fixed typo in test cases #508 (#853)
 add 35416e9  doc: fix typo in install-dependencies.md (#852)

No new revisions were added by this update.

Summary of changes:
 doc/install-dependencies.md | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)



[incubator-apisix] branch v0.9 updated: license: removed dashboard and logos. (#858)

2019-11-15 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch v0.9
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/v0.9 by this push:
 new a77dbe1  license: removed dashboard and logos. (#858)
a77dbe1 is described below

commit a77dbe173213b385a453e9e34d4dc8465d1e8a15
Author: WenMing 
AuthorDate: Fri Nov 15 18:07:31 2019 +0800

license: removed dashboard and logos. (#858)
---
 CHANGELOG.md   |  25 ++--
 CHANGELOG_CN.md|  25 ++--
 CODE_OF_CONDUCT.md |  95 -
 Makefile   |  14 +-
 README.md  | 153 +
 README_CN.md   | 130 -
 dashboard  |   1 -
 doc/README.md  |  12 +-
 doc/README_CN.md   |   3 +-
 doc/{dev-manual-cn.md => how-to-build-cn.md}   |  84 +--
 doc/{dev-manual.md => how-to-build.md} |  82 +--
 doc/images/cncf-landscope.jpg  | Bin 271344 -> 0 bytes
 doc/images/plugin/jwt-auth-1.png   | Bin 45338 -> 38204 bytes
 doc/images/plugin/jwt-auth-2.png   | Bin 77545 -> 227769 bytes
 doc/images/plugin/key-auth-1.png   | Bin 45338 -> 37526 bytes
 doc/images/plugin/key-auth-2.png   | Bin 65698 -> 182157 bytes
 doc/images/plugin/limit-conn-1.png | Bin 65883 -> 72052 bytes
 doc/images/plugin/limit-conn-2.png | Bin 96260 -> 325773 bytes
 doc/images/plugin/limit-count-1.png| Bin 142664 -> 74547 bytes
 doc/images/plugin/limit-count-2.png| Bin 126497 -> 119480 bytes
 doc/images/plugin/limit-req-1.png  | Bin 66804 -> 70315 bytes
 doc/images/plugin/limit-req-2.png  | Bin 91552 -> 289197 bytes
 doc/images/plugin/prometheus-1.png | Bin 64314 -> 67980 bytes
 doc/images/plugin/prometheus-2.png | Bin 83369 -> 237119 bytes
 doc/images/plugin/zipkin-1.jpg | Bin 272972 -> 247284 bytes
 doc/images/plugin/zipkin-1.png | Bin 69668 -> 77813 bytes
 doc/images/plugin/zipkin-2.jpg | Bin 168128 -> 117181 bytes
 doc/images/plugin/zipkin-2.png | Bin 89437 -> 277580 bytes
 doc/images/user-wall.jpg   | Bin 187855 -> 0 bytes
 doc/install-dependencies.md|   5 +
 doc/powered-by.md  |  10 +-
 ...isix-0.9-rc1.rockspec => apisix-0.9-0.rockspec} |   5 +-
 32 files changed, 187 insertions(+), 457 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 851eba9..155186c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -26,7 +26,6 @@
 
 
 ## 0.9.0-RC1
-> Released on 2019/11/11
 
 This release brings many new features, such as support for running APISIX with 
Tengine,
 an advanced debugging mode that is more developer friendly, and a new URI 
redirection plugin.
@@ -39,24 +38,24 @@ an advanced debugging mode that is more developer friendly, 
and a new URI redire
 - Removed router R3 [#725](https://github.com/apache/incubator-apisix/pull/725)
 
 ### Plugins
-- [Redirect 
URI](https://github.com/apache/incubator-apisix/blob/master/doc/plugins/redirect.md):【New
 Plugin】Redirect URI plugin. 
[#732](https://github.com/apache/incubator-apisix/pull/732)
-- [Proxy 
Rewrite](https://github.com/apache/incubator-apisix/blob/master/doc/plugins/proxy-rewrite.md):【New
 Feature】Supported remove `header` feature. 
[#658](https://github.com/apache/incubator-apisix/pull/658)
-- [Limit 
Count](https://github.com/apache/incubator-apisix/blob/master/doc/plugins/limit-count.md):【New
 Feature】Supported global limit count with `Redis 
Server`.[#624](https://github.com/apache/incubator-apisix/pull/624)
+- [Redirect 
URI](https://github.com/apache/incubator-apisix/blob/master/doc/plugins/redirect.md):[New
 Plugin] Redirect URI plugin. 
[#732](https://github.com/apache/incubator-apisix/pull/732)
+- [Proxy 
Rewrite](https://github.com/apache/incubator-apisix/blob/master/doc/plugins/proxy-rewrite.md):[New
 Feature] Supported remove `header` feature. 
[#658](https://github.com/apache/incubator-apisix/pull/658)
+- [Limit 
Count](https://github.com/apache/incubator-apisix/blob/master/doc/plugins/limit-count.md):[New
 Feature] Supported global limit count with `Redis 
Server`.[#624](https://github.com/apache/incubator-apisix/pull/624)
 
 ### lua-resty-*
 - lua-resty-radixtree
-- 【New Feature】Support for `host + uri` as an index.
+- [New Feature] Support for `host + uri` as an index.
 - lua-resty-jsonschema
--

[incubator-apisix] branch v0.9 created (now 35416e9)

2019-11-14 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch v0.9
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git.


  at 35416e9  doc: fix typo in install-dependencies.md (#852)

No new revisions were added by this update.



[incubator-apisix] branch master updated (c712a23 -> 0972462)

2019-11-12 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git.


from c712a23  updated lua-resty-radixtree to 1.6-1 . (#837)
 add 0972462  user: add company into powereby page (#844)

No new revisions were added by this update.

Summary of changes:
 doc/powered-by.md | 1 +
 1 file changed, 1 insertion(+)



[incubator-apisix] tag v0.9 created (now a77dbe1)

2019-11-15 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to tag v0.9
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git.


  at a77dbe1  (commit)
No new revisions were added by this update.



[incubator-apisix] branch v0.9 updated: doc: add doc for install from source RC. (#859)

2019-11-15 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch v0.9
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/v0.9 by this push:
 new a73fb33  doc: add doc for install from source RC. (#859)
a73fb33 is described below

commit a73fb338e3e7dfc9b1bb9118572bbb045cd4f7dc
Author: WenMing 
AuthorDate: Fri Nov 15 22:54:27 2019 +0800

doc: add doc for install from source RC. (#859)
---
 README.md   |  7 ++-
 README_CN.md|  7 ++-
 doc/how-to-build-cn.md  | 10 ++
 doc/how-to-build.md | 14 --
 doc/install-dependencies.md | 15 ---
 5 files changed, 26 insertions(+), 27 deletions(-)

diff --git a/README.md b/README.md
index 0333d8c..1a470a9 100644
--- a/README.md
+++ b/README.md
@@ -89,18 +89,17 @@ We provide an online dashboard [demo 
version](http://apisix.iresty.com), make
 ## Installation
 
 APISIX Installed and tested in the following systems(OpenResty MUST >= 
1.15.8.1, or Tengine >= 2.3.2):
+
 CentOS 7, Ubuntu 16.04, Ubuntu 18.04, Debian 9, Debian 10, macOS, **ARM64** 
Ubuntu 18.04
 
 Steps to install APISIX:
 1. Installation runtime dependencies: OpenResty and etcd, refer to 
[documentation](doc/install-dependencies.md);
 2. There are several ways to install Apache APISIX:
-- [Source code](doc/how-to-build.md#installation-via-source-code)
+- [Source Release 
Candidate](doc/how-to-build.md#installation-via-source-release-candidate)
 - [RPM package](doc/how-to-build.md#installation-via-rpm-package-centos-7) 
for CentOS 7
 - 
[Luarocks](doc/how-to-build.md#installation-via-luarocks-macos-not-supported)
 - [Docker](https://github.com/apache/incubator-apisix-docker)
 
-Then you can try APISIX with the [**Quickstart**](#quickstart) now.
-
 ## Quickstart
 
 1. start server:
@@ -109,8 +108,6 @@ Then you can try APISIX with the 
[**Quickstart**](#quickstart) now.
 sudo apisix start
 ```
 
-*note*: If you are in a development environment, start server by command `make 
run`.
-
 2. try limit count plugin
 
 Limit count plugin is a good start to try APISIX,
diff --git a/README_CN.md b/README_CN.md
index e4fab3d..7a28973 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -87,18 +87,17 @@ APISIX 通过插件机制,提供动态负载平衡、身份验证、限流限
 ## 安装
 
 APISIX 在以下操作系统中可顺利安装并做过运行测试,需要注意的是:OpenResty 的版本必须 >= 1.15.8.1:
+
 CentOS 7, Ubuntu 16.04, Ubuntu 18.04, Debian 9, Debian 10, macOS, **ARM64** 
Ubuntu 18.04
 
 安装 APISIX 的步骤:
 1. 安装运行时依赖:OpenResty 和 etcd,参考[依赖安装文档](doc/install-dependencies.md).
 2. 有以下几种方式来安装 Apache APISIX:
-- 通过[源码安装](doc/how-to-build-cn.md#通过源码安装);
+- 通过[源码候选版本](doc/how-to-build-cn.md#通过源码候选版本安装);
 - 如果你在使用 CentOS 7,可以使用 [RPM 
包安装](doc/how-to-build-cn.md#通过-rpm-包安装centos-7);
 - 其它 Linux 操作系统,可以使用 [Luarocks 
安装方式](doc/how-to-build-cn.md#通过-luarocks-安装-不支持-macos);
 - 你也可以使用 [Docker 镜像](https://github.com/apache/incubator-apisix-docker) 
来安装。
 
-如果安装成功,就可以参考 [**快速上手**](#快速上手) 来进行体验。如果失败,欢迎反馈给我们。
-
 ## 快速上手
 
 1. 启动 APISIX
@@ -107,8 +106,6 @@ CentOS 7, Ubuntu 16.04, Ubuntu 18.04, Debian 9, Debian 10, 
macOS, **ARM64** Ubun
 sudo apisix start
 ```
 
-*注意*:如果你当前在开发环境下,应使用 `make run` 命令启动服务。
-
 2. 测试限流插件
 
 你可以测试限流插件,来上手体验 APISIX,按照[限流插件文档](doc/plugins/limit-count-cn.md)的步骤即可。
diff --git a/doc/how-to-build-cn.md b/doc/how-to-build-cn.md
index 8798f23..56b06a0 100644
--- a/doc/how-to-build-cn.md
+++ b/doc/how-to-build-cn.md
@@ -20,23 +20,25 @@
 
 ## 1. 安装依赖
 Apache APISIX 的运行环境需要 Nginx 和 etcd,
+
 所以在安装前,请根据不同的操作系统来[安装依赖](install-dependencies.md)。
 
 ## 2. 安装 Apache APISIX
 
 你可以通过源码包、Docker、Luarocks 等多种方式来安装 Apache APISIX。
 
-### 通过源码安装
+### 通过源码候选版本安装
 
-你可以下载 Apache release 包(Apache APISIX 还没有发布 Apache release),或者从 GitHub 下载源码:
+你需要先下载源码候选版本:
 
 ```shell
-git clone g...@github.com:iresty/apisix.git
-cd apisix
+wget 
https://dist.apache.org/repos/dist/dev/incubator/apisix/0.9-RC1/apache-apisix-0.9-rc1-incubating-src.tar.gz
+tar zxvf apache-apisix-0.9-rc1-incubating-src.tar.gz
 ```
 
 安装运行时依赖的 Lua 库:
 ```
+cd apache-apisix-0.9-rc1-incubating-src
 make deps
 ```
 
diff --git a/doc/how-to-build.md b/doc/how-to-build.md
index 307c4ab..4aec39c 100644
--- a/doc/how-to-build.md
+++ b/doc/how-to-build.md
@@ -21,23 +21,25 @@
 
 ## 1. Install dependencies
 The runtime environment for Apache APISIX requires Nginx and etcd.
+
 So before installation, please follow the different operating systems [install 
Dependencies](install-dependencies.md).
 
 ## 2. Install Apache APISIX
 
 You can install Apache APISIX in a variety of ways, including source code 
packages, Docker, and Luarocks.
 
-### Installation via source code
+### Installation via source release candidate
 
-You can download the Apache release package (Apache APISIX has not released 
the Apache release yet), or download the source code from GitHub:
+You need to download the source release candidate first:
 
 ```shell
-gi

[incubator-apisix] tag v0.9 created (now 77ad662)

2019-11-15 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to tag v0.9
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git.


  at 77ad662  (commit)
No new revisions were added by this update.



[incubator-apisix] branch v0.9 updated: license: remove dashboard and logos in images. (#856)

2019-11-14 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch v0.9
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/v0.9 by this push:
 new f29abed  license: remove dashboard and logos in images. (#856)
f29abed is described below

commit f29abedd9b99bbbdfe464763d31afc53f1c1a7df
Author: WenMing 
AuthorDate: Fri Nov 15 11:40:24 2019 +0800

license: remove dashboard and logos in images. (#856)
---
 CHANGELOG.md   |  25 +++--
 CHANGELOG_CN.md|  25 +++--
 CODE_OF_CONDUCT.md |  95 -
 Makefile   |   6 +-
 README.md  |  63 +---
 README_CN.md   | 114 +
 dashboard  |   1 -
 doc/README.md  |  12 ++-
 doc/README_CN.md   |   3 +-
 doc/{dev-manual-cn.md => how-to-build-cn.md}   |  84 ++-
 doc/{dev-manual.md => how-to-build.md} |  82 ++-
 doc/images/cncf-landscope.jpg  | Bin 271344 -> 0 bytes
 doc/images/plugin/jwt-auth-1.png   | Bin 45338 -> 38204 bytes
 doc/images/plugin/jwt-auth-2.png   | Bin 77545 -> 227769 bytes
 doc/images/plugin/key-auth-1.png   | Bin 45338 -> 37526 bytes
 doc/images/plugin/key-auth-2.png   | Bin 65698 -> 182157 bytes
 doc/images/plugin/limit-conn-1.png | Bin 65883 -> 72052 bytes
 doc/images/plugin/limit-conn-2.png | Bin 96260 -> 325773 bytes
 doc/images/plugin/limit-count-1.png| Bin 142664 -> 74547 bytes
 doc/images/plugin/limit-count-2.png| Bin 126497 -> 119480 bytes
 doc/images/plugin/limit-req-1.png  | Bin 66804 -> 70315 bytes
 doc/images/plugin/limit-req-2.png  | Bin 91552 -> 289197 bytes
 doc/images/plugin/prometheus-1.png | Bin 64314 -> 67980 bytes
 doc/images/plugin/prometheus-2.png | Bin 83369 -> 237119 bytes
 doc/images/plugin/zipkin-1.jpg | Bin 272972 -> 247284 bytes
 doc/images/plugin/zipkin-1.png | Bin 69668 -> 77813 bytes
 doc/images/plugin/zipkin-2.jpg | Bin 168128 -> 117181 bytes
 doc/images/plugin/zipkin-2.png | Bin 89437 -> 277580 bytes
 doc/images/user-wall.jpg   | Bin 187855 -> 0 bytes
 doc/powered-by.md  |  12 ++-
 ...isix-0.9-rc1.rockspec => apisix-0.9-0.rockspec} |   5 +-
 31 files changed, 167 insertions(+), 360 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 851eba9..155186c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -26,7 +26,6 @@
 
 
 ## 0.9.0-RC1
-> Released on 2019/11/11
 
 This release brings many new features, such as support for running APISIX with 
Tengine,
 an advanced debugging mode that is more developer friendly, and a new URI 
redirection plugin.
@@ -39,24 +38,24 @@ an advanced debugging mode that is more developer friendly, 
and a new URI redire
 - Removed router R3 [#725](https://github.com/apache/incubator-apisix/pull/725)
 
 ### Plugins
-- [Redirect 
URI](https://github.com/apache/incubator-apisix/blob/master/doc/plugins/redirect.md):【New
 Plugin】Redirect URI plugin. 
[#732](https://github.com/apache/incubator-apisix/pull/732)
-- [Proxy 
Rewrite](https://github.com/apache/incubator-apisix/blob/master/doc/plugins/proxy-rewrite.md):【New
 Feature】Supported remove `header` feature. 
[#658](https://github.com/apache/incubator-apisix/pull/658)
-- [Limit 
Count](https://github.com/apache/incubator-apisix/blob/master/doc/plugins/limit-count.md):【New
 Feature】Supported global limit count with `Redis 
Server`.[#624](https://github.com/apache/incubator-apisix/pull/624)
+- [Redirect 
URI](https://github.com/apache/incubator-apisix/blob/master/doc/plugins/redirect.md):[New
 Plugin] Redirect URI plugin. 
[#732](https://github.com/apache/incubator-apisix/pull/732)
+- [Proxy 
Rewrite](https://github.com/apache/incubator-apisix/blob/master/doc/plugins/proxy-rewrite.md):[New
 Feature] Supported remove `header` feature. 
[#658](https://github.com/apache/incubator-apisix/pull/658)
+- [Limit 
Count](https://github.com/apache/incubator-apisix/blob/master/doc/plugins/limit-count.md):[New
 Feature] Supported global limit count with `Redis 
Server`.[#624](https://github.com/apache/incubator-apisix/pull/624)
 
 ### lua-resty-*
 - lua-resty-radixtree
-- 【New Feature】Support for `host + uri` as an index.
+- [New Feature] Support for `host + uri` as an index.
 - lua-resty-jsonschema
-- 【New Plugin】This extension is a JSON da

[incubator-apisix] tag 0.9-RC1 created (now 5385217)

2019-11-07 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to tag 0.9-RC1
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git.


  at 5385217  (commit)
No new revisions were added by this update.



[incubator-apisix-dashboard] branch license-bugfix created (now c1c7572)

2019-11-05 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch license-bugfix
in repository 
https://gitbox.apache.org/repos/asf/incubator-apisix-dashboard.git.


  at c1c7572  license: add point for vue-element-admin's license.

No new revisions were added by this update.



[incubator-apisix] branch 0.9-rc1 updated (31a545a -> 8c56dc6)

2019-11-10 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch 0.9-rc1
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git.


from 31a545a  version: updated version to 0.9-rc1. (#827)
 new 900563e  dashboard: update dashboard. (#828)
 new 8c56dc6  bugfix: key-auth plugin cannot run accurately in the case of 
multiple consumers (#826)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 dashboard   |  2 +-
 lua/apisix/consumer.lua | 15 ---
 t/plugin/key-auth.t | 31 +++
 3 files changed, 36 insertions(+), 12 deletions(-)



[incubator-apisix] branch master updated: plugin: implement plugin `response rewrite`

2019-11-21 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new fbb51dd  plugin: implement plugin `response rewrite`
fbb51dd is described below

commit fbb51ddadd1ded52da3a04c77e047df4fe25e73c
Author: Lien 
AuthorDate: Thu Nov 21 21:49:53 2019 +0800

plugin: implement plugin `response rewrite`
---
 README.md   |   1 +
 README_CN.md|   1 +
 conf/config.yaml|   1 +
 doc/README.md   |   1 +
 doc/README_CN.md|   1 +
 doc/plugins/response-rewrite-cn.md  |  82 
 doc/plugins/response-rewrite.md |  82 
 lua/apisix/plugins/response-rewrite.lua | 115 +++
 t/admin/plugins.t   |   2 +-
 t/debug/debug-mode.t|   1 +
 t/lib/server.lua|   9 +
 t/plugin/response-rewrite.t | 356 
 12 files changed, 651 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 084633e..5f2d94c 100644
--- a/README.md
+++ b/README.md
@@ -73,6 +73,7 @@ For more detailed information, see the [White 
Paper](https://www.iresty.com/down
 - **CLI**: start\stop\reload APISIX through the command line.
 - **REST API**
 - **Proxy Websocket**
+- **[Response Rewrite](doc/plugins/response-rewrite.md)**: Set customized 
response status code, body and header to the client.
 - **IPv6**: Use IPv6 to match route.
 - **Clustering**: APISIX nodes are stateless, creates clustering of the 
configuration center, please refer to [etcd Clustering 
Guide](https://github.com/etcd-io/etcd/blob/master/Documentation/v2/clustering.md).
 - **Scalability**: plug-in mechanism is easy to extend.
diff --git a/README_CN.md b/README_CN.md
index 79d0899..2141831 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -60,6 +60,7 @@ APISIX 通过插件机制,提供动态负载平衡、身份验证、限流限
 - **[限制请求数](doc/plugins/limit-count-cn.md)**
 - **[限制并发](doc/plugins/limit-conn-cn.md)**
 - **[代理请求重写](doc/plugins/proxy-rewrite.md)**: 
支持重写请求上游的`host`、`uri`、`schema`、`enable_websocket`、`headers`信息。
+- **[输出内容重写](doc/plugins/response-rewrite.md)**: 支持自定义修改返回内容的 `status 
code`、`body`、`headers`。
 - **OpenTracing: [支持 Apache Skywalking 和 Zipkin](doc/plugins/zipkin.md)**
 - **监控和指标**: [Prometheus](doc/plugins/prometheus-cn.md)
 - **[gRPC 代理](doc/grpc-proxy-cn.md)**:通过 APISIX 代理 gRPC 连接,并使用 APISIX 
的大部分特性管理你的 gRPC 服务。
diff --git a/conf/config.yaml b/conf/config.yaml
index 68cf4e6..8537184 100644
--- a/conf/config.yaml
+++ b/conf/config.yaml
@@ -88,6 +88,7 @@ plugins:  # plugin list
   - openid-connect
   - proxy-rewrite
   - redirect
+  - response-rewrite
 
 stream_plugins:
   - mqtt-proxy
diff --git a/doc/README.md b/doc/README.md
index 56591f0..7198173 100644
--- a/doc/README.md
+++ b/doc/README.md
@@ -54,3 +54,4 @@ Plugins
 * [ip-restriction](plugins/ip-restriction.md): IP whitelist/blacklist.
 * openid-connect
 * [redirect](plugins/redirect.md): URI redirect.
+* [response-rewrite](plugins/response-rewrite.md): Set customized response 
status code, body and header to the client.
diff --git a/doc/README_CN.md b/doc/README_CN.md
index 20e69ef..0af4da3 100644
--- a/doc/README_CN.md
+++ b/doc/README_CN.md
@@ -55,3 +55,4 @@ Reference document
 * [ip-restriction](plugins/ip-restriction-cn.md): IP 黑白名单。
 * openid-connect
 * [redirect](plugins/redirect-cn.md): URI 重定向。
+* [response-rewrite](plugins/response-rewrite-cn.md): 支持自定义修改返回内容的 `status 
code`、`body`、`headers`。
diff --git a/doc/plugins/response-rewrite-cn.md 
b/doc/plugins/response-rewrite-cn.md
new file mode 100644
index 000..d81e62b
--- /dev/null
+++ b/doc/plugins/response-rewrite-cn.md
@@ -0,0 +1,82 @@
+
+
+[English](response-rewrite.md)
+# response-rewrite
+
+该插件支持修改上游服务返回的 body 和 header 信息。
+
+使用场景:
+1、可以设置 `Access-Control-Allow-*` 等 header 信息,来实现 CORS (跨域资源共享)的功能。
+2、另外也可以通过配置 status_code 和 header 里面的 Location 来实现重定向,当然如果只是需要重定向功能,最好使用 
[redirect](redirect-cn.md) 插件。
+
+ 配置参数
+|名字|可选|说明|
+|--- |-|--|
+|status_code   |可选| 修改上游返回状态码|
+|body  |可选| 修改上游返回的 `body` 内容,如果设置了新内容,header 里面的 content-length 
字段也会被去掉|
+|headers   |可选| 返回给客户端的 `headers`,这里可以设置多个。头信息如果存在将重写,不存在则添加。想要删除某个 header 
的话,把对应的值设置为空字符串即可|
+
+
+### 示例
+
+ 开启插件
+下面是一个示例,在指定的 route 上开启了 `response rewrite` 插件:
+
+```shell
+curl http://127.0.0.1:9080/apisix/admin/routes/1 -X PUT -d '
+{
+"methods": ["GET"],
+"uri": "/test/index.html",
+"plugins": {
+"response-rewrite": {
+"body": "{\"code\":\"ok\",\"message\":\"new json body\"}",
+"headers": {
+"X-Server-id": 3,

[incubator-apisix] branch master updated: feature: added dev mode flag in config yaml to set the nginx worker_process to one (#926)

2019-12-04 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 9e0030e  feature: added dev mode flag in config yaml to set the nginx 
worker_process to one (#926)
9e0030e is described below

commit 9e0030e2e8563555cfdc1a66b4ed17bd733c4140
Author: Nirojan Selvanathan 
AuthorDate: Wed Dec 4 17:09:20 2019 +0100

feature: added dev mode flag in config yaml to set the nginx worker_process 
to one (#926)
---
 bin/apisix   | 8 +++-
 conf/config.yaml | 1 +
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/bin/apisix b/bin/apisix
index bf6212f..b98165d 100755
--- a/bin/apisix
+++ b/bin/apisix
@@ -80,7 +80,7 @@ local template = require("resty.template")
 local ngx_tpl = [=[
 master_process on;
 
-worker_processes auto;
+worker_processes {* worker_processes *};
 {% if os_name == "Linux" then %}
 worker_cpu_affinity auto;
 {% end %}
@@ -513,6 +513,12 @@ local function init()
 sys_conf[k] = v
 end
 
+if(sys_conf["enable_dev_mode"] == true) then
+sys_conf["worker_processes"] = 1
+else
+sys_conf["worker_processes"] = "auto"
+end
+
 local conf_render = template.compile(ngx_tpl)
 local ngxconf = conf_render(sys_conf)
 
diff --git a/conf/config.yaml b/conf/config.yaml
index 8537184..e344931 100644
--- a/conf/config.yaml
+++ b/conf/config.yaml
@@ -19,6 +19,7 @@ apisix:
   enable_heartbeat: true
   enable_admin: true
   enable_debug: false
+  enable_dev_mode: false  # Sets nginx worker_processes to 1 if set to 
true
   enable_ipv6: true
   config_center: etcd # etcd: use etcd to store the config value
   # yaml: fetch the config value from local 
yaml file `/your_path/conf/apisix.yaml`



[incubator-apisix] branch master updated: doc: Update health-check.md (#928)

2019-12-04 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 06e392f  doc: Update health-check.md (#928)
06e392f is described below

commit 06e392ffe87439784535e9ce68b994305cb369d5
Author: 琚致远 
AuthorDate: Thu Dec 5 00:11:59 2019 +0800

doc: Update health-check.md (#928)
---
 doc/health-check.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/health-check.md b/doc/health-check.md
index 160af6e..d992218 100644
--- a/doc/health-check.md
+++ b/doc/health-check.md
@@ -89,7 +89,7 @@ contains: `active` or `passive`.
 The threshold fields of  `unhealthy` are:
 * `active.unhealthy.interval`: Interval between health checks for 
unhealthy targets (in seconds), the minimum is 1.
 * `active.unhealthy.http_failures`: The number of http failures times to 
determine the target is unhealthy, the minimum is 1.
-* `active.req_headers`: Additional request header.
+* `active.req_headers`: Additional request headers. Array format, so you 
can fill in multiple headers.
 
 * `passive`: To enable passive health checks, you need to specify the 
configuration items under `checks.passive` in the Upstream object configuration.
 



[incubator-apisix] branch master updated: test case: Adding unit test for key auth plugin with valid api key (#964)

2019-12-12 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 8958c6c  test case: Adding unit test for key auth plugin with valid 
api key (#964)
8958c6c is described below

commit 8958c6ce0d28ba72a05b86ff53f009aff389c122
Author: Nirojan Selvanathan 
AuthorDate: Fri Dec 13 06:16:47 2019 +0100

test case: Adding unit test for key auth plugin with valid api key (#964)
---
 t/plugin/key-auth.t | 18 +++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/t/plugin/key-auth.t b/t/plugin/key-auth.t
index 1608f96..a47292e 100644
--- a/t/plugin/key-auth.t
+++ b/t/plugin/key-auth.t
@@ -147,7 +147,19 @@ passed
 
 
 
-=== TEST 5: invalid consumer
+=== TEST 5: valid consumer
+--- request
+GET /hello
+--- more_headers
+apikey: auth-one
+--- response_body
+hello world
+--- no_error_log
+[error]
+
+
+
+=== TEST 6: invalid consumer
 --- request
 GET /hello
 --- more_headers
@@ -160,7 +172,7 @@ apikey: 123
 
 
 
-=== TEST 6: not found apikey header
+=== TEST 7: not found apikey header
 --- request
 GET /hello
 --- error_code: 401
@@ -171,7 +183,7 @@ GET /hello
 
 
 
-=== TEST 7: valid consumer
+=== TEST 8: valid consumer
 --- config
 location /add_more_consumer {
 content_by_lua_block {



[incubator-apisix] branch master updated: doc: add getting started guide (#955)

2019-12-10 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 05d3db3  doc: add getting started guide (#955)
05d3db3 is described below

commit 05d3db3a5771f76d1dcfe57d8e31b10123f894c0
Author: Nirojan Selvanathan 
AuthorDate: Wed Dec 11 06:42:53 2019 +0100

doc: add getting started guide (#955)
---
 doc/README.md  |   1 +
 doc/getting-started.md | 228 +
 2 files changed, 229 insertions(+)

diff --git a/doc/README.md b/doc/README.md
index ceb5623..ddfa533 100644
--- a/doc/README.md
+++ b/doc/README.md
@@ -24,6 +24,7 @@ Reference Documentation
 * [APISIX Readme](../README.md)
 * [Architecture Design](architecture-design.md)
 * [Benchmark](benchmark.md)
+* [Getting Started Guide](getting-started.md)
 * [How to build Apache APISIX](how-to-build.md)
 * [Health Check](health-check.md): Enable health check on the upstream node, 
and will automatically filter unhealthy nodes during load balancing to ensure 
system stability.
 * Router
diff --git a/doc/getting-started.md b/doc/getting-started.md
new file mode 100644
index 000..3c78e5b
--- /dev/null
+++ b/doc/getting-started.md
@@ -0,0 +1,228 @@
+
+
+# Quick Start Guide
+
+The goal of this guide is to get started with APISIX and to configure a 
secured public API with APISIX.
+By the end of this guide, you will have a working APISIX setup and a new 
service which will route to a public API, which is secured by an API key.
+
+The following GET endpoint will be used for the purpose of this tutorial. This 
will act as an echo endpoint and will return the parameters which are sent to 
the API.
+
+```bash
+$ curl --location --request GET "https://httpbin.org/get?foo1=bar1=bar2;
+```
+
+Let's deconstruct the above URL.
+
+- Scheme: HTTPS
+- Host/Address: httpbin.org
+- Port: 443
+- URI: get
+- Query Parameters: foo1, foo2
+
+## Prerequisites
+
+- The guide uses docker and docker-compose to setup APISIX. But if you have 
already installed APISIX via other methods, then you can skip to step 2.
+- Curl: The guide uses curl command for API testing, but you can also use any 
other tool of your choice (Eg- Postman).
+
+## Step 1: Install APISIX
+
+APISIX is available to install in multiple operating environments. The 
[following document](how-to-build.md#installation-via-source-release) shows the 
installation steps in multiple platforms.
+For the quick start let's use the docker based set up. To start the APISIX 
server, clone the following 
[repository](https://github.com/apache/incubator-apisix-docker) and navigate to 
the example folder and execute the following commands.
+
+This command will start the APISIX server and the admin API will be available 
in 9080 port (HTTPS port: 9443).
+
+```bash
+$ git clone https://github.com/apache/incubator-apisix-docker.git
+$ cd example
+$ docker-compose -p docker-apisix up -d
+```
+
+It will take a while to download the source for the first time. But the 
consequent loads will be very fast.
+After the docker containers have started visit the following link to check if 
you are getting a successful response.
+
+```bash
+$ curl "http://127.0.0.1:9080/apisix/admin/services/;
+```
+
+The following will be the response from the Admin API.
+
+```json
+{
+"node": {
+"createdIndex": 6,
+"modifiedIndex": 6,
+"key": "/apisix/services",
+"dir": true
+},
+"action": "get"
+}
+```
+
+## Step 2: Create a Route in APISIX
+
+APISIX provides a powerful Admin API and a 
[dashboard](https://github.com/apache/incubator-apisix-dashboard) for 
configuring the routes/services/plugins.
+The quickstart guide will use the Admin API for configuring the routes.
+
+A micro-service can be configured via APISIX through the relationship between 
several entities such as routes, services, upstream, and plugins.
+The route matches the client request and specifies how they are sent to the 
upstream (backend API/Service) after they reach APISIX.
+Services provide an abstraction to the upstream services. Therefore, you can 
create a single service and reference it in multiple routes.
+Check out the architecture document for more information.
+
+Technically all this information(upstream or service, plugins) can be included 
inside a route configuration. The route consists of three main parts.
+
+- Matching Rules:
+
+Let's take the following scenario.
+http://example.com/services/users
+
+The URL above hosts all the micro services related to the users(getUser/ 
GetAllUsers) in the system. For example the GetAllUsers endpoint can be reached 
via the following URL (http://example.com/services/users/GetAllUsers)
+Now you want to expose all the `GET` endpoi

[incubator-apisix] branch master updated: Removing the autogenerated nginx.conf file (#952)

2019-12-10 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 3399c7d  Removing the autogenerated nginx.conf file (#952)
3399c7d is described below

commit 3399c7d5ee3b360e8b73aec17e620f1c241485b4
Author: Nirojan Selvanathan 
AuthorDate: Wed Dec 11 06:43:38 2019 +0100

Removing the autogenerated nginx.conf file (#952)
---
 conf/nginx.conf | 194 
 1 file changed, 194 deletions(-)

diff --git a/conf/nginx.conf b/conf/nginx.conf
deleted file mode 100644
index 74f4e68..000
--- a/conf/nginx.conf
+++ /dev/null
@@ -1,194 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-master_process on;
-
-worker_processes 1;
-
-error_log logs/error.log warn;
-pid logs/nginx.pid;
-
-worker_rlimit_nofile 20480;
-
-events {
-accept_mutex off;
-worker_connections 10620;
-}
-
-worker_rlimit_core  500M;
-working_directory   /tmp/apisix_cores/;
-
-worker_shutdown_timeout 3;
-
-
-http {
-lua_package_path  
"$prefix/deps/share/lua/5.1/?.lua;$prefix/lua/?.lua;/usr/share/lua/5.1/?.lua;;";
-lua_package_cpath 
"$prefix/deps/lib64/lua/5.1/?.so;$prefix/deps/lib/lua/5.1/?.so;/usr/lib64/lua/5.1/?.so;;";
-
-lua_shared_dict plugin-limit-req 10m;
-lua_shared_dict plugin-limit-count   10m;
-lua_shared_dict prometheus-metrics   10m;
-lua_shared_dict plugin-limit-conn10m;
-lua_shared_dict upstream-healthcheck 10m;
-lua_shared_dict worker-events10m;
-
-# for openid-connect plugin
-lua_shared_dict discovery 1m; # cache for discovery metadata 
documents
-lua_shared_dict jwks  1m; # cache for JWKs
-lua_shared_dict introspection10m; # cache for JWT verification 
results
-
-lua_ssl_verify_depth 5;
-ssl_session_timeout 86400;
-
-lua_socket_log_errors off;
-
-resolver 8.8.8.8 114.114.114.114 ipv6=off;
-resolver_timeout 5;
-
-lua_http10_buffering off;
-
-lua_regex_match_limit 10;
-lua_regex_cache_max_entries 8192;
-
-log_format main '$remote_addr - $remote_user [$time_local] $http_host 
"$request" $status $body_bytes_sent $request_time "$http_referer" 
"$http_user_agent" $upstream_addr $upstream_status $upstream_response_time';
-
-access_log logs/access.log main buffer=32768 flush=3;
-open_file_cache  max=1000 inactive=60;
-client_max_body_size 0;
-
-server_tokens off;
-more_set_headers 'Server: APISIX web server';
-
-include mime.types;
-
-real_ip_header X-Real-IP;
-set_real_ip_from 127.0.0.1;
-set_real_ip_from unix:;
-
-upstream apisix_backend {
-server 0.0.0.1;
-balancer_by_lua_block {
-apisix.http_balancer_phase()
-}
-
-keepalive 320;
-}
-
-init_by_lua_block {
-require "resty.core"
-apisix = require("apisix")
-apisix.http_init()
-}
-
-init_worker_by_lua_block {
-apisix.http_init_worker()
-}
-
-
-server {
-listen 9080;
-listen 9443 ssl http2;
-
-ssl_certificate  cert/apisix.crt;
-ssl_certificate_key  cert/apisix.key;
-ssl_session_cacheshared:SSL:1m;
-
-ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
-ssl_ciphers 
ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AE
 [...]
-ssl_prefer_server_ciphers on;
-
-location = /apisix/nginx_status {
-allow 127.0.0.0/24;
-deny all;
-access_log off;
-stub_status;
-}
-
-locatio

[incubator-apisix] branch master updated: doc: move develop document from doc/plugins to doc. (#951)

2019-12-10 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 762da2d  doc: move develop document from doc/plugins to doc. (#951)
762da2d is described below

commit 762da2d986aea11900d7c53ab60e0bc71e7ecdc5
Author: Janko 
AuthorDate: Wed Dec 11 13:43:57 2019 +0800

doc: move develop document from doc/plugins to doc. (#951)
---
 FAQ.md | 2 +-
 FAQ_CN.md  | 2 +-
 doc/{plugins => }/plugin-develop-cn.md | 0
 doc/{plugins => }/plugin-develop.md| 0
 4 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/FAQ.md b/FAQ.md
index 1f1ae17..8d60128 100644
--- a/FAQ.md
+++ b/FAQ.md
@@ -45,7 +45,7 @@ Yes, in version 0.6 we have dashboard built in, you can 
operate APISIX through t
 
 Of course, APISIX provides flexible custom plugins for developers and 
businesses to write their own logic.
 
-[How to write plugin](doc/plugins/plugin-develop.md)
+[How to write plugin](doc/plugin-develop.md)
 
 ## Why we choose etcd as the configuration center?
 
diff --git a/FAQ_CN.md b/FAQ_CN.md
index 6832c2c..97cd102 100644
--- a/FAQ_CN.md
+++ b/FAQ_CN.md
@@ -45,7 +45,7 @@ APISIX 是当前性能最好的 API 网关,单核 QPS 达到 2.3 万,平均
 
 当然可以,APISIX 提供了灵活的自定义插件,方便开发者和企业编写自己的逻辑。
 
-[如何开发插件](doc/plugins/plugin-develop-cn.md)
+[如何开发插件](doc/plugin-develop-cn.md)
 
 ## 我们为什么选择 etcd 作为配置中心?
 
diff --git a/doc/plugins/plugin-develop-cn.md b/doc/plugin-develop-cn.md
similarity index 100%
rename from doc/plugins/plugin-develop-cn.md
rename to doc/plugin-develop-cn.md
diff --git a/doc/plugins/plugin-develop.md b/doc/plugin-develop.md
similarity index 100%
rename from doc/plugins/plugin-develop.md
rename to doc/plugin-develop.md



[incubator-apisix] branch master updated: doc: Fixed some typoes. (#972)

2019-12-13 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 57b69c0  doc: Fixed some typoes. (#972)
57b69c0 is described below

commit 57b69c0e4a455c88c51770ce8f937394735b34f8
Author: agile6v 
AuthorDate: Fri Dec 13 22:59:40 2019 +0800

doc: Fixed some typoes. (#972)
---
 doc/README.md  | 2 +-
 doc/architecture-design.md | 8 +---
 lua/apisix/plugin.lua  | 2 +-
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/doc/README.md b/doc/README.md
index ddfa533..e6b9a30 100644
--- a/doc/README.md
+++ b/doc/README.md
@@ -31,7 +31,7 @@ Reference Documentation
 * [radixtree](router-radixtree.md)
 * [Stand Alone Model](stand-alone.md): Supports to load route rules from local 
yaml file, it is more friendly such as under the kubernetes(k8s).
 * [Stream Proxy](stream-proxy.md)
-* [Admin API](admin-api-cn.md)
+* [Admin API](admin-api.md)
 * [Changelog](../CHANGELOG.md)
 * [Code Style](../CODE_STYLE.md)
 * [FAQ](../FAQ.md)
diff --git a/doc/architecture-design.md b/doc/architecture-design.md
index c225322..f38cf41 100644
--- a/doc/architecture-design.md
+++ b/doc/architecture-design.md
@@ -17,6 +17,8 @@
 #
 -->
 
+[Chinese](architecture-design-cn.md)
+
 ## Table of Contents
 - [**APISIX**](#apisix)
 - [**APISIX Config**](#apisix-config)
@@ -187,7 +189,7 @@ The configuration of the plugin can be directly bound to 
the specified Route, or
 
 A plugin will only be executed once in a single request, even if it is bound 
to multiple different objects (such as Route or Service).
 
-The order in which plugins are run is determined by the priority of the plugin 
itself, for example: [example-plugin](../doc/plugins/example-plugin.lua#L16)。
+The order in which plugins are run is determined by the priority of the plugin 
itself, for example: 
[example-plugin](../lua/apisix/plugins/example-plugin.lua#L37).
 
 The plugin configuration is submitted as part of Route or Service and placed 
under `plugins`. It internally uses the plugin name as the hash's key to hold 
configuration items for different plugins.
 
@@ -208,7 +210,7 @@ The plugin configuration is submitted as part of Route or 
Service and placed und
 
 Not all plugins have specific configuration items. For example, there is no 
specific configuration item under `prometheus`. In this case, an empty object 
identifier can be used.
 
-[APISIX supported plugin list](plugins-cn.md)
+[APISIX supported plugin list](README.md#plugins)
 
 [Back to top](#Table-of-contents)
 
@@ -370,7 +372,7 @@ In APISIX, the process of identifying a Consumer is as 
follows:
 
 
 
-1. Authorization certification: e.g [key-auth](./plugins/key-auth.md), 
[JWT](./plugins/jwt-auth-cn.md), etc.
+1. Authorization certification: e.g [key-auth](./plugins/key-auth.md), 
[JWT](./plugins/jwt-auth.md), etc.
 2. Get consumer_id: By authorization, you can naturally get the corresponding 
Consumer `id`, which is the unique identifier of the Consumer object.
 3. Get the Plugin or Upstream information bound to the Consumer: Complete the 
different configurations for different Consumers.
 
diff --git a/lua/apisix/plugin.lua b/lua/apisix/plugin.lua
index d0e36bc..969ecb1 100644
--- a/lua/apisix/plugin.lua
+++ b/lua/apisix/plugin.lua
@@ -96,7 +96,7 @@ local function load()
 local_conf = core.config.local_conf(true)
 local plugin_names = local_conf.plugins
 if not plugin_names then
-return nil, "failed to read plugin list form local file"
+return nil, "failed to read plugin list from local file"
 end
 
 if local_conf.apisix and local_conf.apisix.enable_heartbeat then



[incubator-apisix] branch master updated (36e814c -> f2bfc13)

2019-12-11 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git.


from 36e814c  Adding twitter social icons (#960)
 add f2bfc13  fix: typo of FAQ (#959)

No new revisions were added by this update.

Summary of changes:
 FAQ.md| 10 +-
 FAQ_CN.md | 10 +-
 2 files changed, 10 insertions(+), 10 deletions(-)



[incubator-apisix] branch master updated: Adding twitter social icons (#960)

2019-12-11 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 36e814c  Adding twitter social icons (#960)
36e814c is described below

commit 36e814c90691172d0422174dfc48366a25da6b7f
Author: Nirojan Selvanathan 
AuthorDate: Thu Dec 12 08:40:43 2019 +0100

Adding twitter social icons (#960)
---
 README.md| 2 +-
 README_CN.md | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 4022f7e..95315c6 100644
--- a/README.md
+++ b/README.md
@@ -25,7 +25,7 @@
 
 - **QQ group**: 552030619
 - Mail list: Mail to dev-subscr...@apisix.apache.org, follow the reply to 
subscribe the mail list.
-- 
[![Twitter](https://img.shields.io/twitter/follow/apisixfast.svg?style=social=Follow)](https://twitter.com/intent/follow?screen_name=apisixfast)
+- ![Twitter 
Follow](https://img.shields.io/twitter/follow/ApacheAPISIX?style=social)
 
 APISIX is a cloud-native microservices API gateway, delivering the ultimate 
performance, security, open source and scalable platform for all your APIs and 
microservices.
 
diff --git a/README_CN.md b/README_CN.md
index d22dfe2..3d62286 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -25,6 +25,7 @@
 
 - **QQ 交流群**: 552030619
 - 邮件列表: 发邮件到 dev-subscr...@apisix.apache.org, 然后跟着回复邮件操作即可。
+- ![Twitter 
Follow](https://img.shields.io/twitter/follow/ApacheAPISIX?style=social)
 
 APISIX 是一个云原生、高性能、可扩展的微服务 API 网关。
 



[incubator-apisix] branch master updated: luarocks: install apisix 0.9 by luarocks. (#934)

2019-12-06 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new a3a591e  luarocks: install apisix 0.9 by luarocks. (#934)
a3a591e is described below

commit a3a591e3a5d58db2bd28da77656579f5b07aa0a0
Author: YuanSheng Wang 
AuthorDate: Fri Dec 6 16:51:56 2019 +0800

luarocks: install apisix 0.9 by luarocks. (#934)
---
 doc/how-to-build-cn.md | 6 +++---
 doc/how-to-build.md| 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/doc/how-to-build-cn.md b/doc/how-to-build-cn.md
index 8d416db..84f7f87 100644
--- a/doc/how-to-build-cn.md
+++ b/doc/how-to-build-cn.md
@@ -61,11 +61,11 @@ sudo sh -c "$(curl -fsSL 
https://raw.githubusercontent.com/apache/incubator-apis
 > 通过 Luarocks 安装指定的版本:
 
 ```shell
-# 安装 apisix 的 0.8 版本
-sudo luarocks install --lua-dir=/path/openresty/luajit apisix 0.8
+# 安装 apisix 的 0.9 版本
+sudo luarocks install --lua-dir=/path/openresty/luajit apisix 0.9
 
 # 老版本 luarocks 可能不支持 `lua-dir` 参数,可以删除该选项
-sudo luarocks install apisix 0.8
+sudo luarocks install apisix 0.9
 ```
 
 ## 3. 管理(启动、关闭等)APISIX 服务
diff --git a/doc/how-to-build.md b/doc/how-to-build.md
index 28c07d9..50d51e9 100644
--- a/doc/how-to-build.md
+++ b/doc/how-to-build.md
@@ -62,11 +62,11 @@ sudo sh -c "$(curl -fsSL 
https://raw.githubusercontent.com/apache/incubator-apis
 > Install the specified version via Luarocks:
 
 ```shell
-# Install version 0.8
-sudo luarocks install --lua-dir=/path/openresty/luajit apisix 0.8
+# Install version 0.9
+sudo luarocks install --lua-dir=/path/openresty/luajit apisix 0.9
 
 # old luarocks not support the `lua-dir` parameter, you can remove this option
-sudo luarocks install apisix 0.8
+sudo luarocks install apisix 0.9
 ```
 
 ## Manage (start/stop) APISIX Server



[incubator-apisix] branch master updated: doc: Update key-auth-cn.md (#947)

2019-12-07 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 56ef702  doc: Update key-auth-cn.md (#947)
56ef702 is described below

commit 56ef702059924a6e21c2e54d9f35a1e66b35e9cf
Author: 琚致远 
AuthorDate: Sun Dec 8 10:20:46 2019 +0800

doc: Update key-auth-cn.md (#947)
---
 doc/plugins/key-auth-cn.md | 2 +-
 doc/plugins/key-auth.md| 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/plugins/key-auth-cn.md b/doc/plugins/key-auth-cn.md
index 3d67b62..93cd7b7 100644
--- a/doc/plugins/key-auth-cn.md
+++ b/doc/plugins/key-auth-cn.md
@@ -84,7 +84,7 @@ curl http://127.0.0.1:9080/apisix/admin/routes/1 -X PUT -d '
 下面是一个正常通过 `key-auth` 验证的请求:
 
 ```shell
-$ curl http://127.0.0.2:9080/index.html -H 'apikey: keykey' -i
+$ curl http://127.0.0.2:9080/index.html -H 'apikey: auth-one' -i
 HTTP/1.1 200 OK
 ...
 ```
diff --git a/doc/plugins/key-auth.md b/doc/plugins/key-auth.md
index 743b9ea..33153ae 100644
--- a/doc/plugins/key-auth.md
+++ b/doc/plugins/key-auth.md
@@ -89,7 +89,7 @@ curl http://127.0.0.1:9080/apisix/admin/routes/1 -X PUT -d '
 Here is a correct test example:
 
 ```shell
-$ curl http://127.0.0.2:9080/index.html -H 'apikey: keykey' -i
+$ curl http://127.0.0.2:9080/index.html -H 'apikey: auth-one' -i
 HTTP/1.1 200 OK
 ...
 ```



[incubator-apisix] branch master updated: doc: Update doc README_CN.md (#866)

2019-12-05 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 2dd63e1  doc: Update doc README_CN.md (#866)
2dd63e1 is described below

commit 2dd63e19d55191b68fdb2cc68acec6eb1db8a8be
Author: linlinnj <57835824+linli...@users.noreply.github.com>
AuthorDate: Thu Dec 5 16:55:19 2019 +0800

doc: Update doc README_CN.md (#866)
---
 doc/README_CN.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/README_CN.md b/doc/README_CN.md
index 2db4eba..810e20d 100644
--- a/doc/README_CN.md
+++ b/doc/README_CN.md
@@ -25,11 +25,11 @@ Reference document
 * [架构设计](architecture-design-cn.md)
 * [压力测试](benchmark-cn.md)
 * [如何构建 Apache APISIX](how-to-build-cn.md)
-* [健康检查](health-check.md): Enable health check on the upstream node, and will 
automatically filter unhealthy nodes during load balancing to ensure system 
stability.
+* [健康检查](health-check.md): 支持对上游节点的主动和被动健康检查,在负载均衡时自动过滤掉不健康的节点。
 * Router(路由)
 * [radixtree](router-radixtree.md)
 * [r3](router-r3.md)
-* [独立运行模型](stand-alone-cn.md): Supports to load route rules from local yaml 
file, it is more friendly such as under the kubernetes(k8s).
+* [独立运行模型](stand-alone-cn.md): 支持从本地 yaml 格式的配置文件启动,更适合 Kubernetes(k8s) 体系。
 * [TCP/UDP 动态代理](stream-proxy-cn.md)
 * [管理 API](admin-api-cn.md)
 * [变更日志](../CHANGELOG_CN.md)



[incubator-apisix] branch master updated: Added the conf/nginx.conf to .gitignore (#974)

2019-12-15 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new af1a29a  Added the conf/nginx.conf to .gitignore (#974)
af1a29a is described below

commit af1a29a38e6c7623fa697ea524832ece76a9cbf6
Author: Kirill 
AuthorDate: Mon Dec 16 03:12:53 2019 +0300

Added the conf/nginx.conf to .gitignore (#974)
---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitignore b/.gitignore
index 60d5294..f65e311 100644
--- a/.gitignore
+++ b/.gitignore
@@ -46,6 +46,7 @@ t/servroot
 go
 \.*
 conf/apisix.uid
+conf/nginx.conf
 deps
 scgi_temp
 uwsgi_temp



[incubator-apisix] branch master updated (4efc120 -> 6f110bf)

2019-10-29 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git.


from 4efc120  optimize: avoid concat string object, and kept source route 
id and se… (#738)
 add 6f110bf  doc: Update jwt-auth.md (#704)

No new revisions were added by this update.

Summary of changes:
 doc/plugins/jwt-auth.md | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)



[incubator-apisix] branch master updated (ce403db -> ecbfa7d)

2019-10-29 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git.


from ce403db  bugfix:zipkin plugin not set tracing data to request header. 
(#715)
 add ecbfa7d  doc: Added Authing into Idp(CN) (#742)

No new revisions were added by this update.

Summary of changes:
 README_CN.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



[incubator-apisix] branch master updated (6f110bf -> ce403db)

2019-10-29 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git.


from 6f110bf  doc: Update jwt-auth.md (#704)
 add ce403db  bugfix:zipkin plugin not set tracing data to request header. 
(#715)

No new revisions were added by this update.

Summary of changes:
 lua/apisix/plugins/zipkin.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



[incubator-apisix] branch master updated (2170fc4 -> de14929)

2019-10-29 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git.


from 2170fc4  doc: Add AWS deployment tutorial link (#740)
 add de14929  bugfix: fix the wrong "method" restriction in plugin's inner 
api.

No new revisions were added by this update.

Summary of changes:
 lua/apisix/plugin.lua  |  2 +-
 t/plugin/jwt-auth.t| 19 +--
 t/plugin/node-status.t |  7 +++
 t/plugin/prometheus.t  | 17 -
 4 files changed, 33 insertions(+), 12 deletions(-)



[incubator-apisix] branch master updated (ecbfa7d -> 2170fc4)

2019-10-29 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git.


from ecbfa7d  doc: Added Authing into Idp(CN) (#742)
 add 2170fc4  doc: Add AWS deployment tutorial link (#740)

No new revisions were added by this update.

Summary of changes:
 README.md | 10 ++
 1 file changed, 10 insertions(+)



[incubator-apisix] branch master updated (c0dfe23 -> 7716416)

2019-10-29 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git.


from c0dfe23  doc: Add `TEST_NGINX_BINARY` environment variables 
description for dev-manual doc.
 add 7716416  doc: change all ` iresty/apisix` link in documents into 
`apache/incubator-apisix` (#754)

No new revisions were added by this update.

Summary of changes:
 .github/PULL_REQUEST_TEMPLATE.md  |  2 +-
 .gitmodules   |  2 +-
 CHANGELOG.md  | 70 +++
 CHANGELOG_CN.md   | 68 ++---
 Contributing.md   |  8 ++---
 FAQ.md|  2 +-
 FAQ_CN.md |  2 +-
 Makefile  |  2 +-
 README.md |  8 ++---
 README_CN.md  |  8 ++---
 doc/powered-by.md |  2 +-
 rockspec/apisix-0.5-0.rockspec|  4 +--
 rockspec/apisix-0.6-0.rockspec|  4 +--
 rockspec/apisix-0.7-0.rockspec|  4 +--
 rockspec/apisix-0.8-0.rockspec|  4 +--
 rockspec/apisix-master-0.rockspec |  4 +--
 utils/install-apisix.sh   |  2 +-
 17 files changed, 98 insertions(+), 98 deletions(-)



[incubator-apisix] branch master updated (de14929 -> c0dfe23)

2019-10-29 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git.


from de14929  bugfix: fix the wrong "method" restriction in plugin's inner 
api.
 add c0dfe23  doc: Add `TEST_NGINX_BINARY` environment variables 
description for dev-manual doc.

No new revisions were added by this update.

Summary of changes:
 doc/dev-manual-cn.md | 4 +++-
 doc/dev-manual.md| 7 ---
 2 files changed, 7 insertions(+), 4 deletions(-)



[incubator-apisix] branch master updated: doc: update users of power by APISIX. (#884)

2019-11-20 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 6bef2e4  doc: update users of power by APISIX. (#884)
6bef2e4 is described below

commit 6bef2e4f51c1773422b4904b9d340bd577a3d353
Author: WenMing 
AuthorDate: Wed Nov 20 19:01:40 2019 +0800

doc: update users of power by APISIX. (#884)
---
 doc/powered-by.md | 18 +-
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/doc/powered-by.md b/doc/powered-by.md
index 84b0e4f..8dde555 100644
--- a/doc/powered-by.md
+++ b/doc/powered-by.md
@@ -24,20 +24,28 @@ or providing commercial products including APISIX.
 
 Users are encouraged to add themselves to this page, 
[issue](https://github.com/apache/incubator-apisix/issues/487) and PR are 
welcomed.
 
+1. chaolian 超链云商 https://www.chaolian360.com/
 1. cunw 湖南新云网 http://www.cunw.com.cn/
+1. dasouche 大搜车 https://www.dasouche.com/
+1. ehomepay 理房通 https://www.ehomepay.com.cn/
 1. fansup.mobi https://fansup.mobi/
+1. haieruplus.com 海尔优家  http://haieruplus.com/
+1. HelloTalk, Inc.  https://www.hellotalk.com/
 1. ke.com 贝壳找房 https://www.ke.com/
 1. Meizu 魅族 https://www.meizu.com/
+1. NASA JPL 美国国家航空航天局 喷气推进实验室 https://www.jpl.nasa.gov
+1. Netease 网易 http://www.163.com
 1. sinovatech 炎黄新星 https://www.sinovatech.com
-1. souche 大搜车 https://www.souche.com/
+1. taikang.com 泰康云   http://taikang.com/
+1. tangdou.com 糖豆网   http://www.tangdou.com/
 1. Tencent Cloud 腾讯云 https://cloud.tencent.com/
+1. Xin 优信二手车 https://www.xin.com/
 1. zuzuche 租租车 https://www.zuzuche.com/
-1. chaolian 超链云商 https://www.chaolian360.com/
-1. HelloTalk, Inc  https://www.hellotalk.com/
-1. tangdou 糖豆网 http://www.tangdou.com
 
 
 # User Cases
+## NASA JPL
+Using Apache APISIX as a API gateway to deal with north-south and east-west 
traffic between microservices.
 
 ## ke.com
 Using APISIX as traffic entry gateway
@@ -51,5 +59,5 @@ Using APISIX as a gateway, it uses the functions of current 
limiting, speed limi
 ## souche.com
 Using APISIX as a Web ACL gateway to deal with backend OA systems traffic.
 
-## HelloTalk, Inc
+## HelloTalk, Inc.
 Using Apache APISIX as an API gateway to manage all API and SSL certificates 
in test\dev\CMS environment.



[incubator-apisix] branch master updated: bugfix: avoid a useless redirect when access `/apisix/dashboard`. (#886)

2019-11-20 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 2c57621  bugfix: avoid a useless redirect when access 
`/apisix/dashboard`. (#886)
2c57621 is described below

commit 2c57621f23549f6f5fb46567e14e23b1ab2be0de
Author: YuanSheng Wang 
AuthorDate: Wed Nov 20 19:01:59 2019 +0800

bugfix: avoid a useless redirect when access `/apisix/dashboard`. (#886)
---
 bin/apisix  | 14 +-
 conf/nginx.conf |  6 ++
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/bin/apisix b/bin/apisix
index 6cdaaf0..bde9135 100755
--- a/bin/apisix
+++ b/bin/apisix
@@ -234,7 +234,13 @@ http {
 }
 }
 
-location /apisix/dashboard {
+location = /apisix/dashboard {
+content_by_lua_block {
+ngx.exec("/apisix/dashboard/")
+}
+}
+
+location /apisix/dashboard/ {
 index index.html;
 {%if allow_admin then%}
 {% for _, allow_ip in ipairs(allow_admin) do %}
@@ -298,6 +304,12 @@ http {
 }
 }
 
+location = /apisix/dashboard {
+content_by_lua_block {
+ngx.exec("/apisix/dashboard/")
+}
+}
+
 location /apisix/dashboard {
 index index.html;
 {%if allow_admin then%}
diff --git a/conf/nginx.conf b/conf/nginx.conf
index 6c09ab2..6014bba 100644
--- a/conf/nginx.conf
+++ b/conf/nginx.conf
@@ -124,6 +124,12 @@ http {
 }
 }
 
+location = /apisix/dashboard {
+content_by_lua_block {
+ngx.exec("/apisix/dashboard/")
+}
+}
+
 location /apisix/dashboard {
 index index.html;
 



[incubator-apisix] branch master updated: bugfix: fixed install deps in makefile. (#904)

2019-11-26 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new a9888b3  bugfix: fixed install deps in makefile. (#904)
a9888b3 is described below

commit a9888b333a053683dd9f205d71bfce89ac977c20
Author: WenMing 
AuthorDate: Tue Nov 26 21:24:45 2019 +0800

bugfix: fixed install deps in makefile. (#904)
---
 .travis/linux_openresty_runner.sh |  2 +-
 .travis/linux_tengine_runner.sh   |  2 --
 Makefile  |  7 --
 README.md | 44 
 README_CN.md  | 47 ---
 lua/apisix/core/version.lua   |  2 +-
 6 files changed, 71 insertions(+), 33 deletions(-)

diff --git a/.travis/linux_openresty_runner.sh 
b/.travis/linux_openresty_runner.sh
index 251b288..9035252 100755
--- a/.travis/linux_openresty_runner.sh
+++ b/.travis/linux_openresty_runner.sh
@@ -23,7 +23,7 @@ export_or_prefix() {
 }
 
 create_lua_deps() {
-WITHOUT_DASHBOARD=1 sudo luarocks make 
--lua-dir=${OPENRESTY_PREFIX}/luajit rockspec/apisix-master-0.rockspec 
--tree=deps --only-deps --local
+sudo luarocks make --lua-dir=${OPENRESTY_PREFIX}/luajit 
rockspec/apisix-master-0.rockspec --tree=deps --only-deps --local
 echo "Create lua deps cache"
 sudo rm -rf build-cache/deps
 sudo cp -r deps build-cache/
diff --git a/.travis/linux_tengine_runner.sh b/.travis/linux_tengine_runner.sh
index a058667..c7742bd 100755
--- a/.travis/linux_tengine_runner.sh
+++ b/.travis/linux_tengine_runner.sh
@@ -24,7 +24,6 @@ export_or_prefix() {
 
 create_lua_deps() {
 sudo luarocks make --lua-dir=${OPENRESTY_PREFIX}/luajit 
rockspec/apisix-master-0.rockspec --tree=deps --only-deps --local
-sudo luarocks install --lua-dir=${OPENRESTY_PREFIX}/luajit lua-resty-libr3 
--tree=deps --local
 echo "Create lua deps cache"
 sudo rm -rf build-cache/deps
 sudo cp -r deps build-cache/
@@ -132,7 +131,6 @@ tengine_install() {
 do_install() {
 export_or_prefix
 
-wget -qO - https://openresty.org/package/pubkey.gpg | sudo apt-key add -
 sudo apt-get -y update --fix-missing
 sudo apt-get -y install software-properties-common
 sudo add-apt-repository -y ppa:longsleep/golang-backports
diff --git a/Makefile b/Makefile
index f5ae8e0..074e389 100644
--- a/Makefile
+++ b/Makefile
@@ -28,14 +28,17 @@ LUAROCKS_VER ?= $(shell luarocks --version | grep -E -o  
"luarocks [0-9]+.")
 .PHONY: default
 default:
 ifeq ($(OR_EXEC), )
-   @echo "OpenResty not found. You have to install OpenResty and add the 
binary file to PATH before install Apache APISIX."
+ifeq ("$(wildcard /usr/local/openresty-debug/bin/openresty)", "")
+   @echo "ERROR: OpenResty not found. You have to install OpenResty and 
add the binary file to PATH before install Apache APISIX."
exit 1
 endif
+endif
 
+LUTJIT_DIR ?= $(shell ${OR_EXEC} -V 2>&1 | grep prefix | grep -Eo 
'prefix=(.*?)/nginx' | grep -Eo '/.*/')luajit
 
 ### help: Show Makefile rules.
 .PHONY: help
-help:
+help: default
@echo Makefile rules:
@echo
@grep -E '^### [-A-Za-z0-9_]+:' Makefile | sed 's/###/   /'
diff --git a/README.md b/README.md
index 342c3b3..b3b2460 100644
--- a/README.md
+++ b/README.md
@@ -84,9 +84,6 @@ For more detailed information, see the [White 
Paper](https://www.iresty.com/down
 - **[TCP/UDP Proxy](doc/stream-proxy.md)**: Dynamic TCP/UDP proxy.
 - **[Dynamic MQTT Proxy](doc/plugins/mqtt-proxy.md)**: Supports to load 
balance MQTT by `client_id`, both support MQTT 
[3.1.*](http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html), 
[5.0](https://docs.oasis-open.org/mqtt/mqtt/v5.0/mqtt-v5.0.html).
 
-## Online Demo Dashboard
-We provide an online dashboard [demo version](http://apisix.iresty.com), make 
it easier for you to understand APISIX.
-
 ## Installation
 
 APISIX Installed and tested in the following systems(OpenResty MUST >= 
1.15.8.1, or Tengine >= 2.3.2):
@@ -117,13 +114,28 @@ you can follow the [documentation of limit 
count](doc/plugins/limit-count.md).
 Then you can try more [plugins](doc/README.md#plugins).
 
 ## Dashboard
+APISIX has built-in support for dashboards, as follows:
+
+- Download the source code of [dashboard] 
(https://github.com/apache/incubator-apisix-dashboard):
+```
+git clone https://github.com/apache/incubator-apisix-dashboard.git
+```
 
-APISIX has the built-in dashboard,open 
`http://127.0.0.1:9080/apisix/dashboard/` with a browser and try it.
+- Install dependencies and compile
+```
+yarn install
+yarn run build: prod
+```
 
+- Integration with APISIX
+Copy the compiled files to the apisix / dashboard directory,
+open `http://127.0.0.1:9080/apisix/dashboard/` with a browser and try

[incubator-apisix-website] 01/01: add user wall.

2019-11-26 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch user-wall
in repository https://gitbox.apache.org/repos/asf/incubator-apisix-website.git

commit 11c91191033f46516c833552809dcb143f8fc82f
Author: WenMing 
AuthorDate: Tue Nov 26 21:55:14 2019 +0800

add user wall.
---
 config.yaml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/config.yaml b/config.yaml
index dc8fb59..512de76 100644
--- a/config.yaml
+++ b/config.yaml
@@ -54,7 +54,7 @@ languages:
   text: Supports http to gRPC transcoding, supports websocket, gRPC, 
Dubbo, MQTT proxy, and supports multiple platforms including ARM64.
   section3:
 title: Who Uses Apache APISIX?
-image: 
https://raw.githubusercontent.com/apache/incubator-apisix/master/doc/images/user-wall.jpg
+image: 
https://raw.githubusercontent.com/iresty/iresty.com/master/user-wall.jpg
   section5: true
   footer:
 quicklinks:
@@ -128,7 +128,7 @@ languages:
 text: 支持 http 到 gRPC 的协议转换,支持 websocket、gRPC、Dubbo、MQTT 的代理,支持包括 ARM64 
在内的多种平台
 section3:
   title: 谁在使用 Apache APISIX?
-  image: 
https://raw.githubusercontent.com/apache/incubator-apisix/master/doc/images/user-wall.jpg
+  image: 
https://raw.githubusercontent.com/iresty/iresty.com/master/user-wall.jpg
 section5: true
 footer:
   quicklinks:



[incubator-apisix-website] branch user-wall created (now 11c9119)

2019-11-26 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch user-wall
in repository https://gitbox.apache.org/repos/asf/incubator-apisix-website.git.


  at 11c9119  add user wall.

This branch includes the following new commits:

 new 11c9119  add user wall.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[incubator-apisix-website] branch master updated: add user wall. (#11)

2019-11-26 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix-website.git


The following commit(s) were added to refs/heads/master by this push:
 new a0b11fd  add user wall. (#11)
a0b11fd is described below

commit a0b11fdd5708799f5f57cf95a6a959ffa8cd680e
Author: WenMing 
AuthorDate: Tue Nov 26 21:57:45 2019 +0800

add user wall. (#11)
---
 config.yaml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/config.yaml b/config.yaml
index dc8fb59..512de76 100644
--- a/config.yaml
+++ b/config.yaml
@@ -54,7 +54,7 @@ languages:
   text: Supports http to gRPC transcoding, supports websocket, gRPC, 
Dubbo, MQTT proxy, and supports multiple platforms including ARM64.
   section3:
 title: Who Uses Apache APISIX?
-image: 
https://raw.githubusercontent.com/apache/incubator-apisix/master/doc/images/user-wall.jpg
+image: 
https://raw.githubusercontent.com/iresty/iresty.com/master/user-wall.jpg
   section5: true
   footer:
 quicklinks:
@@ -128,7 +128,7 @@ languages:
 text: 支持 http 到 gRPC 的协议转换,支持 websocket、gRPC、Dubbo、MQTT 的代理,支持包括 ARM64 
在内的多种平台
 section3:
   title: 谁在使用 Apache APISIX?
-  image: 
https://raw.githubusercontent.com/apache/incubator-apisix/master/doc/images/user-wall.jpg
+  image: 
https://raw.githubusercontent.com/iresty/iresty.com/master/user-wall.jpg
 section5: true
 footer:
   quicklinks:



[incubator-apisix] branch v0.9 updated (fdfaeff -> e8fc365)

2019-11-24 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch v0.9
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git.


from fdfaeff  change: avoid duplicate code. (#877)
 add e8fc365  fixed code style pf doc.

No new revisions were added by this update.

Summary of changes:
 CHANGELOG.md| 28 ++--
 CHANGELOG_CN.md | 28 ++--
 2 files changed, 28 insertions(+), 28 deletions(-)



[incubator-apisix] branch v0.9 updated (6de220d -> fdfaeff)

2019-11-24 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch v0.9
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git.


 discard 6de220d  change: avoid duplicate code. (#877)
omit a7bf0a7  doc: fixed wrong dir of source code. (#861)
omit a73fb33  doc: add doc for install from source RC. (#859)
omit a77dbe1  license: removed dashboard and logos. (#858)
 add 77ad662  bugfix(radixtree_host_uri): match priority, host > uri. (#817)
 add 51d87c0  doc: updated install-dependencies.md (#867)
 add 722e42f  optimization(proxy-rewrite): performance upgrade for 
proxy-rewrite by avoid luajit NYI (#872)
 add c7bac03  doc: fix typo in README_CN.md (#874)
 add 6bef2e4  doc: update users of power by APISIX. (#884)
 add 2c57621  bugfix: avoid a useless redirect when access 
`/apisix/dashboard`. (#886)
 add 227eeae  Split check target into lint & license-check targets in 
Makefile. (#887)
 add fbb51dd  plugin: implement plugin `response rewrite`
 add a3f06de  doc: fix error in limit-conn.md (#890)
 add 01dc41c  bugfix: fetch the current log level when needs. (#885)
 add 24d1190  doc: fixed some typo and update content. (#895)
 add 7443133  Resolve #882 and simplify conf (#894)
 add 31f18f1  license: removed dashboard and logos. (#858)
 add 956101d  doc: add doc for install from source RC. (#859)
 add 3670096  doc: fixed wrong dir of source code. (#861)
 add fdfaeff  change: avoid duplicate code. (#877)

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (6de220d)
\
 N -- N -- N   refs/heads/v0.9 (fdfaeff)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:
 .travis/linux_openresty_runner.sh  |   2 +-
 .travis/linux_tengine_runner.sh|   2 +-
 Makefile   |  49 +--
 README.md  |   3 +-
 README_CN.md   |   1 +
 bin/apisix |  14 +-
 conf/config.yaml   |   1 +
 conf/nginx.conf|   7 +-
 doc/README.md  |   9 +-
 doc/README_CN.md   |   1 +
 doc/benchmark.md   |   2 +-
 doc/how-to-build-cn.md |  23 +-
 doc/how-to-build.md|  23 +-
 doc/https.md   |   2 +-
 doc/install-dependencies.md|   1 +
 doc/plugins.md |   2 +-
 doc/plugins/grpc-transcoding.md|  23 +-
 doc/plugins/ip-restriction.md  |  12 +-
 doc/plugins/jwt-auth.md|  14 +-
 doc/plugins/key-auth.md|   7 +-
 doc/plugins/limit-conn.md  |  37 ++-
 doc/plugins/limit-count.md |  27 +-
 doc/plugins/limit-req.md   |  31 +-
 doc/plugins/prometheus.md  |   2 +-
 doc/plugins/proxy-rewrite.md   |  33 +-
 doc/plugins/redirect.md|  25 +-
 doc/plugins/response-rewrite-cn.md |  82 +
 doc/plugins/response-rewrite.md| 109 +++
 doc/plugins/serverless.md  |  35 +-
 doc/plugins/zipkin.md  |   9 +-
 doc/powered-by.md  |  12 +-
 doc/stand-alone.md |   2 +-
 doc/stream-proxy.md|   2 +-
 lua/apisix/core/log.lua|  70 ++--
 lua/apisix/http/router/radixtree_host_uri.lua  | 124 +++
 lua/apisix/plugins/proxy-rewrite.lua   |  28 +-
 lua/apisix/plugins/response-rewrite.lua| 115 +++
 lua/apisix/schema_def.lua  |   3 +-
 t/admin/plugins.t  |   2 +-
 t/core/{json.t => log.t}   | 116 ---
 t/debug/debug-mode.t   |   1 +
 t/lib/server.lua   |   9 +
 t/plugin/response-rewrite.t| 356 +
 .

[incubator-apisix] branch master updated: bug: fixed bug when no valid upstream node. (#893)

2019-11-25 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 70d3f0b  bug: fixed bug when no valid upstream node. (#893)
70d3f0b is described below

commit 70d3f0b608b178798e846c1fab867566720e0df0
Author: YuanSheng Wang 
AuthorDate: Mon Nov 25 16:46:20 2019 +0800

bug: fixed bug when no valid upstream node. (#893)
---
 lua/apisix/balancer.lua |  3 ++-
 t/node/chash-balance.t  | 70 ++---
 2 files changed, 68 insertions(+), 5 deletions(-)

diff --git a/lua/apisix/balancer.lua b/lua/apisix/balancer.lua
index 01cb0f5..6d37426 100644
--- a/lua/apisix/balancer.lua
+++ b/lua/apisix/balancer.lua
@@ -240,7 +240,8 @@ local function pick_server(route, ctx)
 
 local server, err = server_picker.get(ctx)
 if not server then
-return nil, nil, "failed to find valid upstream server" .. err
+err = err or "no valid upstream node"
+return nil, nil, "failed to find valid upstream server, " .. err
 end
 
 if up_conf.timeout then
diff --git a/t/node/chash-balance.t b/t/node/chash-balance.t
index 247fc37..dd24e69 100644
--- a/t/node/chash-balance.t
+++ b/t/node/chash-balance.t
@@ -321,8 +321,8 @@ passed
 return
 end
 ports_count[res.body] = (ports_count[res.body] or 0) + 1
-end 
- 
+end
+
 local ports_arr = {}
 for port, count in pairs(ports_count) do
 table.insert(ports_arr, {port = port, count = count})
@@ -399,8 +399,8 @@ passed
 return
 end
 ports_count[res.body] = (ports_count[res.body] or 0) + 1
-end 
- 
+end
+
 local ports_arr = {}
 for port, count in pairs(ports_count) do
 table.insert(ports_arr, {port = port, count = count})
@@ -421,3 +421,65 @@ GET /t
 [{"count":5,"port":"1982"},{"count":7,"port":"1981"},{"count":6,"port":"1980"}]
 --- no_error_log
 [error]
+
+
+
+=== TEST 11: set route(weight 0)
+--- config
+location /t {
+content_by_lua_block {
+local t = require("lib.test_admin").test
+local code, body = t('/apisix/admin/routes/1',
+ ngx.HTTP_PUT,
+ [[{
+"uri": "/server_port",
+"upstream": {
+"key": "arg_device_id",
+"type": "chash",
+"nodes": {
+"127.0.0.1:1980": 0,
+"127.0.0.1:1981": 0
+}
+}
+}]]
+)
+
+if code >= 300 then
+ngx.status = code
+end
+ngx.say(body)
+}
+}
+--- request
+GET /t
+--- response_body
+passed
+--- no_error_log
+[error]
+
+
+
+=== TEST 12: hit routes
+--- config
+location /t {
+content_by_lua_block {
+local http = require "resty.http"
+local uri = "http://127.0.0.1:; .. ngx.var.server_port
+.. "/server_port?device_id=1"
+
+local httpc = http.new()
+local res, err = httpc:request_uri(uri, {method = "GET"})
+if not res then
+ngx.say(err)
+return
+end
+
+ngx.status = res.status
+ngx.say(res.body)
+}
+}
+--- request
+GET /t
+--- error_code_like: ^(?:50\d)$
+--- error_log
+failed to find valid upstream server, no valid upstream node



[incubator-apisix] branch master updated: release: the first Apache release of APISIX. (#896)

2019-11-24 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 03b2ffa  release: the first Apache release of APISIX. (#896)
03b2ffa is described below

commit 03b2ffa1c1c5734609f6dfd99a8a153bc7020a3f
Author: WenMing 
AuthorDate: Mon Nov 25 13:09:32 2019 +0800

release: the first Apache release of APISIX. (#896)
---
 CHANGELOG.md   |  29 ++--
 CHANGELOG_CN.md|  29 ++--
 CODE_OF_CONDUCT.md |  95 -
 Makefile   |  35 ++---
 README.md  | 154 +
 README_CN.md   | 134 --
 dashboard  |   1 -
 doc/README.md  |  12 +-
 doc/README_CN.md   |   3 +-
 doc/{dev-manual-cn.md => how-to-build-cn.md}   |  90 +---
 doc/{dev-manual.md => how-to-build.md} |  88 +---
 doc/images/cncf-landscope.jpg  | Bin 271344 -> 0 bytes
 doc/images/plugin/jwt-auth-1.png   | Bin 45338 -> 38204 bytes
 doc/images/plugin/jwt-auth-2.png   | Bin 77545 -> 227769 bytes
 doc/images/plugin/key-auth-1.png   | Bin 45338 -> 37526 bytes
 doc/images/plugin/key-auth-2.png   | Bin 65698 -> 182157 bytes
 doc/images/plugin/limit-conn-1.png | Bin 65883 -> 72052 bytes
 doc/images/plugin/limit-conn-2.png | Bin 96260 -> 325773 bytes
 doc/images/plugin/limit-count-1.png| Bin 142664 -> 74547 bytes
 doc/images/plugin/limit-count-2.png| Bin 126497 -> 119480 bytes
 doc/images/plugin/limit-req-1.png  | Bin 66804 -> 70315 bytes
 doc/images/plugin/limit-req-2.png  | Bin 91552 -> 289197 bytes
 doc/images/plugin/prometheus-1.png | Bin 64314 -> 67980 bytes
 doc/images/plugin/prometheus-2.png | Bin 83369 -> 237119 bytes
 doc/images/plugin/zipkin-1.jpg | Bin 272972 -> 247284 bytes
 doc/images/plugin/zipkin-1.png | Bin 69668 -> 77813 bytes
 doc/images/plugin/zipkin-2.jpg | Bin 168128 -> 117181 bytes
 doc/images/plugin/zipkin-2.png | Bin 89437 -> 277580 bytes
 doc/images/user-wall.jpg   | Bin 187855 -> 0 bytes
 doc/install-dependencies.md|  10 +-
 doc/powered-by.md  |   2 +-
 ...isix-0.9-rc1.rockspec => apisix-0.9-0.rockspec} |   5 +-
 32 files changed, 201 insertions(+), 486 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 851eba9..fc4cc9c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,14 +19,13 @@
 
 # Table of Contents
 
-- [0.9.0-RC1](#090-rc1)
+- [0.9.0](#090)
 - [0.8.0](#080)
 - [0.7.0](#070)
 - [0.6.0](#060)
 
 
-## 0.9.0-RC1
-> Released on 2019/11/11
+## 0.9.0
 
 This release brings many new features, such as support for running APISIX with 
Tengine,
 an advanced debugging mode that is more developer friendly, and a new URI 
redirection plugin.
@@ -39,24 +38,24 @@ an advanced debugging mode that is more developer friendly, 
and a new URI redire
 - Removed router R3 [#725](https://github.com/apache/incubator-apisix/pull/725)
 
 ### Plugins
-- [Redirect 
URI](https://github.com/apache/incubator-apisix/blob/master/doc/plugins/redirect.md):【New
 Plugin】Redirect URI plugin. 
[#732](https://github.com/apache/incubator-apisix/pull/732)
-- [Proxy 
Rewrite](https://github.com/apache/incubator-apisix/blob/master/doc/plugins/proxy-rewrite.md):【New
 Feature】Supported remove `header` feature. 
[#658](https://github.com/apache/incubator-apisix/pull/658)
-- [Limit 
Count](https://github.com/apache/incubator-apisix/blob/master/doc/plugins/limit-count.md):【New
 Feature】Supported global limit count with `Redis 
Server`.[#624](https://github.com/apache/incubator-apisix/pull/624)
+- [Redirect 
URI](https://github.com/apache/incubator-apisix/blob/master/doc/plugins/redirect.md):
 Redirect URI plugin. 
[#732](https://github.com/apache/incubator-apisix/pull/732)
+- [Proxy 
Rewrite](https://github.com/apache/incubator-apisix/blob/master/doc/plugins/proxy-rewrite.md):
 Supported remove `header` feature. 
[#658](https://github.com/apache/incubator-apisix/pull/658)
+- [Limit 
Count](https://github.com/apache/incubator-apisix/blob/master/doc/plugins/limit-count.md):
 Supported global limit count with `Redis 
Server`.[#624](https://github.com/apache/incubator-apisix/pull/624)
 
 ### lua-resty-*
 - lua-resty-radixtree
-- 【New Feature】Support for `ho

[incubator-apisix] branch master updated: change: used `lua-resty-prometheus` which the API is simpler. (#806)

2019-11-25 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 670655d  change: used `lua-resty-prometheus` which the API is simpler. 
(#806)
670655d is described below

commit 670655d62df3b215e86ad1ea1f81abde2627580b
Author: YuanSheng Wang 
AuthorDate: Mon Nov 25 16:53:08 2019 +0800

change: used `lua-resty-prometheus` which the API is simpler. (#806)
---
 lua/apisix/plugins/prometheus/exporter.lua | 32 +-
 rockspec/apisix-master-0.rockspec  |  2 +-
 2 files changed, 15 insertions(+), 19 deletions(-)

diff --git a/lua/apisix/plugins/prometheus/exporter.lua 
b/lua/apisix/plugins/prometheus/exporter.lua
index 97dbcb4..6331d82 100644
--- a/lua/apisix/plugins/prometheus/exporter.lua
+++ b/lua/apisix/plugins/prometheus/exporter.lua
@@ -14,7 +14,7 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
-local base_prometheus = require("nginx.prometheus")
+local base_prometheus = require("resty.prometheus")
 local core  = require("apisix.core")
 local ipairs= ipairs
 local ngx_capture = ngx.location.capture
@@ -27,10 +27,9 @@ local DEFAULT_BUCKETS = { 1, 2, 5, 7, 10, 15, 20, 25, 30, 
40, 50, 60, 70,
 2000, 5000, 1, 3, 6 }
 
 local metrics = {}
-local tmp_tab = {}
 
 
-local _M = {version = 0.2}
+local _M = {version = 0.3}
 
 
 function _M.init()
@@ -61,27 +60,27 @@ end
 
 
 function _M.log(conf, ctx)
-core.table.clear(tmp_tab)
+local vars = ctx.var
 
 local service_name
 if ctx.matched_route and ctx.matched_route.value then
-service_name = ctx.matched_route.value.desc or 
ctx.matched_route.value.id
+service_name = ctx.matched_route.value.desc or
+   ctx.matched_route.value.id
+else
+service_name = vars.host
 end
 
 local balancer_ip = ctx.balancer_ip
-core.table.set(tmp_tab, ctx.var.status, service_name, balancer_ip)
-metrics.status:inc(1, tmp_tab)
+metrics.status:inc(1, vars.status, service_name, balancer_ip)
 
 local latency = (ngx.now() - ngx.req.start_time()) * 1000
-tmp_tab[1] = "request"
-metrics.latency:observe(latency, tmp_tab)
-
-tmp_tab[1] = "ingress"
-metrics.bandwidth:inc(ctx.var.request_length, tmp_tab)
+metrics.latency:observe(latency, "request", service_name, balancer_ip)
 
-tmp_tab[1] = "egress"
-metrics.bandwidth:inc(ctx.var.bytes_sent, tmp_tab)
+metrics.bandwidth:inc(vars.request_length, "ingress", service_name,
+  balancer_ip)
 
+metrics.bandwidth:inc(vars.bytes_sent, "egress", service_name,
+  balancer_ip)
 end
 
 
@@ -105,15 +104,13 @@ local function nginx_status()
 return
 end
 
-core.table.clear(tmp_tab)
 for _, name in ipairs(ngx_statu_items) do
 local val = iterator()
 if not val then
 break
 end
 
-tmp_tab[1] = name
-metrics.connections:set(val[0], tmp_tab)
+metrics.connections:set(val[0], name)
 end
 end
 
@@ -141,7 +138,6 @@ function _M.collect()
 end
 
 core.response.set_header("content_type", "text/plain")
-
 return 200, core.table.concat(prometheus:metric_data())
 end
 
diff --git a/rockspec/apisix-master-0.rockspec 
b/rockspec/apisix-master-0.rockspec
index a4f5a0c..4ed756e 100644
--- a/rockspec/apisix-master-0.rockspec
+++ b/rockspec/apisix-master-0.rockspec
@@ -45,7 +45,7 @@ dependencies = {
 "lua-resty-openidc = 1.7.2-1",
 "luafilesystem = 1.7.0-2",
 "lua-tinyyaml = 0.1",
-"iresty-nginx-lua-prometheus = 0.20190917",
+"lua-resty-prometheus = 1.0",
 "jsonschema = 0.4",
 "lua-resty-ipmatcher = 0.3",
 }



[incubator-apisix] branch master updated: doc: add doc for how to write plugin.(#909)

2019-11-26 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new f76fcec  doc: add doc for how to write plugin.(#909)
f76fcec is described below

commit f76fcec57f2c9370e7b7ee6e56dd23dfd4070ba7
Author: coolsoul 
AuthorDate: Wed Nov 27 13:56:49 2019 +0800

doc: add doc for how to write plugin.(#909)
---
 FAQ.md   |   2 +
 FAQ_CN.md|   2 +
 doc/plugins/plugin-develop-cn.md | 183 +
 doc/plugins/plugin-develop.md| 191 +++
 4 files changed, 378 insertions(+)

diff --git a/FAQ.md b/FAQ.md
index a0e6b82..1f1ae17 100644
--- a/FAQ.md
+++ b/FAQ.md
@@ -45,6 +45,8 @@ Yes, in version 0.6 we have dashboard built in, you can 
operate APISIX through t
 
 Of course, APISIX provides flexible custom plugins for developers and 
businesses to write their own logic.
 
+[How to write plugin](doc/plugins/plugin-develop.md)
+
 ## Why we choose etcd as the configuration center?
 
 For the configuration center, configuration storage is only the most basic 
function, and APISIX also needs the following features:
diff --git a/FAQ_CN.md b/FAQ_CN.md
index e1cf4d0..6832c2c 100644
--- a/FAQ_CN.md
+++ b/FAQ_CN.md
@@ -45,6 +45,8 @@ APISIX 是当前性能最好的 API 网关,单核 QPS 达到 2.3 万,平均
 
 当然可以,APISIX 提供了灵活的自定义插件,方便开发者和企业编写自己的逻辑。
 
+[如何开发插件](doc/plugins/plugin-develop-cn.md)
+
 ## 我们为什么选择 etcd 作为配置中心?
 
 对于配置中心,配置存储只是最基本功能,APISIX 还需要下面几个特性:
diff --git a/doc/plugins/plugin-develop-cn.md b/doc/plugins/plugin-develop-cn.md
new file mode 100644
index 000..6bf6a9d
--- /dev/null
+++ b/doc/plugins/plugin-develop-cn.md
@@ -0,0 +1,183 @@
+
+[English](plugin-develop.md)
+
+# 目录
+- [**检查外部依赖**](#检查外部依赖)
+- [**插件命名与配置**](#插件命名与配置)
+- [**配置描述与校验**](#配置描述与校验)
+- [**确定执行阶段**](#确定执行阶段)
+- [**编写执行逻辑**](#编写执行逻辑)
+- [**编写测试用例**](#编写测试用例)
+
+
+## 检查外部依赖
+
+如果你的插件,涉及到一些外部的依赖和三方库,请首先检查一下依赖项的内容。 如果插件需要用到共享内存,需要在 __bin/apisix__ 文
+件里面进行申明,例如:
+
+```nginx
+lua_shared_dict plugin-limit-req 10m;
+lua_shared_dict plugin-limit-count   10m;
+lua_shared_dict prometheus-metrics   10m;
+lua_shared_dict plugin-limit-conn10m;
+lua_shared_dict upstream-healthcheck 10m;
+lua_shared_dict worker-events10m;
+
+# for openid-connect plugin
+lua_shared_dict discovery 1m; # cache for discovery metadata 
documents
+lua_shared_dict jwks  1m; # cache for JWKs
+lua_shared_dict introspection10m; # cache for JWT verification 
results
+```
+
+插件本身提供了 init 方法。方便插件加载后做初始化动作。
+
+注:如果部分插件的功能实现,需要在 Nginx 初始化启动,则可能需要在 __lua/apisix.lua__ 文件的初始化方法 http_init 
中添加逻辑,并且
+可能需要在 __bin/apisix__ 文件中,对 Nginx 配置文件生成的部分,添加一些你需要的处理。但是这样容易对全局产生影响,根据现有的
+插件机制,我们不建议这样做,除非你已经对代码完全掌握。
+
+## 插件命名与配置
+
+给插件取一个很棒的名字,确定插件的加载优先级,然后在 __conf/config.yaml__ 文件中添加上你的插件名。例如 key-auth 这个插件,
+需要在代码里指定插件名称(名称是插件的唯一标识,不可重名),在 __lua/apisix/plugins/key-auth.lua__ 文件中可以看到:
+
+```lua
+   local plugin_name = "key-auth"
+
+   local _M = {
+   version = 0.1,
+   priority = 2500,
+   type = 'auth',
+   name = plugin_name,
+   schema = schema,
+   }
+```
+
+注:新插件的优先级( priority 属性 )不能与现有插件的优先级相同。
+
+在 __conf/config.yaml__ 配置文件中,列出了启用的插件(都是以插件名指定的):
+
+```yaml
+plugins:  # plugin list
+  - example-plugin
+  - limit-req
+  - limit-count
+  - limit-conn
+  - key-auth
+  - prometheus
+  - node-status
+  - jwt-auth
+  - zipkin
+  - ip-restriction
+  - grpc-transcode
+  - serverless-pre-function
+  - serverless-post-function
+  - openid-connect
+  - proxy-rewrite
+  - redirect
+```
+
+注:先后顺序与执行顺序无关。
+
+## 配置描述与校验
+
+定义插件的配置项,以及对应的 [Json Schema](https://json-schema.org) 描述,并完成对 json 
的校验,这样方便对配置的数据规
+格进行验证,以确保数据的完整性以及程序的健壮性。同样,我们以 key-auth 插件为例,看看他的配置数据:
+
+```json
+ "key-auth" : {
+   "key" : "auth-one"
+  }
+```
+
+插件的配置数据比较简单,只支持一个命名为 key 的属性,那么我们看下他的 Schema 描述:
+
+```lua
+   local schema = {
+   type = "object",
+   properties = {
+   key = {type = "string"},
+   }
+   }
+```
+
+同时,需要实现 __check_schema(conf)__ 方法,完成配置参数的合法性校验。
+
+```lua
+   function _M.check_schema(conf)
+   return core.schema.check(schema, conf)
+   end
+```
+
+注:项目已经提供了 __core.schema.check__ 公共方法,直接使用即可完成配置参数校验。
+
+## 确定执行阶段
+
+根据业务功能,确定你的插件需要在哪个阶段执行。 key-auth 是一个认证插件,只要在请求进来之后业务响应之前完成认证即可。
+该插件在 rewrite 、access 阶段执行都可以,项目中是用 rewrite 阶段执行认证逻辑,一般 IP 准入、接口权限是在 access 阶段
+完成的。
+
+## 编写执行逻辑
+
+在对应的阶段方法里编写功能的逻辑代码。
+
+## 编写测试用例
+
+针对功能,完善各种维度的测试用例,对插件做个全方位的测试吧!插件的测试用例,都在 __t/plugin__ 目录下,可以前去了解。
+项目测试框架采用的 [test-nginx](https://github.com/openresty/test-nginx)  。
+一个测试用例 __.t__ 文件,通常用 \__DATA\__ 分割成 序言部分 和 数据部分。这里我们简单介绍下数据部分,
+也就是真正测试用例的部分,仍然以 key-auth 插件为例:
+
+```perl
+=== TEST 1: sanity
+--- config
+location /t {
+  

[incubator-apisix] branch master updated: test: removed temporary data. (#829)

2019-11-26 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 536f547  test: removed temporary data. (#829)
536f547 is described below

commit 536f547df8b3a2457dfa73a18b7805caa55567c8
Author: YuanSheng Wang 
AuthorDate: Wed Nov 27 10:05:06 2019 +0800

test: removed temporary data. (#829)
---
 t/node/upstream-domain.t | 56 
 1 file changed, 56 insertions(+)

diff --git a/t/node/upstream-domain.t b/t/node/upstream-domain.t
index 5f15aa7..ca03a63 100644
--- a/t/node/upstream-domain.t
+++ b/t/node/upstream-domain.t
@@ -106,3 +106,59 @@ hello world
 [error]
 --- error_log eval
 qr/dns resolver domain: baidu.com to \d+.\d+.\d+.\d+/
+
+
+
+=== TEST 5: delete route
+--- config
+location /t {
+content_by_lua_block {
+ngx.sleep(0.3)
+
+local t = require("lib.test_admin").test
+local code, body = t('/apisix/admin/routes/1',
+ngx.HTTP_DELETE,
+nil,
+[[{"action": "delete"}]]
+)
+
+if code >= 300 then
+ngx.status = code
+end
+ngx.say(body)
+}
+}
+--- request
+GET /t
+--- response_body
+passed
+--- no_error_log
+[error]
+
+
+
+=== TEST 6: delete upstream
+--- config
+location /t {
+content_by_lua_block {
+ngx.sleep(0.3)
+
+local t = require("lib.test_admin").test
+local code, body = t('/apisix/admin/upstreams/1',
+ngx.HTTP_DELETE,
+nil,
+[[{"action": "delete"}]]
+)
+
+if code >= 300 then
+ngx.status = code
+end
+ngx.say(body)
+}
+}
+--- request
+GET /t
+--- response_body
+passed
+--- no_error_log
+[error]



[incubator-apisix] branch master updated (b230961 -> 57023a1)

2019-11-28 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git.


from b230961  plugin(grpc-transcode): support new options for `protocol 
buffer` encoding. (#846)
 add 57023a1  doc: Update README_CN.md to fix bad link. (#915)

No new revisions were added by this update.

Summary of changes:
 doc/README_CN.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



[incubator-apisix] branch master updated: doc: how to enable mqtt-proxy plugin. (#916)

2019-11-28 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 4eaf3ca  doc: how to enable mqtt-proxy plugin. (#916)
4eaf3ca is described below

commit 4eaf3cae291056a650c1c3383a893c4efd1c673f
Author: YuanSheng Wang 
AuthorDate: Fri Nov 29 08:54:59 2019 +0800

doc: how to enable mqtt-proxy plugin. (#916)
---
 doc/plugins/mqtt-proxy-cn.md | 18 +-
 doc/plugins/mqtt-proxy.md| 19 ++-
 2 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/doc/plugins/mqtt-proxy-cn.md b/doc/plugins/mqtt-proxy-cn.md
index 12e5915..287fc31 100644
--- a/doc/plugins/mqtt-proxy-cn.md
+++ b/doc/plugins/mqtt-proxy-cn.md
@@ -30,7 +30,7 @@
 
 `mqtt-proxy` 只工作在流模式,它可以帮助你根据 MQTT 的 `client_id` 实现动态负载均衡。
 
-这个插件都支持 MQTT [3.1.* ]( 
http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html )及[5.0]( 
https://docs.oasis-open.org/mqtt/mqtt/v5.0/mqtt-v5.0.html )。
+这个插件支持 MQTT [3.1.* ]( 
http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html )及[5.0]( 
https://docs.oasis-open.org/mqtt/mqtt/v5.0/mqtt-v5.0.html )两个协议。
 
 ## 属性
 
@@ -41,6 +41,22 @@
 
 ## 如何启用
 
+为了启用该插件,需要先在 `conf/config.yaml` 中首先开启 stream_proxy 配置,比如下面配置代表监听 9100 TCP 端口:
+
+```yaml
+...
+router:
+http: 'radixtree_uri'
+ssl: 'radixtree_sni'
+stream_proxy: # TCP/UDP proxy
+  tcp:# TCP proxy port list
+- 9100
+dns_resolver:
+...
+```
+
+然后把 MQTT 请求发送到 9100 端口即可。
+
 下面是一个示例,在指定的 route 上开启了 mqtt-proxy 插件:
 
 ```shell
diff --git a/doc/plugins/mqtt-proxy.md b/doc/plugins/mqtt-proxy.md
index ca5f1dc..fb0abe2 100644
--- a/doc/plugins/mqtt-proxy.md
+++ b/doc/plugins/mqtt-proxy.md
@@ -32,7 +32,7 @@
 The plugin `mqtt-proxy` only works in stream model, it help you to dynamic load
 balance by `client_id` of MQTT.
 
-And this plugin both support MQTT 
[3.1.*](http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html) and 
[5.0](https://docs.oasis-open.org/mqtt/mqtt/v5.0/mqtt-v5.0.html).
+And this plugin both support MQTT protocol 
[3.1.*](http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html) and 
[5.0](https://docs.oasis-open.org/mqtt/mqtt/v5.0/mqtt-v5.0.html).
 
 ## Attributes
 
@@ -46,6 +46,23 @@ And this plugin both support MQTT 
[3.1.*](http://docs.oasis-open.org/mqtt/mqtt/v
 
 ## How To Enable
 
+To enable this plugin, we need to enable the stream_proxy configuration in 
`conf/config.yaml` first.
+For example, the following configuration represents listening on the 9100 TCP 
port.
+
+```yaml
+...
+router:
+http: 'radixtree_uri'
+ssl: 'radixtree_sni'
+stream_proxy: # TCP/UDP proxy
+  tcp:# TCP proxy port list
+- 9100
+dns_resolver:
+...
+```
+
+Then send the MQTT request to port 9100.
+
 Creates a stream route, and enable plugin `mqtt-proxy`.
 
 ```shell



[incubator-apisix] branch master updated: bugfix: reloaded the etcd configuation data if the index (#871)

2019-11-28 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 863aef7  bugfix: reloaded the etcd configuation data if the index 
(#871)
863aef7 is described below

commit 863aef7510cb64e222eb98d269d03a2593caa53a
Author: YuanSheng Wang 
AuthorDate: Fri Nov 29 15:46:35 2019 +0800

bugfix: reloaded the etcd configuation data if the index (#871)
---
 lua/apisix/core/config_etcd.lua | 89 -
 1 file changed, 61 insertions(+), 28 deletions(-)

diff --git a/lua/apisix/core/config_etcd.lua b/lua/apisix/core/config_etcd.lua
index d3eb909..26e4c73 100644
--- a/lua/apisix/core/config_etcd.lua
+++ b/lua/apisix/core/config_etcd.lua
@@ -54,23 +54,17 @@ local function readdir(etcd_cli, key)
 return nil, nil, "not inited"
 end
 
-local data, err = etcd_cli:readdir(key, true)
-if not data then
+local res, err = etcd_cli:readdir(key, true)
+if not res then
 -- log.error("failed to get key from etcd: ", err)
 return nil, nil, err
 end
 
-local body = data.body
-
-if type(body) ~= "table" then
-return nil, nil, "failed to read etcd dir"
-end
-
-if body.message then
-return nil, nil, body.message
+if type(res.body) ~= "table" then
+return nil, "failed to read etcd dir"
 end
 
-return body.node, data.headers
+return res
 end
 
 local function waitdir(etcd_cli, key, modified_index)
@@ -78,19 +72,17 @@ local function waitdir(etcd_cli, key, modified_index)
 return nil, nil, "not inited"
 end
 
-local data, err = etcd_cli:waitdir(key, modified_index)
-if not data then
+local res, err = etcd_cli:waitdir(key, modified_index)
+if not res then
 -- log.error("failed to get key from etcd: ", err)
-return nil, nil, err
+return nil, err
 end
 
-local body = data.body or {}
-
-if body.message then
-return body.node, data.headers, body.message
+if type(res.body) ~= "table" then
+return nil, "failed to read etcd dir"
 end
 
-return body.node, data.headers
+return res
 end
 
 
@@ -125,8 +117,13 @@ local function sync_data(self)
 return nil, "missing 'key' arguments"
 end
 
-if self.values == nil then
-local dir_res, headers, err = readdir(self.etcd_cli, self.key)
+if self.need_reload then
+local res, err = readdir(self.etcd_cli, self.key)
+if not res then
+return false, err
+end
+
+local dir_res, headers = res.body.node, res.headers
 log.debug("readdir key: ", self.key, " res: ",
   json.delay_encode(dir_res))
 if not dir_res then
@@ -141,6 +138,20 @@ local function sync_data(self)
 dir_res.nodes = {}
 end
 
+if self.values then
+for i, val in ipairs(self.values) do
+if val and val.clean_handlers then
+for _, clean_handler in ipairs(val.clean_handlers) do
+clean_handler(val)
+end
+val.clean_handlers = nil
+end
+end
+
+self.values = nil
+self.values_hash = nil
+end
+
 self.values = new_tab(#dir_res.nodes, 0)
 self.values_hash = new_tab(0, #dir_res.nodes)
 
@@ -185,18 +196,39 @@ local function sync_data(self)
 if changed then
 self.conf_version = self.conf_version + 1
 end
+
+self.need_reload = false
 return true
 end
 
-local res, headers, err = waitdir(self.etcd_cli, self.key,
-  self.prev_index + 1)
-log.debug("waitdir key: ", self.key, " prev_index: ", self.prev_index + 1)
-log.debug("res: ", json.delay_encode(res, true))
-log.debug("headers: ", json.delay_encode(headers, true))
+local dir_res, err = waitdir(self.etcd_cli, self.key, self.prev_index + 1)
+log.info("waitdir key: ", self.key, " prev_index: ", self.prev_index + 1)
+log.info("res: ", json.delay_encode(dir_res, true))
+if not dir_res then
+return false, err
+end
+
+local res = dir_res.body.node
+local err_msg = dir_res.body.message
+if err_msg then
+if err_msg == "The event in requested index is outdated and cleared"
+   and dir_res.body.errorCode == 401 then
+self.need_reload = true
+log.warn("waitdir [", self.key, "] err: ", err_msg,
+ ", need to fully reload")
+   

[incubator-apisix-docker] branch master updated: change to absolute path (#32)

2019-11-22 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix-docker.git


The following commit(s) were added to refs/heads/master by this push:
 new 4be3d5a  change to absolute path (#32)
4be3d5a is described below

commit 4be3d5afaf5570706d26ae4d3303b69d2d65d830
Author: Fei Luo <502207...@qq.com>
AuthorDate: Fri Nov 22 20:20:25 2019 +0800

change to absolute path (#32)
---
 README.md | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index d162c3b..1c267de 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,7 @@ docker build -t apisix:0.8-alpine --build-arg 
APISIX_VERSION=0.8 -f alpine/Docke
 
 ```
 docker run -it --name etcd-server \
--v ./example/etcd_conf/etcd.conf.yml:/opt/bitnami/etcd/conf/etcd.conf.yml \
+-v `pwd`/example/etcd_conf/etcd.conf.yml:/opt/bitnami/etcd/conf/etcd.conf.yml \
 -p 2379:2379 \
 -p 2380:2380  \
 --env ALLOW_NONE_AUTHENTICATION=yes bitnami/etcd:3.3.13-r80
@@ -34,8 +34,8 @@ You need etcd docker to work with APISIX. You can refer to 
[the docker-compose e
 Or you can run APISIX with Docker directly(Docker name is test-api-gateway):
 ```
 docker run --name test-api-gateway \
--v ./example/apisix_conf/config.yaml:/usr/local/apisix/conf/config.yaml \ 
--v ./example/apisix_log:/usr/local/apisix/logs  \
+-v `pwd`/example/apisix_conf/config.yaml:/usr/local/apisix/conf/config.yaml \ 
+-v `pwd`/example/apisix_log:/usr/local/apisix/logs  \
 -p 8080:9080 \ 
 -p 8083:9443 \
 -d iresty/apisix



[incubator-apisix] branch master updated: doc: fix error in limit-conn.md (#890)

2019-11-22 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new a3f06de  doc: fix error in limit-conn.md (#890)
a3f06de is described below

commit a3f06dedf7e31a3d3ec252e84c367490e9808954
Author: renzheng.wang 
AuthorDate: Fri Nov 22 20:24:07 2019 +0800

doc: fix error in limit-conn.md (#890)
---
 doc/plugins/limit-conn.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/plugins/limit-conn.md b/doc/plugins/limit-conn.md
index a7d05b6..ee02f90 100644
--- a/doc/plugins/limit-conn.md
+++ b/doc/plugins/limit-conn.md
@@ -65,7 +65,7 @@ curl http://127.0.0.1:9080/apisix/admin/routes/1 -X PUT -d '
 You can open dashboard with a browser: 
`http://127.0.0.1:9080/apisix/dashboard/`, to complete the above operation 
through the web interface, first add a route:
 ![](../images/plugin/limit-conn-1.png)
 
-Then add limit-count plugin:
+Then add limit-conn plugin:
 ![](../images/plugin/limit-conn-2.png)
 
  test plugin



[incubator-apisix] branch master updated: bug: missing comma. (#989)

2019-12-19 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 41ce629  bug: missing comma. (#989)
41ce629 is described below

commit 41ce62904aa0ba7109ecb054073281e438a76aba
Author: agile6v 
AuthorDate: Fri Dec 20 07:43:22 2019 +0800

bug: missing comma. (#989)
---
 lua/apisix/stream/plugins/mqtt-proxy.lua | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lua/apisix/stream/plugins/mqtt-proxy.lua 
b/lua/apisix/stream/plugins/mqtt-proxy.lua
index b5e27a4..439eee2 100644
--- a/lua/apisix/stream/plugins/mqtt-proxy.lua
+++ b/lua/apisix/stream/plugins/mqtt-proxy.lua
@@ -144,13 +144,13 @@ function _M.preread(conf, ctx)
 end
 
 if res.protocol and res.protocol ~= conf.protocol_name then
-core.log.error("expect protocol name: ", conf.protocol_name
+core.log.error("expect protocol name: ", conf.protocol_name,
", but got ", res.protocol)
 return ngx_exit(1)
 end
 
 if res.protocol_ver and res.protocol_ver ~= conf.protocol_level then
-core.log.error("expect protocol level: ", conf.protocol_level
+core.log.error("expect protocol level: ", conf.protocol_level,
", but got ", res.protocol_ver)
 return ngx_exit(1)
 end



[incubator-apisix] branch master updated: bugfix: Update schema_def.lua (#988)

2019-12-19 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 29a8268  bugfix: Update schema_def.lua (#988)
29a8268 is described below

commit 29a8268ff65eff3bda174cc6d997079fdde3acc1
Author: ChelinTsien 
AuthorDate: Fri Dec 20 14:30:16 2019 +0800

bugfix: Update schema_def.lua (#988)
---
 lua/apisix/schema_def.lua | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lua/apisix/schema_def.lua b/lua/apisix/schema_def.lua
index f790b80..6a731ed 100644
--- a/lua/apisix/schema_def.lua
+++ b/lua/apisix/schema_def.lua
@@ -342,6 +342,7 @@ _M.route = {
 {required = {"upstream", "uri"}},
 {required = {"upstream_id", "uri"}},
 {required = {"service_id", "uri"}},
+{required = {"plugins", "uris"}},
 {required = {"upstream", "uris"}},
 {required = {"upstream_id", "uris"}},
 {required = {"service_id", "uris"}},



[incubator-apisix] branch master updated: doc: adding Oauth token introspection document (#987)

2019-12-19 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 3702786  doc: adding Oauth token introspection document (#987)
3702786 is described below

commit 3702786fca26e896730d3e6f04e82a9f6791cfc7
Author: Nirojan Selvanathan 
AuthorDate: Fri Dec 20 07:27:45 2019 +0100

doc: adding Oauth token introspection document (#987)
---
 doc/images/plugin/oauth-1.png | Bin 0 -> 39482 bytes
 doc/plugins/oauth.md  |  92 ++
 2 files changed, 92 insertions(+)

diff --git a/doc/images/plugin/oauth-1.png b/doc/images/plugin/oauth-1.png
new file mode 100644
index 000..f49d71f
Binary files /dev/null and b/doc/images/plugin/oauth-1.png differ
diff --git a/doc/plugins/oauth.md b/doc/plugins/oauth.md
new file mode 100644
index 000..4f98c1c
--- /dev/null
+++ b/doc/plugins/oauth.md
@@ -0,0 +1,92 @@
+
+
+# Summary
+
+- [**Name**](#name)
+- [**Attributes**](#attributes)
+- [**Token Introspection**](#token-introspection)
+
+## Name
+
+The OAuth 2 / Open ID Connect(OIDC) plugin provides authentication and 
introspection capability to APISIX.
+
+## Attributes
+
+|Name   |Requirement|Description|
+|---|-  |--|
+|client_id  |required   |OAuth client ID|
+|client_secret  |required   |OAuth client secret|
+|discovery  |required   |URL of the discovery endpoint of the identity 
server|
+|realm  |optional   |Realm used for the authentication; default is 
apisix|
+|bearer_only|optional   |Setting this `true` will check for the 
authorization header in the request with a bearer token; default is `false`|
+|logout_path|optional   |default is `/logout`|
+|redirect_uri   |optional   |default is `ngx.var.request_uri`|
+|timeout|optional   |default is 3 seconds|
+|ssl_verify |optional   |default is `false`|
+|introspection_endpoint |optional   |URL of the token 
verification endpoint of the identity server|
+|introspection_endpoint_auth_method |optional   |Authentication method 
name for token introspection |
+
+### Token Introspection
+
+Token introspection helps to validate a request by verifying the token against 
an Oauth 2 authorization server.
+As prerequisite, you should create a trusted client in the identity server and 
generate a valid token(JWT) for introspection.
+The following image shows an example(successful) flow of the token 
introspection via the gateway.
+
+![token introspection](../images/plugin/oauth-1.png)
+
+The following is the curl command to enable the plugin to an external service.
+This route will protect `https://httpbin.org/get`(echo service) by 
introspecting the token provided in the header of the request.
+
+```bash
+curl http://127.0.0.1:9080/apisix/admin/routes/5 -X PUT -d '
+{
+  "uri": "/get",
+  "plugins": {
+"proxy-rewrite": {
+  "scheme": "https"
+},
+"openid-connect": {
+  "client_id": "api_six_client_id",
+  "client_secret": "client_secret_code",
+  "discovery": "full_URL_of_the_discovery_endpoint",
+  "introspection_endpoint": "full_URL_of_introspection_endpoint",
+  "bearer_only": true,
+  "realm": "master",
+  "introspection_endpoint_auth_method": "client_secret_basic"
+}
+  },
+  "upstream": {
+"type": "roundrobin",
+"nodes": {
+  "httpbin.org:443": 1
+}
+  }
+}'
+```
+
+The following command can be used to access the new route.
+
+```bash
+curl -i -X GET http://127.0.0.1:9080/get -H "Host: httpbin.org" -H 
"Authorization: Bearer {replace_jwt_token}"
+```
+
+## Troubleshooting
+
+Check/modify the DNS settings (`conf/config.yml) if APISIX cannot 
resolve/connect to the identity provider.



[incubator-apisix] branch master updated: doc: Update README.md about installing Dashboard (#985)

2019-12-19 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 4d0b721  doc: Update README.md about installing Dashboard (#985)
4d0b721 is described below

commit 4d0b721b2a802bb3859e44491313c3a0a902b33a
Author: 琚致远 
AuthorDate: Thu Dec 19 19:09:08 2019 +0800

doc: Update README.md about installing Dashboard (#985)
---
 README.md| 12 ++--
 README_CN.md | 12 ++--
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/README.md b/README.md
index 95315c6..2905bdd 100644
--- a/README.md
+++ b/README.md
@@ -120,18 +120,18 @@ APISIX has built-in support for dashboards, as follows:
 git clone https://github.com/apache/incubator-apisix-dashboard.git
 ```
 
-- Install dependencies and compile
+- Install dependencies and build
 ```
-yarn install
-yarn run build: prod
+yarn
+yarn run build:prod
 ```
 
 - Integration with APISIX
-Copy the compiled files to the apisix / dashboard directory,
-open `http://127.0.0.1:9080/apisix/dashboard/` with a browser and try it.
+Copy the compiled files under `/dist` directory to the `apisix/dashboard` 
directory,
+open `http://127.0.0.1:9080/apisix/dashboard/` in the browser.
 Do not need to fill the user name and password, log in directly.
 
-Dashboard allow any remote IP by default, and you can modify `allow_admin` in 
`conf/config.yaml` by yourself, to list the list of IPs allowed to access.
+The dashboard allows any remote IP by default, and you can modify 
`allow_admin` in `conf/config.yaml` by yourself, to list the list of IPs 
allowed to access.
 
 We provide an online dashboard [demo version](http://apisix.iresty.com), make 
it easier for you to understand APISIX.
 
diff --git a/README_CN.md b/README_CN.md
index 3d62286..5506e00 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -113,27 +113,27 @@ sudo apisix start
 
 ## 控制台
 
-APISIX 内置了对 dashboard 的支持,步骤如下:
+APISIX 内置了对 Dashboard 的支持,使用步骤如下:
 
-- 下载 [dashboard](https://github.com/apache/incubator-apisix-dashboard) 的源码:
+- 下载 [Dashboard](https://github.com/apache/incubator-apisix-dashboard) 的源码:
 ```
 git clone https://github.com/apache/incubator-apisix-dashboard.git
 ```
 
-- 安装依赖和编译
+- 安装依赖并构建
 ```
-yarn install
+yarn
 yarn run build:prod
 ```
 
 - 与 APISIX 集成
-把编译后的文件,拷贝到 apisix/dashboard 目录下。
+把编译后的在 `/dist` 目录下的所有文件,拷贝到 `apisix/dashboard` 目录下。
 使用浏览器打开 `http://127.0.0.1:9080/apisix/dashboard/` 即可使用,
 不用填写用户名和密码,直接登录。
 
 Dashboard 默认允许任何 IP 访问。你可以自行修改 `conf/config.yaml` 中的 `allow_admin` 字段,指定允许访问 
dashboard 的 IP 列表。
 
-我们部署了一个在线的 [dashboard](http://apisix.iresty.com) ,方便您了解 APISIX。
+我们部署了一个在线的 [Dashboard](http://apisix.iresty.com) ,方便你了解 APISIX。
 
 ## 性能测试
 



[incubator-apisix] branch master updated: feature: Add support for PROXY Protocol. (#1113)

2020-02-11 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 01a5b80  feature: Add support for PROXY Protocol. (#1113)
01a5b80 is described below

commit 01a5b807b58c889070cc63ccab94c4288b4217b8
Author: agile6v 
AuthorDate: Wed Feb 12 10:53:20 2020 +0800

feature: Add support for PROXY Protocol. (#1113)
---
 README.md|  1 +
 README_CN.md |  1 +
 bin/apisix   | 50 +-
 conf/config.yaml | 18 ++
 4 files changed, 65 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md
index 85a5096..6252827 100644
--- a/README.md
+++ b/README.md
@@ -58,6 +58,7 @@ A/B testing, canary release, blue-green deployment, limit 
rate, defense against
 - [gRPC proxy](doc/grpc-proxy.md): Proxying gRPC traffic.
 - [gRPC transcoding](doc/plugins/grpc-transcoding.md): Supports protocol 
transcoding so that clients can access your gRPC API by using HTTP/JSON.
 - Proxy Websocket
+- Proxy Protocol
 - Proxy Dubbo: Dubbo Proxy based on Tengine.
 - HTTP(S) Forward Proxy
 - [SSL](doc/https.md): Dynamically load an SSL certificate.
diff --git a/README_CN.md b/README_CN.md
index b76a5b9..201a41f 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -58,6 +58,7 @@ A/B 测试、金丝雀发布(灰度发布)、蓝绿部署、限流限速、抵
 - [gRPC 代理](doc/grpc-proxy-cn.md):通过 APISIX 代理 gRPC 连接,并使用 APISIX 
的大部分特性管理你的 gRPC 服务。
 - [gRPC 协议转换](doc/plugins/grpc-transcoding-cn.md):支持协议的转换,这样客户端可以通过 
HTTP/JSON 来访问你的 gRPC API。
 - Websocket 代理
+- Proxy Protocol
 - Dubbo 代理:基于 Tengine,可以实现 Dubbo 请求的代理。
 - HTTP(S) 反向代理
 - [SSL](doc/https-cn.md):动态加载 SSL 证书。
diff --git a/bin/apisix b/bin/apisix
index db8e97b..d91e163 100755
--- a/bin/apisix
+++ b/bin/apisix
@@ -130,12 +130,16 @@ stream {
 
 server {
 {% for _, port in ipairs(stream_proxy.tcp or {}) do %}
-listen {*port*} {% if enable_reuseport then %} reuseport {% end %};
+listen {*port*} {% if enable_reuseport then %} reuseport {% end %} {% 
if proxy_protocol and proxy_protocol.enable_tcp_pp then %} proxy_protocol {% 
end %};
 {% end %}
 {% for _, port in ipairs(stream_proxy.udp or {}) do %}
 listen {*port*} udp {% if enable_reuseport then %} reuseport {% end %};
 {% end %}
 
+{% if proxy_protocol and proxy_protocol.enable_tcp_pp_to_upstream then 
%}
+proxy_protocol on;
+{% end %}
+
 preread_by_lua_block {
 apisix.stream_preread_phase()
 }
@@ -202,10 +206,23 @@ http {
 
 include mime.types;
 
+{% if real_ip_header then %}
 real_ip_header {* real_ip_header *};
+{% print("\nDeprecated: apisix.real_ip_header has been moved to 
nginx_config.http.real_ip_header. apisix.real_ip_header will be removed in the 
future version. Please use nginx_config.http.real_ip_header first.\n\n") %}
+{% elseif http.real_ip_header then %}
+real_ip_header {* http.real_ip_header *};
+{% end %}
+
+{% if real_ip_from then %}
+{% print("\nDeprecated: apisix.real_ip_from has been moved to 
nginx_config.http.real_ip_from. apisix.real_ip_from will be removed in the 
future version. Please use nginx_config.http.real_ip_from first.\n\n") %}
 {% for _, real_ip in ipairs(real_ip_from) do %}
 set_real_ip_from {*real_ip*};
 {% end %}
+{% elseif http.real_ip_from then %}
+{% for _, real_ip in ipairs(http.real_ip_from) do %}
+set_real_ip_from {*real_ip*};
+{% end %}
+{% end %}
 
 upstream apisix_backend {
 server 0.0.0.1;
@@ -268,6 +285,13 @@ http {
 listen {* ssl.listen_port *} ssl {% if ssl.enable_http2 then %} http2 
{% end %} {% if enable_reuseport then %} reuseport {% end %};
 {% end %}
 
+{% if proxy_protocol and proxy_protocol.listen_http_port then %}
+listen {* proxy_protocol.listen_http_port *} proxy_protocol;
+{% end %}
+{% if proxy_protocol and proxy_protocol.listen_https_port then %}
+listen {* proxy_protocol.listen_https_port *} ssl {% if 
ssl.enable_http2 then %} http2 {% end %} proxy_protocol;
+{% end %}
+
 {% if enable_ipv6 then %}
 listen [::]:{* node_listen *} {% if enable_reuseport then %} reuseport 
{% end %};
 {% if ssl.enable then %}
@@ -342,6 +366,30 @@ http {
 proxy_set_header   X-Real-IP $remote_addr;
 proxy_pass_header  Server;
 proxy_pass_header  Date;
+
+set $var_x_forwarded_for$remote_addr;
+set $var_x_forwarded_proto  $scheme;
+set $var_x_forwarded_host   $host;
+set $var_x_forwarded_port   $server_port;
+
+if ($http_x_forwarded_for != "") {
+set $var_x_forward

[incubator-apisix] branch master updated: Update README.md (#1118)

2020-02-10 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 759531b  Update README.md (#1118)
759531b is described below

commit 759531b8b8dcbbb85cf81627ee23f4d1692d4fcd
Author: 琚致远 
AuthorDate: Tue Feb 11 12:29:02 2020 +0800

Update README.md (#1118)
---
 README.md| 2 +-
 README_CN.md | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 364bd10..85a5096 100644
--- a/README.md
+++ b/README.md
@@ -140,7 +140,7 @@ Then you can try more [plugins](doc/README.md#plugins).
 ## Dashboard
 APISIX has built-in support for Dashboard, as follows:
 
-1. Please make sure your machine has Node 8.x or higher, or there will occur 
build issues.
+1. Please make sure your machine has Node 8.12.0 or higher, or there will 
occur build issues.
 
 2. Download the source codes of 
[Dashboard](https://github.com/apache/incubator-apisix-dashboard):
 ```
diff --git a/README_CN.md b/README_CN.md
index 19e3aca..b76a5b9 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -140,7 +140,7 @@ sudo apisix start
 
 APISIX 内置了对 Dashboard 的支持,使用步骤如下:
 
-1. 确保你的运行环境中的 Node 版本高于或等于 8.x。
+1. 确保你的运行环境中的 Node 版本 >= 8.12.0。
 
 2. 下载 [Dashboard](https://github.com/apache/incubator-apisix-dashboard) 的源码:
 ```



[incubator-apisix] branch master updated: feature: supported key-based authentication to the dashboard. (#1169)

2020-03-04 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new be2eec3  feature: supported key-based authentication to the dashboard. 
(#1169)
be2eec3 is described below

commit be2eec3c6d6151e4e5d76a1e82797605151d5d6c
Author: Wen Ming 
AuthorDate: Thu Mar 5 14:48:27 2020 +0800

feature: supported key-based authentication to the dashboard. (#1169)
---
 FAQ.md |   4 +-
 FAQ_CN.md  |   4 +-
 benchmark/run.sh   |   4 +-
 conf/config.yaml   |  15 +++
 doc/admin-api-cn.md|   6 +-
 doc/admin-api.md   |   6 +-
 doc/architecture-design-cn.md  |  36 +++
 doc/architecture-design.md |  34 +++---
 doc/benchmark.md   |   4 +-
 doc/getting-started.md |  10 +-
 doc/grpc-proxy-cn.md   |   2 +-
 doc/grpc-proxy.md  |   2 +-
 doc/health-check.md|   2 +-
 doc/how-to-build-cn.md |  32 ++
 doc/how-to-build.md|  37 ++-
 doc/https-cn.md|   4 +-
 doc/https.md   |   4 +-
 doc/plugins-cn.md  |   2 +-
 doc/plugins.md |   2 +-
 doc/plugins/basic-auth-cn.md   |   6 +-
 doc/plugins/basic-auth.md  |   4 +-
 doc/plugins/fault-injection-cn.md  |   6 +-
 doc/plugins/fault-injection.md |   6 +-
 doc/plugins/grpc-transcoding-cn.md |   6 +-
 doc/plugins/grpc-transcoding.md|   4 +-
 doc/plugins/ip-restriction-cn.md   |   2 +-
 doc/plugins/ip-restriction.md  |   2 +-
 doc/plugins/jwt-auth-cn.md |   4 +-
 doc/plugins/jwt-auth.md|   4 +-
 doc/plugins/key-auth-cn.md |   4 +-
 doc/plugins/key-auth.md|   4 +-
 doc/plugins/limit-conn-cn.md   |   4 +-
 doc/plugins/limit-conn.md  |   4 +-
 doc/plugins/limit-count-cn.md  |   6 +-
 doc/plugins/limit-count.md |   6 +-
 doc/plugins/limit-req-cn.md|   4 +-
 doc/plugins/limit-req.md   |   4 +-
 doc/plugins/mqtt-proxy-cn.md   |   2 +-
 doc/plugins/mqtt-proxy.md  |   2 +-
 doc/plugins/oauth.md   |   2 +-
 doc/plugins/prometheus-cn.md   |   2 +-
 doc/plugins/prometheus.md  |   2 +-
 doc/plugins/proxy-rewrite-cn.md|   4 +-
 doc/plugins/proxy-rewrite.md   |   4 +-
 doc/plugins/redirect-cn.md |   6 +-
 doc/plugins/redirect.md|   6 +-
 doc/plugins/response-rewrite-cn.md |   2 +-
 doc/plugins/response-rewrite.md|   4 +-
 doc/plugins/serverless-cn.md   |   4 +-
 doc/plugins/serverless.md  |   4 +-
 doc/plugins/wolf-rbac-cn.md|   6 +-
 doc/plugins/wolf-rbac.md   |   6 +-
 doc/plugins/zipkin-cn.md   |   2 +-
 doc/plugins/zipkin.md  |   2 +-
 doc/router-radixtree.md|   2 +-
 doc/stream-proxy-cn.md |   4 +-
 doc/stream-proxy.md|   4 +-
 lua/apisix/admin/init.lua  |  70 -
 t/APISIX.pm|   2 +
 t/admin/token.t| 205 +
 t/grpc-proxy-test.sh   |   6 +-
 t/router/radixtree-host-uri.t  |   1 +
 t/router/radixtree-host-uri2.t |   1 +
 t/router/radixtree-uri-host.t  |   1 +
 t/router/radixtree-uri-multiple.t  |   1 +
 t/router/radixtree-uri-priority.t  |   1 +
 t/router/radixtree-uri-sanity.t|   1 +
 67 files changed, 506 insertions(+), 143 deletions(-)

diff --git a/FAQ.md b/FAQ.md
index 26ee8e9..166a8b0 100644
--- a/FAQ.md
+++ b/FAQ.md
@@ -80,7 +80,7 @@ An example, if you want to group by the request param 
`arg_id`:
 
 here is the way:
 ```shell
-curl -i http://127.0.0.1:9080/apisix/admin/routes/1 -X PUT -d '
+curl -i http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
 {
 "uri": "/index.html",
 "vars": [
@@ -93,7 +93,7 @@ curl -i http://127.0.0.1:9080/apisix/admin/routes/1 -X PUT -d 
'
 }
 }'
 
-curl -i http://127.0.0.1:9080/apisix/admin/routes/2 -X PUT -d '
+curl -i http://127.0.0.1:9080/apisix/admin/routes/2 -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
 {
 "uri": "/index.html",
 "vars": [
diff --git a/FAQ_CN.md b/FAQ_CN.md
index 55f4ceb..3775093 100644
--- a/FAQ_CN.md
+++ b/FAQ_CN.md
@@ -82,7 +82,7 @@ luarocks 服务。 运行 `luarocks config rocks_servers` 命令(这个命令
 
 可以这么做:
 ```shell
-curl -i http://127.0.0.1:9080/apisix/admin/routes/1 -X PUT -d '
+curl -i http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
 {
 "uri": "/index.html",
 "vars": [
@@ -95,7 +95,7 @@ curl -i http://127.0.0.1:9080/apisix/admin/

[incubator-apisix] branch master updated: doc: add English doc `doc/profile-cn.md` (#1192)

2020-03-03 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new e64ed39  doc: add English doc `doc/profile-cn.md` (#1192)
e64ed39 is described below

commit e64ed39eaeb6b5f63494b237e04e0c58aa056808
Author: Ayeshmantha Perera 
AuthorDate: Wed Mar 4 02:42:56 2020 +0100

doc: add English doc `doc/profile-cn.md` (#1192)
---
 doc/profile.md | 47 +++
 1 file changed, 47 insertions(+)

diff --git a/doc/profile.md b/doc/profile.md
new file mode 100644
index 000..398e77c
--- /dev/null
+++ b/doc/profile.md
@@ -0,0 +1,47 @@
+
+
+# Configuration file switching based on environment variables
+
+The reason the configuration is extracted from the code is to better adapt to 
changes. Usually our applications have different
+operating environments such as development environment and production 
environment. Certain configurations of these applications
+will definitely be different, such as the address of the configuration center.
+
+If the configuration of all environments is placed in the same file, it is 
very difficult to manage. After receiving new
+requirements, we need to change the parameters in the configuration file to 
the development environment when developing the
+development environment. You have to change it back. It's very easy to make 
mistakes.
+
+The solution to the above problem is to distinguish the current running 
environment through environment variables, and switch
+between different configuration files through environment variables. The 
corresponding environment variable in APISIX is: `APISIX_PROFILE`
+
+
+When `APISIX_PROFILE` is not set, the following three configuration files are 
used by default:
+
+* conf/config.yaml
+* conf/apisix.yaml
+* conf/debug.yaml
+
+If the value of `APISIX_PROFILE` is set to` prod`, the following three 
configuration files are used:
+
+* conf/config-prod.yaml
+* conf/apisix-prod.yaml
+* conf/debug-prod.yaml
+
+Although this way will increase the number of configuration files, it can be 
managed independently, and then version management
+tools such as git can be configured, and version management can be better 
achieved.



[incubator-apisix] branch master updated (e64ed39 -> 429f016)

2020-03-03 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git.


from e64ed39  doc: add English doc `doc/profile-cn.md` (#1192)
 add 429f016  feature: Moving logs utils and batch processor to utils dir 
and typo fixes in docs (#1191)

No new revisions were added by this update.

Summary of changes:
 Contributing.md   | 10 +-
 lua/apisix/plugins/udp-logger.lua |  2 +-
 lua/apisix/{plugins => utils}/batch-processor.lua |  1 +
 lua/apisix/{plugins => utils}/log-util.lua|  0
 t/{plugin => utils}/batch-processor.t | 20 ++--
 5 files changed, 17 insertions(+), 16 deletions(-)
 rename lua/apisix/{plugins => utils}/batch-processor.lua (99%)
 rename lua/apisix/{plugins => utils}/log-util.lua (100%)
 rename t/{plugin => utils}/batch-processor.t (93%)



[incubator-apisix] branch master updated: bugfix: removed unwanted quotes. (#1158)

2020-02-26 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 3176a07  bugfix: removed unwanted quotes. (#1158)
3176a07 is described below

commit 3176a0786201d7929199bc6e282f2358d46b8f18
Author: YuanSheng Wang 
AuthorDate: Thu Feb 27 08:45:34 2020 +0800

bugfix: removed unwanted quotes. (#1158)
---
 Makefile | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index f294efa..6083288 100644
--- a/Makefile
+++ b/Makefile
@@ -34,7 +34,7 @@ ifeq ("$(wildcard /usr/local/openresty-debug/bin/openresty)", 
"")
 endif
 endif
 
-LUTJIT_DIR ?= $(shell ${OR_EXEC} -V 2>&1 | grep prefix | grep -Eo 
'prefix=(.*?)/nginx' | grep -Eo '/.*/')luajit
+LUAJIT_DIR ?= $(shell ${OR_EXEC} -V 2>&1 | grep prefix | grep -Eo 
'prefix=(.*?)/nginx' | grep -Eo '/.*/')luajit
 
 ### help: Show Makefile rules.
 .PHONY: help
@@ -48,11 +48,11 @@ help: default
 .PHONY: deps
 deps: default
 ifeq ($(UNAME),Darwin)
-   luarocks install --lua-dir=$(LUTJIT_DIR) 
rockspec/apisix-master-0.rockspec --tree=deps --only-deps --local
-else ifneq ($(LUAROCKS_VER),'luarocks 3.')
-   luarocks install rockspec/apisix-master-0.rockspec --tree=deps 
--only-deps --local
+   luarocks install --lua-dir=$(LUAJIT_DIR) 
rockspec/apisix-master-0.rockspec --tree=deps --only-deps --local
+else ifeq ($(LUAROCKS_VER),luarocks 3.)
+   luarocks install --lua-dir=$(LUAJIT_DIR) 
rockspec/apisix-master-0.rockspec --tree=deps --only-deps --local
 else
-   luarocks install --lua-dir=/usr/local/openresty/luajit 
rockspec/apisix-master-0.rockspec --tree=deps --only-deps --local
+   luarocks install rockspec/apisix-master-0.rockspec --tree=deps 
--only-deps --local
 endif
 
 



[incubator-apisix] branch master updated: ci: remove patch which is no longer necessary and removed in the upstream. (#1090)

2020-01-26 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 9889d66  ci: remove patch which is no longer necessary and removed in 
the upstream. (#1090)
9889d66 is described below

commit 9889d66f269f73c67e45661d295f55870515ba04
Author: 罗泽轩 
AuthorDate: Mon Jan 27 09:51:37 2020 +0800

ci: remove patch which is no longer necessary and removed in the upstream. 
(#1090)
---
 .travis/linux_tengine_runner.sh | 2 --
 1 file changed, 2 deletions(-)

diff --git a/.travis/linux_tengine_runner.sh b/.travis/linux_tengine_runner.sh
index c175664..6ce1a27 100755
--- a/.travis/linux_tengine_runner.sh
+++ b/.travis/linux_tengine_runner.sh
@@ -75,7 +75,6 @@ tengine_install() {
 wget -P patches 
https://raw.githubusercontent.com/openresty/openresty/master/patches/nginx-1.17.4-cache_manager_exit.patch
 wget -P patches 
https://raw.githubusercontent.com/openresty/openresty/master/patches/nginx-1.17.4-daemon_destroy_pool.patch
 wget -P patches 
https://raw.githubusercontent.com/openresty/openresty/master/patches/nginx-1.17.4-delayed_posted_events.patch
-wget -P patches 
https://raw.githubusercontent.com/openresty/openresty/master/patches/nginx-1.17.4-gcc-maybe-uninitialized-warning.patch
 wget -P patches 
https://raw.githubusercontent.com/openresty/openresty/master/patches/nginx-1.17.4-hash_overflow.patch
 wget -P patches 
https://raw.githubusercontent.com/openresty/openresty/master/patches/nginx-1.17.4-init_cycle_pool_release.patch
 wget -P patches 
https://raw.githubusercontent.com/openresty/openresty/master/patches/nginx-1.17.4-larger_max_error_str.patch
@@ -102,7 +101,6 @@ tengine_install() {
 patch -p1 < ../../patches/nginx-1.17.4-cache_manager_exit.patch
 patch -p1 < ../../patches/nginx-1.17.4-daemon_destroy_pool.patch
 patch -p1 < ../../patches/nginx-1.17.4-delayed_posted_events.patch
-patch -p1 < 
../../patches/nginx-1.17.4-gcc-maybe-uninitialized-warning.patch
 patch -p1 < ../../patches/nginx-1.17.4-hash_overflow.patch
 patch -p1 < ../../patches/nginx-1.17.4-init_cycle_pool_release.patch
 patch -p1 < ../../patches/nginx-1.17.4-larger_max_error_str.patch



[incubator-apisix] branch master updated: doc: add English article. (#1089)

2020-01-23 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new affe4b7  doc: add English article. (#1089)
affe4b7 is described below

commit affe4b7da284850f28c20a780e769d3526b98313
Author: WenMing 
AuthorDate: Thu Jan 23 22:06:02 2020 +0800

doc: add English article. (#1089)
---
 README.md | 8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/README.md b/README.md
index 6b7112b..698a9f5 100644
--- a/README.md
+++ b/README.md
@@ -211,13 +211,7 @@ Using AWS's 8 core server, APISIX's QPS reach to 140,000 
with a latency of only
 | Support any Nginx variable as routing condition  | Yes   | No   |
 
 ## Videos And Articles
-- 2019.12.14 [From 0 to 1: APISIX's Apache 
travel(Chinese)](https://zhuanlan.zhihu.com/p/99620158)
-- 2019.12.14 [Next-generation microservice architecture based on Apache 
APISIX(Chinese)](https://www.upyun.com/opentalk/445.html)
-- 2019.10.30 [Introduction to Apache APISIX Microservice Gateway Extreme 
Performance Architecture(Chinese)](https://www.upyun.com/opentalk/440.html)
-- 2019.9.27 [Want to run APISIX on an ARM64 platform? Just three 
steps(Chinese)](https://zhuanlan.zhihu.com/p/84467919)
-- 2019.8.31 [APISIX technology selection, testing and continuous 
integration(Chinese)](https://www.upyun.com/opentalk/433.html)
-- 2019.8.31 [APISIX high performance practice 
2(Chinese)](https://www.upyun.com/opentalk/437.html)
-- 2019.7.6 [APISIX high performance 
practice(Chinese)](https://www.upyun.com/opentalk/429.html)
+- 2019.8.31 [APISIX technology selection, testing and continuous 
integration](https://medium.com/@ming_wen/apache-apisixs-technology-selection-testing-and-continuous-integration-313221b02542)
 
 ## User Stories
 - [ke.com: How to Build a Gateway Based on Apache 
APISIX(Chinese)](https://mp.weixin.qq.com/s/yZl9MWPyF1-gOyCp8plflA)



[incubator-apisix] branch master updated: test: style, formatted by reindex. (#1081)

2020-01-27 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 7a5bd66  test: style, formatted by reindex. (#1081)
7a5bd66 is described below

commit 7a5bd663ca83e9d85a6a3e498aa9fca1bfbbda01
Author: YuanSheng Wang 
AuthorDate: Tue Jan 28 12:13:03 2020 +0800

test: style, formatted by reindex. (#1081)
---
 t/plugin/fault-injection.t | 1 -
 t/plugin/udp-logger.t  | 5 +
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/t/plugin/fault-injection.t b/t/plugin/fault-injection.t
index 14e3770..1038d14 100644
--- a/t/plugin/fault-injection.t
+++ b/t/plugin/fault-injection.t
@@ -523,4 +523,3 @@ GET /hello HTTP/1.1
 Fault Injection!
 --- no_error_log
 [error]
-
diff --git a/t/plugin/udp-logger.t b/t/plugin/udp-logger.t
index 3ad4035..e30066c 100644
--- a/t/plugin/udp-logger.t
+++ b/t/plugin/udp-logger.t
@@ -44,6 +44,7 @@ done
 [error]
 
 
+
 === TEST 2: missing host
 --- config
 location /t {
@@ -66,6 +67,7 @@ done
 [error]
 
 
+
 === TEST 3: wrong type of string
 --- config
 location /t {
@@ -88,6 +90,7 @@ done
 [error]
 
 
+
 === TEST 4: add plugin
 --- config
 location /t {
@@ -147,6 +150,7 @@ passed
 [error]
 
 
+
 === TEST 5: access
 --- request
 GET /opentracing
@@ -157,6 +161,7 @@ opentracing
 --- wait: 0.2
 
 
+
 === TEST 6: error log
 --- config
 location /t {



[incubator-apisix] branch master updated: chore: improve the core.log module (#1093)

2020-01-27 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 6240d1a  chore: improve the core.log module (#1093)
6240d1a is described below

commit 6240d1a9b426f48811af740b84e49b8c4979b8de
Author: 罗泽轩 
AuthorDate: Tue Jan 28 12:11:47 2020 +0800

chore: improve the core.log module (#1093)

1. implement the debug method with the generic logic, so you don't need
to go into the method if you don't need it.
2. avoid computing the same result among different log levels
---
 lua/apisix/core/log.lua | 33 +
 1 file changed, 9 insertions(+), 24 deletions(-)

diff --git a/lua/apisix/core/log.lua b/lua/apisix/core/log.lua
index b0b60de..902b88f 100644
--- a/lua/apisix/core/log.lua
+++ b/lua/apisix/core/log.lua
@@ -32,37 +32,22 @@ local log_levels = {
 error  = ngx.ERR,
 warn   = ngx.WARN,
 notice = ngx.NOTICE,
-info   = ngx.INFO
+info   = ngx.INFO,
+debug  = ngx.DEBUG,
 }
 
 
-do
-local cur_level
-
-function _M.debug(...)
-if not cur_level then
-cur_level = ngx.config.subsystem == "http" and
-require "ngx.errlog" .get_sys_filter_level()
-end
-
-if not DEBUG and cur_level and ngx_DEBUG > cur_level then
-return
-end
-
-return ngx_log(ngx_DEBUG, ...)
-end
-
-end -- do
-
-
+local cur_level = ngx.config.subsystem == "http" and
+  require "ngx.errlog" .get_sys_filter_level()
+local do_nothing = function() end
 setmetatable(_M, {__index = function(self, cmd)
-local cur_level = ngx.config.subsystem == "http" and
-require "ngx.errlog" .get_sys_filter_level()
 local log_level = log_levels[cmd]
 
 local method
-if cur_level and log_levels[cmd] > cur_level then
-method = function() end
+if cur_level and (log_level > cur_level or
+(log_level == ngx_DEBUG and not DEBUG))
+then
+method = do_nothing
 else
 method = function(...)
 return ngx_log(log_level, ...)



[incubator-apisix] branch master updated: feature: Add wolf rbac plugin (#1095)

2020-02-05 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 5fff97d  feature: Add wolf rbac plugin (#1095)
5fff97d is described below

commit 5fff97d0b1650dbcc0a0761b83e5e9419ea6d79f
Author: iGeeky 
AuthorDate: Thu Feb 6 15:22:49 2020 +0800

feature: Add wolf rbac plugin (#1095)
---
 .travis/ASF-Release.cfg   |   1 -
 conf/config.yaml  |   1 +
 doc/images/plugin/wolf-rbac-1.png | Bin 0 -> 79987 bytes
 doc/images/plugin/wolf-rbac-2.png | Bin 0 -> 85769 bytes
 doc/plugins/wolf-rbac-cn.md   | 207 
 doc/plugins/wolf-rbac.md  | 209 +
 lua/apisix/plugins/wolf-rbac.lua  | 386 ++
 t/admin/plugins.t |   2 +-
 t/debug/debug-mode.t  |   1 +
 t/lib/server.lua  |  58 +-
 t/plugin/wolf-rbac.t  | 334 +
 11 files changed, 1191 insertions(+), 8 deletions(-)

diff --git a/.travis/ASF-Release.cfg b/.travis/ASF-Release.cfg
index e967bdc..703a361 100644
--- a/.travis/ASF-Release.cfg
+++ b/.travis/ASF-Release.cfg
@@ -87,7 +87,6 @@ grpc_server_example
 .travis.yml
 grpcurl
 t/servroot
-grpcurl
 
 conf
 .travis/openwhisk-utilities
diff --git a/conf/config.yaml b/conf/config.yaml
index 274a8cf..57efc2a 100644
--- a/conf/config.yaml
+++ b/conf/config.yaml
@@ -96,6 +96,7 @@ plugins:  # plugin list
   - response-rewrite
   - fault-injection
   - udp-logger
+  - wolf-rbac
 
 stream_plugins:
   - mqtt-proxy
diff --git a/doc/images/plugin/wolf-rbac-1.png 
b/doc/images/plugin/wolf-rbac-1.png
new file mode 100644
index 000..ce888d8
Binary files /dev/null and b/doc/images/plugin/wolf-rbac-1.png differ
diff --git a/doc/images/plugin/wolf-rbac-2.png 
b/doc/images/plugin/wolf-rbac-2.png
new file mode 100644
index 000..e1223c9
Binary files /dev/null and b/doc/images/plugin/wolf-rbac-2.png differ
diff --git a/doc/plugins/wolf-rbac-cn.md b/doc/plugins/wolf-rbac-cn.md
new file mode 100644
index 000..37c9dd7
--- /dev/null
+++ b/doc/plugins/wolf-rbac-cn.md
@@ -0,0 +1,207 @@
+
+
+[English](wolf-rbac.md)
+
+# 目录
+
+- [**名字**](#名字)
+- [**属性**](#属性)
+- [**依赖项**](#依赖项)
+- [**如何启用**](#如何启用)
+- [**测试插件**](#测试插件)
+- [**禁用插件**](#禁用插件)
+
+## 名字
+
+`wolf-rbac` 是一个认证及授权(rbac)插件,它需要与 `consumer` 一起配合才能工作。同时需要添加 `wolf-rbac` 到一个 
`service` 或 `route` 中。
+rbac功能由[wolf](https://github.com/iGeeky/wolf)提供, 有关 `wolf` 的更多信息, 
请参考[wolf文档](https://github.com/iGeeky/wolf)。
+
+
+## 属性
+
+* `server`: 设置 `wolf-server` 的访问地址, 如果未设置, 默认为: `http://127.0.0.1:10080`.
+* `appid`: 设置应用id, 该应用id, 需要是在 `wolf-console` 中已经添加的应用id.
+
+
+## 依赖项
+
+### 安装 wolf, 并启动服务
+
+[Wolf快速起步](https://github.com/iGeeky/wolf/blob/master/quick-start-with-docker/README-CN.md)
+
+### 添加应用, 管理员, 普通用户, 权限, 资源 及给用户授权.
+
+[Wolf管理使用](https://github.com/iGeeky/wolf/blob/master/docs/usage.md)
+
+
+## 如何启用
+
+1. 创建一个 consumer 对象,并设置插件 `wolf-rbac` 的值。
+
+```shell
+curl http://127.0.0.1:9080/apisix/admin/consumers -X PUT -d '
+{
+  "username":"wolf_rbac",
+  "plugins":{
+"wolf-rbac":{
+  "server":"http://127.0.0.1:10080;,
+  "appid":"restful"
+}
+  },
+  "desc":"wolf-rbac"
+}'
+```
+
+你可以使用浏览器打开 dashboard:`http://127.0.0.1:9080/apisix/dashboard/`,通过 web 
界面来完成上面的操作,先增加一个 consumer:
+![](../images/plugin/wolf-rbac-1.png)
+
+然后在 consumer 页面中添加 wolf-rbac 插件:
+![](../images/plugin/wolf-rbac-2.png)
+
+注意: 上面填写的 `appid` 需要在wolf控制台中已经存在的.
+
+2. 创建 Route 或 Service 对象,并开启 `wolf-rbac` 插件。
+
+```shell
+curl http://127.0.0.1:9080/apisix/admin/routes/1 -X PUT -d '
+{
+"methods": ["GET"],
+"uri": "/*",
+"plugins": {
+"wolf-rbac": {}
+},
+"upstream": {
+"type": "roundrobin",
+"nodes": {
+"www.baidu.com:80": 1
+}
+}
+}'
+```
+
+## 测试插件
+
+ 首先进行登录获取 `wolf-rbac` token:
+
+下面的 `appid`, `username`, `password` 必须为wolf系统中真实存在的.
+
+* 以POST application/json方式登陆.
+
+```shell
+curl http://127.0.0.1:9080/apisix/plugin/wolf-rbac/login -i \
+-H "Content-Type: application/json" \
+-d '{"appid": "restful", "username":"test", "password":"user-password"}'
+
+HTTP/1.1 200 OK
+Date: Wed, 24 Jul 2019 10:33:31 GMT
+Content-Type: text/plain
+Transfer-Encoding: chunked
+Connection: keep-alive
+Server: APISIX web server
+{"rbac_token":"V1#restful#eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6NzQ5LCJ1c2VybmFtZSI6InRlc3QiLCJtYW5hZ2VyIjoiIiwiYXBwaWQiOiJyZXN0ZnVsIiwiaWF0IjoxNTc5NDQ5ODQxLCJleHAiOjE1ODAwNTQ2NDF9.n2-830zbhrEh6OAxn4K_y

[incubator-apisix] branch master updated: feature: make the number of file is as configurable as the connections. (#1098)

2020-02-01 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new fda20d9  feature: make the number of file is as configurable as the 
connections. (#1098)
fda20d9 is described below

commit fda20d99d55d91905622b9d780e4dce79d128e76
Author: 罗泽轩 
AuthorDate: Sun Feb 2 09:13:34 2020 +0800

feature: make the number of file is as configurable as the connections. 
(#1098)
---
 bin/apisix   | 9 -
 conf/config.yaml | 1 +
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/bin/apisix b/bin/apisix
index 89b2632..0102c38 100755
--- a/bin/apisix
+++ b/bin/apisix
@@ -88,7 +88,7 @@ worker_cpu_affinity auto;
 error_log {* error_log *} {* error_log_level or "error" *};
 pid logs/nginx.pid;
 
-worker_rlimit_nofile 20480;
+worker_rlimit_nofile {* worker_rlimit_nofile *};
 
 events {
 accept_mutex off;
@@ -524,6 +524,13 @@ local function init()
 sys_conf[k] = v
 end
 
+local wrn = sys_conf["worker_rlimit_nofile"]
+local wc = sys_conf["event"]["worker_connections"]
+if not wrn or wrn <= wc then
+-- ensure the number of fds is slightly larger than the number of conn
+sys_conf["worker_rlimit_nofile"] = wc + 128
+end
+
 if(sys_conf["enable_dev_mode"] == true) then
 sys_conf["worker_processes"] = 1
 else
diff --git a/conf/config.yaml b/conf/config.yaml
index 18d1ec3..274a8cf 100644
--- a/conf/config.yaml
+++ b/conf/config.yaml
@@ -59,6 +59,7 @@ apisix:
 nginx_config: # config for render the template to genarate 
nginx.conf
   error_log: "logs/error.log"
   error_log_level: "warn" # warn,error
+  worker_rlimit_nofile: 20480 # the number of files a worker process can 
open, should be larger than worker_connections
   event:
 worker_connections: 10620
   http:



[incubator-apisix] branch master updated: doc: check code style and test case style. (#1099)

2020-02-01 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 734b165  doc: check code style and test case style. (#1099)
734b165 is described below

commit 734b1650dd7911185928b17fe4cc95ffdb5f150c
Author: YuanSheng Wang 
AuthorDate: Sun Feb 2 09:13:10 2020 +0800

doc: check code style and test case style. (#1099)
---
 Contributing.md | 39 +++
 1 file changed, 39 insertions(+)

diff --git a/Contributing.md b/Contributing.md
index 0a37ada..787a850 100644
--- a/Contributing.md
+++ b/Contributing.md
@@ -86,6 +86,45 @@ Once we've discussed your changes and you've got your code 
ready, make sure that
 
 * Use a friendly and conversational tone. Always use simple sentences. If 
the sentence is lengthy try to break it in to smaller sentences.
 
+## Check code style and test case style
+
+* code style
+* Please take a look at [OpenResty Lua Coding Style Guide](CODE_STYLE.md).
+* Use tool to check your code statically by command: `make lint`.
+```shell
+# install `luacheck` first before run it
+$ luarocks install luacheck
+# check source code
+$ make lint
+luacheck -q lua
+Total: 0 warnings / 0 errors in 74 files
+./utils/lj-releng lua/*.lua \
+lua/apisix/*.lua \
+lua/apisix/admin/*.lua \
+lua/apisix/core/*.lua \
+lua/apisix/http/*.lua \
+lua/apisix/http/router/*.lua \
+lua/apisix/plugins/*.lua \
+lua/apisix/plugins/grpc-transcode/*.lua \
+lua/apisix/plugins/limit-count/*.lua > \
+/tmp/check.log 2>&1 || (cat /tmp/check.log && exit 1)
+```
+* test case style
+* Use tool to check your test case style statically by command, eg: 
`reindex t/admin/*.t`.
+```shell
+# install `reindex` first before run it
+# wget 
https://raw.githubusercontent.com/iresty/openresty-devel-utils/master/reindex
+# ./reindex test cases
+$ reindex t/admin/*.t
+reindex: t/plugin/example.t:   skipped.# No changes needed
+reindex: t/plugin/fault-injection.t:   done.   # updated
+reindex: t/plugin/grpc-transcode.t:skipped.
+... ...
+reindex: t/plugin/udp-logger.t:done.
+reindex: t/plugin/zipkin.t:skipped.
+```
+* By the way, we can download "reindex" to another path and add this path 
to "PATH" environment.
+
 ## Do you have questions about the source code?
 
 - **QQ group**: 552030619



[incubator-apisix] branch master updated: bugfix: updated the dns parse result by TTL. (#1077)

2020-02-19 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new de16a7e  bugfix: updated the dns parse result by TTL. (#1077)
de16a7e is described below

commit de16a7e04f6d316a05743666261f159508355416
Author: YuanSheng Wang 
AuthorDate: Wed Feb 19 20:30:34 2020 +0800

bugfix: updated the dns parse result by TTL. (#1077)
---
 bin/apisix   |  2 +-
 conf/config.yaml |  1 +
 lua/apisix.lua   | 59 +---
 lua/apisix/core/lrucache.lua |  4 ++-
 lua/apisix/core/utils.lua| 14 +--
 t/core/lrucache.t| 37 +++
 6 files changed, 99 insertions(+), 18 deletions(-)

diff --git a/bin/apisix b/bin/apisix
index 7e4b89a..5e68c3f 100755
--- a/bin/apisix
+++ b/bin/apisix
@@ -183,7 +183,7 @@ http {
 
 lua_socket_log_errors off;
 
-resolver {% for _, dns_addr in ipairs(dns_resolver or {}) do %} 
{*dns_addr*} {% end %} ipv6=off;
+resolver {% for _, dns_addr in ipairs(dns_resolver or {}) do %} 
{*dns_addr*} {% end %} valid={*dns_resolver_valid*} ipv6=off;
 resolver_timeout 5;
 
 lua_http10_buffering off;
diff --git a/conf/config.yaml b/conf/config.yaml
index 9e098d9..3281f47 100644
--- a/conf/config.yaml
+++ b/conf/config.yaml
@@ -55,6 +55,7 @@ apisix:
 - 223.5.5.5
 - 1.1.1.1
 - 8.8.8.8
+  dns_resolver_valid: 30  # valid time for dns result 30 seconds
 
   ssl:
 enable: true
diff --git a/lua/apisix.lua b/lua/apisix.lua
index bee4376..7517c46 100644
--- a/lua/apisix.lua
+++ b/lua/apisix.lua
@@ -33,9 +33,7 @@ local tostring  = tostring
 local load_balancer
 
 
-local parsed_domain = core.lrucache.new({
-ttl = 300, count = 512
-})
+local parsed_domain
 
 
 local _M = {version = 0.3}
@@ -85,6 +83,14 @@ function _M.http_init_worker()
 end
 
 require("apisix.debug").init_worker()
+
+local local_conf = core.config.local_conf()
+local dns_resolver_valid = local_conf and local_conf.apisix and
+local_conf.apisix.dns_resolver_valid
+
+parsed_domain = core.lrucache.new({
+ttl = dns_resolver_valid, count = 512, invalid_stale = true,
+})
 end
 
 
@@ -174,14 +180,20 @@ local function parse_domain_in_up(up, ver)
 local host, port = core.utils.parse_addr(addr)
 if not ipmatcher.parse_ipv4(host) and
not ipmatcher.parse_ipv6(host) then
-local ip_info = core.utils.dns_parse(dns_resolver, host)
-core.log.info("parse addr: ", core.json.delay_encode(ip_info),
-  " resolver: ", core.json.delay_encode(dns_resolver),
-  " addr: ", addr)
-if ip_info and ip_info.address then
+local ip_info, err = core.utils.dns_parse(dns_resolver, host)
+if not ip_info then
+return nil, err
+end
+
+core.log.info("parse addr: ", core.json.delay_encode(ip_info))
+core.log.info("resolver: ", core.json.delay_encode(dns_resolver))
+core.log.info("host: ", host)
+if ip_info.address then
 new_nodes[ip_info.address .. ":" .. port] = weight
 core.log.info("dns resolver domain: ", host, " to ",
   ip_info.address)
+else
+return nil, "failed to parse domain in route"
 end
 else
 new_nodes[addr] = weight
@@ -206,15 +218,22 @@ local function parse_domain_in_route(route, ver)
 local host, port = core.utils.parse_addr(addr)
 if not ipmatcher.parse_ipv4(host) and
not ipmatcher.parse_ipv6(host) then
-local ip_info = core.utils.dns_parse(dns_resolver, host)
-core.log.info("parse addr: ", core.json.delay_encode(ip_info),
-  " resolver: ", core.json.delay_encode(dns_resolver),
-  " addr: ", addr)
+local ip_info, err = core.utils.dns_parse(dns_resolver, host)
+if not ip_info then
+return nil, err
+end
+
+core.log.info("parse addr: ", core.json.delay_encode(ip_info))
+core.log.info("resolver: ", core.json.delay_encode(dns_resolver))
+core.log.info("host: ", host)
 if ip_info and ip_info.address then
 new_nodes[ip_info.address .. ":" .. port] = weight
 core.log.info("dns resolver domain: ", host, " to ",
   ip_info.address)
+else
+return nil, "failed to parse

[incubator-apisix] branch master updated: bugfix: allow write debug log even if the openresty disabled debug model (#1124)

2020-02-15 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new c881c04  bugfix: allow write debug log even if the openresty disabled 
debug model (#1124)
c881c04 is described below

commit c881c04368350d808a0bb6c4ce1d97927ebdef4b
Author: YuanSheng Wang 
AuthorDate: Sun Feb 16 11:44:01 2020 +0800

bugfix: allow write debug log even if the openresty disabled debug model 
(#1124)

fix 
https://github.com/apache/incubator-apisix/pull/1121#discussion_r378760095
---
 .gitignore  | 1 +
 lua/apisix/core/log.lua | 5 +
 t/core/log.t| 4 
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/.gitignore b/.gitignore
index 880525d..c95899a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -56,6 +56,7 @@ client_body_temp
 utils/lj-releng
 .idea/
 *.iml
+dashboard/
 
 # .travis
 !.travis/*.sh
diff --git a/lua/apisix/core/log.lua b/lua/apisix/core/log.lua
index 902b88f..59791d6 100644
--- a/lua/apisix/core/log.lua
+++ b/lua/apisix/core/log.lua
@@ -16,8 +16,6 @@
 --
 local ngx = ngx
 local ngx_log  = ngx.log
-local ngx_DEBUG= ngx.DEBUG
-local DEBUG= ngx.config.debug
 local require  = require
 
 
@@ -44,8 +42,7 @@ setmetatable(_M, {__index = function(self, cmd)
 local log_level = log_levels[cmd]
 
 local method
-if cur_level and (log_level > cur_level or
-(log_level == ngx_DEBUG and not DEBUG))
+if cur_level and (log_level > cur_level)
 then
 method = do_nothing
 else
diff --git a/t/core/log.t b/t/core/log.t
index 2754174..0660c04 100644
--- a/t/core/log.t
+++ b/t/core/log.t
@@ -57,6 +57,7 @@ info log
 core.log.warn("warn log")
 core.log.notice("notice log")
 core.log.info("info log")
+core.log.debug("debug log")
 ngx.say("done")
 }
 }
@@ -69,6 +70,7 @@ warn log
 --- no_error_log
 notice log
 info log
+debug log
 
 
 
@@ -81,6 +83,7 @@ info log
 core.log.warn("warn log")
 core.log.notice("notice log")
 core.log.info("info log")
+core.log.debug("debug log")
 ngx.say("done")
 }
 }
@@ -93,6 +96,7 @@ warn log
 notice log
 --- no_error_log
 info log
+debug log
 
 
 



[incubator-apisix] branch master updated: bugfix: checked `consumer` first, it maybe a boolean value when it was beed deleted. (#1139)

2020-02-19 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new fbb9bd0  bugfix: checked `consumer` first, it maybe a boolean value 
when it was beed deleted. (#1139)
fbb9bd0 is described below

commit fbb9bd039c528b9cd02d621304fb6f9eb9de7aa0
Author: YuanSheng Wang 
AuthorDate: Thu Feb 20 15:23:30 2020 +0800

bugfix: checked `consumer` first, it maybe a boolean value when it was beed 
deleted. (#1139)
---
 lua/apisix/consumer.lua |  7 ++
 t/plugin/jwt-auth.t | 61 ++---
 2 files changed, 65 insertions(+), 3 deletions(-)

diff --git a/lua/apisix/consumer.lua b/lua/apisix/consumer.lua
index fd0c91b..31dfa05 100644
--- a/lua/apisix/consumer.lua
+++ b/lua/apisix/consumer.lua
@@ -19,6 +19,7 @@ local plugin   = require("apisix.plugin")
 local error= error
 local ipairs   = ipairs
 local pairs= pairs
+local type = type
 local consumers
 
 
@@ -35,6 +36,10 @@ local function plugin_consumer()
 end
 
 for _, consumer in ipairs(consumers.values) do
+if type(consumer) ~= "table" then
+goto CONTINUE
+end
+
 for name, config in pairs(consumer.value.plugins or {}) do
 local plugin_obj = plugin.get(name)
 if plugin_obj and plugin_obj.type == "auth" then
@@ -54,6 +59,8 @@ local function plugin_consumer()
 break
 end
 end
+
+::CONTINUE::
 end
 
 return plugins
diff --git a/t/plugin/jwt-auth.t b/t/plugin/jwt-auth.t
index fa91d59..d910bc2 100644
--- a/t/plugin/jwt-auth.t
+++ b/t/plugin/jwt-auth.t
@@ -29,9 +29,7 @@ __DATA__
 location /t {
 content_by_lua_block {
 local plugin = require("apisix.plugins.jwt-auth")
-local conf = {
-
-}
+local conf = {}
 
 local ok, err = plugin.check_schema(conf)
 if not ok then
@@ -272,3 +270,60 @@ Authorization: bearer 
invalid-eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrZXkiOiJ1c
 {"message":"invalid header: invalid-eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"}
 --- no_error_log
 [error]
+
+
+
+=== TEST 16: delete a exist consumer
+--- config
+location /t {
+content_by_lua_block {
+ngx.sleep(1)
+
+local t = require("lib.test_admin").test
+local code, body = t('/apisix/admin/consumers',
+ngx.HTTP_PUT,
+[[{
+"username": "jack",
+"plugins": {
+"jwt-auth": {
+"key": "user-key",
+"secret": "my-secret-key"
+}
+}
+}]]
+)
+ngx.say("code: ", code < 300, " body: ", body)
+
+code, body = t('/apisix/admin/consumers',
+ngx.HTTP_PUT,
+[[{
+"username": "chen",
+"plugins": {
+"jwt-auth": {
+"key": "chen-key",
+"secret": "chen-key"
+}
+}
+}]]
+)
+ngx.say("code: ", code < 300, " body: ", body)
+
+code, body = t('/apisix/admin/consumers/jack',
+ngx.HTTP_DELETE)
+ngx.say("code: ", code < 300, " body: ", body)
+
+ngx.sleep(1)
+code, body = t('/apisix/plugin/jwt/sign?key=chen-key',
+ngx.HTTP_GET)
+ngx.say("code: ", code < 300, " body: ", body)
+}
+}
+--- request
+GET /t
+--- response_body
+code: true body: passed
+code: true body: passed
+code: true body: passed
+code: true body: passed
+--- no_error_log
+[error]



[incubator-apisix] branch master updated: CLI: only used original Lua package path. (#1032)

2020-01-08 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new c21b8d2  CLI: only used original Lua package path. (#1032)
c21b8d2 is described below

commit c21b8d2fde98beef5e31482dda3404c798622d1f
Author: YuanSheng Wang 
AuthorDate: Thu Jan 9 14:24:37 2020 +0800

CLI: only used original Lua package path. (#1032)
---
 bin/apisix | 45 +
 1 file changed, 21 insertions(+), 24 deletions(-)

diff --git a/bin/apisix b/bin/apisix
index 5fae3ed..2fe82eb 100755
--- a/bin/apisix
+++ b/bin/apisix
@@ -17,8 +17,6 @@
 -- limitations under the License.
 --
 
-local script_path = arg[0]
-
 local function trim(s)
 return (s:gsub("^%s*(.-)%s*$", "%1"))
 end
@@ -30,36 +28,35 @@ local function excute_cmd(cmd)
 return data
 end
 
-local pwd = trim(excute_cmd("pwd"))
-if not pwd then
-error("failed to fetch current path")
-end
-
 excute_cmd("install -d -m 777 /tmp/apisix_cores/")
 
-local apisix_home = "/usr/local/apisix"
-package.cpath = "/usr/local/apisix/deps/lib64/lua/5.1/?.so;"
-.. "/usr/local/apisix/deps/lib/lua/5.1/?.so;"
-.. package.cpath
+local pkg_cpath_org = package.cpath
+local pkg_path_org = package.path
 
-package.path  = "/usr/local/apisix/deps/share/lua/5.1/apisix/lua/?.lua;"
-.. "/usr/local/apisix/deps/share/lua/5.1/?.lua;"
-.. "/usr/share/lua/5.1/apisix/lua/?.lua;"
-.. "/usr/local/share/lua/5.1/apisix/lua/?.lua;"
-.. package.path
+local apisix_home = "/usr/local/apisix"
+local pkg_cpath = apisix_home .. "/deps/lib64/lua/5.1/?.so;"
+  .. apisix_home .. "/deps/lib/lua/5.1/?.so;;"
+local pkg_path  = apisix_home .. "/deps/share/lua/5.1/apisix/lua/?.lua;"
+  .. apisix_home .. "/deps/share/lua/5.1/?.lua;;"
 
 -- only for developer, use current folder as working space
+local script_path = arg[0]
 if script_path:sub(1, 2) == './' then
-apisix_home = pwd
-package.cpath = pwd .. "/deps/lib64/lua/5.1/?.so;"
-.. package.cpath
+apisix_home = trim(excute_cmd("pwd"))
+if not apisix_home then
+error("failed to fetch current path")
+end
 
-package.path  = pwd .. "/lua/?.lua;"
-.. pwd .. "/deps/share/lua/5.1/?.lua;"
-.. package.path
+pkg_cpath = apisix_home .. "/deps/lib64/lua/5.1/?.so;"
+.. apisix_home .. "/deps/lib/lua/5.1/?.so;"
+pkg_path  = apisix_home .. "/lua/?.lua;"
+.. apisix_home .. "/deps/share/lua/5.1/?.lua;;"
 end
 -- print("apisix_home: ", apisix_home)
 
+package.cpath = pkg_cpath .. pkg_cpath_org
+package.path  = pkg_path .. pkg_path_org
+
 do
 -- skip luajit environment
 local ok = pcall(require, "table.new")
@@ -494,8 +491,8 @@ local function init()
 
 -- Using template.render
 local sys_conf = {
-lua_path = package.path,
-lua_cpath = package.cpath,
+lua_path = pkg_path_org,
+lua_cpath = pkg_cpath_org,
 os_name = exec("uname"),
 apisix_lua_home = apisix_home,
 with_module_status = with_module_status,



[incubator-apisix] branch master updated: bugfix: check if uri option starts with / in proxy-rewrite plugin. (#1039)

2020-01-11 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new c07b8b5  bugfix: check if uri option starts with / in proxy-rewrite 
plugin. (#1039)
c07b8b5 is described below

commit c07b8b53a5334497b63d45a7f2ee62a1560474bb
Author: agile6v 
AuthorDate: Sun Jan 12 00:24:01 2020 +0800

bugfix: check if uri option starts with / in proxy-rewrite plugin. (#1039)
---
 lua/apisix/plugins/proxy-rewrite.lua |  6 ++
 t/plugin/proxy-rewrite.t | 39 
 2 files changed, 45 insertions(+)

diff --git a/lua/apisix/plugins/proxy-rewrite.lua 
b/lua/apisix/plugins/proxy-rewrite.lua
index 41c8752..ab0e593 100644
--- a/lua/apisix/plugins/proxy-rewrite.lua
+++ b/lua/apisix/plugins/proxy-rewrite.lua
@@ -21,6 +21,7 @@ local ipairs  = ipairs
 local ngx = ngx
 local type= type
 local re_sub  = ngx.re.sub
+local str_sub = string.sub
 
 
 local schema = {
@@ -91,6 +92,11 @@ function _M.check_schema(conf)
 end
 end
 
+if conf.uri ~= nil then
+if str_sub(conf.uri, 1, 1) ~= "/" then
+return false, "invalid uri(" .. conf.uri .. "), must start with /."
+end
+end
 
 --reform header from object into array, so can avoid use pairs, which is 
NYI
 if conf.headers then
diff --git a/t/plugin/proxy-rewrite.t b/t/plugin/proxy-rewrite.t
index c3fe63b..832a197 100644
--- a/t/plugin/proxy-rewrite.t
+++ b/t/plugin/proxy-rewrite.t
@@ -967,3 +967,42 @@ GET /t
 --- error_code: 400
 --- error_log
 invalid capturing variable name found
+
+
+
+=== TEST 34: set route(invalid uri)
+--- config
+location /t {
+content_by_lua_block {
+local t = require("lib.test_admin").test
+local code, body = t('/apisix/admin/routes/1',
+ ngx.HTTP_PUT,
+ [[{
+"plugins": {
+"proxy-rewrite": {
+"uri": "hello"
+}
+},
+"upstream": {
+"nodes": {
+"127.0.0.1:1980": 1
+},
+"type": "roundrobin"
+},
+"uri": "/hello"
+}]]
+)
+
+if code >= 300 then
+ngx.status = code
+end
+ngx.say(body)
+}
+}
+--- request
+GET /t
+--- error_code: 400
+--- response_body eval
+qr/invalid uri/
+--- no_error_log
+[error]



[incubator-apisix] branch master updated: doc: fix typo in 'The advantages of Apache APISIX' (#1043)

2020-01-12 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 781c81a  doc: fix typo in 'The advantages of Apache APISIX' (#1043)
781c81a is described below

commit 781c81aa4d040cd2eb81a8a4570751de86e21289
Author: Lien 
AuthorDate: Mon Jan 13 14:35:03 2020 +0800

doc: fix typo in 'The advantages of Apache APISIX' (#1043)
---
 README.md| 4 ++--
 README_CN.md | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index eba0f5f..6040f59 100644
--- a/README.md
+++ b/README.md
@@ -178,9 +178,9 @@ Using AWS's 8 core server, APISIX's QPS reach to 140,000 
with a latency of only
  The advantages of Apache APISIX
 | **Features**   | **Apache APISIX**   | **Kong**   |
 |:|:|:|
-| belongs to   | Apache Foundation   | Kong Inc.   |
+| belongs to   | Apache Software Foundation   | Kong Inc.   |
 | Tech Architecture | Nginx + etcd   | Nginx + postgres   |
-| Communication channels  | Mail list, Wechat qroup, QQ group, Github, meetup  
 | Github,freenode, forum   |
+| Communication channels  | Mail list, Wechat group, QQ group, Github, meetup  
 | Github,freenode, forum   |
 | Single-core CPU, QPS(enable limit-count and prometheus plugins)   | 18000   
| 1700   |
 |  latency | 0.2 ms   | 2 ms   |
 | IPv6| Yes   | No   |
diff --git a/README_CN.md b/README_CN.md
index e585575..89bd681 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -180,7 +180,7 @@ Dashboard 默认允许任何 IP 访问。你可以自行修改 `conf/config.yaml
 
 | **功能**   | **Apache APISIX**   | **KONG**   |
 |:|:|:|
-| 项目归属   | Apache 基金会   | Kong Inc.   |
+| 项目归属   | Apache 软件基金会   | Kong Inc.   |
 | 技术架构   | Nginx + etcd   | Nginx + postgres   |
 | 交流渠道  | 微信群、QQ群、邮件列表、Github、meetup   | Github、论坛、freenode   |
 | 单核 QPS(开启限流和prometheus插件)   | 18000   | 1700   |



  1   2   3   4   5   6   >