[incubator-apisix-dashboard] annotated tag v1.0 updated (4eb74a0 -> 9327628)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a change to annotated tag v1.0 in repository https://gitbox.apache.org/repos/asf/incubator-apisix-dashboard.git. *** WARNING: tag v1.0 was modified! *** from 4eb74a0 (commit) to 9327628 (tag) tagging 4eb74a009ff8672d4d0cfd8df46975932df161a8 (commit) by Yuansheng on Fri Feb 14 17:15:00 2020 +0800 - Log - --- No new revisions were added by this update. Summary of changes:
[incubator-apisix] branch master updated: doc: add wolf-rbac plugin (#1116)
This is an automated email from the ASF dual-hosted git repository. membphis 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 7fe2272 doc: add wolf-rbac plugin (#1116) 7fe2272 is described below commit 7fe22724926a6bc82c338c6925f78b2ed9c9ea1c Author: iGeeky AuthorDate: Fri Feb 14 11:08:11 2020 +0800 doc: add wolf-rbac plugin (#1116) Co-authored-by: jie --- README.md| 2 +- README_CN.md | 2 +- doc/README.md| 3 ++- doc/README_CN.md | 3 ++- doc/plugins/wolf-rbac.md | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6252827..21e114b 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ A/B testing, canary release, blue-green deployment, limit rate, defense against - [Support priority](doc/router-radixtree.md#3-match-priority) - **Security** -- Authentications: [key-auth](doc/plugins/key-auth.md), [JWT](doc/plugins/jwt-auth.md), [basic-auth](doc/plugins/basic-auth.md) +- Authentications: [key-auth](doc/plugins/key-auth.md), [JWT](doc/plugins/jwt-auth.md), [basic-auth](doc/plugins/basic-auth.md), [wolf-rbac](doc/plugins/wolf-rbac.md) - [IP Whitelist/Blacklist](doc/plugins/ip-restriction.md) - [IdP](doc/plugins/oauth.md): Support external authentication services, such as Auth0, okta, etc., users can use this to connect to OAuth 2.0 and other authentication methods. - [Limit-req](doc/plugins/limit-req.md) diff --git a/README_CN.md b/README_CN.md index 201a41f..ae6d2fc 100644 --- a/README_CN.md +++ b/README_CN.md @@ -83,7 +83,7 @@ A/B 测试、金丝雀发布(灰度发布)、蓝绿部署、限流限速、抵 - [支持路由的优先级](doc/router-radixtree.md#3-match-priority) - **安全防护** -- 多种身份认证方式: [key-auth](doc/plugins/key-auth-cn.md), [JWT](doc/plugins/jwt-auth-cn.md), [basic-auth](doc/plugins/basic-auth-cn.md)。 +- 多种身份认证方式: [key-auth](doc/plugins/key-auth-cn.md), [JWT](doc/plugins/jwt-auth-cn.md), [basic-auth](doc/plugins/basic-auth-cn.md), [wolf-rbac](doc/plugins/wolf-rbac-cn.md)。 - [IP 黑白名单](doc/plugins/ip-restriction-cn.md) - [IdP 支持](doc/plugins/oauth.md): 支持外部的身份认证服务,比如 Auth0,Okta,Authing 等,用户可以借此来对接 Oauth2.0 等认证方式。 - [限制速率](doc/plugins/limit-req-cn.md) diff --git a/doc/README.md b/doc/README.md index 51e5ac5..7b01f22 100644 --- a/doc/README.md +++ b/doc/README.md @@ -42,7 +42,8 @@ Plugins * [hot reload](plugins.md): Hot reload without reload service. * [key-auth](plugins/key-auth.md): User authentication based on Key Authentication. * [JWT-auth](plugins/jwt-auth.md): User authentication based on [JWT](https://jwt.io/) (JSON Web Tokens) Authentication. -* [basic-auth](doc/plugins/basic-auth.md): User authentication based on Basic Authentication. +* [basic-auth](plugins/basic-auth.md): User authentication based on Basic Authentication. +* [wolf-rbac](plugins/wolf-rbac.md) User Authentication and Authorization based on *RBAC*. * [HTTPS/TLS](https.md): Dynamic load the SSL Certificate by Server Name Indication (SNI). * [limit-count](plugins/limit-count.md): Rate limiting based on a "fixed window" implementation. * [limit-req](plugins/limit-req.md): Request rate limiting and adjustment based on the "leaky bucket" method. diff --git a/doc/README_CN.md b/doc/README_CN.md index 201e6c1..a60d558 100644 --- a/doc/README_CN.md +++ b/doc/README_CN.md @@ -44,7 +44,8 @@ Reference document * [动态负载均衡](architecture-design-cn.md#upstream):跨多个上游服务的动态负载均衡,目前已支持 round-robin 和一致性哈希算法。 * [key-auth](plugins/key-auth-cn.md):基于 Key Authentication 的用户认证。 * [JWT-auth](plugins/jwt-auth-cn.md):基于 [JWT](https://jwt.io/) (JSON Web Tokens) Authentication 的用户认证。 -* [basic-auth](doc/plugins/basic-auth-cn.md):基于 basic auth 的用户认证。 +* [basic-auth](plugins/basic-auth-cn.md):基于 basic auth 的用户认证。 +* [wolf-rbac](plugins/wolf-rbac-cn.md) 基于 *RBAC* 的用户认证及授权。 * [limit-count](plugins/limit-count-cn.md):基于“固定窗口”的限速实现。 * [limit-req](plugins/limit-req-cn.md):基于漏桶原理的请求限速实现。 * [limit-conn](plugins/limit-conn-cn.md):限制并发请求(或并发连接)。 diff --git a/doc/plugins/wolf-rbac.md b/doc/plugins/wolf-rbac.md index 639070b..e237b63 100644 --- a/doc/plugins/wolf-rbac.md +++ b/doc/plugins/wolf-rbac.md @@ -31,7 +31,7 @@ ## Name `wolf-rbac` is an authentication and authorization (rbac) plugin. It needs to work with `consumer`. Also need to add `wolf-rbac` to a` service` or `route`. -The rbac feature is provided by [wolf] (https://github.com/iGeeky/wolf). For more information about `wolf`, please refer to [wolf documentation] (https://github.com/iGeeky/wolf). +The rbac feature is provided by [wolf](https://github.com/iGeeky/wolf). For more information about `wolf`, please refer to [wolf documentation](https://github.com/iGeeky/wolf). ## Attributes
[incubator-apisix] branch master updated: doc: add link to download grafana meta data. (#1119)
This is an automated email from the ASF dual-hosted git repository. membphis 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 187d657 doc: add link to download grafana meta data. (#1119) 187d657 is described below commit 187d65764c9fb2c0895e30f328c2fe0e6a4f4479 Author: YuanSheng Wang AuthorDate: Tue Feb 11 12:57:58 2020 +0800 doc: add link to download grafana meta data. (#1119) Fix #1103 --- doc/plugins/prometheus-cn.md | 2 ++ doc/plugins/prometheus.md| 1 + 2 files changed, 3 insertions(+) diff --git a/doc/plugins/prometheus-cn.md b/doc/plugins/prometheus-cn.md index 9025886..851d40d 100644 --- a/doc/plugins/prometheus-cn.md +++ b/doc/plugins/prometheus-cn.md @@ -84,6 +84,8 @@ scrape_configs: 插件导出的指标可以在 Grafana 进行图形化绘制显示。 +你可以到 [Grafana meta](https://grafana.com/grafana/dashboards/11719) 下载 `Grafana` 元数据. + ![](../../doc/images/plugin/grafana_1.png) ![](../../doc/images/plugin/grafana_2.png) diff --git a/doc/plugins/prometheus.md b/doc/plugins/prometheus.md index 98e0e4e..f589b72 100644 --- a/doc/plugins/prometheus.md +++ b/doc/plugins/prometheus.md @@ -85,6 +85,7 @@ And we can check the status at prometheus console: Metrics exported by the plugin can be graphed in Grafana using a drop in dashboard. +You can goto [Grafana meta](https://grafana.com/grafana/dashboards/11719) for `Grafana` meta data. ![](../../doc/images/plugin/grafana_1.png)
[incubator-apisix] branch master updated: CLI: added missing Lua path. (#1114)
This is an automated email from the ASF dual-hosted git repository. membphis 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 4a681af CLI: added missing Lua path. (#1114) 4a681af is described below commit 4a681af4cb42b2184d5d79bbdd1be65a6b3797f3 Author: YuanSheng Wang AuthorDate: Sun Feb 9 20:57:13 2020 +0800 CLI: added missing Lua path. (#1114) --- .travis/check-nginxconf.sh | 2 +- bin/apisix | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis/check-nginxconf.sh b/.travis/check-nginxconf.sh index ba8e4b7..938325a 100644 --- a/.travis/check-nginxconf.sh +++ b/.travis/check-nginxconf.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash # # Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/bin/apisix b/bin/apisix index eea31ef..db8e97b 100755 --- a/bin/apisix +++ b/bin/apisix @@ -103,6 +103,7 @@ worker_shutdown_timeout 3; {% if stream_proxy then %} stream { lua_package_path "$prefix/deps/share/lua/5.1/?.lua;/usr/share/lua/5.1/apisix/lua/?.lua;]=] + .. [=[/usr/local/share/lua/5.1/apisix/lua/?.lua;]=] .. [=[$prefix/deps/share/lua/5.1/apisix/lua/?.lua;]=] .. [=[{*apisix_lua_home*}/lua/?.lua;;{*lua_path*};"; lua_package_cpath "$prefix/deps/lib64/lua/5.1/?.so;]=] @@ -150,6 +151,7 @@ stream { http { lua_package_path "$prefix/deps/share/lua/5.1/?.lua;/usr/share/lua/5.1/apisix/lua/?.lua;]=] + .. [=[/usr/local/share/lua/5.1/apisix/lua/?.lua;]=] .. [=[$prefix/deps/share/lua/5.1/apisix/lua/?.lua;]=] .. [=[{*apisix_lua_home*}/lua/?.lua;;{*lua_path*};"; lua_package_cpath "$prefix/deps/lib64/lua/5.1/?.so;]=]
[incubator-apisix] branch master updated: CLI: add verify command to verify apisix configuration(nginx.conf). (#1112)
This is an automated email from the ASF dual-hosted git repository. membphis 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 ff4c4f5 CLI: add verify command to verify apisix configuration(nginx.conf). (#1112) ff4c4f5 is described below commit ff4c4f5afbe6b64916b15fcca007580c263ac35d Author: agile6v AuthorDate: Sun Feb 9 20:43:30 2020 +0800 CLI: add verify command to verify apisix configuration(nginx.conf). (#1112) --- Makefile | 6 ++ 1 file changed, 6 insertions(+) diff --git a/Makefile b/Makefile index a72f75f..f56f378 100644 --- a/Makefile +++ b/Makefile @@ -102,6 +102,12 @@ stop: default $(OR_EXEC) -p $$PWD/ -c $$PWD/conf/nginx.conf -s stop +### verify: Verify the configuration of apisix server +.PHONY: verify +verify: default + $(OR_EXEC) -p $$PWD/ -c $$PWD/conf/nginx.conf -t + + ### clean:Remove generated files .PHONY: clean clean:
[incubator-apisix] branch master updated: CLI: `bin/apisix` to support the SO_REUSEPORT (#1085)
This is an automated email from the ASF dual-hosted git repository. membphis 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 60b2493 CLI: `bin/apisix` to support the SO_REUSEPORT (#1085) 60b2493 is described below commit 60b2493f5b781462a442b58f7f0385412945aae9 Author: Yousa AuthorDate: Sun Feb 9 17:19:45 2020 +0800 CLI: `bin/apisix` to support the SO_REUSEPORT (#1085) Fix #342 --- .gitignore | 3 +++ .travis/check-nginxconf.sh | 29 + .travis/linux_apisix_luarocks_runner.sh | 23 +++ bin/apisix | 12 ++-- conf/config.yaml| 1 + 5 files changed, 54 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index e74c4e6..880525d 100644 --- a/.gitignore +++ b/.gitignore @@ -56,3 +56,6 @@ client_body_temp utils/lj-releng .idea/ *.iml + +# .travis +!.travis/*.sh diff --git a/.travis/check-nginxconf.sh b/.travis/check-nginxconf.sh new file mode 100644 index 000..ba8e4b7 --- /dev/null +++ b/.travis/check-nginxconf.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +# +# 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. +# + +#check whether the 'reuseport' is in nginx.conf . +matched=`grep -E "listen.*reuseport" conf/nginx.conf | wc -l` +if [ $matched -eq 0 ]; then +echo "failed: nginx.conf file is missing reuseport configuration" +exit 1 +else +echo "passed: nginx.conf file contains reuseport configuration" +fi + +exit 0 diff --git a/.travis/linux_apisix_luarocks_runner.sh b/.travis/linux_apisix_luarocks_runner.sh index 8a494ff..9327a47 100755 --- a/.travis/linux_apisix_luarocks_runner.sh +++ b/.travis/linux_apisix_luarocks_runner.sh @@ -43,20 +43,27 @@ script() { sudo mkdir -p /usr/local/apisix/deps sudo PATH=$PATH ./utils/install-apisix.sh install -sudo apisix help -sudo apisix init -sudo apisix start -sudo apisix stop +sudo PATH=$PATH apisix help +sudo PATH=$PATH apisix init +sudo PATH=$PATH apisix start +sudo PATH=$PATH apisix stop sudo PATH=$PATH ./utils/install-apisix.sh remove # install APISIX by luarocks sudo luarocks install rockspec/apisix-master-0.rockspec -sudo apisix help -sudo apisix init -sudo apisix start -sudo apisix stop +sudo PATH=$PATH apisix help +sudo PATH=$PATH apisix init +sudo PATH=$PATH apisix start +sudo PATH=$PATH apisix stop + +# make init +# 'make init' operates scripts and related configuration files in the current directory +# The 'apisix' command is a command in the /usr/local/apisix, +# and the configuration file for the operation is in the /usr/local/apisix/conf +sudo PATH=$PATH make init +sudo PATH=$PATH bash .travis/check-nginxconf.sh sudo luarocks remove rockspec/apisix-master-0.rockspec } diff --git a/bin/apisix b/bin/apisix index 69b7453..eea31ef 100755 --- a/bin/apisix +++ b/bin/apisix @@ -129,10 +129,10 @@ stream { server { {% for _, port in ipairs(stream_proxy.tcp or {}) do %} -listen {*port*}; +listen {*port*} {% if enable_reuseport then %} reuseport {% end %}; {% end %} {% for _, port in ipairs(stream_proxy.udp or {}) do %} -listen {*port*} udp; +listen {*port*} udp {% if enable_reuseport then %} reuseport {% end %}; {% end %} preread_by_lua_block { @@ -261,15 +261,15 @@ http { {% end %} server { -listen {* node_listen *}; +listen {* node_listen *} {% if enable_reuseport then %} reuseport {% end %}; {% if ssl.enable then %} -listen {* ssl.listen_port *} ssl {% if ssl.enable_http2 then %} http2 {% end %}; +listen {* ssl.listen_port *} ssl {% if ssl.enable_http2 then %} http2 {% end %} {% if enable_reuseport then %} reuseport {% end %}; {% end %} {% if enable_ipv6 then %} -listen [::]:{* node_listen *}; +listen [::]:{* node_listen *} {%
[incubator-apisix] branch master updated: Using internal request instead of external request in node-status plugin. (#1109)
This is an automated email from the ASF dual-hosted git repository. membphis 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 6cc3654 Using internal request instead of external request in node-status plugin. (#1109) 6cc3654 is described below commit 6cc36546ec7724ee26fd0ab01920b12a0210e515 Author: agile6v AuthorDate: Fri Feb 7 20:00:49 2020 +0800 Using internal request instead of external request in node-status plugin. (#1109) --- lua/apisix/admin/plugins.lua | 4 ++-- lua/apisix/plugins/node-status.lua | 9 ++--- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/lua/apisix/admin/plugins.lua b/lua/apisix/admin/plugins.lua index ba4bdcc..1ae7dfe 100644 --- a/lua/apisix/admin/plugins.lua +++ b/lua/apisix/admin/plugins.lua @@ -42,7 +42,7 @@ function _M.check_schema(plugins_conf) core.json.delay_encode(plugin_conf, true)) local plugin_obj = local_plugins[name] if not plugin_obj then -return false, "unknow plugin [" .. name .. "]" +return false, "unknown plugin [" .. name .. "]" end if plugin_obj.check_schema then @@ -67,7 +67,7 @@ function _M.stream_check_schema(plugins_conf) ": ", core.json.delay_encode(plugin_conf, true)) local plugin_obj = stream_local_plugins[name] if not plugin_obj then -return false, "unknow plugin [" .. name .. "]" +return false, "unknown plugin [" .. name .. "]" end if plugin_obj.check_schema then diff --git a/lua/apisix/plugins/node-status.lua b/lua/apisix/plugins/node-status.lua index d34d271..112813a 100644 --- a/lua/apisix/plugins/node-status.lua +++ b/lua/apisix/plugins/node-status.lua @@ -17,6 +17,7 @@ local core = require("apisix.core") local ngx = ngx local re_gmatch = ngx.re.gmatch +local ngx_capture = ngx.location.capture local plugin_name = "node-status" local apisix_id = core.id.get() local ipairs = ipairs @@ -37,13 +38,7 @@ local ngx_statu_items = { local function collect() -local res, err = core.http.request_self("/apisix/nginx_status", { -keepalive = false, -}) -if not res then -return 500, "failed to fetch nginx status: " .. err -end - +local res = ngx_capture("/apisix/nginx_status") if res.status ~= 200 then return res.status end
[incubator-apisix] branch master updated: doc: updated the download link of rpm. (#1108)
This is an automated email from the ASF dual-hosted git repository. membphis 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 a9f05e5 doc: updated the download link of rpm. (#1108) a9f05e5 is described below commit a9f05e531b7fccf9093639f838bf23e3a34d41d8 Author: WenMing AuthorDate: Thu Feb 6 11:33:56 2020 +0800 doc: updated the download link of rpm. (#1108) --- doc/how-to-build-cn.md | 2 +- doc/how-to-build.md| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/how-to-build-cn.md b/doc/how-to-build-cn.md index 7ed6b51..b630286 100644 --- a/doc/how-to-build-cn.md +++ b/doc/how-to-build-cn.md @@ -45,7 +45,7 @@ make deps ### 通过 RPM 包安装(CentOS 7) ```shell -sudo yum install -y https://github.com/apache/incubator-apisix/releases/download/v1.0/apisix-1.0-0.el7.noarch.rpm +sudo yum install -y https://github.com/apache/incubator-apisix/releases/download/1.0/apisix-1.0-0.el7.noarch.rpm ``` ### 通过 Luarocks 安装 (不支持 macOS) diff --git a/doc/how-to-build.md b/doc/how-to-build.md index 82c1b89..4675629 100644 --- a/doc/how-to-build.md +++ b/doc/how-to-build.md @@ -46,7 +46,7 @@ make deps ### Installation via RPM package (CentOS 7) ```shell -sudo yum install -y https://github.com/apache/incubator-apisix/releases/download/v1.0/apisix-1.0-0.el7.noarch.rpm +sudo yum install -y https://github.com/apache/incubator-apisix/releases/download/1.0/apisix-1.0-0.el7.noarch.rpm ``` ### Installation via Luarocks (macOS not supported)
[incubator-apisix] branch master updated: feature: increase the default size of the core file (#1105)
This is an automated email from the ASF dual-hosted git repository. membphis 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 abcd197 feature: increase the default size of the core file (#1105) abcd197 is described below commit abcd1973120fc67bbe7f0c43c08e349d2cf9dcad Author: 罗泽轩 AuthorDate: Tue Feb 4 11:02:07 2020 +0800 feature: increase the default size of the core file (#1105) Close #1101. --- bin/apisix | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/bin/apisix b/bin/apisix index 0102c38..69b7453 100755 --- a/bin/apisix +++ b/bin/apisix @@ -95,7 +95,7 @@ events { worker_connections {* event.worker_connections *}; } -worker_rlimit_core 500M; +worker_rlimit_core {* worker_rlimit_core *}; working_directory /tmp/apisix_cores/; worker_shutdown_timeout 3; @@ -437,6 +437,17 @@ local function get_openresty_version() return nil end +local function is_32bit_arch() +local ok, ffi = pcall(require, "ffi") +if ok then +-- LuaJIT +return ffi.abi("32bit") +end +local ret = excute_cmd("getconf LONG_BIT") +local bits = tonumber(ret) +return bits <= 32 +end + local function split(self, sep) local sep, fields = sep or ":", {} local pattern = string.format("([^%s]+)", sep) @@ -517,6 +528,12 @@ local function init() error("failed to read `nginx_config` field from yaml file") end +if is_32bit_arch() then +sys_conf["worker_rlimit_core"] = "4G" +else +sys_conf["worker_rlimit_core"] = "16G" +end + for k,v in pairs(yaml_conf.apisix) do sys_conf[k] = v end
[incubator-apisix] branch master updated: test: always specify perl include path. (#1097)
This is an automated email from the ASF dual-hosted git repository. membphis 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 0ddf40a test: always specify perl include path. (#1097) 0ddf40a is described below commit 0ddf40a9106c4530a8f70f5e0878ec39809a8c3d Author: 罗泽轩 AuthorDate: Sat Feb 1 19:56:36 2020 +0800 test: always specify perl include path. (#1097) Close #1091. --- Makefile | 5 - 1 file changed, 5 deletions(-) diff --git a/Makefile b/Makefile index bd60e0c..a72f75f 100644 --- a/Makefile +++ b/Makefile @@ -168,12 +168,7 @@ install: ### test: Run the test case test: -ifeq ($(UNAME),Darwin) prove -I../test-nginx/lib -I./ -r -s t/ -else - prove -I../test-nginx/lib -r -s t/ -endif - ### license-check:Check Lua source code for Apache License .PHONY: license-check
[incubator-apisix] branch master updated: doc: add more english article. (#1092)
This is an automated email from the ASF dual-hosted git repository. membphis 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 76b6254 doc: add more english article. (#1092) 76b6254 is described below commit 76b62544479cab8da961fcf1ba03b91412ddefef Author: WenMing AuthorDate: Sat Feb 1 11:30:41 2020 +0800 doc: add more english article. (#1092) --- README.md | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 698a9f5..364bd10 100644 --- a/README.md +++ b/README.md @@ -55,8 +55,8 @@ A/B testing, canary release, blue-green deployment, limit rate, defense against - **Multi protocols** - [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). -- [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. +- [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 Dubbo: Dubbo Proxy based on Tengine. - HTTP(S) Forward Proxy @@ -69,7 +69,7 @@ A/B testing, canary release, blue-green deployment, limit rate, defense against - [Serverless](doc/plugins/serverless.md): Invoke functions in each phase in APISIX. - Dynamic Load Balancing: Round-robin load balancing with weight. - Hash-based Load Balancing: Load balance with consistent hashing sessions. -- [Health Checks](doc/health-check.md):Enable health check on the upstream node, and will automatically filter unhealthy nodes during load balancing to ensure system stability. +- [Health Checks](doc/health-check.md): Enable health check on the upstream node, and will automatically filter unhealthy nodes during load balancing to ensure system stability. - Circuit-Breaker: Intelligent tracking of unhealthy upstream services. - **Fine-grained routing** @@ -211,7 +211,8 @@ 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.8.31 [APISIX technology selection, testing and continuous integration](https://medium.com/@ming_wen/apache-apisixs-technology-selection-testing-and-continuous-integration-313221b02542) +- [APISIX technology selection, testing and continuous integration](https://medium.com/@ming_wen/apache-apisixs-technology-selection-testing-and-continuous-integration-313221b02542) +- [Analysis of Excellent Performance of Apache APISIX Microservices Gateway](https://medium.com/@ming_wen/analysis-of-excellent-performance-of-apache-apisix-microservices-gateway-fc77db4090b5) ## 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: travis: run a APISIX instance which intalled by luarocks. (#1063)
This is an automated email from the ASF dual-hosted git repository. membphis 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 5f2210b travis: run a APISIX instance which intalled by luarocks. (#1063) 5f2210b is described below commit 5f2210b421aa42cae77971bc04f50dab2bc57e8b Author: YuanSheng Wang AuthorDate: Wed Jan 22 16:19:01 2020 +0800 travis: run a APISIX instance which intalled by luarocks. (#1063) --- .travis.yml | 3 ++ .travis/linux_apisix_luarocks_runner.sh | 74 + utils/install-apisix.sh | 6 +-- 3 files changed, 80 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 287fbb6..ee84fd8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ matrix: fast_finish: true allow_failures: - os: osx +- env: OSNAME=linux_apisix_luarocks include: - os: linux @@ -22,6 +23,8 @@ matrix: services: - redis-server env: OSNAME=linux_tengine +- os: linux + env: OSNAME=linux_apisix_luarocks language: c diff --git a/.travis/linux_apisix_luarocks_runner.sh b/.travis/linux_apisix_luarocks_runner.sh new file mode 100755 index 000..8a494ff --- /dev/null +++ b/.travis/linux_apisix_luarocks_runner.sh @@ -0,0 +1,74 @@ +#!/usr/bin/env bash +# +# 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. +# + +set -ex + +export_or_prefix() { +export OPENRESTY_PREFIX="/usr/local/openresty-debug" +} + +do_install() { +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 "deb http://openresty.org/package/ubuntu $(lsb_release -sc) main" +sudo add-apt-repository -y ppa:longsleep/golang-backports + +sudo apt-get update +sudo apt-get install openresty-debug +} + +script() { +export_or_prefix +export PATH=$OPENRESTY_PREFIX/nginx/sbin:$OPENRESTY_PREFIX/luajit/bin:$OPENRESTY_PREFIX/bin:$PATH +openresty -V +sudo service etcd start + +# install APISIX by shell +sudo mkdir -p /usr/local/apisix/deps +sudo PATH=$PATH ./utils/install-apisix.sh install + +sudo apisix help +sudo apisix init +sudo apisix start +sudo apisix stop + +sudo PATH=$PATH ./utils/install-apisix.sh remove + +# install APISIX by luarocks +sudo luarocks install rockspec/apisix-master-0.rockspec + +sudo apisix help +sudo apisix init +sudo apisix start +sudo apisix stop + +sudo luarocks remove rockspec/apisix-master-0.rockspec +} + +case_opt=$1 +shift + +case ${case_opt} in +do_install) +do_install "$@" +;; +script) +script "$@" +;; +esac diff --git a/utils/install-apisix.sh b/utils/install-apisix.sh index 9cdfb6c..75295dd 100755 --- a/utils/install-apisix.sh +++ b/utils/install-apisix.sh @@ -43,13 +43,13 @@ echo $UNAME do_install() { if [ "$UNAME" = "Darwin" ]; then -luarocks install --lua-dir=$LUA_JIT_DIR $APISIX_VER --tree=/usr/local/apisix/deps --local +sudo luarocks install --lua-dir=$LUA_JIT_DIR $APISIX_VER --tree=/usr/local/apisix/deps --local elif [ "$LUAROCKS_VER" = 'luarocks 3.' ]; then -luarocks install --lua-dir=$LUA_JIT_DIR $APISIX_VER --tree=/usr/local/apisix/deps --local +sudo luarocks install --lua-dir=$LUA_JIT_DIR $APISIX_VER --tree=/usr/local/apisix/deps --local else -luarocks install $APISIX_VER --tree=/usr/local/apisix/deps --local +sudo luarocks install $APISIX_VER --tree=/usr/local/apisix/deps --local fi sudo rm -f /usr/local/bin/apisix
[incubator-apisix] branch master updated: doc: response-rewrite.md optimiazition (#1083)
This is an automated email from the ASF dual-hosted git repository. membphis 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 92d8676 doc: response-rewrite.md optimiazition (#1083) 92d8676 is described below commit 92d867619e7393d3145e1ca9aebad4f43f9e800a Author: Lien AuthorDate: Mon Jan 20 10:36:08 2020 +0800 doc: response-rewrite.md optimiazition (#1083) --- doc/plugins/response-rewrite.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/plugins/response-rewrite.md b/doc/plugins/response-rewrite.md index eb0983d..0857f37 100644 --- a/doc/plugins/response-rewrite.md +++ b/doc/plugins/response-rewrite.md @@ -31,7 +31,7 @@ response rewrite plugin, rewrite the content from upstream. **senario**: 1. can set `Access-Control-Allow-*` series field to support CORS(Cross-origin Resource Sharing). -2. we can set customized `status_code` and `Location` field in header to achieve redirect, you can alse use [redirect](redirect-cn.md) plugin if you just want a redirect function.function +2. we can set customized `status_code` and `Location` field in header to achieve redirect, you can alse use [redirect](redirect-cn.md) plugin if you just want a redirection. ## Attributes |Name|Requirement|Description|
[incubator-apisix] branch master updated: doc: getting-started.md check (#1084)
This is an automated email from the ASF dual-hosted git repository. membphis 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 13534cd doc: getting-started.md check (#1084) 13534cd is described below commit 13534cdbda6a135f49256424a3db9ec58673543f Author: Lien AuthorDate: Mon Jan 20 09:58:13 2020 +0800 doc: getting-started.md check (#1084) --- doc/getting-started.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/getting-started.md b/doc/getting-started.md index 3c78e5b..9d2f156 100644 --- a/doc/getting-started.md +++ b/doc/getting-started.md @@ -33,12 +33,12 @@ Let's deconstruct the above URL. - Scheme: HTTPS - Host/Address: httpbin.org - Port: 443 -- URI: get +- 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. +- This guide uses docker and docker-compose to setup APISIX. But if you have already installed APISIX in other ways, you can just skip to [step 2](getting-started.md#step-2-create-a-route-in-apisix). - 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
[incubator-apisix] branch master updated: doc: added additional information and refactoring sentences. (#1078)
This is an automated email from the ASF dual-hosted git repository. membphis 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 5736a03 doc: added additional information and refactoring sentences. (#1078) 5736a03 is described below commit 5736a0327220ca17fadc9a18cff33dfb7cbe Author: Nirojan Selvanathan AuthorDate: Sat Jan 18 19:04:23 2020 +0530 doc: added additional information and refactoring sentences. (#1078) --- doc/plugin-develop.md | 33 ++--- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/doc/plugin-develop.md b/doc/plugin-develop.md index 72f7816..fc22f50 100644 --- a/doc/plugin-develop.md +++ b/doc/plugin-develop.md @@ -121,7 +121,7 @@ at its schema description : } ``` -at the same time, we need to implement the __check_schema(conf)__ method to complete the specification verification . +At the same time, we need to implement the __check_schema(conf)__ method to complete the specification verification . ```lua function _M.check_schema(conf) @@ -134,21 +134,29 @@ verification . ## choose phase to run -determine which phase to run , generally access or rewrite . if you don't know the Openresty life cycle , it's -recommended to know it in advance . key-auth is an authentication plugin , as long as the authentication is completed -before the business response after the request comes in . The plugin can be executed in the rewrite and access phases , -in the project, the authentication logic is implemented in the rewrite phase . Generally, IP access and interface +Determine which phase to run , generally access or rewrite . If you don't know the [Openresty life cycle](https://openresty-reference.readthedocs.io/en/latest/Directives/) , it's +recommended to know it in advance . For example key-auth is an authentication plugin , thus the authentication should be completed +before forwarding the request to any upstream service. Therefore, the plugin can be executed in the rewrite and access phases. +In APISIX, the authentication logic is implemented in the rewrite phase . Generally, IP access and interface permission are completed in the access phase . +The following code snippet shows how to implement any logic relevant to the plugin in the Openresty log phase. + +```lua +function _M.log(conf) +-- Implement logic here +end +``` + ## implement the logic Write the logic of the plugin in the corresponding phase . ## write test case -for functions , write and improve the test cases of various dimensions , do a comprehensive test for your plugin ! The -test cases of plugins are all in the "__t/plugin__" directory. You can go ahead to find out . the test framework -[test-nginx](https://github.com/openresty/test-nginx) adopted by the project. a test case, .t file is usually +For functions , write and improve the test cases of various dimensions , do a comprehensive test for your plugin ! The +test cases of plugins are all in the "__t/plugin__" directory. You can go ahead to find out. APISIX uses +[test-nginx](https://github.com/openresty/test-nginx) as the test framework. A test case, .t file is usually divided into prologue and data parts by \__data\__ . Here we will briefly introduce the data part, that is, the part of the real test case . For example, the key-auth plugin : @@ -174,14 +182,17 @@ done [error] ``` -a test case consists of three parts : +A test case consists of three parts : - __Program code__ : configuration content of Nginx location - __Input__ : http request information - __Output check__ : status, header, body, error log check -when we request __/t__ , which config in the configuration file , the Nginx will call "__content_by_lua_block__" instruction to +When we request __/t__ , which config in the configuration file , the Nginx will call "__content_by_lua_block__" instruction to complete the Lua script, and finally return. The assertion of the use case is response_body return "done", -"__no_error_log__" means to check the "__error.log__" of Nginx. There must be no ERROR level record . +"__no_error_log__" means to check the "__error.log__" of Nginx. There must be no ERROR level record. The log files for the unit test +are located in the following folder: 't/servroot/logs'. + +Refer the following [document](how-to-build.md#test) to setup the testing framework. ### Attach the test-nginx execution process:
[incubator-apisix] branch master updated: ignore idea files (#1075)
This is an automated email from the ASF dual-hosted git repository. membphis 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 a9963b3 ignore idea files (#1075) a9963b3 is described below commit a9963b36ce5146296e97bc1912621b805bfd41ba Author: qiujiayu <153163...@qq.com> AuthorDate: Fri Jan 17 15:00:24 2020 +0800 ignore idea files (#1075) --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index f65e311..e74c4e6 100644 --- a/.gitignore +++ b/.gitignore @@ -54,3 +54,5 @@ proxy_temp fastcgi_temp client_body_temp utils/lj-releng +.idea/ +*.iml
[incubator-apisix] branch v1.0 updated (48ade0c -> 0c0a6f7)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a change to branch v1.0 in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git. from 48ade0c released new version 1.0 new 8d80f5b bugfix: use current folder as working space for developer. (#1030) new 82e4576 CLI: only used original Lua package path. (#1032) new a5b2571 feature: chash key support more flexible ways (#1022) new a85f164 change: add tips in the generated nginx.conf (#1040) new 912c481 bugfix: added `/usr/share/lua/5.1/apisix/lua/?.lua;` to lua path (#1060) new 0c0a6f7 CLI: fixed path error when install with luarocks (#1068) The 6 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: bin/apisix | 66 ++--- conf/config.yaml | 1 + doc/architecture-design-cn.md | 87 ++- doc/architecture-design.md | 85 +- lua/apisix/admin/routes.lua| 9 + lua/apisix/admin/services.lua | 9 + lua/apisix/admin/upstreams.lua | 67 - lua/apisix/balancer.lua| 31 ++- lua/apisix/schema_def.lua | 30 ++- t/APISIX.pm| 1 + t/admin/routes.t | 131 ++ t/admin/services.t | 127 + t/admin/upstream.t | 259 ++- t/node/{chash-balance.t => chash-hashon.t} | 397 - 14 files changed, 1079 insertions(+), 221 deletions(-) copy t/node/{chash-balance.t => chash-hashon.t} (56%)
[incubator-apisix] 03/06: feature: chash key support more flexible ways (#1022)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a commit to branch v1.0 in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git commit a5b25716ed0596f7616ff9eb8b1dc16a64cdfe42 Author: Changwei Hu <1040385...@qq.com> AuthorDate: Fri Jan 10 15:17:17 2020 +0800 feature: chash key support more flexible ways (#1022) upstream add hash_on, chash key support more flexible ways routes and services admin api add upstream_conf check --- bin/apisix | 1 + conf/config.yaml | 1 + doc/architecture-design-cn.md | 87 ++- doc/architecture-design.md | 85 ++- lua/apisix/admin/routes.lua| 9 + lua/apisix/admin/services.lua | 9 + lua/apisix/admin/upstreams.lua | 67 - lua/apisix/balancer.lua| 31 ++- lua/apisix/schema_def.lua | 30 ++- t/APISIX.pm| 1 + t/admin/routes.t | 131 ++ t/admin/services.t | 127 ++ t/admin/upstream.t | 259 +++- t/node/chash-hashon.t | 540 + 14 files changed, 1358 insertions(+), 20 deletions(-) diff --git a/bin/apisix b/bin/apisix index 2fe82eb..20c0df4 100755 --- a/bin/apisix +++ b/bin/apisix @@ -166,6 +166,7 @@ http { lua_ssl_verify_depth 5; ssl_session_timeout 86400; +underscores_in_headers {* http.underscores_in_headers *}; lua_socket_log_errors off; resolver {% for _, dns_addr in ipairs(dns_resolver or {}) do %} {*dns_addr*} {% end %} ipv6=off; diff --git a/conf/config.yaml b/conf/config.yaml index a743896..bac8813 100644 --- a/conf/config.yaml +++ b/conf/config.yaml @@ -67,6 +67,7 @@ nginx_config: # config for render the template to genarate n client_header_timeout: 60s # timeout for reading client request header, then 408 (Request Time-out) error is returned to the client client_body_timeout: 60s # timeout for reading client request body, then 408 (Request Time-out) error is returned to the client send_timeout: 10s # timeout for transmitting a response to the client.then the connection is closed +underscores_in_headers: "on" # default enables the use of underscores in client request header fields etcd: host: "http://127.0.0.1:2379"; # etcd address diff --git a/doc/architecture-design-cn.md b/doc/architecture-design-cn.md index 552bdd0..8aea1fc 100644 --- a/doc/architecture-design-cn.md +++ b/doc/architecture-design-cn.md @@ -237,7 +237,8 @@ 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,目前支持的 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)| +|hash_on |可选|该选项只有 `type` 是 `chash` 才有效。`hash_on` 支持的类型有 `vars`(Nginx内置变量),`header`(自定义header),`cookie`,`consumer`,默认值为 `vars`| +|key |必需|该选项只有 `type` 是 `chash` 才有效,需要配合 `hash_on` 来使用,通过 `hash_on` 和 `key` 来查找对应的 node `id`。`hash_on` 设为 `vars` 时,`key` 为必传参数,目前支持的 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);`hash_on` 设为 `header` 时, `key` 为必传参数,自定义的 `header name`;`hash_on` 设为 `cookie` 时, `key` 为必传参数, 自定义的 `cookie name`;`hash_on` 设为 `consumer` 时,`key` 不需 [...] |checks |可选|配置健康检查的参数,详细可参考[health-check](health-check.md)| |retries |可选|使用底层的 Nginx 重试机制将请求传递给下一个上游,默认不启用重试机制| @@ -334,9 +335,91 @@ curl http://127.0.0.1:9080/apisix/admin/routes/1 -X PUT -d ' } }' ``` - 更多细节可以参考[健康检查的文档](health-check.md)。 +下面是几个使用不同`hash_on`类型的配置示例: +# Consumer +创建一个consumer对象: +```shell +curl http://127.0.0.1:9080/apisix/admin/consumers -X PUT -d ` +{ +"username": "jack", +"plugins": { +"key-auth": { + "key": "auth-jack" +} +} +}` +``` +新建路由,打开`key-auth`插件认证,`upstream`的`hash_on`类型为`consumer`: +```shell +curl http://127.0.0.1:9080/apisix/admin/routes/1 -X PUT -d ' +{ +"plugins": { +"key-auth": {} +}, +"upstream": { +"nodes": { +"127.0.0.1:1980": 1, +"127.0.0.1:1981": 1 +}, +"type": "chash", +"hash_on": "consumer" +}, +"uri": "/s
[incubator-apisix] 04/06: change: add tips in the generated nginx.conf (#1040)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a commit to branch v1.0 in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git commit a85f1649a2eb6b55162f7fef616b4dc3953865e7 Author: tiantian wang <11660793+wt...@users.noreply.github.com> AuthorDate: Sun Jan 12 09:10:51 2020 +0800 change: add tips in the generated nginx.conf (#1040) --- bin/apisix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/apisix b/bin/apisix index 20c0df4..b42475c 100755 --- a/bin/apisix +++ b/bin/apisix @@ -75,6 +75,9 @@ local yaml = require("tinyyaml") local template = require("resty.template") local ngx_tpl = [=[ +# Configuration File - Nginx Server Configs +# This is a read-only file, do not try to modify it. + master_process on; worker_processes {* worker_processes *};
[incubator-apisix] 01/06: bugfix: use current folder as working space for developer. (#1030)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a commit to branch v1.0 in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git commit 8d80f5b93d1aa9d5914cd3c1a0f33d1a23699c24 Author: YuanSheng Wang AuthorDate: Tue Jan 7 20:18:25 2020 +0800 bugfix: use current folder as working space for developer. (#1030) --- bin/apisix | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/bin/apisix b/bin/apisix index b9de45b..5fae3ed 100755 --- a/bin/apisix +++ b/bin/apisix @@ -17,7 +17,7 @@ -- limitations under the License. -- -local script_path = debug.getinfo(1).source:sub(2) +local script_path = arg[0] local function trim(s) return (s:gsub("^%s*(.-)%s*$", "%1")) @@ -38,18 +38,18 @@ end excute_cmd("install -d -m 777 /tmp/apisix_cores/") local apisix_home = "/usr/local/apisix" -if script_path:sub(1, 17) == '/usr/local/apisix' or script_path:sub(1, 4) == '/bin' then -package.cpath = "/usr/local/apisix/deps/lib64/lua/5.1/?.so;" -.. "/usr/local/apisix/deps/lib/lua/5.1/?.so;" -.. package.cpath - -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 - -else +package.cpath = "/usr/local/apisix/deps/lib64/lua/5.1/?.so;" +.. "/usr/local/apisix/deps/lib/lua/5.1/?.so;" +.. package.cpath + +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 + +-- only for developer, use current folder as working space +if script_path:sub(1, 2) == './' then apisix_home = pwd package.cpath = pwd .. "/deps/lib64/lua/5.1/?.so;" .. package.cpath
[incubator-apisix] 06/06: CLI: fixed path error when install with luarocks (#1068)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a commit to branch v1.0 in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git commit 0c0a6f72dd808d34eab1c52c63c5d9ee7a782709 Author: Lien AuthorDate: Thu Jan 16 15:22:30 2020 +0800 CLI: fixed path error when install with luarocks (#1068) --- bin/apisix | 5 + 1 file changed, 5 insertions(+) diff --git a/bin/apisix b/bin/apisix index 43282ff..89b2632 100755 --- a/bin/apisix +++ b/bin/apisix @@ -103,6 +103,7 @@ worker_shutdown_timeout 3; {% if stream_proxy then %} stream { lua_package_path "$prefix/deps/share/lua/5.1/?.lua;/usr/share/lua/5.1/apisix/lua/?.lua;]=] + .. [=[$prefix/deps/share/lua/5.1/apisix/lua/?.lua;]=] .. [=[{*apisix_lua_home*}/lua/?.lua;;{*lua_path*};"; lua_package_cpath "$prefix/deps/lib64/lua/5.1/?.so;]=] .. [=[$prefix/deps/lib/lua/5.1/?.so;;]=] @@ -149,6 +150,7 @@ stream { http { lua_package_path "$prefix/deps/share/lua/5.1/?.lua;/usr/share/lua/5.1/apisix/lua/?.lua;]=] + .. [=[$prefix/deps/share/lua/5.1/apisix/lua/?.lua;]=] .. [=[{*apisix_lua_home*}/lua/?.lua;;{*lua_path*};"; lua_package_cpath "$prefix/deps/lib64/lua/5.1/?.so;]=] .. [=[$prefix/deps/lib/lua/5.1/?.so;;]=] @@ -169,7 +171,10 @@ http { lua_ssl_verify_depth 5; ssl_session_timeout 86400; +{% if http.underscores_in_headers then %} underscores_in_headers {* http.underscores_in_headers *}; +{%end%} + lua_socket_log_errors off; resolver {% for _, dns_addr in ipairs(dns_resolver or {}) do %} {*dns_addr*} {% end %} ipv6=off;
[incubator-apisix] 05/06: bugfix: added `/usr/share/lua/5.1/apisix/lua/?.lua; ` to lua path (#1060)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a commit to branch v1.0 in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git commit 912c481b1af9dfd9f3983839d3dcf6b2f3dec21d Author: YuanSheng Wang AuthorDate: Wed Jan 15 14:19:44 2020 +0800 bugfix: added `/usr/share/lua/5.1/apisix/lua/?.lua;` to lua path (#1060) --- bin/apisix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/apisix b/bin/apisix index b42475c..43282ff 100755 --- a/bin/apisix +++ b/bin/apisix @@ -102,7 +102,7 @@ worker_shutdown_timeout 3; {% if stream_proxy then %} stream { -lua_package_path "$prefix/deps/share/lua/5.1/?.lua;]=] +lua_package_path "$prefix/deps/share/lua/5.1/?.lua;/usr/share/lua/5.1/apisix/lua/?.lua;]=] .. [=[{*apisix_lua_home*}/lua/?.lua;;{*lua_path*};"; lua_package_cpath "$prefix/deps/lib64/lua/5.1/?.so;]=] .. [=[$prefix/deps/lib/lua/5.1/?.so;;]=] @@ -148,7 +148,7 @@ stream { {% end %} http { -lua_package_path "$prefix/deps/share/lua/5.1/?.lua;]=] +lua_package_path "$prefix/deps/share/lua/5.1/?.lua;/usr/share/lua/5.1/apisix/lua/?.lua;]=] .. [=[{*apisix_lua_home*}/lua/?.lua;;{*lua_path*};"; lua_package_cpath "$prefix/deps/lib64/lua/5.1/?.so;]=] .. [=[$prefix/deps/lib/lua/5.1/?.so;;]=]
[incubator-apisix] 02/06: CLI: only used original Lua package path. (#1032)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a commit to branch v1.0 in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git commit 82e457651f12c783da19953dc3b9d28240f64895 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: CLI: fixed path error when install with luarocks (#1068)
This is an automated email from the ASF dual-hosted git repository. membphis 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 86c4ef6 CLI: fixed path error when install with luarocks (#1068) 86c4ef6 is described below commit 86c4ef64d1836a82ff2fdd46c4156b36788e1b94 Author: Lien AuthorDate: Thu Jan 16 15:22:30 2020 +0800 CLI: fixed path error when install with luarocks (#1068) --- bin/apisix | 5 + 1 file changed, 5 insertions(+) diff --git a/bin/apisix b/bin/apisix index 43282ff..89b2632 100755 --- a/bin/apisix +++ b/bin/apisix @@ -103,6 +103,7 @@ worker_shutdown_timeout 3; {% if stream_proxy then %} stream { lua_package_path "$prefix/deps/share/lua/5.1/?.lua;/usr/share/lua/5.1/apisix/lua/?.lua;]=] + .. [=[$prefix/deps/share/lua/5.1/apisix/lua/?.lua;]=] .. [=[{*apisix_lua_home*}/lua/?.lua;;{*lua_path*};"; lua_package_cpath "$prefix/deps/lib64/lua/5.1/?.so;]=] .. [=[$prefix/deps/lib/lua/5.1/?.so;;]=] @@ -149,6 +150,7 @@ stream { http { lua_package_path "$prefix/deps/share/lua/5.1/?.lua;/usr/share/lua/5.1/apisix/lua/?.lua;]=] + .. [=[$prefix/deps/share/lua/5.1/apisix/lua/?.lua;]=] .. [=[{*apisix_lua_home*}/lua/?.lua;;{*lua_path*};"; lua_package_cpath "$prefix/deps/lib64/lua/5.1/?.so;]=] .. [=[$prefix/deps/lib/lua/5.1/?.so;;]=] @@ -169,7 +171,10 @@ http { lua_ssl_verify_depth 5; ssl_session_timeout 86400; +{% if http.underscores_in_headers then %} underscores_in_headers {* http.underscores_in_headers *}; +{%end%} + lua_socket_log_errors off; resolver {% for _, dns_addr in ipairs(dns_resolver or {}) do %} {*dns_addr*} {% end %} ipv6=off;
[incubator-apisix] branch master updated (3812ee8 -> ce033d6)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git. from 3812ee8 doc: updated admin-api-cn.md (#1067) add ce033d6 doc: updated README_CN.md (#1066) No new revisions were added by this update. Summary of changes: README_CN.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
[incubator-apisix] branch master updated: doc: updated admin-api-cn.md (#1067)
This is an automated email from the ASF dual-hosted git repository. membphis 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 3812ee8 doc: updated admin-api-cn.md (#1067) 3812ee8 is described below commit 3812ee87a495b3fce797e8e7d64c7755b69aaeff Author: leehome <515947...@qq.com> AuthorDate: Thu Jan 16 14:40:10 2020 +0800 doc: updated admin-api-cn.md (#1067) --- doc/admin-api-cn.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/admin-api-cn.md b/doc/admin-api-cn.md index a6dfac1..99d0fa9 100644 --- a/doc/admin-api-cn.md +++ b/doc/admin-api-cn.md @@ -131,7 +131,7 @@ curl http://127.0.0.1:9080/apisix/admin/routes/1 -X PUT -i -d ' "vars": [ ["arg_name", "==", "json"], ["arg_age", ">", "18"], -["arg_address", "~~", "China.*"] +["arg_address", "~~", "^China.*"] ], "upstream": { "type": "roundrobin",
[incubator-apisix] branch master updated: doc: fixed wrong link in architecture-design-cn.md (#1065)
This is an automated email from the ASF dual-hosted git repository. membphis 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 4dd604e doc: fixed wrong link in architecture-design-cn.md (#1065) 4dd604e is described below commit 4dd604e59f4448596a1811e8cc7a100be32e0933 Author: 琚致远 AuthorDate: Thu Jan 16 14:36:10 2020 +0800 doc: fixed wrong link in architecture-design-cn.md (#1065) Fix https://github.com/apache/incubator-apisix/issues/1064 --- doc/architecture-design-cn.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/architecture-design-cn.md b/doc/architecture-design-cn.md index 39c4cfc..8a4a3f0 100644 --- a/doc/architecture-design-cn.md +++ b/doc/architecture-design-cn.md @@ -191,7 +191,7 @@ curl http://127.0.0.1:9080/apisix/admin/routes/102 -X PUT -d ' 优先级更高。 一个插件在一次请求中只会执行一次,即使被同时绑定到多个不同对象中(比如 Route 或 Service)。 -插件运行先后顺序是根据插件自身的优先级来决定的,例如:[example-plugin](../doc/plugins/example-plugin.lua#L16)。 +插件运行先后顺序是根据插件自身的优先级来决定的,例如:[example-plugin](../lua/apisix/plugins/example-plugin.lua#L37)。 插件配置作为 Route 或 Service 的一部分提交的,放到 `plugins` 下。它内部是使用插件 名字作为哈希的 key 来保存不同插件的配置项。
[incubator-apisix] branch master updated: doc: update plugin list and power by companies. (#1054)
This is an automated email from the ASF dual-hosted git repository. membphis 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 361b933 doc: update plugin list and power by companies. (#1054) 361b933 is described below commit 361b933d6b17186eb1f6036ccb5f53facd568ce2 Author: WenMing AuthorDate: Tue Jan 14 21:44:29 2020 +0800 doc: update plugin list and power by companies. (#1054) --- README.md | 3 ++- README_CN.md | 3 ++- doc/README.md | 3 ++- doc/README_CN.md | 3 +++ doc/powered-by.md | 3 ++- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 932402b..b3ca3ad 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ A/B testing, canary release, blue-green deployment, limit rate, defense against - [Support priority](doc/router-radixtree.md#3-match-priority) - **Security** -- Authentications: [key-auth](doc/plugins/key-auth.md), [JWT](doc/plugins/jwt-auth.md) +- Authentications: [key-auth](doc/plugins/key-auth.md), [JWT](doc/plugins/jwt-auth.md), [basic-auth](doc/plugins/basic-auth.md) - [IP Whitelist/Blacklist](doc/plugins/ip-restriction.md) - [IdP](doc/plugins/oauth.md): Support external authentication services, such as Auth0, okta, etc., users can use this to connect to Oauth2.0 and other authentication methods. - [Limit-req](doc/plugins/limit-req.md) @@ -101,6 +101,7 @@ A/B testing, canary release, blue-green deployment, limit rate, defense against - Global Rule: Allows to run any plugin for all request, eg: limit rate, IP filter etc. - High performance: The single-core QPS reaches 18k with an average delay of less than 0.2 milliseconds. - [REST admin API](doc/admin-api.md) +- fault injection - **Highly scalable** - [Custom plugins]((doc/plugin-develop.md)): Allows hooking of common phases, such as `rewrite`, `access`, `header filer`, `body filter` and `log`, also allows to hook the `balancer` stage. diff --git a/README_CN.md b/README_CN.md index 4b760ae..b9992da 100644 --- a/README_CN.md +++ b/README_CN.md @@ -82,7 +82,7 @@ A/B 测试、金丝雀发布(灰度发布)、蓝绿部署、限流限速、抵 - [支持路由的优先级](doc/router-radixtree.md#3-match-priority) - **安全防护** -- 多种身份认证方式: [key-auth](doc/plugins/key-auth-cn.md), [JWT](doc/plugins/jwt-auth-cn.md)。 +- 多种身份认证方式: [key-auth](doc/plugins/key-auth-cn.md), [JWT](doc/plugins/jwt-auth-cn.md), [basic-auth](doc/plugins/basic-auth-cn.md)。 - [IP 黑白名单](doc/plugins/ip-restriction-cn.md) - [IdP 支持](doc/plugins/oauth.md): 支持外部的身份认证服务,比如 Auth0,Okta,Authing 等,用户可以借此来对接 Oauth2.0 等认证方式。 - [限制速率](doc/plugins/limit-req-cn.md) @@ -101,6 +101,7 @@ A/B 测试、金丝雀发布(灰度发布)、蓝绿部署、限流限速、抵 - 全局规则:允许对所有请求执行插件,比如黑白名单、限流限速等。 - 高性能:在单核上 QPS 可以达到 18k,同时延迟只有 0.2 毫秒。 - [REST admin API](doc/admin-api-cn.md) +- 故障注入 - **高度可扩展** - [自定义插件](doc/plugin-develop-cn.md): 允许挂载常见阶段,例如`init`, `rewrite`,`access`,`balancer`,`header filer`,`body filter` 和 `log` 阶段。 diff --git a/doc/README.md b/doc/README.md index d171122..99a3091 100644 --- a/doc/README.md +++ b/doc/README.md @@ -42,6 +42,7 @@ Plugins * [hot reload](plugins.md): Hot reload without reload service. * [key-auth](plugins/key-auth.md): User authentication based on Key Authentication. * [JWT-auth](plugins/jwt-auth.md): User authentication based on [JWT](https://jwt.io/) (JSON Web Tokens) Authentication. +* [basic-auth](doc/plugins/basic-auth.md): User authentication based on Basic Authentication. * [HTTPS/TLS](https.md): Dynamic load the SSL Certificate by Server Name Indication (SNI). * [limit-count](plugins/limit-count.md): Rate limiting based on a "fixed window" implementation. * [limit-req](plugins/limit-req.md): Request rate limiting and adjustment based on the "leaky bucket" method. @@ -55,7 +56,7 @@ Plugins * [openid-connect](plugins/oauth.md) * [redirect](plugins/redirect.md): URI redirect. * [response-rewrite](plugins/response-rewrite.md): Set customized response status code, body and header to the client. - +* fault injection:The specified response body, response code, and response time can be returned, which provides processing capabilities in different failure scenarios, such as service failure, service overload, and high service delay. Deploy to the Cloud === diff --git a/doc/README_CN.md b/doc/README_CN.md index 634d4e6..9e231f1 100644 --- a/doc/README_CN.md +++ b/doc/README_CN.md @@ -44,6 +44,7 @@ Reference document * [动态负载均衡](architecture-design-cn.md#upstream):跨多个上游服务的动态负载均衡,目前已支持 round-robin 和一致性哈希算法。 * [key-auth](plugins/key-auth-cn.md):基于 Key Authentication 的用户认证。 * [JWT-auth](plugins/jwt-auth-cn.md):基于 [JWT](https://jwt.io/) (JSON Web Tokens) Authentication 的用户认证。 +* [basic-auth](doc/plugins/basic-auth-cn.md):基于 basic auth 的用户认证。 * [limit-count](plugins/limit-count-cn.md):基于“固定窗口”
[incubator-apisix] branch master updated: feature: supported to enable Websocket in `upstream` object (#1051)
This is an automated email from the ASF dual-hosted git repository. membphis 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 e680436 feature: supported to enable Websocket in `upstream` object (#1051) e680436 is described below commit e6804360d1712d456cfee31b9d6abb8b16cfffba Author: Lien AuthorDate: Tue Jan 14 14:37:24 2020 +0800 feature: supported to enable Websocket in `upstream` object (#1051) --- doc/architecture-design-cn.md | 2 + doc/architecture-design.md| 2 + lua/apisix.lua| 22 - lua/apisix/schema_def.lua | 4 + t/lib/server.lua | 9 ++ t/node/upstream-websocket.t | 223 ++ 6 files changed, 259 insertions(+), 3 deletions(-) diff --git a/doc/architecture-design-cn.md b/doc/architecture-design-cn.md index 968401d..39c4cfc 100644 --- a/doc/architecture-design-cn.md +++ b/doc/architecture-design-cn.md @@ -241,6 +241,7 @@ APISIX 的 Upstream 除了基本的复杂均衡算法选择外,还支持对上 |key |必需|该选项只有 `type` 是 `chash` 才有效,需要配合 `hash_on` 来使用,通过 `hash_on` 和 `key` 来查找对应的 node `id`。`hash_on` 设为 `vars` 时,`key` 为必传参数,目前支持的 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);`hash_on` 设为 `header` 时, `key` 为必传参数,自定义的 `header name`;`hash_on` 设为 `cookie` 时, `key` 为必传参数, 自定义的 `cookie name`;`hash_on` 设为 `consumer` 时,`key` 不需 [...] |checks |可选|配置健康检查的参数,详细可参考[health-check](health-check.md)| |retries |可选|使用底层的 Nginx 重试机制将请求传递给下一个上游,默认 APISIX 会启用重试机制,根据配置的后端节点个数设置重试次数,如果此参数显式被设置将会覆盖系统默认设置的重试次数。| +|enable_websocket|可选| 是否启用 `websocket`(布尔值),默认不启用| 创建上游对象用例: @@ -259,6 +260,7 @@ curl http://127.0.0.1:9080/apisix/admin/upstreams/2 -X PUT -d ' { "type": "chash", "key": "remote_addr", +"enable_websocket": true, "nodes": { "127.0.0.1:80": 1, "foo.com:80": 2 diff --git a/doc/architecture-design.md b/doc/architecture-design.md index 4ce536a..d678da9 100644 --- a/doc/architecture-design.md +++ b/doc/architecture-design.md @@ -236,6 +236,7 @@ In addition to the basic complex equalization algorithm selection, APISIX's Upst |key |required|This option is only valid if the `type` is `chash`. Find the corresponding node `id` according to `hash_on` and `key`. When `hash_on` is set as `vars`, `key` is the required parameter, 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). When `hash_ [...] |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 enabled by default and set the number of retries according to the number of backend nodes. If `retries` option is explicitly set, it will override the default value.| +|enable_websocket|optional| enable `websocket`(boolean), default `false`.| Create an upstream object use case: @@ -254,6 +255,7 @@ curl http://127.0.0.1:9080/apisix/admin/upstreams/2 -X PUT -d ' { "type": "chash", "key": "remote_addr", +"enable_websocket": true, "nodes": { "127.0.0.1:80": 1, "foo.com:80": 2 diff --git a/lua/apisix.lua b/lua/apisix.lua index 63319cd..2f203b1 100644 --- a/lua/apisix.lua +++ b/lua/apisix.lua @@ -304,6 +304,7 @@ function _M.http_access_phase() api_ctx.conf_id = route.value.id end +local enable_websocket local up_id = route.value.upstream_id if up_id then local upstreams_etcd = core.config.fetch_created_obj("/upstreams") @@ -313,11 +314,26 @@ function _M.http_access_phase() parsed_domain(upstream, api_ctx.conf_version, parse_domain_in_up, upstream) end + +if upstream.value.enable_websocket then +enable_websocket = true +end +end + +else +if route.has_domain then +route = parsed_domain(route, api_ctx.conf_version, + parse_domain_in_route, route) +end + +if route.value.upstream and route.value.upstream.enable_websocket then +enable_websocket = true end +end -elseif route.has_domain then -route = parsed_domain(ro
[incubator-apisix] branch master updated: doc: updated powered-by.md (#1049)
This is an automated email from the ASF dual-hosted git repository. membphis 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 26826c4 doc: updated powered-by.md (#1049) 26826c4 is described below commit 26826c49be92844100a5b66535da524e552cdf1f Author: leehome <515947...@qq.com> AuthorDate: Tue Jan 14 10:48:01 2020 +0800 doc: updated powered-by.md (#1049) --- doc/powered-by.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/powered-by.md b/doc/powered-by.md index b4c418b..18ec8fb 100644 --- a/doc/powered-by.md +++ b/doc/powered-by.md @@ -41,6 +41,7 @@ Users are encouraged to add themselves to this page, [issue](https://github.com/ 1. Tencent Cloud 腾讯云 https://cloud.tencent.com/ 1. Xin 优信二手车 https://www.xin.com/ 1. zuzuche 租租车 https://www.zuzuche.com/ +1. Dataoke 大淘客 https://www.dataoke.com/ # User Cases
[incubator-apisix] branch master updated: doc: added yarn install instructions (#1047)
This is an automated email from the ASF dual-hosted git repository. membphis 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 b2a1022 doc: added yarn install instructions (#1047) b2a1022 is described below commit b2a1022ef795ec1456708a0b7c86fbad65427320 Author: weihai4099 <781531...@qq.com> AuthorDate: Tue Jan 14 09:54:56 2020 +0800 doc: added yarn install instructions (#1047) --- README.md| 2 +- README_CN.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6040f59..bea93de 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,7 @@ APISIX has built-in support for dashboards, as follows: ``` git clone https://github.com/apache/incubator-apisix-dashboard.git ``` - +- install yarn: refer to [documentation](https://yarnpkg.com/en/docs/install) - Install dependencies and build ``` yarn diff --git a/README_CN.md b/README_CN.md index 89bd681..9887c67 100644 --- a/README_CN.md +++ b/README_CN.md @@ -143,7 +143,7 @@ APISIX 内置了对 Dashboard 的支持,使用步骤如下: ``` git clone https://github.com/apache/incubator-apisix-dashboard.git ``` - +- 安装yarn: 参考[安装文档](https://yarnpkg.com/zh-Hans/docs/install) - 安装依赖并构建 ``` yarn
[incubator-apisix] branch master updated: feature: implemented new `fault-injection` plugin. (#1042)
This is an automated email from the ASF dual-hosted git repository. membphis 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 9758a0e feature: implemented new `fault-injection` plugin. (#1042) 9758a0e is described below commit 9758a0e3344c2242d8fc55e2621383ab707b55f9 Author: agile6v AuthorDate: Mon Jan 13 22:22:21 2020 +0800 feature: implemented new `fault-injection` plugin. (#1042) --- conf/config.yaml | 1 + lua/apisix/plugins/fault-injection.lua | 74 + t/admin/plugins.t | 2 +- t/debug/debug-mode.t | 1 + t/plugin/fault-injection.t | 526 + 5 files changed, 603 insertions(+), 1 deletion(-) diff --git a/conf/config.yaml b/conf/config.yaml index 844070e..495c709 100644 --- a/conf/config.yaml +++ b/conf/config.yaml @@ -93,6 +93,7 @@ plugins: # plugin list - proxy-rewrite - redirect - response-rewrite + - fault-injection stream_plugins: - mqtt-proxy diff --git a/lua/apisix/plugins/fault-injection.lua b/lua/apisix/plugins/fault-injection.lua new file mode 100644 index 000..583ca0f --- /dev/null +++ b/lua/apisix/plugins/fault-injection.lua @@ -0,0 +1,74 @@ +-- +-- 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 sleep = ngx.sleep + +local plugin_name = "fault-injection" + +local schema = { +type = "object", +properties = { +abort = { +type = "object", +properties = { +http_status = {type = "integer", minimum = 200}, +body = {type = "string", minLength = 0}, +}, +required = {"http_status"} +}, +delay = { +type = "object", +properties = { +duration = {type = "number", minimum = 0}, +}, +required = {"duration"} +} +}, +minProperties = 1, +} + +local _M = { +version = 0.1, +priority = 11000, +name = plugin_name, +schema = schema, +} + +function _M.check_schema(conf) +local ok, err = core.schema.check(schema, conf) +if not ok then +return false, err +end + +return true +end + + +function _M.rewrite(conf, ctx) +core.log.info("plugin rewrite phase, conf: ", core.json.delay_encode(conf)) + +if conf.delay and conf.delay.duration ~= nil then +sleep(conf.delay.duration) +end + +if conf.abort and conf.abort.http_status ~= nil then +core.response.exit(conf.abort.http_status, conf.abort.body) +end +end + + +return _M diff --git a/t/admin/plugins.t b/t/admin/plugins.t index eae4a6d..e9fe92a 100644 --- a/t/admin/plugins.t +++ b/t/admin/plugins.t @@ -30,6 +30,6 @@ __DATA__ --- request GET /apisix/admin/plugins/list --- response_body_like eval -qr/\["limit-req","limit-count","limit-conn","key-auth","basic-auth","prometheus","node-status","jwt-auth","zipkin","ip-restriction","grpc-transcode","serverless-pre-function","serverless-post-function","openid-connect","proxy-rewrite","redirect","response-rewrite"\]/ +qr/\["limit-req","limit-count","limit-conn","key-auth","basic-auth","prometheus","node-status","jwt-auth","zipkin","ip-restriction","grpc-transcode","serverless-pre-function","serverless-post-function","openid-connect","proxy-rewrite","redirect","response-rewrite","fault-injection"\]/ --- no_error_log [error] diff --git a/t/debug/debug-mode.t b/t/debug/debug-mode.t index 3e18a0f..bc2dd4d 100644 --- a/t/debug/debug-mode.t +++ b/t/debug/debug-mode.t @@ -55,6 +55,7 @@ do
[incubator-apisix] branch master updated: plugin(proxy-rewrite): using schema pattern to check if uri option starts with / in proxy-rewrite plugin. (#1041)
This is an automated email from the ASF dual-hosted git repository. membphis 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 70ff4a5 plugin(proxy-rewrite): using schema pattern to check if uri option starts with / in proxy-rewrite plugin. (#1041) 70ff4a5 is described below commit 70ff4a556d3b0c37c196ce3e3a672b34cd188a59 Author: agile6v AuthorDate: Sun Jan 12 16:35:05 2020 +0800 plugin(proxy-rewrite): using schema pattern to check if uri option starts with / in proxy-rewrite plugin. (#1041) --- lua/apisix/plugin.lua| 2 +- lua/apisix/plugins/proxy-rewrite.lua | 10 ++ t/plugin/proxy-rewrite.t | 2 +- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/lua/apisix/plugin.lua b/lua/apisix/plugin.lua index 969ecb1..0a6b17a 100644 --- a/lua/apisix/plugin.lua +++ b/lua/apisix/plugin.lua @@ -138,7 +138,7 @@ local function load_stream() local plugin_names = local_conf.stream_plugins if not plugin_names then -core.log.warn("failed to read stream plugin list form local file") +core.log.warn("failed to read stream plugin list from local file") return true end diff --git a/lua/apisix/plugins/proxy-rewrite.lua b/lua/apisix/plugins/proxy-rewrite.lua index ab0e593..cc1af62 100644 --- a/lua/apisix/plugins/proxy-rewrite.lua +++ b/lua/apisix/plugins/proxy-rewrite.lua @@ -21,7 +21,6 @@ local ipairs = ipairs local ngx = ngx local type= type local re_sub = ngx.re.sub -local str_sub = string.sub local schema = { @@ -31,7 +30,8 @@ local schema = { description = "new uri for upstream", type= "string", minLength = 1, -maxLength = 4096 +maxLength = 4096, +pattern = "^/.*", }, regex_uri = { description = "new uri that substitute from client uri " .. @@ -92,12 +92,6 @@ 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 conf.headers_arr = {} diff --git a/t/plugin/proxy-rewrite.t b/t/plugin/proxy-rewrite.t index 832a197..f7e7afd 100644 --- a/t/plugin/proxy-rewrite.t +++ b/t/plugin/proxy-rewrite.t @@ -1003,6 +1003,6 @@ invalid capturing variable name found GET /t --- error_code: 400 --- response_body eval -qr/invalid uri/ +qr/failed to match pattern/ --- no_error_log [error]
[incubator-apisix] branch master updated: change: add tips in the generated nginx.conf (#1040)
This is an automated email from the ASF dual-hosted git repository. membphis 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 65446e8 change: add tips in the generated nginx.conf (#1040) 65446e8 is described below commit 65446e8f249427c023bc53674f30ce930e6b48df Author: tiantian wang <11660793+wt...@users.noreply.github.com> AuthorDate: Sun Jan 12 09:10:51 2020 +0800 change: add tips in the generated nginx.conf (#1040) --- bin/apisix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/apisix b/bin/apisix index 20c0df4..b42475c 100755 --- a/bin/apisix +++ b/bin/apisix @@ -75,6 +75,9 @@ local yaml = require("tinyyaml") local template = require("resty.template") local ngx_tpl = [=[ +# Configuration File - Nginx Server Configs +# This is a read-only file, do not try to modify it. + master_process on; worker_processes {* worker_processes *};
[incubator-apisix] branch master updated: plugin(prometheus): added new field (#1028)
This is an automated email from the ASF dual-hosted git repository. membphis 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 21c06b3 plugin(prometheus): added new field (#1028) 21c06b3 is described below commit 21c06b3cc43b62e45f8813f6dd22f24bae702ee1 Author: YuanSheng Wang AuthorDate: Wed Jan 8 14:00:31 2020 +0800 plugin(prometheus): added new field (#1028) feature: added `router_id` for http code metric. feature: added `hostname` for nginx connection metric. --- lua/apisix/plugins/prometheus/exporter.lua | 27 --- t/plugin/prometheus.t | 113 - 2 files changed, 125 insertions(+), 15 deletions(-) diff --git a/lua/apisix/plugins/prometheus/exporter.lua b/lua/apisix/plugins/prometheus/exporter.lua index 691d7a6..81ff31e 100644 --- a/lua/apisix/plugins/prometheus/exporter.lua +++ b/lua/apisix/plugins/prometheus/exporter.lua @@ -47,7 +47,7 @@ function _M.init() -- per service metrics.status = prometheus:counter("http_status", "HTTP status codes per service in APISIX", -{"code", "service", "node"}) +{"code", "route", "service", "node"}) metrics.latency = prometheus:histogram("http_latency", "HTTP request latency per service in APISIX", @@ -55,31 +55,34 @@ function _M.init() metrics.bandwidth = prometheus:counter("bandwidth", "Total bandwidth in bytes consumed per service in APISIX", -{"type", "service", "node"}) +{"type", "route", "service", "node"}) end function _M.log(conf, ctx) 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 +local route_id = "" +local balancer_ip = ctx.balancer_ip +local service_id + +local matched_route = ctx.matched_route and ctx.matched_route.value +if matched_route then +service_id = matched_route.service_id or "" +route_id = matched_route.id else -service_name = vars.host +service_id = vars.host end -local balancer_ip = ctx.balancer_ip -metrics.status:inc(1, vars.status, service_name, balancer_ip) +metrics.status:inc(1, vars.status, route_id, service_id, balancer_ip) local latency = (ngx.now() - ngx.req.start_time()) * 1000 -metrics.latency:observe(latency, "request", service_name, balancer_ip) +metrics.latency:observe(latency, "request", service_id, balancer_ip) -metrics.bandwidth:inc(vars.request_length, "ingress", service_name, +metrics.bandwidth:inc(vars.request_length, "ingress", route_id, service_id, balancer_ip) -metrics.bandwidth:inc(vars.bytes_sent, "egress", service_name, +metrics.bandwidth:inc(vars.bytes_sent, "egress", route_id, service_id, balancer_ip) end diff --git a/t/plugin/prometheus.t b/t/plugin/prometheus.t index 06d9cae..18fa3ed 100644 --- a/t/plugin/prometheus.t +++ b/t/plugin/prometheus.t @@ -151,7 +151,7 @@ apisix_etcd_reachable 1 --- request GET /apisix/prometheus/metrics --- response_body eval -qr/apisix_bandwidth\{type="egress",service="1",node="127.0.0.1"\} \d+/ +qr/apisix_bandwidth\{type="egress",route="1",service="",node="127.0.0.1"\} \d+/ --- no_error_log [error] @@ -293,7 +293,7 @@ passed --- request GET /apisix/prometheus/metrics --- response_body eval -qr/apisix_bandwidth\{type="egress",service="1",node="127.0.0.1"\} \d+/ +qr/apisix_bandwidth\{type="egress",route="1",service="",node="127.0.0.1"\} \d+/ --- no_error_log [error] @@ -303,6 +303,113 @@ qr/apisix_bandwidth\{type="egress",service="1",node="127.0.0.1"\} \d+/ --- request GET /apisix/prometheus/metrics --- response_body eval -qr/apisix_http_latency_count\{type="request",service="1",node="127.0.0.1"\} \d+/ +qr/apisix_http_latency_count\{type="request",service="",node="127.0.0.1"\} \d+/ +--- no_error_log +[error] + + + +=== TEST 15: create service +--- config +location /t { +content_by_lua_block { +local t = require("lib.test_admin").test +local code, body = t('/apisix/admin/services/1', +ngx.HTTP_PUT, +[[{ +&qu
[incubator-apisix] 02/02: released new version 1.0
This is an automated email from the ASF dual-hosted git repository. membphis pushed a commit to branch v1.0 in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git commit 48ade0c67ae1e94129dec6df0002794605c803f7 Author: Yuansheng AuthorDate: Tue Jan 7 10:38:38 2020 +0800 released new version 1.0 --- rockspec/apisix-1.0-0.rockspec | 70 ++ 1 file changed, 70 insertions(+) diff --git a/rockspec/apisix-1.0-0.rockspec b/rockspec/apisix-1.0-0.rockspec new file mode 100644 index 000..5e4f401 --- /dev/null +++ b/rockspec/apisix-1.0-0.rockspec @@ -0,0 +1,70 @@ +-- +-- 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. +-- +package = "apisix" +version = "1.0-0" +supported_platforms = {"linux", "macosx"} + +source = { +url = "git://github.com/apache/incubator-apisix", +branch = "v1.0", +} + +description = { +summary = "Apache APISIX(incubating) is a cloud-native microservices API gateway, delivering the ultimate performance, security, open source and scalable platform for all your APIs and microservices.", +homepage = "https://github.com/apache/incubator-apisix";, +license = "Apache License 2.0", +} + +dependencies = { +"lua-resty-template = 1.9", +"lua-resty-etcd = 0.8", +"lua-resty-balancer = 0.02rc5", +"lua-resty-ngxvar = 0.5", +"lua-resty-jit-uuid = 0.0.7", +"lua-resty-healthcheck-iresty = 2.0", +"lua-resty-jwt = 0.2.0", +"lua-resty-cookie = 0.1.0", +"lua-resty-session = 2.24", +"opentracing-openresty = 0.1", +"lua-resty-radixtree = 1.7", +"lua-protobuf = 0.3.1", +"lua-resty-openidc = 1.7.2-1", +"luafilesystem = 1.7.0-2", +"lua-tinyyaml = 0.1", +"lua-resty-prometheus = 1.0", +"jsonschema = 0.5", +"lua-resty-ipmatcher = 0.3", +} + +build = { +type = "make", +build_variables = { +CFLAGS="$(CFLAGS)", +LIBFLAG="$(LIBFLAG)", +LUA_LIBDIR="$(LUA_LIBDIR)", +LUA_BINDIR="$(LUA_BINDIR)", +LUA_INCDIR="$(LUA_INCDIR)", +LUA="$(LUA)", +}, +install_variables = { +INST_PREFIX="$(PREFIX)", +INST_BINDIR="$(BINDIR)", +INST_LIBDIR="$(LIBDIR)", +INST_LUADIR="$(LUADIR)", +INST_CONFDIR="$(CONFDIR)", +}, +}
[incubator-apisix] 01/02: doc: removed `rc1` version information.
This is an automated email from the ASF dual-hosted git repository. membphis pushed a commit to branch v1.0 in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git commit 3858c11bc32593a1422480d7e524e4038ee53c6a Author: Yuansheng AuthorDate: Tue Jan 7 10:37:36 2020 +0800 doc: removed `rc1` version information. --- doc/how-to-build-cn.md | 2 +- doc/how-to-build.md| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/how-to-build-cn.md b/doc/how-to-build-cn.md index 019c026..7ed6b51 100644 --- a/doc/how-to-build-cn.md +++ b/doc/how-to-build-cn.md @@ -38,7 +38,7 @@ tar zxvf apache-apisix-1.0-incubating-src.tar.gz 安装运行时依赖的 Lua 库: ``` -cd apache-apisix-1.0-rc1-incubating +cd apache-apisix-1.0-incubating make deps ``` diff --git a/doc/how-to-build.md b/doc/how-to-build.md index f9542ef..82c1b89 100644 --- a/doc/how-to-build.md +++ b/doc/how-to-build.md @@ -39,7 +39,7 @@ tar zxvf apache-apisix-1.0-incubating-src.tar.gz Install the Lua libraries that the runtime depends on: ```shell -cd apache-apisix-1.0-rc1-incubating +cd apache-apisix-1.0-incubating make deps ```
[incubator-apisix] branch v1.0 updated (cd041a1 -> 48ade0c)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a change to branch v1.0 in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git. from cd041a1 utils: added new tools to check apisix version. new 3858c11 doc: removed `rc1` version information. new 48ade0c released new version 1.0 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: doc/how-to-build-cn.md | 2 +- doc/how-to-build.md | 2 +- rockspec/{apisix-master-0.rockspec => apisix-1.0-0.rockspec} | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) copy rockspec/{apisix-master-0.rockspec => apisix-1.0-0.rockspec} (98%)
[incubator-apisix] branch master updated (a5d6250 -> fba93d3)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git. from a5d6250 change: modified the SSL module from ffi to ngx.ssl (#1021) add fba93d3 plugin(JWT): JWT authentication plugin compatible with `Bearer` prefix (#1027) No new revisions were added by this update. Summary of changes: lua/apisix/plugins/jwt-auth.lua | 21 + t/plugin/jwt-auth.t | 39 ++- 2 files changed, 51 insertions(+), 9 deletions(-)
[incubator-apisix] branch master updated (61727d4 -> a5d6250)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git. from 61727d4 feature: support regex_uri option in proxy-rewrite plugin (#979) add a5d6250 change: modified the SSL module from ffi to ngx.ssl (#1021) No new revisions were added by this update. Summary of changes: lua/apisix/http/router/radixtree_sni.lua | 51 ++-- 1 file changed, 16 insertions(+), 35 deletions(-)
[incubator-apisix] branch v1.0 updated (afa2a6b -> cd041a1)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a change to branch v1.0 in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git. from afa2a6b doc: Update NOTICE year. new 688fef0 doc: updated version to 1.0 new cd041a1 utils: added new tools to check apisix version. 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: doc/how-to-build-cn.md | 14 +- doc/how-to-build.md | 14 +- lua/apisix/core/version.lua | 2 +- utils/check-version.sh | 68 + 4 files changed, 83 insertions(+), 15 deletions(-) create mode 100755 utils/check-version.sh
[incubator-apisix] 01/02: doc: updated version to 1.0
This is an automated email from the ASF dual-hosted git repository. membphis pushed a commit to branch v1.0 in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git commit 688fef078afbc7be661784b2c5d76cbfc5fd2465 Author: Yuansheng AuthorDate: Mon Jan 6 18:02:35 2020 +0800 doc: updated version to 1.0 --- doc/how-to-build-cn.md | 14 +++--- doc/how-to-build.md | 14 +++--- lua/apisix/core/version.lua | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/doc/how-to-build-cn.md b/doc/how-to-build-cn.md index 84f7f87..019c026 100644 --- a/doc/how-to-build-cn.md +++ b/doc/how-to-build-cn.md @@ -32,20 +32,20 @@ Apache APISIX 的运行环境需要 Nginx 和 etcd, 你需要先下载 Apache Release 源码包: ```shell -wget http://www.apache.org/dist/incubator/apisix/0.9/apache-apisix-0.9-incubating-src.tar.gz -tar zxvf apache-apisix-0.9-incubating-src.tar.gz +wget http://www.apache.org/dist/incubator/apisix/1.0/apache-apisix-1.0-incubating-src.tar.gz +tar zxvf apache-apisix-1.0-incubating-src.tar.gz ``` 安装运行时依赖的 Lua 库: ``` -cd apache-apisix-0.9-rc1-incubating +cd apache-apisix-1.0-rc1-incubating make deps ``` ### 通过 RPM 包安装(CentOS 7) ```shell -sudo yum install -y https://github.com/apache/incubator-apisix/releases/download/v0.9/apisix-0.9-0.el7.noarch.rpm +sudo yum install -y https://github.com/apache/incubator-apisix/releases/download/v1.0/apisix-1.0-0.el7.noarch.rpm ``` ### 通过 Luarocks 安装 (不支持 macOS) @@ -61,11 +61,11 @@ sudo sh -c "$(curl -fsSL https://raw.githubusercontent.com/apache/incubator-apis > 通过 Luarocks 安装指定的版本: ```shell -# 安装 apisix 的 0.9 版本 -sudo luarocks install --lua-dir=/path/openresty/luajit apisix 0.9 +# 安装 apisix 的 1.0 版本 +sudo luarocks install --lua-dir=/path/openresty/luajit apisix 1.0 # 老版本 luarocks 可能不支持 `lua-dir` 参数,可以删除该选项 -sudo luarocks install apisix 0.9 +sudo luarocks install apisix 1.0 ``` ## 3. 管理(启动、关闭等)APISIX 服务 diff --git a/doc/how-to-build.md b/doc/how-to-build.md index 50d51e9..f9542ef 100644 --- a/doc/how-to-build.md +++ b/doc/how-to-build.md @@ -33,20 +33,20 @@ You can install Apache APISIX in a variety of ways, including source code packag You need to download the Apache source release first: ```shell -wget http://www.apache.org/dist/incubator/apisix/0.9/apache-apisix-0.9-incubating-src.tar.gz -tar zxvf apache-apisix-0.9-incubating-src.tar.gz +wget http://www.apache.org/dist/incubator/apisix/1.0/apache-apisix-1.0-incubating-src.tar.gz +tar zxvf apache-apisix-1.0-incubating-src.tar.gz ``` Install the Lua libraries that the runtime depends on: ```shell -cd apache-apisix-0.9-rc1-incubating +cd apache-apisix-1.0-rc1-incubating make deps ``` ### Installation via RPM package (CentOS 7) ```shell -sudo yum install -y https://github.com/apache/incubator-apisix/releases/download/v0.9/apisix-0.9-0.el7.noarch.rpm +sudo yum install -y https://github.com/apache/incubator-apisix/releases/download/v1.0/apisix-1.0-0.el7.noarch.rpm ``` ### Installation via Luarocks (macOS not supported) @@ -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.9 -sudo luarocks install --lua-dir=/path/openresty/luajit apisix 0.9 +# Install version 1.0 +sudo luarocks install --lua-dir=/path/openresty/luajit apisix 1.0 # old luarocks not support the `lua-dir` parameter, you can remove this option -sudo luarocks install apisix 0.9 +sudo luarocks install apisix 1.0 ``` ## Manage (start/stop) APISIX Server diff --git a/lua/apisix/core/version.lua b/lua/apisix/core/version.lua index 4838aef..57f3dcf 100644 --- a/lua/apisix/core/version.lua +++ b/lua/apisix/core/version.lua @@ -15,5 +15,5 @@ -- limitations under the License. -- return { -VERSION = "0.9" +VERSION = "1.0" }
[incubator-apisix] 02/02: utils: added new tools to check apisix version.
This is an automated email from the ASF dual-hosted git repository. membphis pushed a commit to branch v1.0 in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git commit cd041a1dac876031f0f33ca91b458075f4fafba4 Author: Yuansheng AuthorDate: Mon Jan 6 18:02:59 2020 +0800 utils: added new tools to check apisix version. --- utils/check-version.sh | 68 ++ 1 file changed, 68 insertions(+) diff --git a/utils/check-version.sh b/utils/check-version.sh new file mode 100755 index 000..b068b35 --- /dev/null +++ b/utils/check-version.sh @@ -0,0 +1,68 @@ +#!/bin/sh + +# +# 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. +# + +ver=$1 + +red='\e[0;41m' +RED='\e[1;31m' +green='\e[0;32m' +GREEN='\e[1;32m' +NC='\e[0m' + +# doc: apisix $ver +matched=`grep "apisix.[0-9][0-9.]*" -r doc/` +expected=`grep "apisix.$ver" -r doc/` + +if [ "$matched" = "$expected" ]; then +echo -e "${green}passed: (doc) apisix $ver ${NC}" +else +echo -e "${RED}failed: (doc) apisix $ver ${NC}" 1>&2 +echo +echo "-maybe wrong version-" +echo "$matched" +exit 1 +fi + +# doc: version $ver +matched=`grep "version [0-9][0-9.]*" -r doc/` +expected=`grep -F "version $ver" -r doc/` + +if [ "$matched" = "$expected" ]; then +echo -e "${green}passed: (doc) version $ver ${NC}" +else +echo -e "${RED}failed: (doc) version $ver ${NC}" 1>&2 +echo +echo "-maybe wrong version-" +echo "$matched" +exit 1 +fi + +# lua: VERSION = $ver +matched=`grep "VERSION = \"[0-9][0-9.]*\"" -r lua/` +expected=`grep -F "VERSION = \"$ver\"" -r lua/` + +if [ "$matched" = "$expected" ]; then +echo -e "${green}passed: (lua) VERSION = $ver ${NC}" +else +echo -e "${RED}failed: (lua) VERSION = \"$ver\" ${NC}" 1>&2 +echo +echo "-maybe wrong version-" +echo "$matched" +exit 1 +fi
[incubator-apisix] branch v1.0 updated: doc: Update NOTICE year.
This is an automated email from the ASF dual-hosted git repository. membphis pushed a commit to branch v1.0 in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git The following commit(s) were added to refs/heads/v1.0 by this push: new afa2a6b doc: Update NOTICE year. afa2a6b is described below commit afa2a6b08c164878c294857b48bf418253488265 Author: Yuansheng AuthorDate: Mon Jan 6 17:52:26 2020 +0800 doc: Update NOTICE year. --- NOTICE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NOTICE b/NOTICE index c63a855..e15bb45 100644 --- a/NOTICE +++ b/NOTICE @@ -1,5 +1,5 @@ Apache APISIX (incubating) -Copyright 2019 The Apache Software Foundation +Copyright 2019-2020 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (http://www.apache.org/).
[incubator-apisix] branch v1.0 created (now 7c4ecb5)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a change to branch v1.0 in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git. at 7c4ecb5 doc: added changelog for 1.0 release. (#1015) No new revisions were added by this update.
[incubator-apisix] branch master updated: change: responsed a better tip when failed to match any route. (#1013)
This is an automated email from the ASF dual-hosted git repository. membphis 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 9e98773 change: responsed a better tip when failed to match any route. (#1013) 9e98773 is described below commit 9e98773fae6b19e4908090f8ab34eab2b4e39c04 Author: YuanSheng Wang AuthorDate: Fri Jan 3 10:11:37 2020 +0800 change: responsed a better tip when failed to match any route. (#1013) --- lua/apisix.lua| 2 +- lua/apisix/http/router/radixtree_host_uri.lua | 2 +- lua/apisix/http/router/radixtree_uri.lua | 4 ++-- t/debug/hook.t| 4 ++-- t/node/global-rule.t | 8 +++ t/node/hosts.t| 8 +++ t/node/invalid-route.t| 4 ++-- t/node/invalid-service.t | 4 ++-- t/node/invalid-upstream.t | 4 ++-- t/node/merge-route.t | 4 ++-- t/node/not-exist-service.t| 2 +- t/node/not-exist-upstream.t | 4 ++-- t/node/remote-addr-ipv6.t | 12 +- t/node/remote-addr.t | 8 +++ t/node/remote_addrs.t | 6 ++--- t/node/route-domain.t | 4 ++-- t/node/route-filter-func.t| 4 ++-- t/node/route-host.t | 12 +- t/node/route-uris.t | 2 -- t/node/sanity-radixtree.t | 8 +++ t/node/upstream-domain.t | 4 ++-- t/node/upstream-ipv6.t| 4 ++-- t/node/upstream.t | 4 ++-- t/node/vars.t | 32 +-- t/node/wildcard-host.t| 8 +++ t/router/radixtree-host-uri.t | 20 - t/router/radixtree-uri-host.t | 20 + t/router/radixtree-uri-multiple.t | 4 ++-- t/router/radixtree-uri-sanity.t | 20 - 29 files changed, 105 insertions(+), 117 deletions(-) diff --git a/lua/apisix.lua b/lua/apisix.lua index 741862c..63319cd 100644 --- a/lua/apisix.lua +++ b/lua/apisix.lua @@ -268,7 +268,7 @@ function _M.http_access_phase() local route = api_ctx.matched_route if not route then -return core.response.exit(404) +return core.response.exit(404, {error_msg = "failed to match any routes"}) end if route.value.service_protocol == "grpc" then diff --git a/lua/apisix/http/router/radixtree_host_uri.lua b/lua/apisix/http/router/radixtree_host_uri.lua index 960b8a0..cee7b2c 100644 --- a/lua/apisix/http/router/radixtree_host_uri.lua +++ b/lua/apisix/http/router/radixtree_host_uri.lua @@ -158,7 +158,7 @@ function _M.match(api_ctx) end core.log.info("not find any matched route") -return core.response.exit(404) +return true end diff --git a/lua/apisix/http/router/radixtree_uri.lua b/lua/apisix/http/router/radixtree_uri.lua index c84062e..dfcd654 100644 --- a/lua/apisix/http/router/radixtree_uri.lua +++ b/lua/apisix/http/router/radixtree_uri.lua @@ -98,7 +98,7 @@ function _M.match(api_ctx) if not uri_router then core.log.error("failed to fetch valid `uri` router: ") -return core.response.exit(404) +return true end core.table.clear(match_opts) @@ -110,7 +110,7 @@ function _M.match(api_ctx) local ok = uri_router:dispatch(api_ctx.var.uri, match_opts, api_ctx) if not ok then core.log.info("not find any matched route") -return core.response.exit(404) +return true end return true diff --git a/t/debug/hook.t b/t/debug/hook.t index 2d76d24..49bce20 100644 --- a/t/debug/hook.t +++ b/t/debug/hook.t @@ -84,8 +84,8 @@ passed --- request GET /not_found --- error_code: 404 response_body eval -qr/404 Not Found/ +--- response_body +{"error_msg":"failed to match any routes"} --- no_error_log [error] diff --git a/t/node/global-rule.t b/t/node/global-rule.t index 6eb64f0..c1de5dd 100644 --- a/t/node/global-rule.t +++ b/t/node/global-rule.t @@ -93,8 +93,8 @@ passed --- request GET /not_found --- error_code: 404 response_body eval -qr/404 Not Found/ +--- response_body +{"error_msg":"failed to match any routes"} --- no_error_log [error] @@ -104,8 +104,8 @@ qr/404 Not Found/ --- request GET /hello --- error_code: 404 response_body eval -qr/404 Not Found/ +--- response_body +{"error_msg":"failed to match any routes"} --- no_error_log [error] diff --git a/t/node/hosts.t b/t/node/hosts.t inde
[incubator-apisix] branch master updated: change: disable search engine inclusion. (#1012)
This is an automated email from the ASF dual-hosted git repository. membphis 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 d4442ff change: disable search engine inclusion. (#1012) d4442ff is described below commit d4442ff6a73cc466c76657e4722c88cb3ca79ca5 Author: YuanSheng Wang AuthorDate: Fri Jan 3 10:08:00 2020 +0800 change: disable search engine inclusion. (#1012) --- bin/apisix | 4 1 file changed, 4 insertions(+) diff --git a/bin/apisix b/bin/apisix index 97f1a22..b9de45b 100755 --- a/bin/apisix +++ b/bin/apisix @@ -247,6 +247,10 @@ http { try_files $uri $uri/index.html /index.html; } + +location /robots.txt { +return 200 'User-agent: *\nDisallow: /'; +} } {% end %}
[incubator-apisix] branch master updated: doc: fixed error in serverless plugin. (#1006)
This is an automated email from the ASF dual-hosted git repository. membphis 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 1069c3d doc: fixed error in serverless plugin. (#1006) 1069c3d is described below commit 1069c3d32dbbaeaa87555d41a16f7ec54b623a96 Author: WenMing AuthorDate: Mon Dec 30 20:28:36 2019 +0800 doc: fixed error in serverless plugin. (#1006) --- doc/plugins/serverless-cn.md | 10 -- doc/plugins/serverless.md| 2 +- lua/apisix/plugins/heartbeat.lua | 4 ++-- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/doc/plugins/serverless-cn.md b/doc/plugins/serverless-cn.md index e5b695c..c9f5f49 100644 --- a/doc/plugins/serverless-cn.md +++ b/doc/plugins/serverless-cn.md @@ -61,12 +61,10 @@ curl -i http://127.0.0.1:9080/apisix/admin/routes/1 -X PUT -d ' { "uri": "/index.html", "plugins": { -"plugins": { -"serverless-pre-function": { -"phase": "rewrite", -"functions" : ["return function() ngx.log(ngx.ERR, 'serverless pre function'); end"] -} -}, +"serverless-pre-function": { +"phase": "rewrite", +"functions" : ["return function() ngx.log(ngx.ERR, \"serverless pre function\"); end"] +} }, "upstream": { "type": "roundrobin", diff --git a/doc/plugins/serverless.md b/doc/plugins/serverless.md index 239d8b1..e6cffda 100644 --- a/doc/plugins/serverless.md +++ b/doc/plugins/serverless.md @@ -75,7 +75,7 @@ curl -i http://127.0.0.1:9080/apisix/admin/routes/1 -X PUT -d ' "plugins": { "serverless-pre-function": { "phase": "rewrite", -"functions" : ["return function() ngx.log(ngx.ERR, 'serverless pre function'); end"] +"functions" : ["return function() ngx.log(ngx.ERR, \"serverless pre function\"); end"] } }, "upstream": { diff --git a/lua/apisix/plugins/heartbeat.lua b/lua/apisix/plugins/heartbeat.lua index b9275c3..66e0faa 100644 --- a/lua/apisix/plugins/heartbeat.lua +++ b/lua/apisix/plugins/heartbeat.lua @@ -75,7 +75,7 @@ local function report() end end -core.log.warn(core.json.encode(etcd_version)) +core.log.info(core.json.encode(etcd_version)) local info = { version = core.version, @@ -92,7 +92,7 @@ local function report() core.log.error("failed to encode hearbeat information: ", err) return end -core.log.warn("heartbeat body: ", args) +core.log.info("heartbeat body: ", args) local res res, err = request_apisix_svr(args)
[incubator-apisix] branch master updated: change: upgrade `ngx_var` module 0.4 to 0.5. (#1005)
This is an automated email from the ASF dual-hosted git repository. membphis 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 b40d3bc change: upgrade `ngx_var` module 0.4 to 0.5. (#1005) b40d3bc is described below commit b40d3bc8f88ec7f91627ff402be509cbc06b3abc Author: Janko AuthorDate: Fri Dec 27 16:53:45 2019 +0800 change: upgrade `ngx_var` module 0.4 to 0.5. (#1005) --- lua/apisix/http/router/radixtree_host_uri.lua | 2 +- lua/apisix/http/router/radixtree_uri.lua | 2 +- lua/apisix/plugins/zipkin.lua | 2 +- rockspec/apisix-master-0.rockspec | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/apisix/http/router/radixtree_host_uri.lua b/lua/apisix/http/router/radixtree_host_uri.lua index d4fad18..960b8a0 100644 --- a/lua/apisix/http/router/radixtree_host_uri.lua +++ b/lua/apisix/http/router/radixtree_host_uri.lua @@ -139,7 +139,7 @@ function _M.match(api_ctx) end core.table.clear(match_opts) -match_opts.method = api_ctx.var.method +match_opts.method = api_ctx.var.request_method match_opts.remote_addr = api_ctx.var.remote_addr match_opts.vars = api_ctx.var match_opts.host = api_ctx.var.host diff --git a/lua/apisix/http/router/radixtree_uri.lua b/lua/apisix/http/router/radixtree_uri.lua index 6b364b5..ba40160 100644 --- a/lua/apisix/http/router/radixtree_uri.lua +++ b/lua/apisix/http/router/radixtree_uri.lua @@ -99,7 +99,7 @@ function _M.match(api_ctx) end core.table.clear(match_opts) -match_opts.method = api_ctx.var.method +match_opts.method = api_ctx.var.request_method match_opts.host = api_ctx.var.host match_opts.remote_addr = api_ctx.var.remote_addr match_opts.vars = api_ctx.var diff --git a/lua/apisix/plugins/zipkin.lua b/lua/apisix/plugins/zipkin.lua index 7dce205..4974ca6 100644 --- a/lua/apisix/plugins/zipkin.lua +++ b/lua/apisix/plugins/zipkin.lua @@ -89,7 +89,7 @@ function _M.rewrite(conf, ctx) tags = { component = "apisix", ["span.kind"] = "server", -["http.method"] = ctx.var.method, +["http.method"] = ctx.var.request_method, ["http.url"] = ctx.var.request_uri, -- TODO: support ipv6 ["peer.ipv4"] = core.request.get_remote_client_ip(ctx), diff --git a/rockspec/apisix-master-0.rockspec b/rockspec/apisix-master-0.rockspec index 27cb11b..7ef6bef 100644 --- a/rockspec/apisix-master-0.rockspec +++ b/rockspec/apisix-master-0.rockspec @@ -33,7 +33,7 @@ dependencies = { "lua-resty-template = 1.9", "lua-resty-etcd = 0.8", "lua-resty-balancer = 0.02rc5", -"lua-resty-ngxvar = 0.4", +"lua-resty-ngxvar = 0.5", "lua-resty-jit-uuid = 0.0.7", "lua-resty-healthcheck-iresty = 2.0", "lua-resty-jwt = 0.2.0",
[incubator-apisix] branch master updated (eff1ca7 -> 206f8b8)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git. from eff1ca7 feature: added support CORS for /apisix/admin. (#982) add 206f8b8 CLI: update apisix, maybe custom directory place in /usr (#1002) No new revisions were added by this update. Summary of changes: bin/apisix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
[incubator-apisix] branch master updated (29a8268 -> 051bade)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git. from 29a8268 bugfix: Update schema_def.lua (#988) add 051bade test: avoided listening on unnecessary unix sockets. (#995) No new revisions were added by this update. Summary of changes: t/APISIX.pm | 1 - t/plugin/grpc-transcode.t | 2 +- t/router/radixtree-sni.t | 8 3 files changed, 9 insertions(+), 2 deletions(-)
[incubator-apisix] branch master updated: change: upgrade etcd to version 0.8 and modify the connection keys. (#980)
This is an automated email from the ASF dual-hosted git repository. membphis 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 bb04914 change: upgrade etcd to version 0.8 and modify the connection keys. (#980) bb04914 is described below commit bb0491453cd4671bb0e6113e3a7cc5db1cad5c76 Author: Janko AuthorDate: Thu Dec 19 16:49:55 2019 +0800 change: upgrade etcd to version 0.8 and modify the connection keys. (#980) --- lua/apisix/core/config_etcd.lua | 2 ++ lua/apisix/core/etcd.lua | 2 ++ rockspec/apisix-master-0.rockspec | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/apisix/core/config_etcd.lua b/lua/apisix/core/config_etcd.lua index 26e4c73..484e6ef 100644 --- a/lua/apisix/core/config_etcd.lua +++ b/lua/apisix/core/config_etcd.lua @@ -380,6 +380,8 @@ function _M.new(key, opts) local etcd_conf = clone_tab(local_conf.etcd) local prefix = etcd_conf.prefix +etcd_conf.http_host = etcd_conf.host +etcd_conf.host = nil etcd_conf.prefix = nil local etcd_cli diff --git a/lua/apisix/core/etcd.lua b/lua/apisix/core/etcd.lua index 3e34144..818c99b 100644 --- a/lua/apisix/core/etcd.lua +++ b/lua/apisix/core/etcd.lua @@ -29,6 +29,8 @@ local function new() local etcd_conf = clone_tab(local_conf.etcd) local prefix = etcd_conf.prefix +etcd_conf.http_host = etcd_conf.host +etcd_conf.host = nil etcd_conf.prefix = nil local etcd_cli diff --git a/rockspec/apisix-master-0.rockspec b/rockspec/apisix-master-0.rockspec index 1298a3d..27cb11b 100644 --- a/rockspec/apisix-master-0.rockspec +++ b/rockspec/apisix-master-0.rockspec @@ -31,7 +31,7 @@ description = { dependencies = { "lua-resty-template = 1.9", -"lua-resty-etcd = 0.7", +"lua-resty-etcd = 0.8", "lua-resty-balancer = 0.02rc5", "lua-resty-ngxvar = 0.4", "lua-resty-jit-uuid = 0.0.7",
[incubator-apisix] branch master updated: optimize(radixtree_host_uri): reuse empty function. (#937)
This is an automated email from the ASF dual-hosted git repository. membphis 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 678142e optimize(radixtree_host_uri): reuse empty function. (#937) 678142e is described below commit 678142e051ecaeb361e8f681d84048962e22080b Author: YuanSheng Wang AuthorDate: Tue Dec 10 13:28:40 2019 +0800 optimize(radixtree_host_uri): reuse empty function. (#937) --- lua/apisix/http/router/radixtree_host_uri.lua | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/apisix/http/router/radixtree_host_uri.lua b/lua/apisix/http/router/radixtree_host_uri.lua index 051d3b1..d4fad18 100644 --- a/lua/apisix/http/router/radixtree_host_uri.lua +++ b/lua/apisix/http/router/radixtree_host_uri.lua @@ -83,6 +83,9 @@ local function push_host_router(route, host_routes, only_uri_routes) end +local function empty_func() end + + local function create_radixtree_router(routes) local host_routes = {} local only_uri_routes = {} @@ -102,8 +105,7 @@ local function create_radixtree_router(routes) filter_fun = function(vars, opts, ...) return sub_router:dispatch(vars.uri, opts, ...) end, -handler = function (api_ctx) -end +handler = empty_func, }) end if #host_router_routes > 0 then
[incubator-apisix] branch master updated: doc: removed gitter. (#938)
This is an automated email from the ASF dual-hosted git repository. membphis 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 5621e95 doc: removed gitter. (#938) 5621e95 is described below commit 5621e95a3daffeb3ce1ebf3472b2e1dfa8d40b49 Author: WenMing AuthorDate: Fri Dec 6 14:48:50 2019 +0800 doc: removed gitter. (#938) --- README.md| 3 +-- README_CN.md | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 28e7214..4022f7e 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,6 @@ - **QQ group**: 552030619 - Mail list: Mail to dev-subscr...@apisix.apache.org, follow the reply to subscribe the mail list. -- [![Gitter](https://badges.gitter.im/apisix/community.svg)](https://gitter.im/apisix/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) - [![Twitter](https://img.shields.io/twitter/follow/apisixfast.svg?style=social&label=Follow)](https://twitter.com/intent/follow?screen_name=apisixfast) APISIX is a cloud-native microservices API gateway, delivering the ultimate performance, security, open source and scalable platform for all your APIs and microservices. @@ -36,7 +35,7 @@ APISIX is based on Nginx and etcd. Compared with traditional API gateways, APISI If you are building a website, mobile device or IoT (Internet of Things) application, you may need to use an API gateway to handle interface traffic. -APISIX is a cloud-based microservices API gateway that handles traditional north-south traffic and handles east-west traffic between services. +APISIX is a cloud-based microservices API gateway that handles traditional north-south traffic and handles east-west traffic between services, and can also be used as a k8s ingress controller. APISIX provides dynamic load balancing, authentication, rate limiting, other plugins through plugin mechanisms, and supports plugins you develop yourself. diff --git a/README_CN.md b/README_CN.md index 012f0bb..d22dfe2 100644 --- a/README_CN.md +++ b/README_CN.md @@ -24,8 +24,7 @@ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/apache/incubator-apisix/blob/master/LICENSE) - **QQ 交流群**: 552030619 -- 邮件列表: 发邮件到 dev-subscr...@apisix.apache.org, 然后跟着回复邮件操作即可 -- [![Gitter](https://badges.gitter.im/apisix/community.svg)](https://gitter.im/apisix/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) +- 邮件列表: 发邮件到 dev-subscr...@apisix.apache.org, 然后跟着回复邮件操作即可。 APISIX 是一个云原生、高性能、可扩展的微服务 API 网关。 @@ -35,7 +34,7 @@ APISIX 是一个云原生、高性能、可扩展的微服务 API 网关。 如果你正在构建网站、移动设备或 IoT(物联网)的应用,那么你可能需要使用 API 网关来处理接口流量。 -APISIX 是基于云原生的微服务 API 网关,可以处理传统的南北向流量,也可以处理服务间的东西向流量。 +APISIX 是基于云原生的微服务 API 网关,可以处理传统的南北向流量,也可以处理服务间的东西向流量,也可以当做 k8s ingress controller 来使用。 APISIX 通过插件机制,提供动态负载平衡、身份验证、限流限速等功能,并且支持你自己开发的插件。
[incubator-apisix] branch master updated: feature: support to specify TTL for route。 (#807)
This is an automated email from the ASF dual-hosted git repository. membphis 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 c7f9fdf feature: support to specify TTL for route。 (#807) c7f9fdf is described below commit c7f9fdf9d756e93ad609bb4161d98717cf46958c Author: YuanSheng Wang AuthorDate: Fri Dec 6 11:13:24 2019 +0800 feature: support to specify TTL for route。 (#807) Fix #443. --- doc/admin-api-cn.md | 28 - lua/apisix/admin/init.lua | 14 - lua/apisix/admin/routes.lua | 12 ++-- lua/apisix/core/etcd.lua| 8 +-- t/admin/routes.t| 144 5 files changed, 192 insertions(+), 14 deletions(-) diff --git a/doc/admin-api-cn.md b/doc/admin-api-cn.md index 2af0580..feb211f 100644 --- a/doc/admin-api-cn.md +++ b/doc/admin-api-cn.md @@ -25,7 +25,7 @@ ## Route -*地址*:/apisix/admin/routes/{id} +*地址*:/apisix/admin/routes/{id}?ttl=0 *说明*:Route 字面意思就是路由,通过定义一些规则来匹配客户端的请求,然后根据匹配结果加载并执行相应的 插件,并把请求转发给到指定 Upstream。 @@ -40,7 +40,13 @@ |DELETE |/apisix/admin/routes/{id}|无|删除资源| |PATCH|/apisix/admin/routes/{id}/{path}|{...}|修改已有 Route 的部分内容,其他不涉及部分会原样保留。| -> 请求参数: +> uri 请求参数: + +|名字 |可选项 |类型 |说明|示例| +|-|-||---|| +|ttl |可选 |辅助 |超过这个时间会被自动删除,单位:秒|ttl=1| + +> body 请求参数: |名字 |可选项 |类型 |说明|示例| |-|-||---|| @@ -64,6 +70,7 @@ 示例: ```shell +# 创建一个路由 $ curl http://127.0.0.1:9080/apisix/admin/routes/1 -X PUT -i -d ' { "uri": "/index.html", @@ -81,6 +88,23 @@ $ curl http://127.0.0.1:9080/apisix/admin/routes/1 -X PUT -i -d ' HTTP/1.1 201 Created Date: Sat, 31 Aug 2019 01:17:15 GMT ... + +# 创建一个有效期为 60 秒的路由,过期后自动删除 +$ curl http://127.0.0.1:9080/apisix/admin/routes/2?ttl=60 -X PUT -i -d ' +{ +"uri": "/aa/index.html", +"upstream": { +"type": "roundrobin", +"nodes": { +"39.97.63.215:80": 1 +} +} +}' + +HTTP/1.1 201 Created +Date: Sat, 31 Aug 2019 01:17:15 GMT +... + ``` > 应答参数 diff --git a/lua/apisix/admin/init.lua b/lua/apisix/admin/init.lua index 128340f..ee4ebea 100644 --- a/lua/apisix/admin/init.lua +++ b/lua/apisix/admin/init.lua @@ -17,10 +17,11 @@ local core = require("apisix.core") local route = require("resty.radixtree") local plugin = require("apisix.plugin") +local ngx = ngx local get_method = ngx.req.get_method +local tonumber = tonumber local str_lower = string.lower local require = require -local ngx = ngx local reload_event = "/apisix/admin/plugins/reload" local events @@ -80,7 +81,16 @@ local function run() req_body = data end -local code, data = resource[method](seg_id, req_body, seg_sub_path) +local uri_args = ngx.req.get_uri_args() or {} +if uri_args.ttl then +if not tonumber(uri_args.ttl) then +core.response.exit(400, {error_msg = "invalid argument ttl: " + .. "should be a number"}) +end +end + +local code, data = resource[method](seg_id, req_body, seg_sub_path, +uri_args) if code then core.response.exit(code, data) end diff --git a/lua/apisix/admin/routes.lua b/lua/apisix/admin/routes.lua index e27e33a..34ab758 100644 --- a/lua/apisix/admin/routes.lua +++ b/lua/apisix/admin/routes.lua @@ -117,14 +117,14 @@ local function check_conf(id, conf, need_id) end -function _M.put(id, conf) +function _M.put(id, conf, sub_path, args) local id, err = check_conf(id, conf, true) if not id then return 400, err end local key = "/routes/" .. id -local res, err = core.etcd.set(key, conf) +local res, err = core.etcd.set(key, conf, args.ttl) if not res then core.log.error("failed to put route[", key, "]: ", err) return 500, {error_msg = err} @@ -150,7 +150,7 @@ function _M.get(id) end -function _M.post(id, conf) +function _M.post(id, conf, sub_path, args) local id, err = check_conf(id, conf, false) if not id then return 400, err @@ -158,7 +158,7 @@ function _M.post(id, conf) local key = "/routes" -- core.log.info("key: ", key) -local res, err = core.etcd.push("/routes", conf) +local res, err = core.etcd.push("/routes", conf, args.ttl) if not res then core.log.error("failed to post route[", key, "]: ", err) return 500, {error_msg = err} @@ -185,7 +185,7 @@ function _M.delete(id) end -function _M.patch(id, conf, sub_path) +fu
[incubator-apisix] branch master updated (863aef7 -> 4517e7b)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git. from 863aef7 bugfix: reloaded the etcd configuation data if the index (#871) add 4517e7b test case for grpc transcode pb option (#920) No new revisions were added by this update. Summary of changes: doc/plugins/grpc-transcoding-cn.md | 2 +- t/plugin/grpc-transcode.t | 19 +++ 2 files changed, 16 insertions(+), 5 deletions(-)
[incubator-apisix] branch master updated: plugin(grpc-transcode): support new options for `protocol buffer` encoding. (#846)
This is an automated email from the ASF dual-hosted git repository. membphis 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 b230961 plugin(grpc-transcode): support new options for `protocol buffer` encoding. (#846) b230961 is described below commit b23096139e78064bd9ccf0e70b8539596ceab9c5 Author: tom2nonames <13682645...@139.com> AuthorDate: Thu Nov 28 09:07:09 2019 +0800 plugin(grpc-transcode): support new options for `protocol buffer` encoding. (#846) * bugfix: Adjust the MaxLength parameter in grpc proto from 4096b to 1M (#820) * change: grpc-transcode plugins add schema check --- doc/plugins/grpc-transcoding-cn.md | 71 +- lua/apisix/plugins/grpc-transcode.lua | 43 ++-- lua/apisix/plugins/grpc-transcode/request.lua | 15 -- lua/apisix/plugins/grpc-transcode/response.lua | 10 +++- lua/apisix/plugins/grpc-transcode/util.lua | 6 ++- 5 files changed, 133 insertions(+), 12 deletions(-) diff --git a/doc/plugins/grpc-transcoding-cn.md b/doc/plugins/grpc-transcoding-cn.md index 200504f..f95b448 100644 --- a/doc/plugins/grpc-transcoding-cn.md +++ b/doc/plugins/grpc-transcoding-cn.md @@ -53,7 +53,7 @@ curl http://127.0.0.1:9080/apisix/admin/proto/1 -X PUT -d ' * `proto_id`: `.proto`内容的id. * `service`: grpc服务名. * `method`: grpc服务中要调用的方法名. - +* `option`: proto 编码过程中的转换选项. [ "int64_as_string" / "enum_as_value" / "auto_default_values" / "enable_hooks" ] ### 示例 @@ -107,3 +107,72 @@ Proxy-Connection: keep-alive 这表示已成功代理。 + + 使用 grpc-transcode 插件的 pb_option 选项 + +在指定 route 中,代理 grpc 服务接口: + +**选项清单** + * 枚举类型 +> enum_as_name +> enum_as_value + + * 64位整型 +> int64_as_number +> int64_as_string +> int64_as_hexstring + + * 使用默认值 +> auto_default_values +> no_default_values +> use_default_values +> use_default_metatable + + * Hooks开关 +> enable_hooks +> disable_hooks + +```shell +curl http://127.0.0.1:9080/apisix/admin/routes/23 -X PUT -d ' +{ +"methods": ["GET"], +"uri": "/zeebe/WorkflowInstanceCreate", +"service_protocol": "grpc", +"plugins": { +"grpc-transcode": { + "proto_id": "1", + "service": "gateway_protocol.Gateway", + "method": "CreateWorkflowInstance", + "pb_option":["int64_as_string"] +} +}, +"upstream": { +"type": "roundrobin", +"nodes": { +"127.0.0.1:26500": 1 +} +} +}' +``` + + 测试 + +访问上面配置的 route: + +``` +$ curl -i "http://127.0.0.1:9080/zeebe/WorkflowInstanceCreate?bpmnProcessId=order-process&version=1&variables=\{\"orderId\":\"7\",\"ordervalue\":99\}"; +HTTP/1.1 200 OK +Date: Wed, 13 Nov 2019 03:38:27 GMT +Content-Type: application/json +Transfer-Encoding: chunked +Connection: keep-alive +grpc-encoding: identity +grpc-accept-encoding: gzip +Server: APISIX web server +Trailer: grpc-status +Trailer: grpc-message + +{"workflowKey":"#2251799813685260","workflowInstanceKey":"#2251799813688013","bpmnProcessId":"order-process","version":1} +``` + +`"workflowKey":"#2251799813685260"` 这表示已成功。 diff --git a/lua/apisix/plugins/grpc-transcode.lua b/lua/apisix/plugins/grpc-transcode.lua index 7791a4f..4c8191f 100644 --- a/lua/apisix/plugins/grpc-transcode.lua +++ b/lua/apisix/plugins/grpc-transcode.lua @@ -16,18 +16,53 @@ -- local ngx = ngx local core= require("apisix.core") +local schema_def = require("apisix.schema_def") local plugin_name = "grpc-transcode" local proto = require("apisix.plugins.grpc-transcode.proto") local request = require("apisix.plugins.grpc-transcode.request") local response= require("apisix.plugins.grpc-transcode.response") +local pb_option_def = { +{ description = "enum as result", +type = "string", +enum = {"int64_as_number", + "int64_as_string", + "int64_as_hexstring"}, +}, +{ description = "int64 as result", +type = "string", +enum = {"ienum_as_name", +"enum_as_value"}, +}, +{ description ="default values option", +type = "string", +enum = {"auto_default_values", +&qu
[incubator-apisix] branch master updated: Tengine: run test cases with patch files (#834)
This is an automated email from the ASF dual-hosted git repository. membphis 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 2510241 Tengine: run test cases with patch files (#834) 2510241 is described below commit 25102419d0487ee37d80db5e1b2a10a29843a75b Author: wonglend AuthorDate: Wed Nov 27 23:57:23 2019 +0800 Tengine: run test cases with patch files (#834) * Patches the tengine 2.3.2 (which based on nginx-1.17.3) core using .patch files from openresty upstream: ``` patch -p1 < ../../patches/nginx-1.17.4-always_enable_cc_feature_tests.patch patch -p1 < ../../patches/nginx-1.17.4-balancer_status_code.patch 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 patch -p1 < ../../patches/nginx-1.17.4-log_escape_non_ascii.patch patch -p1 < ../../patches/nginx-1.17.4-no_Werror.patch patch -p1 < ../../patches/nginx-1.17.4-pcre_conf_opt.patch patch -p1 < ../../patches/nginx-1.17.4-proxy_host_port_vars.patch patch -p1 < ../../patches/nginx-1.17.4-resolver_conf_parsing.patch patch -p1 < ../../patches/nginx-1.17.4-reuseport_close_unused_fds.patch patch -p1 < ../../patches/nginx-1.17.4-safe_resolver_ipv6_option.patch patch -p1 < ../../patches/nginx-1.17.4-single_process_graceful_exit.patch patch -p1 < ../../patches/nginx-1.17.4-ssl_cert_cb_yield.patch patch -p1 < ../../patches/nginx-1.17.4-ssl_sess_cb_yield.patch patch -p1 < ../../patches/nginx-1.17.4-stream_balancer_export.patch patch -p1 < ../../patches/nginx-1.17.4-stream_proxy_get_next_upstream_tries.patch patch -p1 < ../../patches/nginx-1.17.4-stream_proxy_timeout_fields.patch patch -p1 < ../../patches/nginx-1.17.4-stream_ssl_preread_no_skip.patch patch -p1 < ../../patches/nginx-1.17.4-upstream_pipelining.patch patch -p1 < ../../patches/nginx-1.17.4-upstream_timeout_fields.patch ``` --- .travis/linux_tengine_runner.sh | 59 + 1 file changed, 59 insertions(+) diff --git a/.travis/linux_tengine_runner.sh b/.travis/linux_tengine_runner.sh index c7742bd..c175664 100755 --- a/.travis/linux_tengine_runner.sh +++ b/.travis/linux_tengine_runner.sh @@ -67,6 +67,65 @@ tengine_install() { cd openresty-1.15.8.2 +# patching start +# https://github.com/alibaba/tengine/issues/1381#issuecomment-541493008 +# other patches for tengine 2.3.2 from upstream openresty +wget -P patches https://raw.githubusercontent.com/openresty/openresty/master/patches/nginx-1.17.4-always_enable_cc_feature_tests.patch +wget -P patches https://raw.githubusercontent.com/openresty/openresty/master/patches/nginx-1.17.4-balancer_status_code.patch +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 +wget -P patches https://raw.githubusercontent.com/openresty/openresty/master/patches/nginx-1.17.4-log_escape_non_ascii.patch +wget -P patches https://raw.githubusercontent.com/openresty/openresty/master/patches/nginx-1.17.4-no_Werror.patch +wget -P patches https://raw.githubusercontent.com/openresty/openresty/master/patches/nginx-1.17.4-pcre_conf_opt.patch +wget -P patches https://raw.githubusercontent.com/openresty/openresty/master/patches/nginx-1.17.4-proxy_host_port_vars.patch +wget -P patches https://raw.githubusercontent.com/openresty/openresty/master/patches/nginx-1.17.4-resolver_conf_parsing.patch +wget -P patches https://raw.githubusercontent.com/openresty/openresty/master/patche
[incubator-apisix] branch master updated: doc: install from Apache release first. (#906)
This is an automated email from the ASF dual-hosted git repository. membphis 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 dfb139e doc: install from Apache release first. (#906) dfb139e is described below commit dfb139e93ad7e0e6ec3ba9ac68aba9677421c11b Author: WenMing AuthorDate: Wed Nov 27 21:55:56 2019 +0800 doc: install from Apache release first. (#906) --- README.md | 6 +++--- README_CN.md | 4 ++-- doc/how-to-build-cn.md | 10 +- doc/how-to-build.md| 10 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index b3b2460..28e7214 100644 --- a/README.md +++ b/README.md @@ -91,9 +91,9 @@ APISIX Installed and tested in the following systems(OpenResty MUST >= 1.15.8.1, 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); +1. Installation runtime dependencies: OpenResty and etcd, refer to [documentation](doc/install-dependencies.md) 2. There are several ways to install Apache APISIX: -- [Source Release Candidate](doc/how-to-build.md#installation-via-source-release-candidate) +- [Source Release](doc/how-to-build.md#installation-via-source-release) - [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) @@ -116,7 +116,7 @@ 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): +- Download the source code of [dashboard](https://github.com/apache/incubator-apisix-dashboard): ``` git clone https://github.com/apache/incubator-apisix-dashboard.git ``` diff --git a/README_CN.md b/README_CN.md index 8cd2e7a..012f0bb 100644 --- a/README_CN.md +++ b/README_CN.md @@ -90,9 +90,9 @@ APISIX 在以下操作系统中可顺利安装并做过运行测试,需要注 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). +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) 来安装。 diff --git a/doc/how-to-build-cn.md b/doc/how-to-build-cn.md index 79b9663..8d416db 100644 --- a/doc/how-to-build-cn.md +++ b/doc/how-to-build-cn.md @@ -27,13 +27,13 @@ Apache APISIX 的运行环境需要 Nginx 和 etcd, 你可以通过源码包、Docker、Luarocks 等多种方式来安装 Apache APISIX。 -### 通过源码候选版本安装 +### 通过源码包安装 -你需要先下载源码候选版本: +你需要先下载 Apache Release 源码包: ```shell -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 +wget http://www.apache.org/dist/incubator/apisix/0.9/apache-apisix-0.9-incubating-src.tar.gz +tar zxvf apache-apisix-0.9-incubating-src.tar.gz ``` 安装运行时依赖的 Lua 库: @@ -45,7 +45,7 @@ make deps ### 通过 RPM 包安装(CentOS 7) ```shell -sudo yum install -y https://github.com/apache/incubator-apisix/releases/download/v0.8/apisix-0.8-0.el7.noarch.rpm +sudo yum install -y https://github.com/apache/incubator-apisix/releases/download/v0.9/apisix-0.9-0.el7.noarch.rpm ``` ### 通过 Luarocks 安装 (不支持 macOS) diff --git a/doc/how-to-build.md b/doc/how-to-build.md index b49bd66..28c07d9 100644 --- a/doc/how-to-build.md +++ b/doc/how-to-build.md @@ -28,13 +28,13 @@ So before installation, please follow the different operating systems [install D You can install Apache APISIX in a variety of ways, including source code packages, Docker, and Luarocks. -### Installation via source release candidate +### Installation via source release -You need to download the source release candidate first: +You need to download the Apache source release first: ```shell -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 +wget http://www.apache.org/dist/incubator/apisix/0.9/apache-apisix-0.9-incubating-src.tar.gz +tar zxvf apache-apisix-0.9-incubating-src.tar.gz ``` Install the Lua libraries that the runtime depends on: @@ -46,7 +46,7 @@ make deps ### Installation via RPM package (CentO
[incubator-apisix] branch master updated: travis: removed luacheck for macos. (#907)
This is an automated email from the ASF dual-hosted git repository. membphis 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 d6e343e travis: removed luacheck for macos. (#907) d6e343e is described below commit d6e343e492069f7633c83aa69cf2c459ba723428 Author: WenMing AuthorDate: Wed Nov 27 21:54:18 2019 +0800 travis: removed luacheck for macos. (#907) --- .travis/osx_openresty_runner.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis/osx_openresty_runner.sh b/.travis/osx_openresty_runner.sh index 8b91e62..2f1ac1f 100755 --- a/.travis/osx_openresty_runner.sh +++ b/.travis/osx_openresty_runner.sh @@ -60,8 +60,6 @@ script() { etcd --enable-v2=true & sleep 1 -luarocks install luacheck - sudo cpanm Test::Nginx ./grpc_server_example/grpc_server_example &
[incubator-apisix] branch master updated: doc: fixed some typo and update content. (#895)
This is an automated email from the ASF dual-hosted git repository. membphis 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 24d1190 doc: fixed some typo and update content. (#895) 24d1190 is described below commit 24d1190e83007a6a8e7f4db1f48b423b7df8681b Author: agile6v AuthorDate: Sun Nov 24 21:15:39 2019 +0800 doc: fixed some typo and update content. (#895) --- README.md | 2 +- doc/README.md | 8 +++--- doc/benchmark.md| 2 +- doc/https.md| 2 +- 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 | 35 ++--- 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.md | 57 ++--- doc/plugins/serverless.md | 35 + doc/plugins/zipkin.md | 9 --- doc/stand-alone.md | 2 +- doc/stream-proxy.md | 2 +- 20 files changed, 204 insertions(+), 126 deletions(-) diff --git a/README.md b/README.md index 5f2d94c..883f841 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ # --> -[中文](README_CN.md) +[Chinese](README_CN.md) ## APISIX [![Build Status](https://travis-ci.org/apache/incubator-apisix.svg?branch=master)](https://travis-ci.org/apache/incubator-apisix) diff --git a/doc/README.md b/doc/README.md index 7198173..8e6c728 100644 --- a/doc/README.md +++ b/doc/README.md @@ -16,9 +16,9 @@ # limitations under the License. # --> -[中文](README_CN.md) +[Chinese](README_CN.md) -Reference document +Reference Documentation == * [APISIX Readme](../README.md) @@ -41,7 +41,7 @@ Plugins * [hot reload](plugins.md): Hot reload without reload service. * [key-auth](plugins/key-auth.md): User authentication based on Key Authentication. -* [JWT-auth](plugins/jwt-auth-cn.md): User authentication based on [JWT](https://jwt.io/) (JSON Web Tokens) Authentication. +* [JWT-auth](plugins/jwt-auth.md): User authentication based on [JWT](https://jwt.io/) (JSON Web Tokens) Authentication. * [HTTPS/TLS](https.md): Dynamic load the SSL Certificate by Server Name Indication (SNI). * [limit-count](plugins/limit-count.md): Rate limiting based on a "fixed window" implementation. * [limit-req](plugins/limit-req.md): Request rate limiting and adjustment based on the "leaky bucket" method. @@ -50,7 +50,7 @@ Plugins * [prometheus](plugins/prometheus.md): Expose metrics related to APISIX and proxied upstream services in Prometheus exposition format, which can be scraped by a Prometheus Server. * [OpenTracing](plugins/zipkin.md): Supports Zikpin and Apache SkyWalking. * [grpc-transcode](plugins/grpc-transcoding.md): REST <--> gRPC transcoding。 -* [serverless](plugins/serverless-cn.md):AllowS to dynamically run Lua code at *different* phase in APISIX. +* [serverless](plugins/serverless.md):Allows to dynamically run Lua code at *different* phase in APISIX. * [ip-restriction](plugins/ip-restriction.md): IP whitelist/blacklist. * openid-connect * [redirect](plugins/redirect.md): URI redirect. diff --git a/doc/benchmark.md b/doc/benchmark.md index 9a70ba5..b2fbf11 100644 --- a/doc/benchmark.md +++ b/doc/benchmark.md @@ -17,7 +17,7 @@ # --> -[中文](benchmark-cn.md) +[Chinese](benchmark-cn.md) ### Benchmark Environments n1-highcpu-8 (8 vCPUs, 7.2 GB memory) on Google Cloud diff --git a/doc/https.md b/doc/https.md index 6405859..c63c709 100644 --- a/doc/https.md +++ b/doc/https.md @@ -17,7 +17,7 @@ # --> -[中文](https-cn.md) +[Chinese](https-cn.md) ### HTTPS `APISIX` supports to load a specific SSL certificate by TLS extension Server Name Indication (SNI). diff --git a/doc/plugins.md b/doc/plugins.md index f41e39d..711290c 100644 --- a/doc/plugins.md +++ b/doc/plugins.md @@ -17,7 +17,7 @@ # --> -[中文](plugins-cn.md) +[Chinese](plugins-cn.md) ## Hot reload APISIX plug-ins are hot-loaded. No matter you add, delete or modify plug-ins, you don't need to restart the service. diff --git a/doc/plugins/grpc-transcoding.md b/doc/plugins/grpc-transcoding.md index 23be79c..0b5c391 100644 --- a/doc/plugins/grpc-transcoding.md +++ b/doc/plugins/grpc-transcoding.md @@ -17,14 +17,15 @@ # --> -[中文](grpc-transcoding-cn.md) -# grpc-transcoding +[Chinese](grpc-transcoding-cn.md) + +## Name HTTP(s) -> APISIX -> gRPC server ##
[incubator-apisix] branch master updated: bugfix: fetch the current log level when needs. (#885)
This is an automated email from the ASF dual-hosted git repository. membphis 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 01dc41c bugfix: fetch the current log level when needs. (#885) 01dc41c is described below commit 01dc41c8a6ac6acb5f7836b5d44a6cdc1dc90f94 Author: YuanSheng Wang AuthorDate: Sat Nov 23 20:40:47 2019 +0800 bugfix: fetch the current log level when needs. (#885) * bugfix: fetch the current log level when needs. --- lua/apisix/core/log.lua | 70 +++ t/core/log.t| 146 2 files changed, 193 insertions(+), 23 deletions(-) diff --git a/lua/apisix/core/log.lua b/lua/apisix/core/log.lua index d04c4f8..b0b60de 100644 --- a/lua/apisix/core/log.lua +++ b/lua/apisix/core/log.lua @@ -18,32 +18,33 @@ local ngx = ngx local ngx_log = ngx.log local ngx_DEBUG= ngx.DEBUG local DEBUG= ngx.config.debug --- todo: support stream module -local cur_level = ngx.config.subsystem == "http" and - require "ngx.errlog" .get_sys_filter_level() - -local _M = {version = 0.1} - - -for name, log_level in pairs({stderr = ngx.STDERR, - emerg = ngx.EMERG, - alert = ngx.ALERT, - crit = ngx.CRIT, - error = ngx.ERR, - warn = ngx.WARN, - notice = ngx.NOTICE, - info = ngx.INFO, }) do -if cur_level and log_level > cur_level then -_M[name] = function() end -else -_M[name] = function(...) -return ngx_log(log_level, ...) -end -end -end +local require = require + +local _M = {version = 0.3} + + +local log_levels = { +stderr = ngx.STDERR, +emerg = ngx.EMERG, +alert = ngx.ALERT, +crit = ngx.CRIT, +error = ngx.ERR, +warn = ngx.WARN, +notice = ngx.NOTICE, +info = ngx.INFO +} + + +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 @@ -51,5 +52,28 @@ function _M.debug(...) return ngx_log(ngx_DEBUG, ...) end +end -- do + + +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 +else +method = function(...) +return ngx_log(log_level, ...) +end +end + +-- cache the lazily generated method in our +-- module table +_M[cmd] = method +return method +end}) + return _M diff --git a/t/core/log.t b/t/core/log.t new file mode 100644 index 000..2754174 --- /dev/null +++ b/t/core/log.t @@ -0,0 +1,146 @@ +# +# 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. +# +use t::APISIX 'no_plan'; + +repeat_each(2); +no_long_string(); +no_root_location(); + +run_tests; + +__DATA__ + +=== TEST 1: error log +--- config +location /t { +content_by_lua_block { +local core = require("apisix.core") +core.log.error("error log") +core.log.warn("warn log") +core.log.notice("notice log") +core.log.info("info log") +ngx.say("done") +} +} +--- log_level: error +--- request +GET /t +--- error_log +error log +--- no_error_log +warn log +notice log +info log + + + +=== TEST 2: warn log +--- config +location /t { +content_by_lua_block { +local core = require("apisix.core") +core.log.error("error log") +
[incubator-apisix] branch master updated: Split check target into lint & license-check targets in Makefile. (#887)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git View the commit online: https://github.com/apache/incubator-apisix/commit/227eeaef48cce77a7ee7f44c4ebbe79c56ecbf65 The following commit(s) were added to refs/heads/master by this push: new 227eeae Split check target into lint & license-check targets in Makefile. (#887) 227eeae is described below commit 227eeaef48cce77a7ee7f44c4ebbe79c56ecbf65 Author: agile6v AuthorDate: Wed Nov 20 19:23:16 2019 -0600 Split check target into lint & license-check targets in Makefile. (#887) --- .travis/linux_openresty_runner.sh | 2 +- .travis/linux_tengine_runner.sh | 2 +- Makefile | 41 --- doc/dev-manual-cn.md | 23 +++--- doc/dev-manual.md | 23 +++--- 5 files changed, 51 insertions(+), 40 deletions(-) diff --git a/.travis/linux_openresty_runner.sh b/.travis/linux_openresty_runner.sh index 872a744..251b288 100755 --- a/.travis/linux_openresty_runner.sh +++ b/.travis/linux_openresty_runner.sh @@ -123,7 +123,7 @@ script() { ./bin/apisix stop sleep 1 -make check || exit 1 +make lint && make license-check || exit 1 APISIX_ENABLE_LUACOV=1 prove -Itest-nginx/lib -r t } diff --git a/.travis/linux_tengine_runner.sh b/.travis/linux_tengine_runner.sh index 4cdb12b..a058667 100755 --- a/.travis/linux_tengine_runner.sh +++ b/.travis/linux_tengine_runner.sh @@ -195,7 +195,7 @@ script() { sleep 1 ./bin/apisix stop sleep 1 -make check || exit 1 +make lint && make license-check || exit 1 APISIX_ENABLE_LUACOV=1 prove -Itest-nginx/lib -r t } diff --git a/Makefile b/Makefile index 06e8fef..8112520 100644 --- a/Makefile +++ b/Makefile @@ -24,14 +24,13 @@ UNAME ?= $(shell uname) OR_EXEC ?= $(shell which openresty) LUA_JIT_DIR ?= $(shell ${OR_EXEC} -V 2>&1 | grep prefix | grep -Eo 'prefix=(.*?)/nginx' | grep -Eo '/.*/')luajit LUAROCKS_VER ?= $(shell luarocks --version | grep -E -o "luarocks [0-9]+.") -lj-releng-exist = $(shell if [ -f 'utils/lj-releng' ]; then echo "exist"; else echo "not_exist"; fi;) .PHONY: default default: -### help: Show Makefile rules. +### help: Show Makefile rules. .PHONY: help help: @echo Makefile rules: @@ -39,7 +38,7 @@ help: @grep -E '^### [-A-Za-z0-9_]+:' Makefile | sed 's/###/ /' -### deps: Installation dependencies +### deps: Installation dependencies .PHONY: deps deps: ifeq ($(UNAME),Darwin) @@ -51,19 +50,18 @@ else endif -### utils:Installation tools +### utils:Installation tools .PHONY: utils utils: -ifeq ($(lj-releng-exist), not_exist) +ifeq ("$(wildcard utils/lj-releng)", "") wget -O utils/lj-releng https://raw.githubusercontent.com/iresty/openresty-devel-utils/iresty/lj-releng chmod a+x utils/lj-releng endif -### check:Check Lua source code -.PHONY: check -check: - .travis/openwhisk-utilities/scancode/scanCode.py --config .travis/ASF-Release.cfg ./ +### lint: Lint Lua source code +.PHONY: lint +lint: utils luacheck -q lua ./utils/lj-releng lua/*.lua \ lua/apisix/*.lua \ @@ -77,14 +75,14 @@ check: /tmp/check.log 2>&1 || (cat /tmp/check.log && exit 1) -### init: Initialize the runtime environment +### init: Initialize the runtime environment .PHONY: init init: ./bin/apisix init ./bin/apisix init_etcd -### run: Start the apisix server +### run: Start the apisix server .PHONY: run run: mkdir -p logs @@ -96,7 +94,7 @@ endif $(OR_EXEC) -p $$PWD/ -c $$PWD/conf/nginx.conf -### stop: Stop the apisix server +### stop: Stop the apisix server .PHONY: stop stop: ifeq ($(OR_EXEC), ) @@ -106,13 +104,13 @@ endif $(OR_EXEC) -p $$PWD/ -c $$PWD/conf/nginx.conf -s stop -### clean:Remove generated files +### clean:Remove generated files .PHONY: clean clean: rm -rf logs/ -### reload: Reload the apisix server +### reload: Reload the apisix server .PHONY: reload reload: ifeq ($(OR_EXEC), ) @@ -122,7 +120,7 @@ endif $(OR_EXEC) -p $$PWD/ -c $$PWD/conf/nginx.conf -s reload -### install: Install the apisix +### install: Install the apisix .PHONY: install install: $(INSTALL) -d /usr/local/apisix/logs/ @@ -174,10 +172,21 @@ install: $(INSTALL) bin/apisix $(INST_BINDIR)/apisix -### test: Run the test case +### test: Run the test case test: ifeq ($(UNAME),Darwin)
[incubator-apisix] branch master updated: doc: fix typo in README_CN.md (#874)
This is an automated email from the ASF dual-hosted git repository. membphis 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 c7bac03 doc: fix typo in README_CN.md (#874) c7bac03 is described below commit c7bac037891fad7a0f5cdb1407535d436ca65cc7 Author: Ado <5552...@qq.com> AuthorDate: Tue Nov 19 13:24:58 2019 +0800 doc: fix typo in README_CN.md (#874) --- README.md| 2 +- README_CN.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1d5b30e..084633e 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,7 @@ The main steps to install APISIX: sudo yum install yum-utils sudo yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo sudo yum install -y openresty etcd -sudo service etcd start +sudo systemctl start etcd sudo yum install -y https://github.com/apache/incubator-apisix/releases/download/v0.8/apisix-0.8-0.el7.noarch.rpm ``` diff --git a/README_CN.md b/README_CN.md index 438aaf0..79d0899 100644 --- a/README_CN.md +++ b/README_CN.md @@ -122,7 +122,8 @@ APISIX 在以下操作系统中可顺利安装并做过运行测试,需要注 sudo yum install yum-utils sudo yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo sudo yum install -y openresty etcd -sudo service etcd start + +sudo systemctl start etcd sudo yum install -y https://github.com/apache/incubator-apisix/releases/download/v0.8/apisix-0.8-0.el7.noarch.rpm ```
[incubator-apisix] branch master updated: optimization(proxy-rewrite): performance upgrade for proxy-rewrite by avoid luajit NYI (#872)
This is an automated email from the ASF dual-hosted git repository. membphis 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 722e42f optimization(proxy-rewrite): performance upgrade for proxy-rewrite by avoid luajit NYI (#872) 722e42f is described below commit 722e42ffcc7557af04f6c02fe8e7d86271622ea6 Author: Lien AuthorDate: Tue Nov 19 08:14:59 2019 +0800 optimization(proxy-rewrite): performance upgrade for proxy-rewrite by avoid luajit NYI (#872) --- lua/apisix/plugins/proxy-rewrite.lua | 28 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/lua/apisix/plugins/proxy-rewrite.lua b/lua/apisix/plugins/proxy-rewrite.lua index 0541a08..37abf95 100644 --- a/lua/apisix/plugins/proxy-rewrite.lua +++ b/lua/apisix/plugins/proxy-rewrite.lua @@ -18,6 +18,8 @@ local core= require("apisix.core") local plugin_name = "proxy-rewrite" local pairs = pairs local ipairs = ipairs +local ngx = ngx +local type= type local schema = { @@ -67,6 +69,24 @@ function _M.check_schema(conf) if not ok then return false, err end + +--reform header from object into array, so can avoid use pairs, which is NYI +if conf.headers then +conf.headers_arr = {} + +for field, value in pairs(conf.headers) do +if type(field) == 'string' +and (type(value) == 'string' or type(value) == 'number') then +if #field == 0 then +return false, 'invalid field length in header' +end +core.table.insert(conf.headers_arr, field) +core.table.insert(conf.headers_arr, value) +else +return false, 'invalid type as header value' +end +end +end return true end @@ -102,10 +122,10 @@ function _M.rewrite(conf, ctx) ctx.var.upstream_connection = ctx.var.http_connection end --- TODO: support deleted header -if conf.headers then -for header_name, header_value in pairs(conf.headers) do -core.request.set_header(header_name, header_value) +if conf.headers_arr then +local field_cnt = #conf.headers_arr +for i = 1, field_cnt, 2 do +ngx.req.set_header(conf.headers_arr[i], conf.headers_arr[i+1]) end end end
[incubator-apisix] branch master updated (77ad662 -> 51d87c0)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git. from 77ad662 bugfix(radixtree_host_uri): match priority, host > uri. (#817) add 51d87c0 doc: updated install-dependencies.md (#867) No new revisions were added by this update. Summary of changes: doc/install-dependencies.md | 1 + 1 file changed, 1 insertion(+)
[incubator-apisix] branch master updated: bugfix(radixtree_host_uri): match priority, host > uri. (#817)
This is an automated email from the ASF dual-hosted git repository. membphis 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 77ad662 bugfix(radixtree_host_uri): match priority, host > uri. (#817) 77ad662 is described below commit 77ad66206e0136700350b872f27f096c2d48c47d Author: YuanSheng Wang AuthorDate: Fri Nov 15 17:24:51 2019 +0800 bugfix(radixtree_host_uri): match priority, host > uri. (#817) * bugfix(radixtree_host_uri): match priority, host > uri. Fix #761. --- Makefile | 4 +- lua/apisix/http/router/radixtree_host_uri.lua | 124 ++-- lua/apisix/schema_def.lua | 3 +- t/router/radixtree-host-uri2.t| 203 ++ 4 files changed, 253 insertions(+), 81 deletions(-) diff --git a/Makefile b/Makefile index b5d1785..06e8fef 100644 --- a/Makefile +++ b/Makefile @@ -65,10 +65,12 @@ endif check: .travis/openwhisk-utilities/scancode/scanCode.py --config .travis/ASF-Release.cfg ./ luacheck -q lua - ./utils/lj-releng lua/*.lua lua/apisix/*.lua \ + ./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 > \ diff --git a/lua/apisix/http/router/radixtree_host_uri.lua b/lua/apisix/http/router/radixtree_host_uri.lua index a4ebc43..051d3b1 100644 --- a/lua/apisix/http/router/radixtree_host_uri.lua +++ b/lua/apisix/http/router/radixtree_host_uri.lua @@ -21,20 +21,22 @@ local plugin = require("apisix.plugin") local ipairs = ipairs local type = type local error = error +local tab_insert = table.insert local loadstring = loadstring +local pairs = pairs local user_routes local cached_version -local only_uri_routes = {} +local host_router local only_uri_router -local host_uri_routes = {} -local host_uri_router local _M = {version = 0.1} -local function add_host_uri_routes(path, host, route) -core.log.info("add host+uri route, host: ", host, " path: ", path) +local function push_host_router(route, host_routes, only_uri_routes) +if type(route) ~= "table" then +return +end local filter_fun, err if route.value.filter_func then @@ -50,98 +52,62 @@ local function add_host_uri_routes(path, host, route) filter_fun = filter_fun() end -core.table.insert(host_uri_routes, { -paths = {host .. path}, +local hosts = route.value.hosts or {route.value.host} + +local radixtree_route = { +paths = route.value.uris or route.value.uri, methods = route.value.methods, -remote_addrs = route.value.remote_addrs or route.value.remote_addr, +remote_addrs = route.value.remote_addrs + or route.value.remote_addr, vars = route.value.vars, filter_fun = filter_fun, handler = function (api_ctx) api_ctx.matched_params = nil api_ctx.matched_route = route -end, -}) -end - - -local function push_radixtree_host_router(route) -if type(route) ~= "table" then -return -end - -local hosts = route.value.hosts or {route.value.host} -local hosts_wildcard = {} -local uris = route.value.uris or {route.value.uri} - -local added_count = 0 -for _, host in ipairs(hosts) do -if host:sub(1, 1) == "*" then -core.table.insert(hosts_wildcard, host) -else -for _, uri in ipairs(uris) do -add_host_uri_routes(uri, host, route) -end -added_count = added_count + 1 end -end +} --- 4 cases: --- hosts = {} --- hosts = {"foo.com"} --- hosts = {"*.foo.com", "bar.com"} --- hosts = {"*.foo.com", "*.bar.com"} -if added_count > 0 and added_count == #hosts then +if #hosts == 0 then +core.table.insert(only_uri_routes, radixtree_route) return end -if #hosts_wildcard == 0 then -hosts_wildcard = nil -end - -local filter_fun, err -if route.value.filter_func then -filter_fun, err = loadstring( -"return " .. route.value.filter_func, -"router#" .. route.value.id) -if not filter_fun then -core.log.error("failed to load filter function: ", err, -" route id: ", route.value.id) -
[incubator-apisix] branch master updated (360a033 -> 553f4e9)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git. from 360a033 doc: fixed grpc server example link. (#851) add 553f4e9 test: fixed typo in test cases #508 (#853) No new revisions were added by this update. Summary of changes: t/admin/services.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
[incubator-apisix] branch master updated (bae08d8 -> 360a033)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git. from bae08d8 bugfix: `proxy-rewrite-cn.md` enable plugin example error. (#850) add 360a033 doc: fixed grpc server example link. (#851) No new revisions were added by this update. Summary of changes: doc/grpc-proxy-cn.md | 4 ++-- doc/grpc-proxy.md | 4 ++-- doc/plugins/grpc-transcoding-cn.md | 2 +- doc/plugins/grpc-transcoding.md| 2 +- 4 files changed, 6 insertions(+), 6 deletions(-)
[incubator-apisix] branch master updated (027da04 -> bae08d8)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git. from 027da04 doc: added doc about "How to compile the Openresty". (#831) add bae08d8 bugfix: `proxy-rewrite-cn.md` enable plugin example error. (#850) No new revisions were added by this update. Summary of changes: doc/plugins/proxy-rewrite-cn.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
[incubator-apisix] branch master updated (0972462 -> 027da04)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git. from 0972462 user: add company into powereby page (#844) add 027da04 doc: added doc about "How to compile the Openresty". (#831) No new revisions were added by this update. Summary of changes: doc/install-dependencies.md | 20 +++- 1 file changed, 15 insertions(+), 5 deletions(-)
[incubator-apisix] branch master updated: change: use `make deps` to install dependencies. (#835)
This is an automated email from the ASF dual-hosted git repository. membphis 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 910ff21 change: use `make deps` to install dependencies. (#835) 910ff21 is described below commit 910ff21f540de617687c37c53874e0dc3a857cc3 Author: YuanSheng Wang AuthorDate: Tue Nov 12 16:38:23 2019 +0800 change: use `make deps` to install dependencies. (#835) --- .travis/osx_openresty_runner.sh | 2 +- Makefile| 20 doc/dev-manual-cn.md| 6 +++--- doc/dev-manual.md | 6 +++--- 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/.travis/osx_openresty_runner.sh b/.travis/osx_openresty_runner.sh index 59fe862..8b91e62 100755 --- a/.travis/osx_openresty_runner.sh +++ b/.travis/osx_openresty_runner.sh @@ -38,7 +38,7 @@ before_install() { do_install() { export_or_prefix -make dev +make deps git clone https://github.com/iresty/test-nginx.git test-nginx git clone https://github.com/iresty/grpc_server_example.git grpc_server_example diff --git a/Makefile b/Makefile index e58f2e1..b5d1785 100644 --- a/Makefile +++ b/Makefile @@ -39,9 +39,9 @@ help: @grep -E '^### [-A-Za-z0-9_]+:' Makefile | sed 's/###/ /' -### dev: Create a development ENV -.PHONY: dev -dev: +### deps: Installation dependencies +.PHONY: deps +deps: ifeq ($(UNAME),Darwin) luarocks install --lua-dir=$(LUA_JIT_DIR) rockspec/apisix-master-0.rockspec --tree=deps --only-deps --local else ifneq ($(LUAROCKS_VER),'luarocks 3.') @@ -49,6 +49,11 @@ else ifneq ($(LUAROCKS_VER),'luarocks 3.') else luarocks install --lua-dir=/usr/local/openresty/luajit rockspec/apisix-master-0.rockspec --tree=deps --only-deps --local endif + + +### utils:Installation tools +.PHONY: utils +utils: ifeq ($(lj-releng-exist), not_exist) wget -O utils/lj-releng https://raw.githubusercontent.com/iresty/openresty-devel-utils/iresty/lj-releng chmod a+x utils/lj-releng @@ -118,15 +123,6 @@ endif ### install: Install the apisix .PHONY: install install: -ifneq ($(WITHOUT_DASHBOARD),1) - $(INSTALL) -d /usr/local/apisix/dashboard - cd `mktemp -d /tmp/apisix.XX` && \ - git clone https://github.com/apache/incubator-apisix.git apisix --recursive && \ - cd apisix && \ - cp -r dashboard/* /usr/local/apisix/dashboard - chmod -R 755 /usr/local/apisix/dashboard -endif - $(INSTALL) -d /usr/local/apisix/logs/ $(INSTALL) -d /usr/local/apisix/conf/cert $(INSTALL) conf/mime.types /usr/local/apisix/conf/mime.types diff --git a/doc/dev-manual-cn.md b/doc/dev-manual-cn.md index e5b628a..5675968 100644 --- a/doc/dev-manual-cn.md +++ b/doc/dev-manual-cn.md @@ -34,7 +34,7 @@ cd apisix git submodule update --init --recursive # install dependency -make dev +make deps ``` 如果一切顺利,你会在最后看到这样的信息: @@ -101,12 +101,12 @@ $ make help Makefile rules: help: Show Makefile rules. -dev: Create a development ENV +deps: Installation dependencies +utils:Installation utils check:Check Lua source code init: Initialize the runtime environment run: Start the apisix server stop: Stop the apisix server -restart: restart the apisix server clean:Remove generated files reload: Reload the apisix server install: Install the apisix diff --git a/doc/dev-manual.md b/doc/dev-manual.md index 8bef6f2..a423d9d 100644 --- a/doc/dev-manual.md +++ b/doc/dev-manual.md @@ -33,7 +33,7 @@ cd apisix git submodule update --init --recursive # install dependency -make dev +make deps ``` If all goes well, you will see this message at the end: @@ -101,12 +101,12 @@ $ make help Makefile rules: help: Show Makefile rules. -dev: Create a development ENV +deps: Installation dependencies +utils:Installation utils check:Check Lua source code init: Initialize the runtime environment run: Start the apisix server stop: Stop the apisix server -restart: restart the apisix server clean:Remove generated files reload: Reload the apisix server install: Install the apisix
[incubator-apisix] branch master updated: change: adjusted the MaxLength parameter in grpc proto from 4096b to 1M (#820) (#836)
This is an automated email from the ASF dual-hosted git repository. membphis 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 bb28766 change: adjusted the MaxLength parameter in grpc proto from 4096b to 1M (#820) (#836) bb28766 is described below commit bb2876627a0e6a39c40aa9531ff10bde9e924e54 Author: tom2nonames <13682645...@139.com> AuthorDate: Mon Nov 11 18:45:19 2019 +0800 change: adjusted the MaxLength parameter in grpc proto from 4096b to 1M (#820) (#836) --- lua/apisix/schema_def.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/apisix/schema_def.lua b/lua/apisix/schema_def.lua index 859be9f..7d9832f 100644 --- a/lua/apisix/schema_def.lua +++ b/lua/apisix/schema_def.lua @@ -402,7 +402,7 @@ _M.proto = { type = "object", properties = { content = { -type = "string", minLength = 1, maxLength = 4096 +type = "string", minLength = 1, maxLength = 1024*1024 } }, required = {"content"},
[incubator-apisix] branch master updated (19678ba -> d3b0259)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git. from 19678ba change: update v0.9.0-rc1 changelog. (#832) add d3b0259 change: update changelog show format. (#833) No new revisions were added by this update. Summary of changes: CHANGELOG_CN.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
[incubator-apisix] branch master updated (7d33fb6 -> 5e85e93)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git. from 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) No new revisions were added by this update. Summary of changes: 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 7 files changed, 58 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: bugfix: key-auth plugin cannot run accurately in the case of multiple consumers (#826)
This is an automated email from the ASF dual-hosted git repository. membphis 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 7d33fb6 bugfix: key-auth plugin cannot run accurately in the case of multiple consumers (#826) 7d33fb6 is described below commit 7d33fb66bc822ca864a68d5d272c9d2099b56279 Author: 贝克 <1219415...@qq.com> AuthorDate: Sun Nov 10 21:50:57 2019 +0800 bugfix: key-auth plugin cannot run accurately in the case of multiple consumers (#826) --- lua/apisix/consumer.lua | 15 --- t/plugin/key-auth.t | 31 +++ 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/lua/apisix/consumer.lua b/lua/apisix/consumer.lua index ba09fde..fd0c91b 100644 --- a/lua/apisix/consumer.lua +++ b/lua/apisix/consumer.lua @@ -23,7 +23,7 @@ local consumers local _M = { -version = 0.2, +version = 0.3, } @@ -37,12 +37,13 @@ local function plugin_consumer() for _, consumer in ipairs(consumers.values) do for name, config in pairs(consumer.value.plugins or {}) do local plugin_obj = plugin.get(name) -if plugin_obj and plugin_obj.type == "auth" - and not plugins[name] then -plugins[name] = { -nodes = {}, -conf_version = consumers.conf_version -} +if plugin_obj and plugin_obj.type == "auth" then +if not plugins[name] then +plugins[name] = { +nodes = {}, +conf_version = consumers.conf_version +} +end local new_consumer = core.table.clone(consumer.value) new_consumer.consumer_id = new_consumer.id diff --git a/t/plugin/key-auth.t b/t/plugin/key-auth.t index 792bd47..1608f96 100644 --- a/t/plugin/key-auth.t +++ b/t/plugin/key-auth.t @@ -172,11 +172,34 @@ GET /hello === TEST 7: valid consumer +--- config +location /add_more_consumer { +content_by_lua_block { +local t = require("lib.test_admin").test +local username = "" +local key = "" +local code, body +for i = 1, 20 do +username = "user_" .. tostring(i) +key = "auth-" .. tostring(i) +code, body = t('/apisix/admin/consumers', +ngx.HTTP_PUT, + string.format('{"username":"%s","plugins":{"key-auth":{"key":"%s"}}}', username, key), + string.format('{"node":{"value":{"username":"%s","plugins":{"key-auth":{"key":"%s","action":"set"}', username, key) +) +end + +ngx.status = code +ngx.say(body) +} +} --- request -GET /hello +GET /add_more_consumer +--- pipelined_requests eval +["GET /add_more_consumer", "GET /hello"] --- more_headers -apikey: auth-one response_body -hello world +apikey: auth-13 +--- response_body eval +["passed\n", "hello world\n"] --- no_error_log [error]
[incubator-apisix] branch master updated: dashboard: update dashboard. (#828)
This is an automated email from the ASF dual-hosted git repository. membphis 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 8b67dfe dashboard: update dashboard. (#828) 8b67dfe is described below commit 8b67dfe73fd884f1a2e4fc9392e8dd859b1a18a4 Author: WenMing AuthorDate: Sun Nov 10 21:49:25 2019 +0800 dashboard: update dashboard. (#828) --- dashboard | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard b/dashboard index 1799a07..5ce7c37 16 --- a/dashboard +++ b/dashboard @@ -1 +1 @@ -Subproject commit 1799a07c8740bcb374c5e73d821a92456f2833b6 +Subproject commit 5ce7c37c758f6365da042333d7909c12c0ab6714
[incubator-apisix] branch master updated: doc: sync README_CN.md from README.md (#825)
This is an automated email from the ASF dual-hosted git repository. membphis 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 f4f89fa doc: sync README_CN.md from README.md (#825) f4f89fa is described below commit f4f89fa0b1e2d4093e15b18d94f7fe34cafc523f Author: super_mario <406517...@qq.com> AuthorDate: Sat Nov 9 21:08:47 2019 +0800 doc: sync README_CN.md from README.md (#825) --- README_CN.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README_CN.md b/README_CN.md index 8fcdcd0..438aaf0 100644 --- a/README_CN.md +++ b/README_CN.md @@ -46,6 +46,7 @@ APISIX 通过插件机制,提供动态负载平衡、身份验证、限流限 ## 功能 +- **运行环境**: OpenResty 和 Tengine 都支持。 - **云原生**: 平台无关,没有供应商锁定,无论裸机还是 Kubernetes,APISIX 都可以运行。 - **[热更新和热插件](doc/plugins-cn.md)**: 无需重启服务,就可以持续更新配置和插件。 - **动态负载均衡**:动态支持有权重的 round-robin 负载平衡。
[incubator-apisix] branch master updated: fix: show more firendly error log when configuration field missed (#824)
This is an automated email from the ASF dual-hosted git repository. membphis 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 7b29586 fix: show more firendly error log when configuration field missed (#824) 7b29586 is described below commit 7b29586f7ada4c3b52eb0aebfad85f05fac03b23 Author: Lien AuthorDate: Sat Nov 9 21:07:24 2019 +0800 fix: show more firendly error log when configuration field missed (#824) --- bin/apisix | 17 + 1 file changed, 17 insertions(+) diff --git a/bin/apisix b/bin/apisix index 3a097d0..6cdaaf0 100755 --- a/bin/apisix +++ b/bin/apisix @@ -507,6 +507,15 @@ local function init() node_ssl_listen = 9443, -- default value error_log = {level = "warn"}, } + +if not yaml_conf.apisix then +error("failed to read `apisix` field from yaml file") +end + +if not yaml_conf.nginx_config then +error("failed to read `nginx_config` field from yaml file") +end + for k,v in pairs(yaml_conf.apisix) do sys_conf[k] = v end @@ -543,10 +552,18 @@ local function init_etcd(show_output) error("failed to read local yaml config of apisix: " .. err) end +if not yaml_conf.apisix then +error("failed to read `apisix` field from yaml file when init etcd") +end + if yaml_conf.apisix.config_center ~= "etcd" then return true end +if not yaml_conf.etcd then +error("failed to read `etcd` field from yaml file when init etcd") +end + local etcd_conf = yaml_conf.etcd local uri = etcd_conf.host .. "/v2/keys" .. (etcd_conf.prefix or "")
[incubator-apisix] branch master updated: change: removed useless file copy. (#819)
This is an automated email from the ASF dual-hosted git repository. membphis 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 5931172 change: removed useless file copy. (#819) 5931172 is described below commit 5931172a681e89b149a94f6eb1d5fbe4b25b3ebe Author: YuanSheng Wang AuthorDate: Thu Nov 7 21:09:47 2019 +0800 change: removed useless file copy. (#819) --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index 3bfb3bc..e58f2e1 100644 --- a/Makefile +++ b/Makefile @@ -172,7 +172,6 @@ endif $(INSTALL) -d $(INST_LUADIR)/apisix/lua/apisix/stream/router $(INSTALL) lua/apisix/stream/router/*.lua $(INST_LUADIR)/apisix/lua/apisix/stream/router/ - $(INSTALL) COPYRIGHT $(INST_CONFDIR)/COPYRIGHT $(INSTALL) README.md $(INST_CONFDIR)/README.md $(INSTALL) bin/apisix $(INST_BINDIR)/apisix
[incubator-apisix] branch master updated: fix: core.utils.parse_addr didn't parse IPv6 address correctly (#809)
This is an automated email from the ASF dual-hosted git repository. membphis 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 b7e2800 fix: core.utils.parse_addr didn't parse IPv6 address correctly (#809) b7e2800 is described below commit b7e280033bcdad46ef45656242cec4685161ba30 Author: 罗泽轩 AuthorDate: Wed Nov 6 14:27:08 2019 +0800 fix: core.utils.parse_addr didn't parse IPv6 address correctly (#809) --- lua/apisix/balancer.lua | 21 +++--- lua/apisix/core/utils.lua | 55 --- t/core/utils.t| 27 +++ 3 files changed, 77 insertions(+), 26 deletions(-) diff --git a/lua/apisix/balancer.lua b/lua/apisix/balancer.lua index 8fa20c7..01cb0f5 100644 --- a/lua/apisix/balancer.lua +++ b/lua/apisix/balancer.lua @@ -19,13 +19,10 @@ local roundrobin = require("resty.roundrobin") local resty_chash = require("resty.chash") local balancer= require("ngx.balancer") local core= require("apisix.core") -local sub_str = string.sub -local find_str= string.find local error = error local str_char= string.char local str_gsub= string.gsub local pairs = pairs -local tonumber= tonumber local tostring= tostring local set_more_tries = balancer.set_more_tries local get_last_failure = balancer.get_last_failure @@ -50,18 +47,6 @@ local _M = { } -local function parse_addr(addr) -local pos = find_str(addr, ":", 1, true) -if not pos then -return addr, 80 -end - -local host = sub_str(addr, 1, pos - 1) -local port = sub_str(addr, pos + 1) -return host, tonumber(port) -end - - local function fetch_health_nodes(upstream, checker) if not checker then return upstream.nodes @@ -71,7 +56,7 @@ local function fetch_health_nodes(upstream, checker) local up_nodes = core.table.new(0, #upstream.nodes) for addr, weight in pairs(upstream.nodes) do -local ip, port = parse_addr(addr) +local ip, port = core.utils.parse_addr(addr) local ok = checker:get_target_status(ip, port, host) if ok then up_nodes[addr] = weight @@ -95,7 +80,7 @@ local function create_checker(upstream, healthcheck_parent) }) for addr, weight in pairs(upstream.nodes) do -local ip, port = parse_addr(addr) +local ip, port = core.utils.parse_addr(addr) local ok, err = checker:add_target(ip, port, upstream.checks.host) if not ok then core.log.error("failed to add new health check target: ", addr, @@ -267,7 +252,7 @@ local function pick_server(route, ctx) end end -local ip, port, err = parse_addr(server) +local ip, port, err = core.utils.parse_addr(server) ctx.balancer_ip = ip ctx.balancer_port = port diff --git a/lua/apisix/core/utils.lua b/lua/apisix/core/utils.lua index 8f68a14..3a5bd36 100644 --- a/lua/apisix/core/utils.lua +++ b/lua/apisix/core/utils.lua @@ -21,7 +21,7 @@ local ipmatcher= require("resty.ipmatcher") local open = io.open local math = math local sub_str = string.sub -local find_str = string.find +local str_byte = string.byte local tonumber = tonumber @@ -83,15 +83,54 @@ function _M.dns_parse(resolvers, domain) end -function _M.parse_addr(addr) -local pos = find_str(addr, ":", 1, true) -if not pos then -return addr, 80 +local function rfind_char(s, ch, idx) +local b = str_byte(ch) +for i = idx or #s, 1, -1 do +if str_byte(s, i, i) == b then +return i +end end +return nil +end + -local host = sub_str(addr, 1, pos - 1) -local port = sub_str(addr, pos + 1) -return host, tonumber(port) +-- parse_addr parses 'addr' into the host and the port parts. If the 'addr' +-- doesn't have a port, 80 is used to return. For malformed 'addr', the entire +-- 'addr' is returned as the host part. For IPv6 literal host, like [::1], the +-- square brackets will be removed. +function _M.parse_addr(addr) +local default_port = 80 +if str_byte(addr, 1) == str_byte("[") then +-- IPv6 format +local right_bracket = str_byte("]") +local len = #addr +if str_byte(addr, len) == right_bracket then +-- addr in [ip:v6] format +return sub_str(addr, 2, len-1), default_port +else +local pos = rfind_char(addr, ":", #addr - 1) +if not pos or str_byte(addr, pos - 1) ~= right_bracket then +-- malformed addr +return addr, default_port +end + +-- addr in [ip:v6]:port format +local host = sub_str(addr, 2, p
[incubator-apisix] branch master updated: chore: fixed typo detected by misspell (#801)
This is an automated email from the ASF dual-hosted git repository. membphis 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 b67f99b chore: fixed typo detected by misspell (#801) b67f99b is described below commit b67f99b265caf60305b2aa508cede31f57087431 Author: 罗泽轩 AuthorDate: Tue Nov 5 10:58:04 2019 +0800 chore: fixed typo detected by misspell (#801) --- doc/grpc-proxy-cn.md | 4 ++-- doc/grpc-proxy.md | 4 ++-- doc/plugins/grpc-transcoding-cn.md| 2 +- doc/plugins/grpc-transcoding.md | 2 +- lua/apisix/plugins/grpc-transcode.lua | 4 ++-- lua/apisix/plugins/redirect.lua | 6 +++--- t/node/route-filter-func.t| 4 ++-- t/router/radixtree-uri-host.t | 4 ++-- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/doc/grpc-proxy-cn.md b/doc/grpc-proxy-cn.md index f4b1a81..28a78b9 100644 --- a/doc/grpc-proxy-cn.md +++ b/doc/grpc-proxy-cn.md @@ -25,7 +25,7 @@ ### 参数 -* `service_protocol`: 这个 Route 的属性 `service_protocal` 必须设置为 `grpc` +* `service_protocol`: 这个 Route 的属性 `service_protocol` 必须设置为 `grpc` * `uri`: 格式为 /service/method 如:/helloworld.Greeter/SayHello @@ -35,7 +35,7 @@ 在指定 Route 中,代理 gRPC 服务接口: -* 注意: 这个 Route 的属性 `service_protocal` 必须设置为 `grpc`; +* 注意: 这个 Route 的属性 `service_protocol` 必须设置为 `grpc`; * 注意: APISIX 使用 TLS 加密的 HTTP/2 暴露 gRPC 服务, 所以需要先 [配置 SSL 证书](https://github.com/iresty/apisix/blob/master/doc/https-cn.md); * 下面例子所代理的 gRPC 服务可供参考:[grpc_server_example](https://github.com/nic-chen/grpc_server_example)。 diff --git a/doc/grpc-proxy.md b/doc/grpc-proxy.md index d611b7d..a7f09f3 100644 --- a/doc/grpc-proxy.md +++ b/doc/grpc-proxy.md @@ -25,7 +25,7 @@ gRPC client -> APISIX -> gRPC server ### Parameters -* `service_protocol`: the route's option `service_protocal` must be `grpc` +* `service_protocol`: the route's option `service_protocol` must be `grpc` * `uri`: format likes /service/method , Example:/helloworld.Greeter/SayHello @@ -36,7 +36,7 @@ gRPC client -> APISIX -> gRPC server Here's an example, to proxying gRPC service by specified route: -* attention: the route's option `service_protocal` must be `grpc` +* attention: the route's option `service_protocol` must be `grpc` * attention: APISIX use TLS‑encrypted HTTP/2 to expose gRPC service, so need to [config SSL certificate](https://github.com/iresty/apisix/blob/master/doc/https.md) * the grpc server example:[grpc_server_example](https://github.com/nic-chen/grpc_server_example) diff --git a/doc/plugins/grpc-transcoding-cn.md b/doc/plugins/grpc-transcoding-cn.md index af338c4..a6fadbe 100644 --- a/doc/plugins/grpc-transcoding-cn.md +++ b/doc/plugins/grpc-transcoding-cn.md @@ -62,7 +62,7 @@ curl http://127.0.0.1:9080/apisix/admin/proto/1 -X PUT -d ' 在指定 route 中,代理 grpc 服务接口: -* 注意: 这个 route 的属性`service_protocal` 必须设置为 `grpc` +* 注意: 这个 route 的属性`service_protocol` 必须设置为 `grpc` * 例子所代理的 grpc 服务可参考:[grpc_server_example](https://github.com/nic-chen/grpc_server_example) ```shell diff --git a/doc/plugins/grpc-transcoding.md b/doc/plugins/grpc-transcoding.md index 5146d2b..3cffb61 100644 --- a/doc/plugins/grpc-transcoding.md +++ b/doc/plugins/grpc-transcoding.md @@ -60,7 +60,7 @@ curl http://127.0.0.1:9080/apisix/admin/proto/1 -X PUT -d ' Here's an example, to enable the grpc-transcode plugin to specified route: -* attention: the route's option `service_protocal` must be `grpc` +* attention: the route's option `service_protocol` must be `grpc` * the grpc server example:[grpc_server_example](https://github.com/nic-chen/grpc_server_example) ```shell diff --git a/lua/apisix/plugins/grpc-transcode.lua b/lua/apisix/plugins/grpc-transcode.lua index f1aff95..7791a4f 100644 --- a/lua/apisix/plugins/grpc-transcode.lua +++ b/lua/apisix/plugins/grpc-transcode.lua @@ -68,7 +68,7 @@ function _M.access(conf, ctx) local ok, err = request(proto_obj, conf.service, conf.method) if not ok then -core.log.error("trasnform request error: ", err) +core.log.error("transform request error: ", err) return end @@ -98,7 +98,7 @@ function _M.body_filter(conf, ctx) local err = response(proto_obj, conf.service, conf.method) if err then -core.log.error("trasnform response error: ", err) +core.log.error("transform response error: ", err) return end end diff --git a/lua/apisix/plugins/redirect.lua b/lua/apisix/plugins/redirect.lua index 733a848..6cc28ac 100644 --- a/lua/apisix/plugins/redirect.lua +++ b/lua/apisix/plugins/redirect.lua @@ -92,14 +92,14 @@ end local tmp = {} local function concat_new_uri(uri, ctx) -local pased_uri_segs, err = lrucache(uri, nil, parse_uri, uri) -if no
[incubator-apisix] branch master updated: doc: changed wording for clarity in README.md (#795)
This is an automated email from the ASF dual-hosted git repository. membphis 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 5ac22b5 doc: changed wording for clarity in README.md (#795) 5ac22b5 is described below commit 5ac22b59c5e6d3aba702c90ec38cbecb5d5c3160 Author: BradyBromley <51128276+bradybrom...@users.noreply.github.com> AuthorDate: Sun Nov 3 18:21:33 2019 -0800 doc: changed wording for clarity in README.md (#795) --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index eacc881..1d5b30e 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ If you are building a website, mobile device or IoT (Internet of Things) applica APISIX is a cloud-based microservices API gateway that handles traditional north-south traffic and handles east-west traffic between services. -APISIX provides dynamic load balancing, authentication, rate limiting, and other plugins through plugin mechanisms, and supports plugins you develop yourself. +APISIX provides dynamic load balancing, authentication, rate limiting, other plugins through plugin mechanisms, and supports plugins you develop yourself. For more detailed information, see the [White Paper](https://www.iresty.com/download/Choosing%20the%20Right%20Microservice%20API%20Gateway%20for%20the%20Enterprise%20User.pdf). @@ -102,9 +102,9 @@ APISIX Installed and tested in the following systems(OpenResty MUST >= 1.15.8.1, - macOS - **ARM64** Ubuntu 18.04 -You now have four ways to install APISIX: +There are four ways to install APISIX: - if you are using CentOS 7, it is recommended to use [RPM](#install-from-rpm-for-centos-7); -- if using macOS, only support git clone and install by manual, please take a look at [dev manual](doc/dev-manual.md); +- if you are using macOS, only git clone and install by manual are supported. Please take a look at [dev manual](doc/dev-manual.md); - other systems please use [Luarocks](#install-from-luarocks-not-support-macos); - You can also install from [Docker image](https://github.com/iresty/docker-apisix).
[incubator-apisix] branch master updated: plugin(prometheus): added new field `node` and new item latency. (#794)
This is an automated email from the ASF dual-hosted git repository. membphis 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 89688d3 plugin(prometheus): added new field `node` and new item latency. (#794) 89688d3 is described below commit 89688d32ad3934a2ff7d0f12a514a29a1930fc6c Author: lyyoung <920157...@qq.com> AuthorDate: Sun Nov 3 21:11:52 2019 +0800 plugin(prometheus): added new field `node` and new item latency. (#794) --- lua/apisix/plugins/prometheus/exporter.lua | 32 +++--- t/plugin/prometheus.t | 13 ++-- 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/lua/apisix/plugins/prometheus/exporter.lua b/lua/apisix/plugins/prometheus/exporter.lua index 92fe842..97dbcb4 100644 --- a/lua/apisix/plugins/prometheus/exporter.lua +++ b/lua/apisix/plugins/prometheus/exporter.lua @@ -21,6 +21,10 @@ local ngx_capture = ngx.location.capture local re_gmatch = ngx.re.gmatch local prometheus +-- Default set of latency buckets, 1ms to 60s: +local DEFAULT_BUCKETS = { 1, 2, 5, 7, 10, 15, 20, 25, 30, 40, 50, 60, 70, +80, 90, 100, 200, 300, 400, 500, 1000, +2000, 5000, 1, 3, 6 } local metrics = {} local tmp_tab = {} @@ -39,31 +43,45 @@ function _M.init() {"state"}) metrics.etcd_reachable = prometheus:gauge("etcd_reachable", -"Config server etcd reachable from Apisix, 0 is unreachable") +"Config server etcd reachable from APISIX, 0 is unreachable") -- per service metrics.status = prometheus:counter("http_status", -"HTTP status codes per service in Apisix", -{"code", "service"}) +"HTTP status codes per service in APISIX", +{"code", "service", "node"}) + +metrics.latency = prometheus:histogram("http_latency", +"HTTP request latency per service in APISIX", +{"type", "service", "node"}, DEFAULT_BUCKETS) metrics.bandwidth = prometheus:counter("bandwidth", -"Total bandwidth in bytes consumed per service in Apisix", -{"type", "service"}) +"Total bandwidth in bytes consumed per service in APISIX", +{"type", "service", "node"}) end function _M.log(conf, ctx) core.table.clear(tmp_tab) -local host = ctx.var.host -core.table.set(tmp_tab, ctx.var.status, host) +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 +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) +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) tmp_tab[1] = "egress" metrics.bandwidth:inc(ctx.var.bytes_sent, tmp_tab) + end diff --git a/t/plugin/prometheus.t b/t/plugin/prometheus.t index 670aae0..15c9b0b 100644 --- a/t/plugin/prometheus.t +++ b/t/plugin/prometheus.t @@ -151,7 +151,7 @@ apisix_etcd_reachable 1 --- request GET /apisix/prometheus/metrics --- response_body eval -qr/apisix_bandwidth\{type="egress",service="localhost"\} \d+/ +qr/apisix_bandwidth\{type="egress",service="1",node="127.0.0.1"\} \d+/ --- no_error_log [error] @@ -293,6 +293,15 @@ passed --- request GET /apisix/prometheus/metrics --- response_body eval -qr/apisix_bandwidth\{type="egress",service="localhost"\} \d+/ +qr/apisix_bandwidth\{type="egress",service="1",node="127.0.0.1"\} \d+/ +--- no_error_log +[error] + + +=== TEST 14: fetch the prometheus metric data +--- request +GET /apisix/prometheus/metrics +--- response_body eval +qr/apisix_http_latency_count\{type="request",service="1",node="127.0.0.1"\} \d+/ --- no_error_log [error]
[incubator-apisix] branch master updated: travis: removed the temporary folder `openresty-1.15.8.2`. (#791)
This is an automated email from the ASF dual-hosted git repository. membphis 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 df3576d travis: removed the temporary folder `openresty-1.15.8.2`. (#791) df3576d is described below commit df3576d1d2ae536d1bfd8be9d4e1d7997c85f9f4 Author: YuanSheng Wang AuthorDate: Sat Nov 2 11:08:18 2019 +0800 travis: removed the temporary folder `openresty-1.15.8.2`. (#791) --- .travis/linux_tengine_runner.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis/linux_tengine_runner.sh b/.travis/linux_tengine_runner.sh index 874c4e3..4cdb12b 100755 --- a/.travis/linux_tengine_runner.sh +++ b/.travis/linux_tengine_runner.sh @@ -126,6 +126,7 @@ tengine_install() { mkdir -p build-cache${OPENRESTY_PREFIX} cp -r ${OPENRESTY_PREFIX}/* build-cache${OPENRESTY_PREFIX} ls build-cache${OPENRESTY_PREFIX} +rm -rf openresty-1.15.8.2 } do_install() {
[incubator-apisix] branch master updated: travis: supported to run APISIX with Tengine. (#683)
This is an automated email from the ASF dual-hosted git repository. membphis 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 4ee1180 travis: supported to run APISIX with Tengine. (#683) 4ee1180 is described below commit 4ee11806de142011fa3e51147826775dc79a2af6 Author: YuanSheng Wang AuthorDate: Sat Nov 2 09:05:38 2019 +0800 travis: supported to run APISIX with Tengine. (#683) --- .travis.yml| 16 +- .travis/ASF-Release.cfg| 2 + .../{linux_runner.sh => linux_openresty_runner.sh} | 2 +- .travis/linux_tengine_runner.sh| 222 + .travis/{osx_runner.sh => osx_openresty_runner.sh} | 0 README.md | 18 +- README_CN.md | 12 +- bin/apisix | 17 +- conf/nginx.conf| 2 +- t/APISIX.pm| 2 +- t/config-center-yaml/route-upstream.t | 2 +- t/node/not-exist-upstream.t| 4 +- t/router/radixtree-sni.t | 6 +- 13 files changed, 280 insertions(+), 25 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4ac7320..287fbb6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,12 +10,18 @@ matrix: - os: linux services: - redis-server + env: OSNAME=linux_openresty - os: osx + env: OSNAME=osx_openresty if: type IN (push) cache: directories: - $HOME/Library/Caches/Homebrew - /usr/local/Homebrew +- os: linux + services: +- redis-server + env: OSNAME=linux_tengine language: c @@ -42,14 +48,14 @@ before_cache: - brew cleanup before_install: - - echo $TRAVIS_OS_NAME - - $PWD/.travis/${TRAVIS_OS_NAME}_runner.sh before_install + - echo $OSNAME + - $PWD/.travis/${OSNAME}_runner.sh before_install install: - - $PWD/.travis/${TRAVIS_OS_NAME}_runner.sh do_install + - $PWD/.travis/${OSNAME}_runner.sh do_install script: - - $PWD/.travis/${TRAVIS_OS_NAME}_runner.sh script + - $PWD/.travis/${OSNAME}_runner.sh script after_success: - - $PWD/.travis/${TRAVIS_OS_NAME}_runner.sh after_success + - $PWD/.travis/${OSNAME}_runner.sh after_success diff --git a/.travis/ASF-Release.cfg b/.travis/ASF-Release.cfg index 9338f55..e967bdc 100644 --- a/.travis/ASF-Release.cfg +++ b/.travis/ASF-Release.cfg @@ -86,6 +86,8 @@ test-nginx grpc_server_example .travis.yml grpcurl +t/servroot +grpcurl conf .travis/openwhisk-utilities diff --git a/.travis/linux_runner.sh b/.travis/linux_openresty_runner.sh similarity index 99% rename from .travis/linux_runner.sh rename to .travis/linux_openresty_runner.sh index 2a7136e..872a744 100755 --- a/.travis/linux_runner.sh +++ b/.travis/linux_openresty_runner.sh @@ -66,7 +66,7 @@ do_install() { git clone https://github.com/iresty/test-nginx.git test-nginx wget -P utils https://raw.githubusercontent.com/iresty/openresty-devel-utils/iresty/lj-releng - chmod a+x utils/lj-releng +chmod a+x utils/lj-releng git clone https://github.com/apache/openwhisk-utilities.git .travis/openwhisk-utilities cp .travis/ASF* .travis/openwhisk-utilities/scancode/ diff --git a/.travis/linux_tengine_runner.sh b/.travis/linux_tengine_runner.sh new file mode 100755 index 000..874c4e3 --- /dev/null +++ b/.travis/linux_tengine_runner.sh @@ -0,0 +1,222 @@ +#!/usr/bin/env bash +# +# 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. +# + +set -ex + +export_or_prefix() { +export OPENRESTY_PREFIX="/usr/local/openresty-debug" +} + +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/ +s
[incubator-apisix] branch master updated: doc: add mail list in readme. (#789)
This is an automated email from the ASF dual-hosted git repository. membphis 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 fc84c28 doc: add mail list in readme. (#789) fc84c28 is described below commit fc84c282aa926c6dc9a59b279e22a76a3504f2b2 Author: WenMing AuthorDate: Sat Nov 2 08:44:15 2019 +0800 doc: add mail list in readme. (#789) --- README.md| 1 + README_CN.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 92419db..cbe1153 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/apache/incubator-apisix/blob/master/LICENSE) - **QQ group**: 552030619 +- Mail list: Mail to dev-subscr...@apisix.apache.org, follow the reply to subscribe the mail list. - [![Gitter](https://badges.gitter.im/apisix/community.svg)](https://gitter.im/apisix/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) - [![Twitter](https://img.shields.io/twitter/follow/apisixfast.svg?style=social&label=Follow)](https://twitter.com/intent/follow?screen_name=apisixfast) diff --git a/README_CN.md b/README_CN.md index 46af10f..f730cb2 100644 --- a/README_CN.md +++ b/README_CN.md @@ -24,8 +24,8 @@ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/apache/incubator-apisix/blob/master/LICENSE) - **QQ 交流群**: 552030619 +- 邮件列表: 发邮件到 dev-subscr...@apisix.apache.org, 然后跟着回复邮件操作即可 - [![Gitter](https://badges.gitter.im/apisix/community.svg)](https://gitter.im/apisix/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) - APISIX 是一个云原生、高性能、可扩展的微服务 API 网关。 它是基于 OpenResty 和 etcd 来实现,和传统 API 网关相比,APISIX 具备动态路由和插件热加载,特别适合微服务体系下的 API 管理。
[incubator-apisix] branch master updated: travis: only start the redis server for linux os. (#782)
This is an automated email from the ASF dual-hosted git repository. membphis 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 be9108e travis: only start the redis server for linux os. (#782) be9108e is described below commit be9108e2e918562d8d76f331280888aa5a2c86f2 Author: YuanSheng Wang AuthorDate: Fri Nov 1 22:35:36 2019 +0800 travis: only start the redis server for linux os. (#782) * travis: only start the redis server for linux os. * ASF: ignore folder `grpcurl`. --- .travis.yml | 5 ++--- .travis/ASF-Release.cfg | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0a1c230..4ac7320 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,8 @@ matrix: include: - os: linux + services: +- redis-server - os: osx if: type IN (push) cache: @@ -32,9 +34,6 @@ addons: homebrew: update: true -services: - - redis-server - cache: directories: - build-cache diff --git a/.travis/ASF-Release.cfg b/.travis/ASF-Release.cfg index 3beefe1..9338f55 100644 --- a/.travis/ASF-Release.cfg +++ b/.travis/ASF-Release.cfg @@ -85,6 +85,7 @@ deps test-nginx grpc_server_example .travis.yml +grpcurl conf .travis/openwhisk-utilities
[incubator-apisix] branch master updated (41d4a7c -> d112c97)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git. from 41d4a7c docs: fix typo (#784) add d112c97 bugfix: exported schema for plugin `serverless`. (#787) No new revisions were added by this update. Summary of changes: lua/apisix/plugins/serverless.lua | 1 + t/admin/schema.t | 80 +++ t/config-center-yaml/route-upstream.t | 1 + 3 files changed, 82 insertions(+)
[incubator-apisix] branch master updated: docs: fix typo (#784)
This is an automated email from the ASF dual-hosted git repository. membphis 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 41d4a7c docs: fix typo (#784) 41d4a7c is described below commit 41d4a7c4d4133a8c8dfd77f89c7d6550dc097afc Author: 琚致远 AuthorDate: Fri Nov 1 22:27:08 2019 +0800 docs: fix typo (#784) --- doc/https-cn.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/https-cn.md b/doc/https-cn.md index bb37954..34de2d4 100644 --- a/doc/https-cn.md +++ b/doc/https-cn.md @@ -62,9 +62,9 @@ curl --resolve 'test.com:9443:127.0.0.1' https://test.com:9443/hello -vvv > Accept: */* ``` -### 范域名 +### 泛域名 -一个 SSL 证书的域名也可能包含范域名,如`*.test.com`,它代表所有以`test.com`结尾的域名都可以使用该证书。 +一个 SSL 证书的域名也可能包含泛域名,如`*.test.com`,它代表所有以`test.com`结尾的域名都可以使用该证书。 比如`*.test.com`,可以匹配 `www.test.com`、`mail.test.com`甚至`a.b.test.com`。 看下面这个例子,请注意 `sni` 这个属性:
[incubator-apisix] branch master updated (71f49a4 -> 50ebc7e)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git. from 71f49a4 CLI: update Makefile to throw an error when OpenResty does not exist in PATH (#778) add 50ebc7e travis: allow failure when exec CI process in MacOS (#779) No new revisions were added by this update. Summary of changes: .travis.yml | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-)
[incubator-apisix] branch membphis-patch-1 updated (f890020 -> 27384c1)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a change to branch membphis-patch-1 in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git. from f890020 test add 27384c1 test: run etcd. No new revisions were added by this update. Summary of changes: .github/workflows/lua.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
[incubator-apisix] branch membphis-patch-1 updated (03ffc45 -> f890020)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a change to branch membphis-patch-1 in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git. from 03ffc45 test add f890020 test No new revisions were added by this update. Summary of changes: .github/workflows/lua.yml | 1 - 1 file changed, 1 deletion(-)
[incubator-apisix] branch membphis-patch-1 updated (79e522b -> 03ffc45)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a change to branch membphis-patch-1 in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git. from 79e522b test add 03ffc45 test No new revisions were added by this update. Summary of changes: .github/workflows/lua.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
[incubator-apisix] branch membphis-patch-1 updated (a9c3a46 -> 79e522b)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a change to branch membphis-patch-1 in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git. from a9c3a46 test add 79e522b test No new revisions were added by this update. Summary of changes: .github/workflows/lua.yml | 5 - 1 file changed, 4 insertions(+), 1 deletion(-)
[incubator-apisix] branch membphis-patch-1 updated (f8e64ca -> a9c3a46)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a change to branch membphis-patch-1 in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git. from f8e64ca test add a9c3a46 test No new revisions were added by this update. Summary of changes: .github/workflows/lua.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
[incubator-apisix] branch membphis-patch-1 updated (df43d0b -> f8e64ca)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a change to branch membphis-patch-1 in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git. from df43d0b test add f8e64ca test No new revisions were added by this update. Summary of changes: .github/workflows/lua.yml | 1 + 1 file changed, 1 insertion(+)
[incubator-apisix] branch membphis-patch-1 updated (87e06e3 -> df43d0b)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a change to branch membphis-patch-1 in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git. from 87e06e3 test add df43d0b test No new revisions were added by this update. Summary of changes: .github/workflows/lua.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
[incubator-apisix] branch membphis-patch-1 updated (e009349 -> 87e06e3)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a change to branch membphis-patch-1 in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git. from e009349 test add 87e06e3 test No new revisions were added by this update. Summary of changes: .github/workflows/lua.yml | 14 +- .travis.yml | 45 - 2 files changed, 9 insertions(+), 50 deletions(-) delete mode 100644 .travis.yml
[incubator-apisix] branch membphis-patch-1 updated (0f00f2a -> e009349)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a change to branch membphis-patch-1 in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git. from 0f00f2a test add e009349 test No new revisions were added by this update. Summary of changes: .github/workflows/lua.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)