[GitHub] [apisix] membphis commented on issue #2425: bug: zipkin plugin can not work with new config when plugin config is change

2020-10-18 Thread GitBox


membphis commented on issue #2425:
URL: https://github.com/apache/apisix/issues/2425#issuecomment-711607503


   @gy09535 would like to submit a PR to fix this bug? 
   
   we can use a different key, then we can fix this issue.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] membphis commented on pull request #2408: The old CLI invalid argument prompt is unfriendly.

2020-10-18 Thread GitBox


membphis commented on pull request #2408:
URL: https://github.com/apache/apisix/pull/2408#issuecomment-711605284


   @sober-wang many thx, merged already



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] membphis commented on pull request #2397: feature(core): implement `core.sleep`

2020-10-18 Thread GitBox


membphis commented on pull request #2397:
URL: https://github.com/apache/apisix/pull/2397#issuecomment-711603835


   @dabue many thx



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] imjoey commented on issue #2452: discuss: How apisix records the request data sent to the upstream service

2020-10-18 Thread GitBox


imjoey commented on issue #2452:
URL: https://github.com/apache/apisix/issues/2452#issuecomment-711603899


   +1 for me.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] membphis commented on pull request #2395: improve: refactor apisix command line tool

2020-10-18 Thread GitBox


membphis commented on pull request #2395:
URL: https://github.com/apache/apisix/pull/2395#issuecomment-711573927


   CI failed, please take a look at the output: 
https://github.com/apache/apisix/pull/2395/checks?check_run_id=1272985327#step:9:43



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] imjoey commented on a change in pull request #2451: Plugin(request-validation): use draft7 way to rewrite the JSON Schema

2020-10-18 Thread GitBox


imjoey commented on a change in pull request #2451:
URL: https://github.com/apache/apisix/pull/2451#discussion_r507458347



##
File path: t/plugin/request-validation.t
##
@@ -271,46 +231,6 @@ hello1 world
 "type": "roundrobin"
 },
 "uri": "/opentracing"
-}]],

Review comment:
   @fukiki Thanks and good to see it's back.  





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] fukiki commented on a change in pull request #2451: Plugin(request-validation): use draft7 way to rewrite the JSON Schema

2020-10-18 Thread GitBox


fukiki commented on a change in pull request #2451:
URL: https://github.com/apache/apisix/pull/2451#discussion_r507405839



##
File path: t/plugin/request-validation.t
##
@@ -271,46 +231,6 @@ hello1 world
 "type": "roundrobin"
 },
 "uri": "/opentracing"
-}]],

Review comment:
   > @fukiki may I ask the reason to to remove these contents? Thanks.
   
   In my test environment, the parameter string is larger than the remain space 
of the fixed buffer, which causes nginx to report an error. Therefore, the 
optional parameter was deleted.
   The code in `t/plugin/request-validation.t` has been restored.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] dabue commented on issue #2410: feat: plugin `error-log-logger`, collect error log and report to remote server by `cosocket`

2020-10-18 Thread GitBox


dabue commented on issue #2410:
URL: https://github.com/apache/apisix/issues/2410#issuecomment-711489292


   @membphis  the plugin will impact all request when it be set, is that ok? 
and it needs to be initialized during http_init.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] tokers edited a comment on pull request #2395: improve: refactor apisix command line tool

2020-10-18 Thread GitBox


tokers edited a comment on pull request #2395:
URL: https://github.com/apache/apisix/pull/2395#issuecomment-711486895


   Rebased the newest master branch and reviewed the historical changes for the 
old `bin/apisix` file after the birth of this branch and applied them, also 
code was tweaked according to the code review comments. @spacewander @membphis 



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] tokers commented on a change in pull request #2395: improve: refactor apisix command line tool

2020-10-18 Thread GitBox


tokers commented on a change in pull request #2395:
URL: https://github.com/apache/apisix/pull/2395#discussion_r507395837



##
File path: bin/apisix
##
@@ -798,333 +41,30 @@ version:print the version of apisix
 end
 
 
-local checked_admin_key = false
-local function init()
-if is_root_path then
-print('Warning! Running apisix under /root is only suitable for 
development environments'
-.. ' and it is dangerous to do so. It is recommended to run APISIX 
in a directory other than /root.')
-end
-
--- read_yaml_conf
-local yaml_conf, err = read_yaml_conf()
-if not yaml_conf then
-error("failed to read local yaml config of apisix: " .. err)
-end
--- print("etcd: ", yaml_conf.etcd.host)
-
--- check the Admin API token
-if yaml_conf.apisix.enable_admin and yaml_conf.apisix.allow_admin then
-for _, allow_ip in ipairs(yaml_conf.apisix.allow_admin) do
-if allow_ip == "127.0.0.0/24" then
-checked_admin_key = true
-end
-end
-end
-
-if yaml_conf.apisix.enable_admin and not checked_admin_key then
-checked_admin_key = true
-local help = [[
-
-%s
-Please modify "admin_key" in conf/config.yaml .
-
-]]
-if type(yaml_conf.apisix.admin_key) ~= "table" or
-   #yaml_conf.apisix.admin_key == 0
-then
-io.stderr:write(help:format("ERROR: missing valid Admin API 
token."))
-os.exit(1)
-end
-
-for _, admin in ipairs(yaml_conf.apisix.admin_key) do
-if type(admin.key) == "table" then
-admin.key = ""
-else
-admin.key = tostring(admin.key)
-end
-
-if admin.key == "" then
-io.stderr:write(help:format("ERROR: missing valid Admin API 
token."), "\n")
-os.exit(1)
-end
-
-if admin.key == "edd1c9f034335f136f87ad84b625c8f1" then
-io.stderr:write(
-help:format([[WARNING: using fixed Admin API token has 
security risk.]]),
-"\n"
-)
-end
-end
-end
-
-local or_ver = execute_cmd("openresty -V 2>&1")
-local with_module_status = true
-if or_ver and not or_ver:find("http_stub_status_module", 1, true) then
-io.stderr:write("'http_stub_status_module' module is missing in ",
-"your openresty, please check it out. Without this ",
-"module, there will be fewer monitoring indicators.\n")
-with_module_status = false
-end
-
-local enabled_plugins = {}
-for i, name in ipairs(yaml_conf.plugins) do
-enabled_plugins[name] = true
-end
-
-if enabled_plugins["proxy-cache"] and not yaml_conf.apisix.proxy_cache then
-error("missing apisix.proxy_cache for plugin proxy-cache")
-end
-
--- Using template.render
-local sys_conf = {
-lua_path = pkg_path_org,
-lua_cpath = pkg_cpath_org,
-os_name = trim(execute_cmd("uname")),
-apisix_lua_home = apisix_home,
-with_module_status = with_module_status,
-error_log = {level = "warn"},
-enabled_plugins = enabled_plugins,
-}
-
-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
-
-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
-for k,v in pairs(yaml_conf.nginx_config) do
-sys_conf[k] = v
-end
-
-local wrn = sys_conf["worker_rlimit_nofile"]
-local wc = sys_conf["event"]["worker_connections"]
-if not wrn or wrn <= wc then
--- ensure the number of fds is slightly larger than the number of conn
-sys_conf["worker_rlimit_nofile"] = wc + 128
-end
-
-if(sys_conf["enable_dev_mode"] == true) then
-sys_conf["worker_processes"] = 1
-sys_conf["enable_reuseport"] = false
-elseif tonumber(sys_conf["worker_processes"]) == nil then
-sys_conf["worker_processes"] = "auto"
-end
-
-local dns_resolver = sys_conf["dns_resolver"]
-if not dns_resolver or #dns_resolver == 0 then
-local dns_addrs, err = local_dns_resolver("/etc/resolv.conf")
-if not dns_addrs then
-error("failed to import local DNS: " .. err)
-end
-
-if #dns_addrs == 0 then
-error("local DNS is empty")
-end
-sys_conf["dns_resolver"] = dns_addrs
-end
-
-local conf_render = template.compile(ngx_tpl)
-local ngxconf = conf_render(sys_conf)
-
-local ok, err = write_file(apisix_home .. "/conf/nginx.conf", ngxconf)
-if not ok then
-

[GitHub] [apisix] Jaycean commented on pull request #2415: feat:The limit-conn plugin supports 'consumer_name' field

2020-10-18 Thread GitBox


Jaycean commented on pull request #2415:
URL: https://github.com/apache/apisix/pull/2415#issuecomment-711484039


   @spacewander PTAL



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] spacewander opened a new pull request #2461: doc(echo): mark it as production-unready

2020-10-18 Thread GitBox


spacewander opened a new pull request #2461:
URL: https://github.com/apache/apisix/pull/2461


   ### What this PR does / why we need it:
   
   
   
   ### Pre-submission checklist:
   
   * [ ] Did you explain what problem does this PR solve? Or what new features 
have been added?
   * [ ] Have you added corresponding test cases?
   * [ ] Have you modified the corresponding document?
   * [ ] Is this PR backward compatible?
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[apisix] branch master updated: feature(core): implement `core.sleep` (#2397)

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 943be09  feature(core): implement `core.sleep` (#2397)
943be09 is described below

commit 943be095004a28cedb6a3717ebb97497801cd638
Author: dabue <53054094+da...@users.noreply.github.com>
AuthorDate: Mon Oct 19 10:49:01 2020 +0800

feature(core): implement `core.sleep` (#2397)
---
 apisix/core.lua|  5 -
 apisix/core/config_etcd.lua|  2 +-
 apisix/core/config_yaml.lua|  2 +-
 apisix/core/timer.lua  |  2 +-
 apisix/core/utils.lua  | 20 +++-
 apisix/plugins/fault-injection.lua |  2 +-
 apisix/plugins/limit-conn.lua  |  2 +-
 apisix/plugins/limit-req.lua   |  2 +-
 apisix/plugins/wolf-rbac.lua   |  3 ++-
 9 files changed, 31 insertions(+), 9 deletions(-)

diff --git a/apisix/core.lua b/apisix/core.lua
index fbed577..f9432e0 100644
--- a/apisix/core.lua
+++ b/apisix/core.lua
@@ -15,6 +15,7 @@
 -- limitations under the License.
 --
 local log = require("apisix.core.log")
+local utils = require("apisix.core.utils")
 local local_conf, err = require("apisix.core.config_local").local_conf()
 if not local_conf then
 error("failed to parse yaml config: " .. err)
@@ -26,10 +27,12 @@ log.info("use config_center: ", config_center)
 local config = require("apisix.core.config_" .. config_center)
 config.type = config_center
 
+
 return {
 version  = require("apisix.core.version"),
 log  = log,
 config   = config,
+sleep= utils.sleep,
 json = require("apisix.core.json"),
 table= require("apisix.core.table"),
 request  = require("apisix.core.request"),
@@ -40,7 +43,7 @@ return {
 ctx  = require("apisix.core.ctx"),
 timer= require("apisix.core.timer"),
 id   = require("apisix.core.id"),
-utils= require("apisix.core.utils"),
+utils= utils,
 etcd = require("apisix.core.etcd"),
 http = require("apisix.core.http"),
 tablepool= require("tablepool"),
diff --git a/apisix/core/config_etcd.lua b/apisix/core/config_etcd.lua
index 4f3fd55..7fb1241 100644
--- a/apisix/core/config_etcd.lua
+++ b/apisix/core/config_etcd.lua
@@ -29,7 +29,7 @@ local insert_tab   = table.insert
 local type = type
 local ipairs   = ipairs
 local setmetatable = setmetatable
-local ngx_sleep= ngx.sleep
+local ngx_sleep= require("apisix.core.utils").sleep
 local ngx_timer_at = ngx.timer.at
 local ngx_time = ngx.time
 local sub_str  = string.sub
diff --git a/apisix/core/config_yaml.lua b/apisix/core/config_yaml.lua
index 61d40d6..f5d3b0e 100644
--- a/apisix/core/config_yaml.lua
+++ b/apisix/core/config_yaml.lua
@@ -28,7 +28,7 @@ local insert_tab   = table.insert
 local type = type
 local ipairs   = ipairs
 local setmetatable = setmetatable
-local ngx_sleep= ngx.sleep
+local ngx_sleep= require("apisix.core.utils").sleep
 local ngx_timer_at = ngx.timer.at
 local ngx_time = ngx.time
 local sub_str  = string.sub
diff --git a/apisix/core/timer.lua b/apisix/core/timer.lua
index 7982d69..2100675 100644
--- a/apisix/core/timer.lua
+++ b/apisix/core/timer.lua
@@ -15,7 +15,7 @@
 -- limitations under the License.
 --
 local log = require("apisix.core.log")
-local sleep = ngx.sleep
+local sleep = require("apisix.core.utils").sleep
 local timer_every = ngx.timer.every
 local timer_at = ngx.timer.at
 local update_time = ngx.update_time
diff --git a/apisix/core/utils.lua b/apisix/core/utils.lua
index e29784f..61963a9 100644
--- a/apisix/core/utils.lua
+++ b/apisix/core/utils.lua
@@ -29,7 +29,9 @@ local type = type
 local C= ffi.C
 local ffi_string = ffi.string
 local get_string_buf = base.get_string_buf
-
+local exiting = ngx.worker.exiting
+local ngx_sleep= ngx.sleep
+local max_sleep_interval = 1
 
 ffi.cdef[[
 int ngx_escape_uri(char *dst, const char *src,
@@ -200,4 +202,20 @@ function _M.validate_header_value(value)
 end
 
 
+local function sleep(sec)
+if sec <= max_sleep_interval then
+return ngx_sleep(sec)
+end
+ngx_sleep(max_sleep_interval)
+if exiting() then
+return
+end
+sec = sec - max_sleep_interval
+return sleep(sec)
+end
+
+
+_M.sleep = sleep
+
+
 return _M
diff --git a/apisix/plugins/fault-injection.lua 
b/apisix/plugins/fault-injection.lua
index 8484352..8cf8b8d 100644
--- a/apisix/plugins/fault-injection.lua
+++ b/apisix/plugins/fault-injection.lua
@@ -15,7 +15,7 @@
 -- limitations under the License.
 --
 local core  = require("apisix.core")
-local sleep = ngx.sleep
+local sleep = core.sleep
 
 local plugin_name   = "fault-injection"
 
diff --git a/apisix/plugins/limit-conn.lua b/apisix/plugins/limit-conn.lua
index cf0f31f..7979b5f 100644
--- a/apisix/plugins/limit-conn.lua

[GitHub] [apisix] moonming merged pull request #2397: feature(core): implement `core.sleep`

2020-10-18 Thread GitBox


moonming merged pull request #2397:
URL: https://github.com/apache/apisix/pull/2397


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] moonming closed issue #2170: feature(core): implement `core.sleep`

2020-10-18 Thread GitBox


moonming closed issue #2170:
URL: https://github.com/apache/apisix/issues/2170


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] spacewander commented on a change in pull request #2395: improve: refactor apisix command line tool

2020-10-18 Thread GitBox


spacewander commented on a change in pull request #2395:
URL: https://github.com/apache/apisix/pull/2395#discussion_r507376609



##
File path: bin/apisix
##
@@ -798,333 +41,30 @@ version:print the version of apisix
 end
 
 
-local checked_admin_key = false
-local function init()
-if is_root_path then
-print('Warning! Running apisix under /root is only suitable for 
development environments'
-.. ' and it is dangerous to do so. It is recommended to run APISIX 
in a directory other than /root.')
-end
-
--- read_yaml_conf
-local yaml_conf, err = read_yaml_conf()
-if not yaml_conf then
-error("failed to read local yaml config of apisix: " .. err)
-end
--- print("etcd: ", yaml_conf.etcd.host)
-
--- check the Admin API token
-if yaml_conf.apisix.enable_admin and yaml_conf.apisix.allow_admin then
-for _, allow_ip in ipairs(yaml_conf.apisix.allow_admin) do
-if allow_ip == "127.0.0.0/24" then
-checked_admin_key = true
-end
-end
-end
-
-if yaml_conf.apisix.enable_admin and not checked_admin_key then
-checked_admin_key = true
-local help = [[
-
-%s
-Please modify "admin_key" in conf/config.yaml .
-
-]]
-if type(yaml_conf.apisix.admin_key) ~= "table" or
-   #yaml_conf.apisix.admin_key == 0
-then
-io.stderr:write(help:format("ERROR: missing valid Admin API 
token."))
-os.exit(1)
-end
-
-for _, admin in ipairs(yaml_conf.apisix.admin_key) do
-if type(admin.key) == "table" then
-admin.key = ""
-else
-admin.key = tostring(admin.key)
-end
-
-if admin.key == "" then
-io.stderr:write(help:format("ERROR: missing valid Admin API 
token."), "\n")
-os.exit(1)
-end
-
-if admin.key == "edd1c9f034335f136f87ad84b625c8f1" then
-io.stderr:write(
-help:format([[WARNING: using fixed Admin API token has 
security risk.]]),
-"\n"
-)
-end
-end
-end
-
-local or_ver = execute_cmd("openresty -V 2>&1")
-local with_module_status = true
-if or_ver and not or_ver:find("http_stub_status_module", 1, true) then
-io.stderr:write("'http_stub_status_module' module is missing in ",
-"your openresty, please check it out. Without this ",
-"module, there will be fewer monitoring indicators.\n")
-with_module_status = false
-end
-
-local enabled_plugins = {}
-for i, name in ipairs(yaml_conf.plugins) do
-enabled_plugins[name] = true
-end
-
-if enabled_plugins["proxy-cache"] and not yaml_conf.apisix.proxy_cache then
-error("missing apisix.proxy_cache for plugin proxy-cache")
-end
-
--- Using template.render
-local sys_conf = {
-lua_path = pkg_path_org,
-lua_cpath = pkg_cpath_org,
-os_name = trim(execute_cmd("uname")),
-apisix_lua_home = apisix_home,
-with_module_status = with_module_status,
-error_log = {level = "warn"},
-enabled_plugins = enabled_plugins,
-}
-
-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
-
-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
-for k,v in pairs(yaml_conf.nginx_config) do
-sys_conf[k] = v
-end
-
-local wrn = sys_conf["worker_rlimit_nofile"]
-local wc = sys_conf["event"]["worker_connections"]
-if not wrn or wrn <= wc then
--- ensure the number of fds is slightly larger than the number of conn
-sys_conf["worker_rlimit_nofile"] = wc + 128
-end
-
-if(sys_conf["enable_dev_mode"] == true) then
-sys_conf["worker_processes"] = 1
-sys_conf["enable_reuseport"] = false
-elseif tonumber(sys_conf["worker_processes"]) == nil then
-sys_conf["worker_processes"] = "auto"
-end
-
-local dns_resolver = sys_conf["dns_resolver"]
-if not dns_resolver or #dns_resolver == 0 then
-local dns_addrs, err = local_dns_resolver("/etc/resolv.conf")
-if not dns_addrs then
-error("failed to import local DNS: " .. err)
-end
-
-if #dns_addrs == 0 then
-error("local DNS is empty")
-end
-sys_conf["dns_resolver"] = dns_addrs
-end
-
-local conf_render = template.compile(ngx_tpl)
-local ngxconf = conf_render(sys_conf)
-
-local ok, err = write_file(apisix_home .. "/conf/nginx.conf", ngxconf)
-if not ok then
-  

[GitHub] [apisix] spacewander merged pull request #2408: The old CLI invalid argument prompt is unfriendly.

2020-10-18 Thread GitBox


spacewander merged pull request #2408:
URL: https://github.com/apache/apisix/pull/2408


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[apisix] branch master updated: chore: show help message if the argument is invalid. (#2408)

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 1fe4e50  chore: show help message if the argument is invalid. (#2408)
1fe4e50 is described below

commit 1fe4e50f5a153edc738efbe92aba3f910e5c888e
Author: 尚墨 <35804630+sober-w...@users.noreply.github.com>
AuthorDate: Mon Oct 19 10:35:42 2020 +0800

chore: show help message if the argument is invalid. (#2408)
---
 bin/apisix | 1 +
 1 file changed, 1 insertion(+)

diff --git a/bin/apisix b/bin/apisix
index 7b3da87..71a8434 100755
--- a/bin/apisix
+++ b/bin/apisix
@@ -1158,6 +1158,7 @@ end
 
 if not _M[cmd_action] then
 print("invalid argument: ", cmd_action, "\n")
+_M.help()
 return
 end
 



[GitHub] [apisix] tokers commented on a change in pull request #2395: improve: refactor apisix command line tool

2020-10-18 Thread GitBox


tokers commented on a change in pull request #2395:
URL: https://github.com/apache/apisix/pull/2395#discussion_r507372495



##
File path: apisix/cmd/etcd.lua
##
@@ -0,0 +1,196 @@
+--
+-- 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 dkjson = require "dkjson"
+local file = require "apisix.cmd.file"
+local util = require "apisix.cmd.util"
+local env = require "apisix.cmd.env"
+
+local base64_encode = require("base64").encode
+
+local type = type
+local ipairs = ipairs
+local print = print
+local tonumber = tonumber
+local str_format = string.format
+
+local _M = {}
+
+
+local function parse_semantic_version(ver)
+local errmsg = "invalid semantic version: " .. ver
+
+local parts = util.split(ver, "-")
+if #parts > 2 then
+return nil, errmsg
+end
+
+if #parts == 2 then
+ver = parts[1]
+end
+
+local fields = util.split(ver, ".")
+if #fields ~= 3 then
+return nil, errmsg
+end
+
+local major = tonumber(fields[1])
+local minor = tonumber(fields[2])
+local patch = tonumber(fields[3])
+
+if not (major and minor and patch) then
+return nil, errmsg
+end
+
+return {
+major = major,
+minor = minor,
+patch = patch,
+}
+end
+
+
+local function compare_semantic_version(v1, v2)
+local ver1, err = parse_semantic_version(v1)
+if not ver1 then
+return nil, err
+end
+
+local ver2, err = parse_semantic_version(v2)
+if not ver2 then
+return nil, err
+end
+
+if ver1.major ~= ver2.major then
+return ver1.major < ver2.major
+end
+
+if ver1.minor ~= ver2.minor then
+return ver1.minor < ver2.minor
+end
+
+return ver1.patch < ver2.patch
+end
+
+
+function _M.init(show_output)
+-- read_yaml_conf
+local yaml_conf, err = file.read_yaml_conf()
+if not yaml_conf then
+return util.die("failed to read local yaml config of apisix: ",
+err)
+end
+
+if not yaml_conf.apisix then
+return util.die("failed to read `apisix` field from yaml file ",
+"while initializing etcd")
+end
+
+if yaml_conf.apisix.config_center ~= "etcd" then
+return true
+end
+
+if not yaml_conf.etcd then
+return util.die("failed to read `etcd` field from yaml file ",
+"while initializing etcd")
+end
+
+--convert old single etcd config to multiple etcd config
+if type(yaml_conf.etcd.host) == "string" then
+yaml_conf.etcd.host = { yaml_conf.etcd.host }
+end
+
+local etcd_conf = yaml_conf.etcd
+local timeout = yaml_conf.etcd.timeout or 3
+local host_count = #(yaml_conf.etcd.host)
+local uri
+
+for index, host in ipairs(yaml_conf.etcd.host) do
+-- check the etcd cluster version
+uri = etcd_conf.host[1] .. "/version"

Review comment:
   Yeah, to prevent the very corner case like the network partition.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] gy09535 commented on pull request #2177: feature: support plugin for aliyun log service

2020-10-18 Thread GitBox


gy09535 commented on pull request #2177:
URL: https://github.com/apache/apisix/pull/2177#issuecomment-711474875


   > @gy09535 I think we need to way to confirm this plugin can work fine with 
aliyun. if we can check this in the test, it should be great.
   
   Thanks I will try it.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] spacewander opened a new pull request #2460: doc: we can also use reload after configuration changed

2020-10-18 Thread GitBox


spacewander opened a new pull request #2460:
URL: https://github.com/apache/apisix/pull/2460


   ### What this PR does / why we need it:
   
   
   
   ### Pre-submission checklist:
   
   * [ ] Did you explain what problem does this PR solve? Or what new features 
have been added?
   * [ ] Have you added corresponding test cases?
   * [ ] Have you modified the corresponding document?
   * [ ] Is this PR backward compatible?
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] LY-GO commented on issue #2450: bug: limit-conn

2020-10-18 Thread GitBox


LY-GO commented on issue #2450:
URL: https://github.com/apache/apisix/issues/2450#issuecomment-711471376


   > I think you should provide a complete case, we need to know more detailed 
step information.
   > 
   > Mainly two questions:
   > 
   > 1. What is the route data?
   > 2. What is your test method?
   https://user-images.githubusercontent.com/67543312/96394096-c254e200-11f3-11eb-9ce3-57545e0deeba.png;>
   https://user-images.githubusercontent.com/67543312/96394103-c680ff80-11f3-11eb-8dd8-1985ae637cbf.png;>
   https://user-images.githubusercontent.com/67543312/96394105-c8e35980-11f3-11eb-8de1-6974ffa1360c.png;>
   2.i use the jmeter to test plugin
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] membphis merged pull request #2440: plugin(consumer-restriction): use draft7 way to rewrite the JSON Schema.

2020-10-18 Thread GitBox


membphis merged pull request #2440:
URL: https://github.com/apache/apisix/pull/2440


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] membphis closed issue #2402: plugin(consumer-restriction): update the schema

2020-10-18 Thread GitBox


membphis closed issue #2402:
URL: https://github.com/apache/apisix/issues/2402


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[apisix] branch master updated: plugin(consumer-restriction): use draft7 way to rewrite the JSON Schema. (#2440)

2020-10-18 Thread membphis
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/apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 5fcbb4d  plugin(consumer-restriction): use draft7 way to rewrite the 
JSON Schema. (#2440)
5fcbb4d is described below

commit 5fcbb4de9cdaac2570f8132fca98fc2bd2a93a0a
Author: JinChen <36916582+jayc...@users.noreply.github.com>
AuthorDate: Mon Oct 19 09:55:08 2020 +0800

plugin(consumer-restriction): use draft7 way to rewrite the JSON Schema. 
(#2440)

fix: #2402
---
 apisix/plugins/consumer-restriction.lua | 54 +
 t/plugin/consumer-restriction.t |  7 +++--
 2 files changed, 38 insertions(+), 23 deletions(-)

diff --git a/apisix/plugins/consumer-restriction.lua 
b/apisix/plugins/consumer-restriction.lua
index f80e096..68b1711 100644
--- a/apisix/plugins/consumer-restriction.lua
+++ b/apisix/plugins/consumer-restriction.lua
@@ -19,27 +19,41 @@ local core  = require("apisix.core")
 
 local schema = {
 type = "object",
-properties = {
-type = {
-type = "string",
-enum = {"consumer_name", "service_id"},
-default = "consumer_name"
-},
-whitelist = {
-type = "array",
-items = {type = "string"},
-minItems = 1
-},
-blacklist = {
-type = "array",
-items = {type = "string"},
-minItems = 1
-},
-rejected_code = {type = "integer", minimum = 200, default = 403}
-},
 oneOf = {
-{required = {"whitelist"}},
-{required = {"blacklist"}}
+{
+title = "blacklist",
+properties = {
+type = {
+type = "string",
+enum = {"consumer_name", "service_id"},
+default = "consumer_name"
+   },
+   blacklist = {
+type = "array",
+minItems = 1,
+items = {type = "string"}
+},
+rejected_code = {type = "integer", minimum = 200, default = 
403}
+},
+required = {"blacklist"},
+},
+{
+title = "whitelist",
+properties = {
+   type = {
+type = "string",
+enum = {"consumer_name", "service_id"},
+default = "consumer_name"
+   },
+whitelist = {
+type = "array",
+minItems = 1,
+items = {type = "string"}
+  },
+   rejected_code = {type = "integer", minimum = 200, default = 403}
+},
+required = {"whitelist"},
+}
 }
 }
 
diff --git a/t/plugin/consumer-restriction.t b/t/plugin/consumer-restriction.t
index afa7492..bca9817 100644
--- a/t/plugin/consumer-restriction.t
+++ b/t/plugin/consumer-restriction.t
@@ -30,8 +30,9 @@ __DATA__
 location /t {
 content_by_lua_block {
 local plugin = require("apisix.plugins.consumer-restriction")
-local conf = {
-whitelist = {
+local conf = {
+   title = "whitelist",
+   whitelist = {
 "jack1",
 "jack2"
 }
@@ -47,7 +48,7 @@ __DATA__
 --- request
 GET /t
 --- response_body
-{"rejected_code":403,"type":"consumer_name","whitelist":["jack1","jack2"]}
+{"type":"consumer_name","title":"whitelist","rejected_code":403,"whitelist":["jack1","jack2"]}
 --- no_error_log
 [error]
 



[GitHub] [apisix] membphis commented on issue #2450: bug: limit-conn

2020-10-18 Thread GitBox


membphis commented on issue #2450:
URL: https://github.com/apache/apisix/issues/2450#issuecomment-711466145


   I think you should provide a complete case, we need to know more detailed 
step information.
   
   Mainly two questions:
   
   1. What is the route data?
   2. What is your test method?



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[apisix-dashboard] branch refactor updated: feat: compatible with PUT method of `admin api` and nodes of upstream (#561)

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

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


The following commit(s) were added to refs/heads/refactor by this push:
 new 0bbcc75  feat: compatible with PUT method of `admin api` and nodes of 
upstream (#561)
0bbcc75 is described below

commit 0bbcc7534e0ab570e7d876291301d79e6b5f93bf
Author: nic-chen <33000667+nic-c...@users.noreply.github.com>
AuthorDate: Mon Oct 19 09:52:28 2020 +0800

feat: compatible with PUT method of `admin api` and nodes of upstream (#561)

* feat: support labels

* feat: compatible with PUT method of `admin api`

* fix mock test fail

* feat: upstream nodes format

* test: add test case

* fix code style

* fix: update schema sync tool
---
 api/build-tools/schema-sync.lua|  1 +
 api/internal/core/entity/entity.go | 85 ++
 api/internal/core/entity/format.go | 52 
 api/internal/core/entity/format_test.go| 39 
 api/internal/core/store/store.go   | 42 ++---
 api/internal/core/store/store_test.go  |  8 +--
 api/internal/handler/consumer/consumer.go  | 10 ++-
 api/internal/handler/consumer/consumer_test.go | 29 +
 api/internal/handler/route/route.go| 15 -
 api/internal/handler/route/route_test.go   |  6 +-
 api/internal/handler/service/service.go| 15 -
 api/internal/handler/ssl/ssl.go|  6 +-
 api/internal/handler/upstream/upstream.go  | 15 -
 13 files changed, 256 insertions(+), 67 deletions(-)

diff --git a/api/build-tools/schema-sync.lua b/api/build-tools/schema-sync.lua
index 596f6d8..257d220 100644
--- a/api/build-tools/schema-sync.lua
+++ b/api/build-tools/schema-sync.lua
@@ -46,6 +46,7 @@ local fake_module_list = {
 'resty.openidc',
 'resty.random',
 'resty.redis',
+'resty.rediscluster',
 'resty.signal',
 'resty.string',
 
diff --git a/api/internal/core/entity/entity.go 
b/api/internal/core/entity/entity.go
index 06f4d31..c15a5d5 100644
--- a/api/internal/core/entity/entity.go
+++ b/api/internal/core/entity/entity.go
@@ -16,6 +16,12 @@
  */
 package entity
 
+import (
+   "time"
+
+   "github.com/apisix/manager-api/internal/utils"
+)
+
 type BaseInfo struct {
ID string `json:"id"`
CreateTime int64  `json:"create_time"`
@@ -26,6 +32,24 @@ func (info *BaseInfo) GetBaseInfo() *BaseInfo {
return info
 }
 
+func (info *BaseInfo) Creating() {
+   if info.ID == "" {
+   info.ID = utils.GetFlakeUidStr()
+   }
+   info.CreateTime = time.Now().Unix()
+   info.UpdateTime = time.Now().Unix()
+}
+
+func (info *BaseInfo) Updating(storedInfo *BaseInfo) {
+   info.ID = storedInfo.ID
+   info.CreateTime = storedInfo.CreateTime
+   info.UpdateTime = time.Now().Unix()
+}
+
+type BaseInfoSetter interface {
+   GetBaseInfo() *BaseInfo
+}
+
 type BaseInfoGetter interface {
GetBaseInfo() *BaseInfo
 }
@@ -46,10 +70,11 @@ type Route struct {
FilterFunc  string `json:"filter_func,omitempty"`
Script  interface{}`json:"script,omitempty"`
Plugins map[string]interface{} `json:"plugins,omitempty"`
-   Upstreaminterface{}`json:"upstream,omitempty"`
+   Upstream*UpstreamDef   `json:"upstream,omitempty"`
ServiceID   string `json:"service_id,omitempty"`
UpstreamID  string `json:"upstream_id,omitempty"`
ServiceProtocol string 
`json:"service_protocol,omitempty"`
+   Labels  map[string]string  `json:"labels,omitempty"`
 }
 
 // --- structures for upstream start  ---
@@ -112,22 +137,27 @@ type HealthChecker struct {
Passive Passive `json:"passive,omitempty"`
 }
 
+type UpstreamDef struct {
+   Nodes   interface{}   `json:"nodes,omitempty"`
+   Retries int   `json:"retries,omitempty"`
+   Timeout interface{}   `json:"timeout,omitempty"`
+   K8sInfo interface{}   `json:"k8s_deployment_info,omitempty"`
+   Typestring`json:"type,omitempty"`
+   Checks  interface{}   `json:"checks,omitempty"`
+   HashOn  string`json:"hash_on,omitempty"`
+   Key string`json:"key,omitempty"`
+   EnableWebsocket bool  `json:"enable_websocket,omitempty"`
+   PassHoststring`json:"pass_host,omitempty"`
+   UpstreamHoststring`json:"upstream_host,omitempty"`
+   Namestring`json:"name,omitempty"`
+   Descstring`json:"desc,omitempty"`
+   

[GitHub] [apisix-dashboard] juzhiyuan merged pull request #561: feat: compatible with PUT method of `admin api` and nodes of upstream

2020-10-18 Thread GitBox


juzhiyuan merged pull request #561:
URL: https://github.com/apache/apisix-dashboard/pull/561


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] nic-chen commented on issue #2412: CI on OS X is broken

2020-10-18 Thread GitBox


nic-chen commented on issue #2412:
URL: https://github.com/apache/apisix/issues/2412#issuecomment-711465843


   > @nic-chen got it.
   > please add the close reason not just close issue.
   
   OK, thanks for tips.
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] moonming commented on issue #2412: CI on OS X is broken

2020-10-18 Thread GitBox


moonming commented on issue #2412:
URL: https://github.com/apache/apisix/issues/2412#issuecomment-711463434


   @nic-chen got it. 
   please add the close reason not just close issue.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] LY-GO commented on issue #2450: bug: limit-conn

2020-10-18 Thread GitBox


LY-GO commented on issue #2450:
URL: https://github.com/apache/apisix/issues/2450#issuecomment-711460517


   > > i hope that the plugin only limit concurrency,and different users also 
continue to request the router when user request the service after first .
   > 
   > What is the difference between different users? The client's IP address or 
other things? Please confirm this first.
   > 
   > and please provide a mini case which we can reproduce your bug.
   
   one questions:
   you had said the request would been allowed when concurrence declines.When i 
test the plugin of limit-conn,even through i decline the conn,the request still 
is unsuccess. this is a bug ?



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] nic-chen commented on issue #2412: CI on OS X is broken

2020-10-18 Thread GitBox


nic-chen commented on issue #2412:
URL: https://github.com/apache/apisix/issues/2412#issuecomment-711460510


   @moonming 
   It doesn't need a PR for this issue. just upload a darwin version release 
for `grpc_server_example`:
   
   https://github.com/api7/grpc_server_example/releases/tag/20200901
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] membphis edited a comment on issue #1574: feature: prometheus plugin `apisix_http_status` metric `route` tag Improve recognition

2020-10-18 Thread GitBox


membphis edited a comment on issue #1574:
URL: https://github.com/apache/apisix/issues/1574#issuecomment-711447595


   here are more cases: 
https://github.com/api7/lua-resty-radixtree/search?q=matched



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] membphis commented on issue #1574: feature: prometheus plugin `apisix_http_status` metric `route` tag Improve recognition

2020-10-18 Thread GitBox


membphis commented on issue #1574:
URL: https://github.com/apache/apisix/issues/1574#issuecomment-711447595


   here is more cases: 
https://github.com/api7/lua-resty-radixtree/search?q=matched



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] membphis commented on issue #1574: feature: prometheus plugin `apisix_http_status` metric `route` tag Improve recognition

2020-10-18 Thread GitBox


membphis commented on issue #1574:
URL: https://github.com/apache/apisix/issues/1574#issuecomment-711447339


   you can take a look at this, it can help you:
   
   https://github.com/api7/lua-resty-radixtree#synopsis
   
   ```lua
   -- try to match
   local opts = {
   host = "foo.com",
   method = "GET",
   remote_addr = "127.0.0.1",
   vars = ngx.var,
   }
   ngx.say(rx:match("/aa", opts))
   
   -- try to match and store the cached value
   local opts = {
   host = "foo.com",
   method = "GET",
   remote_addr = "127.0.0.1",
   vars = ngx.var,
   matched = {}
   }
   ngx.say(rx:match("/name/json/foo/bar/gloo", opts))
   ngx.say("name: ", opts.matched.name, " other:", opts.matched.other)



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] tzssangglass commented on issue #1574: feature: prometheus plugin `apisix_http_status` metric `route` tag Improve recognition

2020-10-18 Thread GitBox


tzssangglass commented on issue #1574:
URL: https://github.com/apache/apisix/issues/1574#issuecomment-711287916


   Under the condition of setting `uris` or `hosts`, I want to record the 
specific elements in the `uris` or `hosts` that match the current request.
   At first I tried to take advantage of the pass by reference feature of the 
table, so I wrote the following code
   ```
   handler = function (api_ctx, curr_req_matched_record)
   api_ctx.matched_params = nil
   api_ctx.matched_route = route
   --to keep the record which matches the current request and pass it 
to api_ctx
   api_ctx.curr_req_matched_record = curr_req_matched_record
   end
   ```
   
   ```
   local curr_req_matched_record = {}
   match_opts.matched = curr_req_matched_record
   
   local ok = uri_router:dispatch(api_ctx.var.uri, match_opts, api_ctx, 
curr_req_matched_record)
   ```
   
   I want to init  `match_opts.matched` , so that I can get the matched record 
on the callback after dispatch success.
   
   But this can lead to failure in some cases, because of the following code 
(https://github.com/api7/lua-resty-radixtree/blob/master/lib/resty/radixtree.lua#L456-L458),
   
   ```
   if not opts.matched and not route.param then
   return true
   end
   ```
   In my case it won't return true.
   
   So this line of thinking tends to be invalid.
   
   I also considered the `metadata` you mentioned above, but that doesn't solve 
`uris` or `hosts`.
   
   Now I don't have a solution, is there a way to get the specific elements in 
the `uris` or `hosts` that match the current request in `apisix`?
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] tzssangglass commented on pull request #2443: feature: prometheus plugin `apisix_http_status` metric `route` tag Im…

2020-10-18 Thread GitBox


tzssangglass commented on pull request #2443:
URL: https://github.com/apache/apisix/pull/2443#issuecomment-711271130


   > @tzssangglass I think your new code is wrong. please check it first.
   > 
   > 
https://github.com/apache/apisix/pull/2443/checks?check_run_id=1266120426#step:6:373
   
   Yes, you're right, I found my error through debugging.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] liuxiran commented on pull request #2440: plugin(consumer-restriction): use draft7 way to rewrite the JSON Schema.

2020-10-18 Thread GitBox


liuxiran commented on pull request #2440:
URL: https://github.com/apache/apisix/pull/2440#issuecomment-711265925


   > My current PR does not modify the logic of this disable field. I intend to 
submit a new PR for modification
   > 
   > After all, the logic related to the disable field has nothing to do with 
the current PR, which first deals with the schema format of the 
plugin(consumer-restriction)
   
   Eagerly awaiting for a change in logic of this disable field, which will 
allow the dashboard better to use.
   
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] membphis commented on a change in pull request #2458: [doc]to correct some typo and incorrect examples in getting-started.md and syslog.md

2020-10-18 Thread GitBox


membphis commented on a change in pull request #2458:
URL: https://github.com/apache/apisix/pull/2458#discussion_r507176656



##
File path: doc/getting-started.md
##
@@ -237,7 +237,7 @@ curl http://127.0.0.1:9080/apisix/admin/routes/5 -H 
'X-API-KEY: edd1c9f034335f13
 Now you can invoke the route with the following command:
 
 ```bash
-curl -i -X GET http://127.0.0.1:9080/samplePrefix/get?param1=foo=bar -H 
'apikey: superSecretAPIKey'
+curl -i -X GET "http://127.0.0.1:9080/samplePrefix/get?param1=foo=bar; 
-H 'apikey: superSecretAPIKey'

Review comment:
   I prefer to use `'` in this case, the same as `-H`.

##
File path: doc/plugins/syslog.md
##
@@ -57,25 +57,22 @@ This will provide the ability to send Log data requests as 
JSON objects.
 The following is an example on how to enable the sys-logger for a specific 
route.
 
 ```shell
-curl http://127.0.0.1:9080/apisix/admin/consumers -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '

Review comment:
   nice catch

##
File path: doc/zh-cn/getting-started.md
##
@@ -232,7 +232,7 @@ curl http://127.0.0.1:9080/apisix/admin/routes/5 -H 
'X-API-KEY: edd1c9f034335f13
 现在可以使用以下命令调用路由:
 
 ```bash
-curl -i -X GET http://127.0.0.1:9080/samplePrefix/get?param1=foo=bar -H 
'apikey: superSecretAPIKey'
+curl -i -X GET "http://127.0.0.1:9080/samplePrefix/get?param1=foo=bar; 
-H 'apikey: superSecretAPIKey'

Review comment:
   ditto





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] membphis commented on pull request #2454: doc: Contributor Over Time

2020-10-18 Thread GitBox


membphis commented on pull request #2454:
URL: https://github.com/apache/apisix/pull/2454#issuecomment-711222127


   It can only be updated manually now



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] membphis commented on pull request #2456: CI: remove `luacov`, maybe reopen it later.

2020-10-18 Thread GitBox


membphis commented on pull request #2456:
URL: https://github.com/apache/apisix/pull/2456#issuecomment-711221022


   > Why remove Luacov?
   
   the result is unstable, and it causes the test case to time out and fails.
   
   and we have no way to view the result now.
   
   I think we can reopen it after we resolve those problems as I commented in 
the CI scripts.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] qiujiayu commented on issue #2369: bug: Unable to get the latest upstream node list by service discovery

2020-10-18 Thread GitBox


qiujiayu commented on issue #2369:
URL: https://github.com/apache/apisix/issues/2369#issuecomment-711209534


   Adding `up_version`  is a good solution.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] moonming commented on issue #2412: CI on OS X is broken

2020-10-18 Thread GitBox


moonming commented on issue #2412:
URL: https://github.com/apache/apisix/issues/2412#issuecomment-711174217


   > fixed
   
   Where is the fix PR? @nic-chen 



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] moonming commented on pull request #2454: doc: Contributor Over Time

2020-10-18 Thread GitBox


moonming commented on pull request #2454:
URL: https://github.com/apache/apisix/pull/2454#issuecomment-711173809


   How to update this?



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] spacewander opened a new pull request #2459: change(jwt-auth): split schema to adapt different occasions

2020-10-18 Thread GitBox


spacewander opened a new pull request #2459:
URL: https://github.com/apache/apisix/pull/2459


   Close #2288.
   
   ### What this PR does / why we need it:
   
   
   
   ### Pre-submission checklist:
   
   * [x] Did you explain what problem does this PR solve? Or what new features 
have been added?
   * [x] Have you added corresponding test cases?
   * [ ] Have you modified the corresponding document?
   * [] Is this PR backward compatible?
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] dabue opened a new pull request #2458: [doc]to correct some typo and incorrect examples in getting-started.md and syslog.md

2020-10-18 Thread GitBox


dabue opened a new pull request #2458:
URL: https://github.com/apache/apisix/pull/2458


   ### What this PR does / why we need it:
   
   fix #2457 
   ### Pre-submission checklist:
   
https://github.com/apache/apisix/blob/master/doc/getting-started.md#add-a-prefix-to-the-route
 Line 240
   should be replaced with
   curl -i -X GET 
"http://127.0.0.1:9080/samplePrefix/get?param1=foo=bar; -H 'apikey: 
superSecretAPIKey'
   
   the example in  
https://github.com/apache/apisix/blob/master/doc/plugins/syslog.md#how-to-enable
 should be for route not consumers and the value is wrong.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] membphis commented on issue #2457: doc: typo in getting-started.md and the example in plugins/syslog.md#how-to-enable is wrong.

2020-10-18 Thread GitBox


membphis commented on issue #2457:
URL: https://github.com/apache/apisix/issues/2457#issuecomment-711162776


   nice, welcome PR



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] dabue commented on issue #2457: doc: typo in getting-started.md and the example in plugins/syslog.md#how-to-enable is wrong.

2020-10-18 Thread GitBox


dabue commented on issue #2457:
URL: https://github.com/apache/apisix/issues/2457#issuecomment-711152963



https://github.com/apache/apisix/blob/master/doc/getting-started.md#add-a-prefix-to-the-route
Line 240
   
   and the example which in  
https://github.com/apache/apisix/blob/master/doc/plugins/syslog.md#how-to-enable
   is also wrong.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] membphis commented on issue #2457: doc: typo in getting-started.md

2020-10-18 Thread GitBox


membphis commented on issue #2457:
URL: https://github.com/apache/apisix/issues/2457#issuecomment-711147817


   can you provide the original doc link?



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] membphis commented on pull request #2440: plugin(consumer-restriction): use draft7 way to rewrite the JSON Schema.

2020-10-18 Thread GitBox


membphis commented on pull request #2440:
URL: https://github.com/apache/apisix/pull/2440#issuecomment-711147574


   thx for your explain



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] spacewander commented on issue #2441: plugin(hmac-auth): update the schema

2020-10-18 Thread GitBox


spacewander commented on issue #2441:
URL: https://github.com/apache/apisix/issues/2441#issuecomment-711143671


   My suggestion is to put `metadata`/`consumer` into the arguments, if the 
argument is missing, choice the default plain `schema`.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] Jaycean edited a comment on pull request #2440: plugin(consumer-restriction): use draft7 way to rewrite the JSON Schema.

2020-10-18 Thread GitBox


Jaycean edited a comment on pull request #2440:
URL: https://github.com/apache/apisix/pull/2440#issuecomment-711140040


   > > Do you mean that the current function can directly remove this field?
   > 
   > You haven't added this field yet? I do not find it in the changed files: 
https://github.com/apache/apisix/pull/2440/files
   
   My current PR does not modify the logic of this disable field. I intend to 
submit a new PR for modification
   
   After all, the logic related to the disable field has nothing to do with the 
current PR, which first deals with the schema format of the  
plugin(consumer-restriction)



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] Jaycean commented on pull request #2440: plugin(consumer-restriction): use draft7 way to rewrite the JSON Schema.

2020-10-18 Thread GitBox


Jaycean commented on pull request #2440:
URL: https://github.com/apache/apisix/pull/2440#issuecomment-711140040


   > > Do you mean that the current function can directly remove this field?
   > 
   > You haven't added this field yet? I do not find it in the changed files: 
https://github.com/apache/apisix/pull/2440/files
   
   My current PR does not modify the logic of this disable field. I intend to 
submit a new PR for modification



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] Miss-you commented on pull request #2454: doc: Contributor Over Time

2020-10-18 Thread GitBox


Miss-you commented on pull request #2454:
URL: https://github.com/apache/apisix/pull/2454#issuecomment-711133448


   I have fix the problem in the image attributor-over-time.png.
   
   
![image](https://user-images.githubusercontent.com/3816205/96362049-237da680-115d-11eb-9f51-53bb3ba4387b.png)
   
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] dabue opened a new issue #2457: doc: typo in getting-started.md

2020-10-18 Thread GitBox


dabue opened a new issue #2457:
URL: https://github.com/apache/apisix/issues/2457


   ### Issue description
   Line 240:
   curl -i -X GET http://127.0.0.1:9080/samplePrefix/get?param1=foo=bar 
-H 'apikey: superSecretAPIKey'
   
   should be replaced with 
   curl -i -X GET 
"http://127.0.0.1:9080/samplePrefix/get?param1=foo=bar; -H 'apikey: 
superSecretAPIKey'
   
   ### Environment
   
   * apisix version (cmd: `apisix version`):
   * OS: centos 7
   
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org