[GitHub] [apisix-website] guoqqqi removed a comment on pull request #716: feat: add Datadog plugin card in plugin hub

2021-11-11 Thread GitBox


guoqqqi removed a comment on pull request #716:
URL: https://github.com/apache/apisix-website/pull/716#issuecomment-966883922


   wait #715 


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] spacewander merged pull request #5477: change(wolf-rbac): change default port number and add `authType` parameter to documentation

2021-11-11 Thread GitBox


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


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[apisix] branch master updated: change(wolf-rbac): change default port number and add `authType` parameter to documentation (#5477)

2021-11-11 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 8206f47  change(wolf-rbac): change default port number and add 
`authType` parameter to documentation (#5477)
8206f47 is described below

commit 8206f475639d6de633ff4ea50a8e1c2ce9b36fac
Author: iGeeky 
AuthorDate: Fri Nov 12 15:49:55 2021 +0800

change(wolf-rbac): change default port number and add `authType` parameter 
to documentation (#5477)
---
 apisix/plugins/wolf-rbac.lua| 2 +-
 docs/en/latest/plugins/wolf-rbac.md | 7 ---
 docs/zh/latest/plugins/wolf-rbac.md | 7 ---
 t/plugin/wolf-rbac.t| 2 +-
 4 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/apisix/plugins/wolf-rbac.lua b/apisix/plugins/wolf-rbac.lua
index 1756004..9234454 100644
--- a/apisix/plugins/wolf-rbac.lua
+++ b/apisix/plugins/wolf-rbac.lua
@@ -49,7 +49,7 @@ local schema = {
 },
 server = {
 type = "string",
-default = "http://127.0.0.1:10080;
+default = "http://127.0.0.1:12180;
 },
 header_prefix = {
 type = "string",
diff --git a/docs/en/latest/plugins/wolf-rbac.md 
b/docs/en/latest/plugins/wolf-rbac.md
index c76310e..96ced3a 100644
--- a/docs/en/latest/plugins/wolf-rbac.md
+++ b/docs/en/latest/plugins/wolf-rbac.md
@@ -39,7 +39,7 @@ The rbac feature is provided by 
[wolf](https://github.com/iGeeky/wolf). For more
 
 | Name  | Type   | Requirement | Default  | Valid | 
Description   |
 | - | -- | --- |  | - | 
- |
-| server| string | optional| "http://127.0.0.1:10080; |   | 
Set the service address of `wolf-server`. |
+| server| string | optional| "http://127.0.0.1:12180; |   | 
Set the service address of `wolf-server`. |
 | appid | string | optional| "unset"  |   | 
Set the app id. The app id must be added in wolf-console. |
 | header_prefix | string | optional| "X-" |   | 
prefix of custom HTTP header. After authentication is successful, three headers 
will be added to the request header (for backend) and response header (for 
frontend): `X-UserId`, `X-Username`, `X-Nickname`. |
 
@@ -73,7 +73,7 @@ curl http://127.0.0.1:9080/apisix/admin/consumers  -H 
'X-API-KEY: edd1c9f034335f
   "username":"wolf_rbac",
   "plugins":{
 "wolf-rbac":{
-  "server":"http://127.0.0.1:10080;,
+  "server":"http://127.0.0.1:12180;,
   "appid":"restful"
 }
   },
@@ -113,13 +113,14 @@ curl http://127.0.0.1:9080/apisix/admin/routes/1  -H 
'X-API-KEY: edd1c9f034335f1
  Login and get `wolf-rbac` token:
 
 The following `appid`, `username`, and `password` must be real ones in the 
wolf system.
+`authType` is the authentication type, `1` is password authentication, `2` is 
`LDAP` authentication. The default is `1`.  `wolf` supports `LDAP` 
authentication since version 0.5.0
 
 * Login as `POST application/json`
 
 ```shell
 curl http://127.0.0.1:9080/apisix/plugin/wolf-rbac/login -i \
 -H "Content-Type: application/json" \
--d '{"appid": "restful", "username":"test", "password":"user-password"}'
+-d '{"appid": "restful", "username":"test", "password":"user-password", 
"authType":1}'
 
 HTTP/1.1 200 OK
 Date: Wed, 24 Jul 2019 10:33:31 GMT
diff --git a/docs/zh/latest/plugins/wolf-rbac.md 
b/docs/zh/latest/plugins/wolf-rbac.md
index a176e0f..153d776 100644
--- a/docs/zh/latest/plugins/wolf-rbac.md
+++ b/docs/zh/latest/plugins/wolf-rbac.md
@@ -39,7 +39,7 @@ rbac 功能由[wolf](https://github.com/iGeeky/wolf)提供, 有关 `wolf` 的更
 
 | 名称  | 类型   | 必选项 | 默认值   | 有效值 | 描述  

 |
 | - | -- | -- |  | -- | 
--
 |
-| server| string | 可选   | "http://127.0.0.1:10080; || 设置 
`wolf-server` 的访问地址 
 |
+| server| string | 可选   | "http://127.0.0.1:12180; || 设置 
`wolf-server` 的访问地址 
 |
 | appid | string | 可选   | "unset"  || 设置应用 id, 
该应用 id, 需要是在 `wolf-console` 中已经添加的应用 id 
   |
 | 

[GitHub] [apisix-ingress-controller] nic-6443 edited a comment on pull request #745: feat: support environment variable in config file

2021-11-11 Thread GitBox


nic-6443 edited a comment on pull request #745:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/745#issuecomment-966889636


   > The code LGTM. Thanks!
   > 
   > But I personally prefer to directly support configuration through 
environment variables or through configuration files Instead of supporting 
environment variables in the configuration file.
   > 
   > WDYT? @gxthrj @tokers @lilien1010
   
   @tao12345666333  In the case that the user chooses to use file configuration 
instead of commands of container, the use of environment variables is to write 
sensitive information through downward api and secret.  So if the program 
directly uses env, we need to consider the problem of file configuration and 
env configuration merging,  doesn't make this problem easy.
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] lanbiaowan commented on issue #5342: request help: share limit counter between routes

2021-11-11 Thread GitBox


lanbiaowan commented on issue #5342:
URL: https://github.com/apache/apisix/issues/5342#issuecomment-966889711


   i will take 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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix-ingress-controller] nic-6443 commented on pull request #745: feat: support environment variable in config file

2021-11-11 Thread GitBox


nic-6443 commented on pull request #745:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/745#issuecomment-966889636


   > The code LGTM. Thanks!
   > 
   > But I personally prefer to directly support configuration through 
environment variables or through configuration files Instead of supporting 
environment variables in the configuration file.
   > 
   > WDYT? @gxthrj @tokers @lilien1010
   In the case that the user chooses to use file configuration instead of 
commands of container, the use of environment variables is to write sensitive 
information through downward api and secret.  So if the program directly uses 
env, we need to consider the problem of file configuration and env 
configuration merging,  doesn't make this problem easy.
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix-website] guoqqqi commented on pull request #716: feat: add Datadog plugin card in plugin hub

2021-11-11 Thread GitBox


guoqqqi commented on pull request #716:
URL: https://github.com/apache/apisix-website/pull/716#issuecomment-966883922


   wait #715 


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] spacewander merged pull request #5480: refactor: Method for latency calculation and related refactoring

2021-11-11 Thread GitBox


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


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[apisix] branch master updated: refactor: Method for latency calculation and related refactoring (#5480)

2021-11-11 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 4cd1edc  refactor: Method for latency calculation and related 
refactoring (#5480)
4cd1edc is described below

commit 4cd1edcc39a1733c0ea10e2eccc324db47a112c8
Author: Bisakh 
AuthorDate: Fri Nov 12 12:57:27 2021 +0530

refactor: Method for latency calculation and related refactoring (#5480)
---
 apisix/plugins/datadog.lua | 12 
 apisix/plugins/prometheus/exporter.lua | 17 -
 apisix/utils/log-util.lua  | 19 +++
 3 files changed, 27 insertions(+), 21 deletions(-)

diff --git a/apisix/plugins/datadog.lua b/apisix/plugins/datadog.lua
index 0a6a134..6a55886 100644
--- a/apisix/plugins/datadog.lua
+++ b/apisix/plugins/datadog.lua
@@ -18,6 +18,7 @@ local core = require("apisix.core")
 local plugin = require("apisix.plugin")
 local batch_processor = require("apisix.utils.batch-processor")
 local fetch_log = require("apisix.utils.log-util").get_full_log
+local latency_details = require("apisix.utils.log-util").latency_details_in_ms
 local service_fetch = require("apisix.http.service").get
 local ngx = ngx
 local udp = ngx.socket.udp
@@ -139,7 +140,7 @@ function _M.log(conf, ctx)
 end
 
 local entry = fetch_log(ngx, {})
-entry.upstream_latency = ctx.var.upstream_response_time * 1000
+entry.latency, entry.upstream_latency, entry.apisix_latency = 
latency_details(ctx)
 entry.balancer_ip = ctx.balancer_ip or ""
 entry.scheme = ctx.upstream_scheme or ""
 
@@ -215,23 +216,18 @@ function _M.log(conf, ctx)
 end
 
 -- upstream latency
-local apisix_latency = entry.latency
 if entry.upstream_latency then
 local ok, err = sock:send(format("%s:%s|%s%s", prefix ..
-"upstream.latency", 
entry.upstream_latency, "h", suffix))
+"upstream.latency", entry.upstream_latency, 
"h", suffix))
 if not ok then
 core.log.error("failed to report upstream latency to 
dogstatsd server: host["
 .. host .. "] port[" .. tostring(port) .. "] 
err: " .. err)
 end
-apisix_latency =  apisix_latency - entry.upstream_latency
-if apisix_latency < 0 then
-apisix_latency = 0
-end
 end
 
 -- apisix_latency
 local ok, err = sock:send(format("%s:%s|%s%s", prefix ..
-"apisix.latency", apisix_latency, 
"h", suffix))
+"apisix.latency", entry.apisix_latency, 
"h", suffix))
 if not ok then
 core.log.error("failed to report apisix latency to dogstatsd 
server: host[" .. host
 .. "] port[" .. tostring(port) .. "] err: " .. err)
diff --git a/apisix/plugins/prometheus/exporter.lua 
b/apisix/plugins/prometheus/exporter.lua
index b2c1ebc..d565b4c 100644
--- a/apisix/plugins/prometheus/exporter.lua
+++ b/apisix/plugins/prometheus/exporter.lua
@@ -33,6 +33,7 @@ local clear_tab = core.table.clear
 local get_stream_routes = router.stream_routes
 local get_protos = require("apisix.plugins.grpc-transcode.proto").protos
 local service_fetch = require("apisix.http.service").get
+local latency_details = require("apisix.utils.log-util").latency_details_in_ms
 
 
 
@@ -143,25 +144,15 @@ function _M.log(conf, ctx)
 gen_arr(vars.status, route_id, matched_uri, matched_host,
 service_id, consumer_name, balancer_ip))
 
-local latency = (ngx.now() - ngx.req.start_time()) * 1000
+local latency, upstream_latency, apisix_latency = latency_details(ctx)
 metrics.latency:observe(latency,
 gen_arr("request", route_id, service_id, consumer_name, balancer_ip))
 
-local apisix_latency = latency
-if ctx.var.upstream_response_time then
-local upstream_latency = ctx.var.upstream_response_time * 1000
+if upstream_latency then
 metrics.latency:observe(upstream_latency,
 gen_arr("upstream", route_id, service_id, consumer_name, 
balancer_ip))
-apisix_latency =  apisix_latency - upstream_latency
-
--- The latency might be negative, as Nginx uses different time 
measurements in
--- different metrics.
--- See 
https://github.com/apache/apisix/issues/5146#issuecomment-928919399
-if apisix_latency < 0 then
-apisix_latency = 0
-end
-
 end
+
 metrics.latency:observe(apisix_latency,
 gen_arr("apisix", route_id, service_id, consumer_name, balancer_ip))
 
diff --git a/apisix/utils/log-util.lua b/apisix/utils/log-util.lua
index cf3fc22..10620d1 100644
--- 

[GitHub] [apisix-ingress-controller] tao12345666333 commented on pull request #745: feat: support environment variable in config file

2021-11-11 Thread GitBox


tao12345666333 commented on pull request #745:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/745#issuecomment-966882948


   The code LGTM. Thanks!
   
   But I personally prefer to directly support configuration through 
environment variables or through configuration files
   Instead of supporting environment variables in the configuration file.
   
   WDYT? @gxthrj @tokers @lilien1010 


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] spacewander commented on issue #5343: request help: kafka logger supports logging request body

2021-11-11 Thread GitBox


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


   BTW, we are not expected to discuss the logging response body in an issue 
about the request body. It's off-topic.  


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] spacewander commented on issue #5343: request help: kafka logger supports logging request body

2021-11-11 Thread GitBox


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


   Since the kafka-logger's priority is low enough, we can just keep it 
untouched.
   We are engineers, not mathematicians. We need to know when to trade off.
   
   BTW, the gzip plugin doesn't do the gzip directly, it just controls the 
behavior of gzip.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix-website] guoqqqi commented on pull request #716: feat: add Datadog plugin card in plugin hub

2021-11-11 Thread GitBox


guoqqqi commented on pull request #716:
URL: https://github.com/apache/apisix-website/pull/716#issuecomment-966880270


   cc @bzp2010 


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix-website] guoqqqi opened a new pull request #716: feat: add Datadog plugin card in plugin hub

2021-11-11 Thread GitBox


guoqqqi opened a new pull request #716:
URL: https://github.com/apache/apisix-website/pull/716


   Fixes: #[Add issue number here]
   
   1. add Datadog plugin card
   2. update the icon
   
![image](https://user-images.githubusercontent.com/72343596/141426368-46a76099-1fe2-40f7-b500-d513aaf1c89d.png)
   
   
   
   
   Screenshots of the change:
   
   
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] spacewander merged pull request #5478: feat: provide skywalking logger plugin

2021-11-11 Thread GitBox


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


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[apisix] branch master updated (0570d59 -> 5f6afdb)

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

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


from 0570d59  docs: remove duplicate Dubbo entry (#5483)
 add 5f6afdb  feat: provide skywalking logger plugin (#5478)

No new revisions were added by this update.

Summary of changes:
 .../{http-logger.lua => skywalking-logger.lua} | 115 -
 conf/config-default.yaml   |   1 +
 docs/en/latest/config.json |   1 +
 .../{http-logger.md => skywalking-logger.md}   |  60 ++---
 docs/zh/latest/config.json |   1 +
 .../{http-logger.md => skywalking-logger.md}   |  56 ++---
 t/admin/plugins.t  |   2 +-
 t/plugin/skywalking-logger.t   | 269 +
 8 files changed, 350 insertions(+), 155 deletions(-)
 copy apisix/plugins/{http-logger.lua => skywalking-logger.lua} (68%)
 copy docs/en/latest/plugins/{http-logger.md => skywalking-logger.md} (65%)
 copy docs/zh/latest/plugins/{http-logger.md => skywalking-logger.md} (62%)
 create mode 100644 t/plugin/skywalking-logger.t


[GitHub] [apisix-ingress-controller] codecov-commenter edited a comment on pull request #745: feat: support environment variable in config file

2021-11-11 Thread GitBox


codecov-commenter edited a comment on pull request #745:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/745#issuecomment-966835293


   # 
[Codecov](https://codecov.io/gh/apache/apisix-ingress-controller/pull/745?src=pr=h1_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 Report
   > Merging 
[#745](https://codecov.io/gh/apache/apisix-ingress-controller/pull/745?src=pr=desc_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 (2daf86c) into 
[master](https://codecov.io/gh/apache/apisix-ingress-controller/commit/4a862e206602ae9c7ac534fdfd9a557748b9ad26?el=desc_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 (4a862e2) will **increase** coverage by `0.09%`.
   > The diff coverage is `85.71%`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-ingress-controller/pull/745/graphs/tree.svg?width=650=150=pr=WPLQXPY3V0_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-ingress-controller/pull/745?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
   
   ```diff
   @@Coverage Diff @@
   ##   master #745  +/-   ##
   ==
   + Coverage   31.70%   31.79%   +0.09% 
   ==
 Files  66   66  
 Lines6640 6652  +12 
   ==
   + Hits 2105 2115  +10 
   - Misses   4280 4281   +1 
   - Partials  255  256   +1 
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/apisix-ingress-controller/pull/745?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 | Coverage Δ | |
   |---|---|---|
   | 
[test/e2e/e2e.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/745/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-dGVzdC9lMmUvZTJlLmdv)
 | `100.00% <ø> (ø)` | |
   | 
[pkg/config/config.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/745/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-cGtnL2NvbmZpZy9jb25maWcuZ28=)
 | `65.00% <85.71%> (+2.50%)` | :arrow_up: |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-ingress-controller/pull/745?src=pr=continue_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-ingress-controller/pull/745?src=pr=footer_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation).
 Last update 
[4a862e2...2daf86c](https://codecov.io/gh/apache/apisix-ingress-controller/pull/745?src=pr=lastupdated_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation).
 Read the [comment 
docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation).
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix-website] yzeng25 opened a new pull request #715: docs: add APISIX-Datadog plugin doc

2021-11-11 Thread GitBox


yzeng25 opened a new pull request #715:
URL: https://github.com/apache/apisix-website/pull/715


   Changes:
   add APISIX-Datadog plugin doc
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix-dashboard] Marno-o opened a new issue #2205: dos format shell

2021-11-11 Thread GitBox


Marno-o opened a new issue #2205:
URL: https://github.com/apache/apisix-dashboard/issues/2205


   ### Issue description
   
   I want to build image locally ,but found this error:
   ```shell
   /usr/bin/env: 'bash\r': No such file or directory
   ```
   It's caused by this build script: `api/build.sh`.
   
   This build script was wrote in format dos , it contains `\r` so cannot be 
read by linux.
   
   ### Expected behavior
   
   please check and fix
   
   ### How to Reproduce
   
   docker build -t apisix-dashboard:test .
   
   ### Screenshots
   
   _No response_
   
   ### Environment
   
   - OS (cmd: `uname -a`): CentOS 7
   - apisix-dashboard version, if have: 2.9.0
   
   
   ### Additional context
   
   _No response_


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix-ingress-controller] codecov-commenter commented on pull request #745: feat: support environment variable in config file

2021-11-11 Thread GitBox


codecov-commenter commented on pull request #745:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/745#issuecomment-966835293


   # 
[Codecov](https://codecov.io/gh/apache/apisix-ingress-controller/pull/745?src=pr=h1_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 Report
   > Merging 
[#745](https://codecov.io/gh/apache/apisix-ingress-controller/pull/745?src=pr=desc_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 (2daf86c) into 
[master](https://codecov.io/gh/apache/apisix-ingress-controller/commit/4a862e206602ae9c7ac534fdfd9a557748b9ad26?el=desc_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 (4a862e2) will **increase** coverage by `0.08%`.
   > The diff coverage is `85.71%`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-ingress-controller/pull/745/graphs/tree.svg?width=650=150=pr=WPLQXPY3V0_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-ingress-controller/pull/745?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
   
   ```diff
   @@Coverage Diff @@
   ##   master #745  +/-   ##
   ==
   + Coverage   31.70%   31.78%   +0.08% 
   ==
 Files  66   65   -1 
 Lines6640 6651  +11 
   ==
   + Hits 2105 2114   +9 
   - Misses   4280 4281   +1 
   - Partials  255  256   +1 
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/apisix-ingress-controller/pull/745?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 | Coverage Δ | |
   |---|---|---|
   | 
[pkg/config/config.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/745/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-cGtnL2NvbmZpZy9jb25maWcuZ28=)
 | `65.00% <85.71%> (+2.50%)` | :arrow_up: |
   | 
[test/e2e/e2e.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/745/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-dGVzdC9lMmUvZTJlLmdv)
 | | |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-ingress-controller/pull/745?src=pr=continue_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-ingress-controller/pull/745?src=pr=footer_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation).
 Last update 
[4a862e2...2daf86c](https://codecov.io/gh/apache/apisix-ingress-controller/pull/745?src=pr=lastupdated_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation).
 Read the [comment 
docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation).
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix-dashboard] bzp2010 commented on a change in pull request #2202: test: migrate global rule e2e

2021-11-11 Thread GitBox


bzp2010 commented on a change in pull request #2202:
URL: https://github.com/apache/apisix-dashboard/pull/2202#discussion_r747973372



##
File path: api/test/e2enew/global_rule/global_rule_test.go
##
@@ -0,0 +1,201 @@
+/*
+ * 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 global_rule_test
+
+import (
+   "net/http"
+
+   . "github.com/onsi/ginkgo"
+   . "github.com/onsi/ginkgo/extensions/table"
+
+   "github.com/apisix/manager-api/test/e2enew/base"
+)
+
+var _ = Describe("Global Rule", func() {
+   var _ = DescribeTable("test global rule curd",
+   func(tc base.HttpTestCase) {
+   base.RunTestCase(tc)
+   },
+   Entry("create global rule", base.HttpTestCase{
+   Object: base.ManagerApiExpect(),
+   Method: http.MethodPut,
+   Path:   "/apisix/admin/global_rules/1",
+   Body: `{
+   "plugins": {
+   "response-rewrite": {
+   "headers": {
+   "X-VERSION":"1.0"
+   }
+   }
+   }
+   }`,
+   Headers:  map[string]string{"Authorization": 
base.GetToken()},
+   ExpectStatus: http.StatusOK,
+   ExpectBody:   "\"X-VERSION\":\"1.0\"",
+   }),
+   Entry("full update global rule", base.HttpTestCase{
+   Object: base.ManagerApiExpect(),
+   Method: http.MethodPut,
+   Path:   "/apisix/admin/global_rules/1",
+   Body: `{
+   "plugins": {
+   "response-rewrite": {
+   "headers": {
+   "X-TEST":"1.0"
+   }
+   }
+   }
+   }`,
+   Headers:  map[string]string{"Authorization": 
base.GetToken()},
+   ExpectStatus: http.StatusOK,
+   ExpectBody:   "\"X-TEST\":\"1.0\"",
+   }),
+   Entry("partial update global rule", base.HttpTestCase{
+   Object: base.ManagerApiExpect(),
+   Method: http.MethodPatch,
+   Path:   "/apisix/admin/global_rules/1/plugins",
+   Body: `{
+   "response-rewrite": {
+   "headers": {
+   "X-VERSION":"1.0"
+   }
+   },
+   "key-auth": {}
+   }`,
+   Headers:  map[string]string{"Authorization": 
base.GetToken()},
+   ExpectStatus: http.StatusOK,
+   ExpectBody:   "\"key-auth\":{}",
+   }),
+   Entry("delete global rule", base.HttpTestCase{
+   Object:   base.ManagerApiExpect(),
+   Method:   http.MethodDelete,
+   Path: "/apisix/admin/global_rules/1",
+   Headers:  map[string]string{"Authorization": 
base.GetToken()},
+   ExpectStatus: http.StatusOK,
+   }),
+   )
+
+   var _ = DescribeTable("test global rule integration",
+   func(tc base.HttpTestCase) {
+   base.RunTestCase(tc)
+   },
+   Entry("create route", base.HttpTestCase{
+   Object: base.ManagerApiExpect(),
+   Method: http.MethodPut,
+   Path:   "/apisix/admin/routes/r1",
+   Body: `{
+   "name": "route1",
+   

[GitHub] [apisix-dashboard] nic-chen commented on a change in pull request #2202: test: migrate global rule e2e

2021-11-11 Thread GitBox


nic-chen commented on a change in pull request #2202:
URL: https://github.com/apache/apisix-dashboard/pull/2202#discussion_r747974671



##
File path: api/test/e2enew/global_rule/global_rule_test.go
##
@@ -0,0 +1,201 @@
+/*
+ * 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 global_rule_test
+
+import (
+   "net/http"
+
+   . "github.com/onsi/ginkgo"
+   . "github.com/onsi/ginkgo/extensions/table"
+
+   "github.com/apisix/manager-api/test/e2enew/base"
+)
+
+var _ = Describe("Global Rule", func() {
+   var _ = DescribeTable("test global rule curd",
+   func(tc base.HttpTestCase) {
+   base.RunTestCase(tc)
+   },
+   Entry("create global rule", base.HttpTestCase{
+   Object: base.ManagerApiExpect(),
+   Method: http.MethodPut,
+   Path:   "/apisix/admin/global_rules/1",
+   Body: `{
+   "plugins": {
+   "response-rewrite": {
+   "headers": {
+   "X-VERSION":"1.0"
+   }
+   }
+   }
+   }`,
+   Headers:  map[string]string{"Authorization": 
base.GetToken()},
+   ExpectStatus: http.StatusOK,
+   ExpectBody:   "\"X-VERSION\":\"1.0\"",
+   }),
+   Entry("full update global rule", base.HttpTestCase{
+   Object: base.ManagerApiExpect(),
+   Method: http.MethodPut,
+   Path:   "/apisix/admin/global_rules/1",
+   Body: `{
+   "plugins": {
+   "response-rewrite": {
+   "headers": {
+   "X-TEST":"1.0"
+   }
+   }
+   }
+   }`,
+   Headers:  map[string]string{"Authorization": 
base.GetToken()},
+   ExpectStatus: http.StatusOK,
+   ExpectBody:   "\"X-TEST\":\"1.0\"",
+   }),
+   Entry("partial update global rule", base.HttpTestCase{
+   Object: base.ManagerApiExpect(),
+   Method: http.MethodPatch,
+   Path:   "/apisix/admin/global_rules/1/plugins",
+   Body: `{
+   "response-rewrite": {
+   "headers": {
+   "X-VERSION":"1.0"
+   }
+   },
+   "key-auth": {}
+   }`,
+   Headers:  map[string]string{"Authorization": 
base.GetToken()},
+   ExpectStatus: http.StatusOK,
+   ExpectBody:   "\"key-auth\":{}",
+   }),
+   Entry("delete global rule", base.HttpTestCase{
+   Object:   base.ManagerApiExpect(),
+   Method:   http.MethodDelete,
+   Path: "/apisix/admin/global_rules/1",
+   Headers:  map[string]string{"Authorization": 
base.GetToken()},
+   ExpectStatus: http.StatusOK,
+   }),
+   )
+
+   var _ = DescribeTable("test global rule integration",
+   func(tc base.HttpTestCase) {
+   base.RunTestCase(tc)
+   },
+   Entry("create route", base.HttpTestCase{
+   Object: base.ManagerApiExpect(),
+   Method: http.MethodPut,
+   Path:   "/apisix/admin/routes/r1",
+   Body: `{
+   "name": "route1",
+  

[GitHub] [apisix] daputaowang opened a new issue #5491: request help: Do we have a solution for deploying Apisix and Apisix-Dashboard for MIPS installation?

2021-11-11 Thread GitBox


daputaowang opened a new issue #5491:
URL: https://github.com/apache/apisix/issues/5491


   ### Issue description
   
   Do we have a solution for deploying Apisix and Apisix-Dashboard for MIPS 
installation?
   
   ### Environment
   
   - apisix version (cmd: `apisix version`): 2.10
   - OS (cmd: `uname -a`): Linux neokylin-os-sn2 
3.10.0-862.9.1.ns7_4.37.mips64el
   - OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`): 1.19.3.1
   - etcd version, if have (cmd: run `curl 
http://127.0.0.1:9090/v1/server_info` to get the info from server-info API): 
3.4.13
   - apisix-dashboard version, if have: 2.9
   - the plugin runner version, if the issue is about a plugin runner (cmd: 
depended on the kind of runner):
   - luarocks version, if the issue is about installation (cmd: `luarocks 
--version`): 3.5.0
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix-dashboard] bzp2010 commented on a change in pull request #2202: test: migrate global rule e2e

2021-11-11 Thread GitBox


bzp2010 commented on a change in pull request #2202:
URL: https://github.com/apache/apisix-dashboard/pull/2202#discussion_r747973372



##
File path: api/test/e2enew/global_rule/global_rule_test.go
##
@@ -0,0 +1,201 @@
+/*
+ * 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 global_rule_test
+
+import (
+   "net/http"
+
+   . "github.com/onsi/ginkgo"
+   . "github.com/onsi/ginkgo/extensions/table"
+
+   "github.com/apisix/manager-api/test/e2enew/base"
+)
+
+var _ = Describe("Global Rule", func() {
+   var _ = DescribeTable("test global rule curd",
+   func(tc base.HttpTestCase) {
+   base.RunTestCase(tc)
+   },
+   Entry("create global rule", base.HttpTestCase{
+   Object: base.ManagerApiExpect(),
+   Method: http.MethodPut,
+   Path:   "/apisix/admin/global_rules/1",
+   Body: `{
+   "plugins": {
+   "response-rewrite": {
+   "headers": {
+   "X-VERSION":"1.0"
+   }
+   }
+   }
+   }`,
+   Headers:  map[string]string{"Authorization": 
base.GetToken()},
+   ExpectStatus: http.StatusOK,
+   ExpectBody:   "\"X-VERSION\":\"1.0\"",
+   }),
+   Entry("full update global rule", base.HttpTestCase{
+   Object: base.ManagerApiExpect(),
+   Method: http.MethodPut,
+   Path:   "/apisix/admin/global_rules/1",
+   Body: `{
+   "plugins": {
+   "response-rewrite": {
+   "headers": {
+   "X-TEST":"1.0"
+   }
+   }
+   }
+   }`,
+   Headers:  map[string]string{"Authorization": 
base.GetToken()},
+   ExpectStatus: http.StatusOK,
+   ExpectBody:   "\"X-TEST\":\"1.0\"",
+   }),
+   Entry("partial update global rule", base.HttpTestCase{
+   Object: base.ManagerApiExpect(),
+   Method: http.MethodPatch,
+   Path:   "/apisix/admin/global_rules/1/plugins",
+   Body: `{
+   "response-rewrite": {
+   "headers": {
+   "X-VERSION":"1.0"
+   }
+   },
+   "key-auth": {}
+   }`,
+   Headers:  map[string]string{"Authorization": 
base.GetToken()},
+   ExpectStatus: http.StatusOK,
+   ExpectBody:   "\"key-auth\":{}",
+   }),
+   Entry("delete global rule", base.HttpTestCase{
+   Object:   base.ManagerApiExpect(),
+   Method:   http.MethodDelete,
+   Path: "/apisix/admin/global_rules/1",
+   Headers:  map[string]string{"Authorization": 
base.GetToken()},
+   ExpectStatus: http.StatusOK,
+   }),
+   )
+
+   var _ = DescribeTable("test global rule integration",
+   func(tc base.HttpTestCase) {
+   base.RunTestCase(tc)
+   },
+   Entry("create route", base.HttpTestCase{
+   Object: base.ManagerApiExpect(),
+   Method: http.MethodPut,
+   Path:   "/apisix/admin/routes/r1",
+   Body: `{
+   "name": "route1",
+   

[GitHub] [apisix] chzhuo commented on issue #4077: passive healthcheck not working after configuration changing

2021-11-11 Thread GitBox


chzhuo commented on issue #4077:
URL: https://github.com/apache/apisix/issues/4077#issuecomment-966808450


   @shuaijinchao You can reproduce in apisix by following step:
   1. add `log(self)` in 
https://github.com/api7/lua-resty-healthcheck/blob/master/lib/resty/healthcheck.lua#L1326
 
   2. add the first upstream with only active config
   3. add the second upstream with active and passive config
   4. assign route to the two upstream
   5. curl the route that assign to first upstream
   6. curl the route that assign to second upstream
   7. checking the passive `http_statues` from `log(self)` is correct
   
   notice: apisix won't start the health check when the upstream only has one 
node


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix-ingress-controller] tao12345666333 commented on pull request #745: feat: support environment variable in config file

2021-11-11 Thread GitBox


tao12345666333 commented on pull request #745:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/745#issuecomment-966805428


   Please resolve the conflicts, thanks!


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[apisix-ingress-controller] branch master updated (62b7162 -> 4a862e2)

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

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


from 62b7162  fix: wrong var type in response_rewrite e2e (#754)
 add 4a862e2  fix: use independent dns service for UDP e2e test (#753)

No new revisions were added by this update.

Summary of changes:
 test/e2e/ingress/stream.go   | 54 +---
 test/e2e/scaffold/ingress.go |  2 --
 test/e2e/scaffold/k8s.go | 30 
 3 files changed, 81 insertions(+), 5 deletions(-)


[GitHub] [apisix-ingress-controller] tao12345666333 commented on pull request #753: fix: use independent dns service for UDP e2e test

2021-11-11 Thread GitBox


tao12345666333 commented on pull request #753:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/753#issuecomment-966801280


   CI :green_circle: 


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix-ingress-controller] tao12345666333 merged pull request #753: fix: use independent dns service for UDP e2e test

2021-11-11 Thread GitBox


tao12345666333 merged pull request #753:
URL: https://github.com/apache/apisix-ingress-controller/pull/753


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix-ingress-controller] codecov-commenter edited a comment on pull request #753: fix: use independent dns service for UDP e2e test

2021-11-11 Thread GitBox


codecov-commenter edited a comment on pull request #753:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/753#issuecomment-966185018


   # 
[Codecov](https://codecov.io/gh/apache/apisix-ingress-controller/pull/753?src=pr=h1_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 Report
   > Merging 
[#753](https://codecov.io/gh/apache/apisix-ingress-controller/pull/753?src=pr=desc_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 (d4c5743) into 
[master](https://codecov.io/gh/apache/apisix-ingress-controller/commit/62b71628fb621a6625400e3ebc6847c21000d563?el=desc_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 (62b7162) will **increase** coverage by `0.01%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-ingress-controller/pull/753/graphs/tree.svg?width=650=150=pr=WPLQXPY3V0_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-ingress-controller/pull/753?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
   
   ```diff
   @@Coverage Diff @@
   ##   master #753  +/-   ##
   ==
   + Coverage   31.69%   31.70%   +0.01% 
   ==
 Files  65   66   +1 
 Lines6639 6640   +1 
   ==
   + Hits 2104 2105   +1 
 Misses   4280 4280  
 Partials  255  255  
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/apisix-ingress-controller/pull/753?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 | Coverage Δ | |
   |---|---|---|
   | 
[test/e2e/e2e.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/753/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-dGVzdC9lMmUvZTJlLmdv)
 | `100.00% <0.00%> (ø)` | |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-ingress-controller/pull/753?src=pr=continue_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-ingress-controller/pull/753?src=pr=footer_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation).
 Last update 
[62b7162...d4c5743](https://codecov.io/gh/apache/apisix-ingress-controller/pull/753?src=pr=lastupdated_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation).
 Read the [comment 
docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation).
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] chzhuo commented on issue #4077: passive healthcheck not working after configuration changing

2021-11-11 Thread GitBox


chzhuo commented on issue #4077:
URL: https://github.com/apache/apisix/issues/4077#issuecomment-966792347


   @shuaijinchao In you last screenshot, do you found out that the content of 
the global variable `defaults`  has been modifed?
   
   
![image](https://user-images.githubusercontent.com/10919124/141404089-4ae54b14-daef-40a6-8b78-ef4fbcf79959.png)
   
   This change will effect the other `upstream` to call `healthcheck.new()`


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[apisix] branch master updated: docs: remove duplicate Dubbo entry (#5483)

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 0570d59  docs: remove duplicate Dubbo entry (#5483)
0570d59 is described below

commit 0570d59fd0848a72a3341634ed7553476b0213f4
Author: 罗泽轩 
AuthorDate: Fri Nov 12 10:42:14 2021 +0800

docs: remove duplicate Dubbo entry (#5483)

Signed-off-by: spacewander 
---
 README.md| 1 -
 docs/zh/latest/README.md | 1 -
 2 files changed, 2 deletions(-)

diff --git a/README.md b/README.md
index 2e4c114..fea4087 100644
--- a/README.md
+++ b/README.md
@@ -77,7 +77,6 @@ A/B testing, canary release, blue-green deployment, limit 
rate, defense against
   - [gRPC transcoding](docs/en/latest/plugins/grpc-transcode.md): Supports 
protocol transcoding so that clients can access your gRPC API by using 
HTTP/JSON.
   - Proxy Websocket
   - Proxy Protocol
-  - Proxy Dubbo: Dubbo Proxy based on Tengine.
   - HTTP(S) Forward Proxy
   - [SSL](docs/en/latest/certificate.md): Dynamically load an SSL certificate.
 
diff --git a/docs/zh/latest/README.md b/docs/zh/latest/README.md
index c8ae97b..9164d0f 100644
--- a/docs/zh/latest/README.md
+++ b/docs/zh/latest/README.md
@@ -78,7 +78,6 @@ A/B 测试、金丝雀发布(灰度发布)、蓝绿部署、限流限速、抵
   - [gRPC 协议转换](plugins/grpc-transcode.md):支持协议的转换,这样客户端可以通过 HTTP/JSON 来访问你的 
gRPC API。
   - Websocket 代理
   - Proxy Protocol
-  - Dubbo 代理:基于 Tengine,可以实现 Dubbo 请求的代理。
   - HTTP(S) 反向代理
   - [SSL](certificate.md):动态加载 SSL 证书。
 


[GitHub] [apisix] moonming merged pull request #5483: docs: remove duplicate Dubbo entry

2021-11-11 Thread GitBox


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


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] moonming merged pull request #5486: docs: custom configuration for datadog plugin

2021-11-11 Thread GitBox


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


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[apisix] branch master updated: docs: custom configuration for datadog plugin (#5486)

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 4a57523  docs: custom configuration for datadog plugin (#5486)
4a57523 is described below

commit 4a57523627d9b3bbd96b1b2c20aa6689c0cc1877
Author: Bisakh 
AuthorDate: Fri Nov 12 08:11:37 2021 +0530

docs: custom configuration for datadog plugin (#5486)
---
 docs/en/latest/plugins/datadog.md | 28 
 1 file changed, 28 insertions(+)

diff --git a/docs/en/latest/plugins/datadog.md 
b/docs/en/latest/plugins/datadog.md
index 7842018..f99e9b5 100644
--- a/docs/en/latest/plugins/datadog.md
+++ b/docs/en/latest/plugins/datadog.md
@@ -30,6 +30,7 @@ title: datadog
 - [Exported Metrics](#exported-metrics)
 - [How To Enable](#how-to-enable)
 - [Disable Plugin](#disable-plugin)
+- [Custom Configuration](#custom-configuration)
 
 ## Name
 
@@ -129,3 +130,30 @@ $ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 
'X-API-KEY: edd1c9f034335f
 }
 }'
 ```
+
+## Custom Configuration
+
+In the default configuration, the plugin expects the dogstatsd service to be 
available at `127.0.0.1:8125`. If you wish to update the config, please update 
the plugin metadata. To know more about the fields of the datadog metadata, see 
[here](#metadata).
+
+Make a request to _/apisix/admin/plugin_metadata_ endpoint with the updated 
metadata as following:
+
+```shell
+$ curl http://127.0.0.1:9080/apisix/admin/plugin_metadata/datadog -H 
'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+{
+"host": "172.168.45.29",
+"port": 8126,
+"constant_tags": [
+"source:apisix",
+"service:custom"
+],
+"namespace": "apisix"
+}'
+```
+
+This HTTP PUT request will update the metadata and subsequent metrics will be 
pushed to the `172.168.45.29:8126` endpoint via UDP StatsD. Everything will be 
hot-loaded, there is no need to restart Apache APISIX instances.
+
+In case, if you wish to revert the datadog metadata schema to the default 
values, just make another PUT request to the same endpoint with an empty body. 
For example:
+
+```shell
+$ curl http://127.0.0.1:9080/apisix/admin/plugin_metadata/datadog -H 
'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '{}'
+```


[apisix] branch master updated: docs: fix borken link in `FAQ.md` (#5490)

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

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


The following commit(s) were added to refs/heads/master by this push:
 new b358db4  docs: fix borken link in `FAQ.md` (#5490)
b358db4 is described below

commit b358db4a1ad2872d56728ce7ef8a8579103dc159
Author: leslie <59061168+leslie-ts...@users.noreply.github.com>
AuthorDate: Fri Nov 12 10:41:12 2021 +0800

docs: fix borken link in `FAQ.md` (#5490)

Signed-off-by: leslie 
---
 docs/en/latest/FAQ.md | 2 +-
 docs/zh/latest/FAQ.md | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/docs/en/latest/FAQ.md b/docs/en/latest/FAQ.md
index 6dd2d62..8038b9c 100644
--- a/docs/en/latest/FAQ.md
+++ b/docs/en/latest/FAQ.md
@@ -59,7 +59,7 @@ For the configuration center, configuration storage is only 
the most basic funct
 4. Change Notification
 5. High Performance
 
-See more [etcd 
why](https://github.com/etcd-io/website/blob/master/content/en/docs/next/learning/why.md#comparison-chart).
+See more [etcd 
why](https://etcd.io/docs/latest/learning/why/#comparison-chart).
 
 ## Why is it that installing Apache APISIX dependencies with Luarocks causes 
timeout, slow or unsuccessful installation?
 
diff --git a/docs/zh/latest/FAQ.md b/docs/zh/latest/FAQ.md
index 5808f74..742a215 100644
--- a/docs/zh/latest/FAQ.md
+++ b/docs/zh/latest/FAQ.md
@@ -58,7 +58,7 @@ APISIX 是当前性能最好的 API 网关,单核 QPS 达到 2.3 万,平均
 4. 变化通知
 5. 高性能
 
-APISIX 需要一个配置中心,上面提到的很多功能是传统关系型数据库和 KV 数据库是无法提供的。与 etcd 同类软件还有 
Consul、ZooKeeper 等,更详细比较可以参考这里:[etcd 
why](https://github.com/etcd-io/website/blob/master/content/en/docs/next/learning/why.md#comparison-chart),在将来也许会支持其他配置存储方案。
+APISIX 需要一个配置中心,上面提到的很多功能是传统关系型数据库和 KV 数据库是无法提供的。与 etcd 同类软件还有 
Consul、ZooKeeper 等,更详细比较可以参考这里:[etcd 
why](https://etcd.io/docs/latest/learning/why/#comparison-chart),在将来也许会支持其他配置存储方案。
 
 ## 为什么在用 Luarocks 安装 APISIX 依赖时会遇到超时,很慢或者不成功的情况?
 


[GitHub] [apisix] moonming closed issue #5469: docs: Why use ETCD link is out of date

2021-11-11 Thread GitBox


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


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] moonming merged pull request #5490: docs: fix borken link in `FAQ.md`

2021-11-11 Thread GitBox


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


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix-ingress-controller] tao12345666333 commented on pull request #733: bug: Remove route timeout default value

2021-11-11 Thread GitBox


tao12345666333 commented on pull request #733:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/733#issuecomment-966773272


   hi #754  has been merged to fix e2e CI. Could you please merge from master?


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] windyrjc edited a comment on issue #5343: request help: kafka logger supports logging request body

2021-11-11 Thread GitBox


windyrjc edited a comment on issue #5343:
URL: https://github.com/apache/apisix/issues/5343#issuecomment-966758816


   > In practice, it is not a problem. The gzip filter runs after lua filter
   
   Other plugin like `response_rewrite` plugin will also change the response.So 
do you means I should change all the kafka-logger code to the `filter_by_lua` 
phase and set the kafka-logger priority after all the other plugin except gzip 
? 
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] windyrjc commented on issue #5343: request help: kafka logger supports logging request body

2021-11-11 Thread GitBox


windyrjc commented on issue #5343:
URL: https://github.com/apache/apisix/issues/5343#issuecomment-966758816


   > In practice, it is not a problem. The gzip filter runs after lua filter
   Other plugin like `response_rewrite` plugin will also change the response.So 
do you means I should change all the kafka-logger code to the `filter_by_lua` 
phase and set the kafka-logger priority after all the other plugin except gzip 
? 
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] shuaijinchao edited a comment on issue #5474: proposal: support google cloud logging service plugin

2021-11-11 Thread GitBox


shuaijinchao edited a comment on issue #5474:
URL: https://github.com/apache/apisix/issues/5474#issuecomment-965962436


   Name
    
   plugin name is: `google-logging`
   
   Configuration
   
   
   ```json
   {
   "auth_config": {
   "private_key": "***"
   "client_email": "***"
   "project_id": "***"
   "token_uri": "***"
   },
   "auth_file": "/path/to/google-service-account.json",
   "resource": {
   "type": "global"
   },
   "log_id": "cloudresourcemanager.googleapis.com%2Factivity",
   "batch_max_size": 200,
   "batch_timeout": 10,
   }
   ```
   
   - `auth_config`  the google service account 
config(Semi-optional, one of `auth_config` or `auth_file` must be configured)
   - `auth_config.private_key`  the private key parameters of the Google 
service account
   - `auth_config.client_email` the client email parameters of the Google 
service account
   - `auth_config.project_id`the project id parameters of the Google 
service account
   - `auth_config.token_uri`the token uri parameters of the Google service 
account
   - `auth_file`path to the google service account json 
file(Semi-optional, one of `auth_config` or `auth_file` must be configured)
   - `resource`the Google monitor resource, refer to: 
https://cloud.google.com/logging/docs/reference/v2/rest/v2/MonitoredResource
   - `log_id`  google logging id, refer to: 
https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry
   - `batch_max_size`   batch queue max number of bearer entries
   - `batch_timeout`   batch queue timeout of bearer entries
   
   
   Details
   
   
   1. Obtain and assemble request information in the APISIX Log phase
   2. To interact with google logging service for the first time, you need to 
request token information. After obtaining the token, it will be cached in the 
memory of the working node.
   3. After obtaining a valid token, put the request information into the batch 
processing queue. When the batch processing queue triggers the batch_max_size 
or batch_timeout threshold, the data in the queue is synchronized to the google 
cloud logging service
   4. Before each request is sent, check whether the token is about to time 
out, and refresh the token if it will time out.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] wu-sheng commented on a change in pull request #5478: feat: provide skywalking logger plugin

2021-11-11 Thread GitBox


wu-sheng commented on a change in pull request #5478:
URL: https://github.com/apache/apisix/pull/5478#discussion_r747928385



##
File path: docs/en/latest/plugins/skywalking-logger.md
##
@@ -0,0 +1,117 @@
+---
+title: skywalking-logger
+---
+
+
+
+## Summary
+
+- [**Name**](#name)
+- [**Attributes**](#attributes)
+- [**How To Enable**](#how-to-enable)
+- [**Test Plugin**](#test-plugin)
+- [**Metadata**](#metadata)
+- [**Disable Plugin**](#disable-plugin)
+
+## Name
+
+`skywalking-logger` is a plugin which push Access Log data to `SkyWalking OAP` 
server over HTTP.

Review comment:
   ```suggestion
   `skywalking-logger` is a plugin which push Access Log data to `SkyWalking 
OAP` server over HTTP. If there is tracing context existing, it sets up the 
trace-log correlation automatically, and relies on [SkyWalking Cross Process 
Propagation Headers 
Protocol](https://skywalking.apache.org/docs/main/latest/en/protocols/skywalking-cross-process-propagation-headers-protocol-v3/).
   ```




-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] leslie-tsang commented on issue #5417: bug: auto-generated apisix id is likely to be duplicated in containerized environments

2021-11-11 Thread GitBox


leslie-tsang commented on issue #5417:
URL: https://github.com/apache/apisix/issues/5417#issuecomment-966753779


   > @leslie-tsang Would you like to have a try? Thanks!
   
   Sure.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] dmsolr commented on a change in pull request #5478: feat: provide skywalking logger plugin

2021-11-11 Thread GitBox


dmsolr commented on a change in pull request #5478:
URL: https://github.com/apache/apisix/pull/5478#discussion_r747926580



##
File path: apisix/plugins/skywalking-logger.lua
##
@@ -0,0 +1,242 @@
+--
+-- 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 batch_processor = require("apisix.utils.batch-processor")
+local log_util= require("apisix.utils.log-util")
+local core= require("apisix.core")
+local http= require("resty.http")
+local url = require("net.url")
+local plugin  = require("apisix.plugin")
+
+local base64  = require("ngx.base64")
+local ngx_re  = require("ngx.re")
+
+local ngx  = ngx
+local tostring = tostring
+local tonumber = tonumber
+local ipairs   = ipairs
+local timer_at = ngx.timer.at
+
+local plugin_name = "skywalking-logger"
+local stale_timer_running = false
+local buffers = {}
+
+local schema = {
+type = "object",
+properties = {
+endpoint_addr = core.schema.uri_def,
+service_name = {type = "string", default = "APISIX"},
+service_instance_name = {type = "string", default = "APISIX Instance 
Name"},
+timeout = {type = "integer", minimum = 1, default = 3},
+name = {type = "string", default = "skywalking logger"},
+max_retry_count = {type = "integer", minimum = 0, default = 0},
+retry_delay = {type = "integer", minimum = 0, default = 1},
+buffer_duration = {type = "integer", minimum = 1, default = 60},
+inactive_timeout = {type = "integer", minimum = 1, default = 5},
+batch_max_size = {type = "integer", minimum = 1, default = 1000},
+include_req_body = {type = "boolean", default = false},
+},
+required = {"endpoint_addr"},
+}
+
+
+local metadata_schema = {
+type = "object",
+properties = {
+log_format = log_util.metadata_schema_log_format,
+},
+}
+
+
+local _M = {
+version = 0.1,
+priority = 408,
+name = plugin_name,
+schema = schema,
+metadata_schema = metadata_schema,
+}
+
+
+function _M.check_schema(conf, schema_type)
+if schema_type == core.schema.TYPE_METADATA then
+return core.schema.check(metadata_schema, conf)
+end
+return core.schema.check(schema, conf)
+end
+
+
+local function send_http_data(conf, log_message)
+local err_msg
+local res = true
+local url_decoded = url.parse(conf.endpoint_addr)
+local host = url_decoded.host
+local port = url_decoded.port
+
+core.log.info("sending a batch logs to ", conf.endpoint_addr)
+
+local httpc = http.new()
+httpc:set_timeout(conf.timeout * 1000)
+local ok, err = httpc:connect(host, port)
+
+if not ok then
+return false, "failed to connect to host[" .. host .. "] port["
+.. tostring(port) .. "] " .. err
+end
+
+local httpc_res, httpc_err = httpc:request({
+method = "POST",
+path = "/v3/logs",
+body = log_message,
+headers = {
+["Host"] = url_decoded.host,
+["Content-Type"] = "application/json",
+}
+})
+
+if not httpc_res then
+return false, "error while sending data to [" .. host .. "] port["
+.. tostring(port) .. "] " .. httpc_err
+end
+
+-- some error occurred in the server
+if httpc_res.status >= 400 then
+res =  false
+err_msg = "server returned status code[" .. httpc_res.status .. "] 
host["
+.. host .. "] port[" .. tostring(port) .. "] "
+.. "body[" .. httpc_res:read_body() .. "]"
+end
+
+return res, err_msg
+end
+
+
+-- remove stale objects from the memory after timer expires
+local function remove_stale_objects(premature)
+if premature then
+return
+end
+
+for key, batch in ipairs(buffers) do
+if #batch.entry_buffer.entries == 0 and #batch.batch_to_process == 0 
then
+core.log.warn("removing batch processor stale object, conf: ",
+  core.json.delay_encode(key))
+buffers[key] = nil
+end
+end
+
+stale_timer_running = false
+end
+
+
+function _M.log(conf, ctx)
+local metadata = plugin.plugin_metadata(plugin_name)
+

[GitHub] [apisix] dmsolr commented on a change in pull request #5478: feat: provide skywalking logger plugin

2021-11-11 Thread GitBox


dmsolr commented on a change in pull request #5478:
URL: https://github.com/apache/apisix/pull/5478#discussion_r747926130



##
File path: apisix/plugins/skywalking-logger.lua
##
@@ -0,0 +1,242 @@
+--
+-- 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 batch_processor = require("apisix.utils.batch-processor")
+local log_util= require("apisix.utils.log-util")
+local core= require("apisix.core")
+local http= require("resty.http")
+local url = require("net.url")
+local plugin  = require("apisix.plugin")
+
+local base64  = require("ngx.base64")
+local ngx_re  = require("ngx.re")
+
+local ngx  = ngx
+local tostring = tostring
+local tonumber = tonumber
+local ipairs   = ipairs
+local timer_at = ngx.timer.at
+
+local plugin_name = "skywalking-logger"
+local stale_timer_running = false
+local buffers = {}
+
+local schema = {
+type = "object",
+properties = {
+endpoint_addr = core.schema.uri_def,
+service_name = {type = "string", default = "APISIX"},
+service_instance_name = {type = "string", default = "APISIX Instance 
Name"},
+timeout = {type = "integer", minimum = 1, default = 3},
+name = {type = "string", default = "skywalking logger"},
+max_retry_count = {type = "integer", minimum = 0, default = 0},
+retry_delay = {type = "integer", minimum = 0, default = 1},
+buffer_duration = {type = "integer", minimum = 1, default = 60},
+inactive_timeout = {type = "integer", minimum = 1, default = 5},
+batch_max_size = {type = "integer", minimum = 1, default = 1000},
+include_req_body = {type = "boolean", default = false},
+},
+required = {"endpoint_addr"},
+}
+
+
+local metadata_schema = {
+type = "object",
+properties = {
+log_format = log_util.metadata_schema_log_format,
+},
+}
+
+
+local _M = {
+version = 0.1,
+priority = 408,
+name = plugin_name,
+schema = schema,
+metadata_schema = metadata_schema,
+}
+
+
+function _M.check_schema(conf, schema_type)
+if schema_type == core.schema.TYPE_METADATA then
+return core.schema.check(metadata_schema, conf)
+end
+return core.schema.check(schema, conf)
+end
+
+
+local function send_http_data(conf, log_message)
+local err_msg
+local res = true
+local url_decoded = url.parse(conf.endpoint_addr)
+local host = url_decoded.host
+local port = url_decoded.port
+
+core.log.info("sending a batch logs to ", conf.endpoint_addr)
+
+local httpc = http.new()
+httpc:set_timeout(conf.timeout * 1000)
+local ok, err = httpc:connect(host, port)
+
+if not ok then
+return false, "failed to connect to host[" .. host .. "] port["
+.. tostring(port) .. "] " .. err
+end
+
+local httpc_res, httpc_err = httpc:request({
+method = "POST",
+path = "/v3/logs",
+body = log_message,
+headers = {
+["Host"] = url_decoded.host,
+["Content-Type"] = "application/json",
+}
+})
+
+if not httpc_res then
+return false, "error while sending data to [" .. host .. "] port["
+.. tostring(port) .. "] " .. httpc_err
+end
+
+-- some error occurred in the server
+if httpc_res.status >= 400 then
+res =  false
+err_msg = "server returned status code[" .. httpc_res.status .. "] 
host["
+.. host .. "] port[" .. tostring(port) .. "] "
+.. "body[" .. httpc_res:read_body() .. "]"
+end
+
+return res, err_msg
+end
+
+
+-- remove stale objects from the memory after timer expires
+local function remove_stale_objects(premature)
+if premature then
+return
+end
+
+for key, batch in ipairs(buffers) do
+if #batch.entry_buffer.entries == 0 and #batch.batch_to_process == 0 
then
+core.log.warn("removing batch processor stale object, conf: ",
+  core.json.delay_encode(key))
+buffers[key] = nil
+end
+end
+
+stale_timer_running = false
+end
+
+
+function _M.log(conf, ctx)
+local metadata = plugin.plugin_metadata(plugin_name)
+

[GitHub] [apisix-ingress-controller] tokers commented on a change in pull request #726: feat: add externalname support for upstream

2021-11-11 Thread GitBox


tokers commented on a change in pull request #726:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/726#discussion_r747925062



##
File path: pkg/kube/apisix/apis/config/v1/types.go
##
@@ -23,6 +23,15 @@ import (

"github.com/apache/apisix-ingress-controller/pkg/kube/apisix/apis/config/v2alpha1"
 )
 
+const (
+   // UseOriginalClientHost means host option set to "pass" for the 
upstream
+   UseOriginalClientHost = "useOriginalClientHost"

Review comment:
   As per the Kubernetes convention, the value should be in upper camel 
case. Like values of `ImagePullPolicy`: `Always`, `Never`, `IfNotPresent`.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix-ingress-controller] tao12345666333 commented on pull request #753: fix: use independent dns service for UDP e2e test

2021-11-11 Thread GitBox


tao12345666333 commented on pull request #753:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/753#issuecomment-966749853


   @nic-6443 #754 has been merged. Can you please rebase the code? Then e2e can 
pass.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] spacewander commented on issue #5343: request help: kafka logger supports logging request body

2021-11-11 Thread GitBox


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


   > it may cause performance issue
   
   Yes. The log of body is expensive. So we should only log it if need.
   
   > Other phase like filter_by_lua may rewrite request and response by other 
plugin.
   
   In practice, it is not a problem. The gzip filter runs after lua filter, so 
there is no way to log the gzipped response body in the Lua. However, very few 
people want to log the gzipped body instead of the original one. If people need 
a 100% real body sent to the client, they should do it in another proxy or a 
traffic capture sidecar.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix-ingress-controller] tao12345666333 merged pull request #754: fix: wrong var type in response_rewrite e2e

2021-11-11 Thread GitBox


tao12345666333 merged pull request #754:
URL: https://github.com/apache/apisix-ingress-controller/pull/754


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[apisix-ingress-controller] branch master updated: fix: wrong var type in response_rewrite e2e (#754)

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 62b7162  fix: wrong var type in response_rewrite e2e (#754)
62b7162 is described below

commit 62b71628fb621a6625400e3ebc6847c21000d563
Author: Nic 
AuthorDate: Fri Nov 12 09:38:54 2021 +0800

fix: wrong var type in response_rewrite e2e (#754)
---
 test/e2e/plugins/response_rewrite.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/e2e/plugins/response_rewrite.go 
b/test/e2e/plugins/response_rewrite.go
index e44ac19..2047e4e 100644
--- a/test/e2e/plugins/response_rewrite.go
+++ b/test/e2e/plugins/response_rewrite.go
@@ -182,7 +182,7 @@ spec:
  location: https://a.com/b/c
  x-changed-by: apisix
vars:
-   - ["status", "==", "200"]
+   - ["status", "==", 200]
 `, backendSvc, backendPorts[0])
 
assert.Nil(ginkgo.GinkgoT(), s.CreateResourceFromString(ar))


[GitHub] [apisix-ingress-controller] codecov-commenter edited a comment on pull request #754: fix: wrong var type in response_rewrite e2e

2021-11-11 Thread GitBox


codecov-commenter edited a comment on pull request #754:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/754#issuecomment-966229909


   # 
[Codecov](https://codecov.io/gh/apache/apisix-ingress-controller/pull/754?src=pr=h1_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 Report
   > Merging 
[#754](https://codecov.io/gh/apache/apisix-ingress-controller/pull/754?src=pr=desc_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 (e2b0e9d) into 
[master](https://codecov.io/gh/apache/apisix-ingress-controller/commit/da30386c9a4335a82723b46fe7b1342bf0f42867?el=desc_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 (da30386) will **increase** coverage by `0.01%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-ingress-controller/pull/754/graphs/tree.svg?width=650=150=pr=WPLQXPY3V0_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-ingress-controller/pull/754?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
   
   ```diff
   @@Coverage Diff @@
   ##   master #754  +/-   ##
   ==
   + Coverage   31.69%   31.70%   +0.01% 
   ==
 Files  65   66   +1 
 Lines6639 6640   +1 
   ==
   + Hits 2104 2105   +1 
 Misses   4280 4280  
 Partials  255  255  
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/apisix-ingress-controller/pull/754?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 | Coverage Δ | |
   |---|---|---|
   | 
[test/e2e/e2e.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/754/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-dGVzdC9lMmUvZTJlLmdv)
 | `100.00% <0.00%> (ø)` | |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-ingress-controller/pull/754?src=pr=continue_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-ingress-controller/pull/754?src=pr=footer_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation).
 Last update 
[da30386...e2b0e9d](https://codecov.io/gh/apache/apisix-ingress-controller/pull/754?src=pr=lastupdated_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation).
 Read the [comment 
docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation).
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] tzssangglass commented on issue #5343: request help: kafka logger supports logging request body

2021-11-11 Thread GitBox


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


   get request body in `access_by_lua` phase, and get response body in 
`log_by_lua` phase?


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] tokers edited a comment on issue #5485: Proposal: support Apache OpenWhisk serverless framework plugin

2021-11-11 Thread GitBox


tokers edited a comment on issue #5485:
URL: https://github.com/apache/apisix/issues/5485#issuecomment-966746639


   > at the end of the day, we need to handle framework-specific authorization
   
   That makes sense. It would be tough to change the upstream core logic to 
adjust these platforms' authentication. Now I prefer to implement it to a 
plugin. (Note why I have such an idea is that the Amazon API Gateway supports 
using its Lambda function as an integration (backend)).
   
   However, it's my understanding that these FaaS plugins will have some common 
characteristics so that we may encapsulate these codes and reuse them in each 
of these plugins. @bisakhmondal @bzp2010 


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] tokers edited a comment on issue #5485: Proposal: support Apache OpenWhisk serverless framework plugin

2021-11-11 Thread GitBox


tokers edited a comment on issue #5485:
URL: https://github.com/apache/apisix/issues/5485#issuecomment-966746639


   > at the end of the day, we need to handle framework-specific authorization
   
   That makes sense. It would be tough to change the upstream core logic to 
adjust these platforms' authentication. Now I prefer to implement it to a 
plugin. (Note why I have such an idea is that the Amazon API Gateway supports 
its Lambda function as an integration (backend)).
   
   However, it's my understanding that these FaaS plugins will have some common 
characteristics so that we may encapsulate these codes and reuse them in each 
of these plugins. @bisakhmondal @bzp2010 


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] tokers edited a comment on issue #5485: Proposal: support Apache OpenWhisk serverless framework plugin

2021-11-11 Thread GitBox


tokers edited a comment on issue #5485:
URL: https://github.com/apache/apisix/issues/5485#issuecomment-966746639


   > at the end of the day, we need to handle framework-specific authorization
   That makes sense. It would be tough to change the upstream core logic to 
adjust these platforms' authentication. Now I prefer to implement it to a 
plugin. (Note why I have such an idea is that the Amazon API Gateway supports 
its Lambda function as an integration (backend)).
   
   However, it's my understanding that these FaaS plugins will have some common 
characteristics so that we may encapsulate these codes and reuse them in each 
of these plugins. @bisakhmondal @bzp2010 


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] tokers commented on issue #5485: Proposal: support Apache OpenWhisk serverless framework plugin

2021-11-11 Thread GitBox


tokers commented on issue #5485:
URL: https://github.com/apache/apisix/issues/5485#issuecomment-966746639


   > at the end of the day, we need to handle framework-specific authorization
   That makes sense. It would be tough to change the upstream core logic to 
adjust these platforms' authentication. Now I prefer to implement it to a 
plugin. (Note why I have such an idea is that the Amazon API Gateway supports 
its Lambda function as an integration (backend)).
   
   However, it's my understanding that these FaaS plugins will have some common 
characteristics so that we may reuse them in each of these plugins. 
@bisakhmondal @bzp2010 


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] spacewander commented on a change in pull request #5478: feat: provide skywalking logger plugin

2021-11-11 Thread GitBox


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



##
File path: apisix/plugins/skywalking-logger.lua
##
@@ -0,0 +1,242 @@
+--
+-- 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 batch_processor = require("apisix.utils.batch-processor")
+local log_util= require("apisix.utils.log-util")
+local core= require("apisix.core")
+local http= require("resty.http")
+local url = require("net.url")
+local plugin  = require("apisix.plugin")
+
+local base64  = require("ngx.base64")
+local ngx_re  = require("ngx.re")
+
+local ngx  = ngx
+local tostring = tostring
+local tonumber = tonumber
+local ipairs   = ipairs
+local timer_at = ngx.timer.at
+
+local plugin_name = "skywalking-logger"
+local stale_timer_running = false
+local buffers = {}
+
+local schema = {
+type = "object",
+properties = {
+endpoint_addr = core.schema.uri_def,
+service_name = {type = "string", default = "APISIX"},
+service_instance_name = {type = "string", default = "APISIX Instance 
Name"},
+timeout = {type = "integer", minimum = 1, default = 3},
+name = {type = "string", default = "skywalking logger"},
+max_retry_count = {type = "integer", minimum = 0, default = 0},
+retry_delay = {type = "integer", minimum = 0, default = 1},
+buffer_duration = {type = "integer", minimum = 1, default = 60},
+inactive_timeout = {type = "integer", minimum = 1, default = 5},
+batch_max_size = {type = "integer", minimum = 1, default = 1000},
+include_req_body = {type = "boolean", default = false},
+},
+required = {"endpoint_addr"},
+}
+
+
+local metadata_schema = {
+type = "object",
+properties = {
+log_format = log_util.metadata_schema_log_format,
+},
+}
+
+
+local _M = {
+version = 0.1,
+priority = 408,
+name = plugin_name,
+schema = schema,
+metadata_schema = metadata_schema,
+}
+
+
+function _M.check_schema(conf, schema_type)
+if schema_type == core.schema.TYPE_METADATA then
+return core.schema.check(metadata_schema, conf)
+end
+return core.schema.check(schema, conf)
+end
+
+
+local function send_http_data(conf, log_message)
+local err_msg
+local res = true
+local url_decoded = url.parse(conf.endpoint_addr)
+local host = url_decoded.host
+local port = url_decoded.port
+
+core.log.info("sending a batch logs to ", conf.endpoint_addr)
+
+local httpc = http.new()
+httpc:set_timeout(conf.timeout * 1000)
+local ok, err = httpc:connect(host, port)
+
+if not ok then
+return false, "failed to connect to host[" .. host .. "] port["
+.. tostring(port) .. "] " .. err
+end
+
+local httpc_res, httpc_err = httpc:request({
+method = "POST",
+path = "/v3/logs",
+body = log_message,
+headers = {
+["Host"] = url_decoded.host,
+["Content-Type"] = "application/json",
+}
+})
+
+if not httpc_res then
+return false, "error while sending data to [" .. host .. "] port["
+.. tostring(port) .. "] " .. httpc_err
+end
+
+-- some error occurred in the server
+if httpc_res.status >= 400 then
+res =  false
+err_msg = "server returned status code[" .. httpc_res.status .. "] 
host["
+.. host .. "] port[" .. tostring(port) .. "] "
+.. "body[" .. httpc_res:read_body() .. "]"
+end
+
+return res, err_msg
+end
+
+
+-- remove stale objects from the memory after timer expires
+local function remove_stale_objects(premature)
+if premature then
+return
+end
+
+for key, batch in ipairs(buffers) do
+if #batch.entry_buffer.entries == 0 and #batch.batch_to_process == 0 
then
+core.log.warn("removing batch processor stale object, conf: ",
+  core.json.delay_encode(key))
+buffers[key] = nil
+end
+end
+
+stale_timer_running = false
+end
+
+
+function _M.log(conf, ctx)
+local metadata = plugin.plugin_metadata(plugin_name)
+  

[GitHub] [apisix-ingress-controller] tao12345666333 commented on pull request #747: docs: Customize the namespace used for installation

2021-11-11 Thread GitBox


tao12345666333 commented on pull request #747:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/747#issuecomment-966746122


   ping @gxthrj  @lingsamuel  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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] spacewander commented on issue #5417: bug: auto-generated apisix id is likely to be duplicated in containerized environments

2021-11-11 Thread GitBox


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


   @leslie-tsang 
   Would you like to have a try? Thanks!


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] sandy420 commented on pull request #5462: fix(upstream): load imbalance when it's referred by multiple routes

2021-11-11 Thread GitBox


sandy420 commented on pull request #5462:
URL: https://github.com/apache/apisix/pull/5462#issuecomment-966737576


   Thanks to contributors, the problem of uneven load has been solved!
   
![3(YM1QV20OF{KGB`B5B61EW](https://user-images.githubusercontent.com/10955441/141391436-9b3b5052-c711-4d1a-8032-7752da47b3a0.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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] leslie-tsang opened a new pull request #5490: docs: fix borken link in `FAQ.md`

2021-11-11 Thread GitBox


leslie-tsang opened a new pull request #5490:
URL: https://github.com/apache/apisix/pull/5490


   Signed-off-by: leslie 
   
   ### What this PR does / why we need it:
   
   
   Ref to #5469 
   ### Pre-submission checklist:
   
   
   
   * [x] 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?
   * [x] Is this PR backward compatible? **If it is not backward compatible, 
please discuss on the [mailing 
list](https://github.com/apache/apisix/tree/master#community) first**
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] fbartels commented on a change in pull request #5449: feat(oidc): make it possible to validate tokens against provider host…

2021-11-11 Thread GitBox


fbartels commented on a change in pull request #5449:
URL: https://github.com/apache/apisix/pull/5449#discussion_r747627520



##
File path: t/plugin/openid-connect.t
##
@@ -1487,3 +1487,140 @@ GET /t
 
{"access_token_in_authorization_header":false,"bearer_only":false,"client_id":"kbyuFDidLLm280LIwVFiazOqjO3ty8KH","client_secret":"60Op4HFM0I8ajz0WdiStAbziZ-VFQttXuxixHHs2R7r7-CW8GR79l-mmLqMhc-Sa","discovery":"http://127.0.0.1:1980/.well-known/openid-configuration","introspection_endpoint_auth_method":"client_secret_basic","logout_path":"/logout","realm":"apisix","scope":"openid","set_access_token_header":true,"set_id_token_header":true,"set_userinfo_header":true,"ssl_verify":false,"timeout":3}
 --- no_error_log
 [error]
+
+
+
+=== TEST 25: Update plugin with ID provider jwks endpoint for token 
verification.
+--- config
+location /t {
+content_by_lua_block {
+local t = require("lib.test_admin").test
+local code, body = t('/apisix/admin/routes/1',
+ ngx.HTTP_PUT,
+ [[{ "plugins": {
+"openid-connect": {
+"client_id": 
"kbyuFDidLLm280LIwVFiazOqjO3ty8KH",
+"client_secret": 
"60Op4HFM0I8ajz0WdiStAbziZ-VFQttXuxixHHs2R7r7-CW8GR79l-mmLqMhc-Sa",
+"discovery": 
"https://samples.auth0.com/.well-known/openid-configuration;,
+"redirect_uri": "https://iresty.com;,
+"ssl_verify": false,
+"timeout": 10,
+"bearer_only": true,
+"scope": "apisix",
+"use_jwks": true,
+"token_signing_alg_values_expected": "RS256"
+}
+},
+"upstream": {
+"nodes": {
+"127.0.0.1:1980": 1
+},
+"type": "roundrobin"
+},
+"uri": "/hello"
+}]],
+[[{ "node": {
+"value": {
+"plugins": {
+"openid-connect": {
+"client_id": 
"kbyuFDidLLm280LIwVFiazOqjO3ty8KH",
+"client_secret": 
"60Op4HFM0I8ajz0WdiStAbziZ-VFQttXuxixHHs2R7r7-CW8GR79l-mmLqMhc-Sa",
+"discovery": 
"https://samples.auth0.com/.well-known/openid-configuration;,
+"redirect_uri": "https://iresty.com;,
+"ssl_verify": false,
+"timeout": 10,
+"bearer_only": true,
+"scope": "apisix",
+"use_jwks": true,
+"token_signing_alg_values_expected": 
"RS256"
+}
+},
+"upstream": {
+"nodes": {
+"127.0.0.1:1980": 1
+},
+"type": "roundrobin"
+},
+"uri": "/hello"
+},
+"key": "/apisix/routes/1"
+},
+"action": "set"
+}]]
+)
+
+if code >= 300 then
+ngx.status = code
+end
+ngx.say(body)
+}
+}
+--- request
+GET /t
+--- response_body
+passed
+--- no_error_log
+[error]
+
+
+
+=== TEST 26: Access route with valid token.

Review comment:
   Ahm. yes indeed. I checked the tokens that are already part of the test 
suite, but sadly none of them have a kid (key id) in its header. I have 
searched on the auth0 webpage for matching example tokens, but could not find 
one.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] bisakhmondal commented on issue #5485: Proposal: support Apache OpenWhisk serverless framework plugin

2021-11-11 Thread GitBox


bisakhmondal commented on issue #5485:
URL: https://github.com/apache/apisix/issues/5485#issuecomment-966400503


   > So the request is terminated by APISIX and won't be proxied to the 
upstream, if we use this plugin?
   
   Yes, @tokers, the serverless function URI will be treated as a new upstream. 
Is there any use cases when we need both conventional upstream and serverless 
functions as upstream-duo?
   
   > Is it more suitable to extend the Upstream so that these serverless 
platforms can be supported as the standard backends.
   
   The idea is really good. But I am not sure considering this massive 
refactoring if the benefits that come after that would be a good tradeoff. 
Because, at the end of the day, we need to handle framework-specific 
authorization. That's where we again have to introduce plugins. They not only 
vary in header names for authorization but also some of the providers support 
complex authz techniques such as (aws key-secret pair, IAM role-based authz 
etc). So I think we can't abstract this plugin requirement into a single entity.
   
   Let me know what do you think, definitely it's going to be a good discussion 
: )
   Thanks!


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] dmsolr commented on a change in pull request #5478: feat: provide skywalking logger plugin

2021-11-11 Thread GitBox


dmsolr commented on a change in pull request #5478:
URL: https://github.com/apache/apisix/pull/5478#discussion_r747584069



##
File path: docs/en/latest/plugins/skywalking-logger.md
##
@@ -0,0 +1,117 @@
+---
+title: http-logger

Review comment:
   fixed

##
File path: t/plugin/skywalking-logger.t
##
@@ -0,0 +1,285 @@
+#
+# 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';
+
+log_level('debug');
+repeat_each(1);
+no_long_string();
+no_root_location();
+
+add_block_preprocessor(sub {
+my ($block) = @_;
+
+my $http_config = $block->http_config // <<_EOC_;
+
+server {
+listen 1986;
+server_tokens off;
+
+location /v3/logs {
+content_by_lua_block {
+local core = require("apisix.core")
+
+core.log.warn(core.json.encode(core.request.get_body(), true))
+}
+}
+}
+_EOC_
+
+$block->set_value("http_config", $http_config);

Review comment:
   updated




-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] bisakhmondal commented on a change in pull request #5486: docs: custom configuration for datadog plugin

2021-11-11 Thread GitBox


bisakhmondal commented on a change in pull request #5486:
URL: https://github.com/apache/apisix/pull/5486#discussion_r747562078



##
File path: docs/en/latest/plugins/datadog.md
##
@@ -129,3 +130,30 @@ $ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 
'X-API-KEY: edd1c9f034335f
 }
 }'
 ```
+
+## Custom Conguration

Review comment:
   Thanks!




-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] bzp2010 edited a comment on issue #5485: Proposal: support Apache OpenWhisk serverless framework plugin

2021-11-11 Thread GitBox


bzp2010 edited a comment on issue #5485:
URL: https://github.com/apache/apisix/issues/5485#issuecomment-966340865






-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] bzp2010 edited a comment on issue #5485: Proposal: support Apache OpenWhisk serverless framework plugin

2021-11-11 Thread GitBox


bzp2010 edited a comment on issue #5485:
URL: https://github.com/apache/apisix/issues/5485#issuecomment-966340865


   > Is it more suitable to extend the Upstream so that these serverless 
platforms can be supported as the standard backends.
   
   @tokers I think it's a good idea. But it involves changes to the APISIX core 
data entity and functions, so its scheme needs further discussion, do you have 
any good suggestions for this?
   
   Currently @bisakhmondal is working on a similar plugin `azure-serverless` 
development, do you have any ideas?
   
   cc @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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] bzp2010 edited a comment on issue #5485: Proposal: support Apache OpenWhisk serverless framework plugin

2021-11-11 Thread GitBox


bzp2010 edited a comment on issue #5485:
URL: https://github.com/apache/apisix/issues/5485#issuecomment-966340865


   > Is it more suitable to extend the Upstream so that these serverless 
platforms can be supported as the standard backends.
   
   @tokers I think it's a good idea. But it involves changes to the APISIX core 
data entity and functions, so its scheme needs further discussion, do you have 
any good suggestions for this?
   
   cc @spacewander @membphis @bisakhmondal 


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] bzp2010 commented on issue #5485: Proposal: support Apache OpenWhisk serverless framework plugin

2021-11-11 Thread GitBox


bzp2010 commented on issue #5485:
URL: https://github.com/apache/apisix/issues/5485#issuecomment-966340865


   > Is it more suitable to extend the Upstream so that these serverless 
platforms can be supported as the standard backends.
   
   I think it's a good idea. But it involves changes to the APISIX core data 
entity, so its scheme needs further discussion, do you have any good 
suggestions for this?
   
   cc @spacewander @membphis @bisakhmondal 


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] juzhiyuan commented on a change in pull request #5486: docs: custom configuration for datadog plugin

2021-11-11 Thread GitBox


juzhiyuan commented on a change in pull request #5486:
URL: https://github.com/apache/apisix/pull/5486#discussion_r747504578



##
File path: docs/en/latest/plugins/datadog.md
##
@@ -129,3 +130,30 @@ $ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 
'X-API-KEY: edd1c9f034335f
 }
 }'
 ```
+
+## Custom Conguration

Review comment:
   ```suggestion
   ## Custom Configuration
   ```




-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] lishaoshu1240 commented on issue #5484: docker install api-gateway faild.

2021-11-11 Thread GitBox


lishaoshu1240 commented on issue #5484:
URL: https://github.com/apache/apisix/issues/5484#issuecomment-966240307


   @tokers  I have checke the directory exist.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix-ingress-controller] codecov-commenter commented on pull request #754: fix: wrong var type in response_rewrite e2e

2021-11-11 Thread GitBox


codecov-commenter commented on pull request #754:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/754#issuecomment-966229909


   # 
[Codecov](https://codecov.io/gh/apache/apisix-ingress-controller/pull/754?src=pr=h1_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 Report
   > Merging 
[#754](https://codecov.io/gh/apache/apisix-ingress-controller/pull/754?src=pr=desc_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 (e2b0e9d) into 
[master](https://codecov.io/gh/apache/apisix-ingress-controller/commit/da30386c9a4335a82723b46fe7b1342bf0f42867?el=desc_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 (da30386) will **increase** coverage by `68.30%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-ingress-controller/pull/754/graphs/tree.svg?width=650=150=pr=WPLQXPY3V0_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-ingress-controller/pull/754?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
   
   ```diff
   @@ Coverage Diff  @@
   ##   master  #754   +/-   ##
   
   + Coverage   31.69%   100.00%   +68.30% 
   
 Files  65 1   -64 
 Lines6639 1 -6638 
   
   - Hits 2104 1 -2103 
   + Misses   4280 0 -4280 
   + Partials  255 0  -255 
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/apisix-ingress-controller/pull/754?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 | Coverage Δ | |
   |---|---|---|
   | 
[cmd/ingress/ingress.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/754/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-Y21kL2luZ3Jlc3MvaW5ncmVzcy5nbw==)
 | | |
   | 
[pkg/apisix/consumer.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/754/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-cGtnL2FwaXNpeC9jb25zdW1lci5nbw==)
 | | |
   | 
[pkg/kube/translation/annotations.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/754/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-cGtnL2t1YmUvdHJhbnNsYXRpb24vYW5ub3RhdGlvbnMuZ28=)
 | | |
   | 
[pkg/kube/translation/apisix\_route.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/754/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-cGtnL2t1YmUvdHJhbnNsYXRpb24vYXBpc2l4X3JvdXRlLmdv)
 | | |
   | 
[pkg/apisix/apisix.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/754/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-cGtnL2FwaXNpeC9hcGlzaXguZ28=)
 | | |
   | 
[pkg/ingress/manifest.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/754/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-cGtnL2luZ3Jlc3MvbWFuaWZlc3QuZ28=)
 | | |
   | 
[pkg/ingress/compare.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/754/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-cGtnL2luZ3Jlc3MvY29tcGFyZS5nbw==)
 | | |
   | 
[pkg/apisix/cluster.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/754/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-cGtnL2FwaXNpeC9jbHVzdGVyLmdv)
 | | |
   | 
[pkg/apisix/schema.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/754/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-cGtnL2FwaXNpeC9zY2hlbWEuZ28=)
 | | |
   | 
[pkg/api/router/router.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/754/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-cGtnL2FwaS9yb3V0ZXIvcm91dGVyLmdv)
 | | |
   | ... and [56 
more](https://codecov.io/gh/apache/apisix-ingress-controller/pull/754/diff?src=pr=tree-more_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 | |
   
   --
   
   

[GitHub] [apisix-ingress-controller] elvis-cai commented on a change in pull request #726: feat: add externalname support for upstream

2021-11-11 Thread GitBox


elvis-cai commented on a change in pull request #726:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/726#discussion_r747423428



##
File path: docs/en/latest/concepts/apisix_upstream.md
##
@@ -193,3 +193,33 @@ In the meanwhile, the ApisixUpstream `foo` sets `http` 
scheme for port `7000` an
 (all ports are the service port). But both ports shares the load balancer 
configuration.
 
 `PortLevelSettings` is not mandatory if the service only exposes one port but 
is useful when multiple ports are defined.
+
+### Http Host Rewrite Policy

Review comment:
   thanks for pointing out, rerun markdownlint and gofmt locally to fix the 
format 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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] yunfhu commented on issue #5357: request help: Could Apache APISIX process traffic control with tcp/ip protocol?

2021-11-11 Thread GitBox


yunfhu commented on issue #5357:
URL: https://github.com/apache/apisix/issues/5357#issuecomment-966224054


   > > > > Is apisix able process traffic control with tcp/ip protocol?
   > > > 
   > > > 
   > > > Yes, you can use the `limit-conn` plugin in the stream sub-system, see 
https://github.com/apache/apisix/blob/master/apisix/stream/plugins/limit-conn.lua.
   > > > However, it's not feasible to limit the bandwidth through APISIX 
stream plugins, you may have to write your own.
   > > 
   > > 
   > > thanks, the limit-conn plugin works well for tcp/ip,any other traffic 
control plugin for tcp/ip traffic?
   > 
   > If I remember correctly, currently, we can just use this.
   
   Ok,really appreciate 


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] wu-sheng commented on a change in pull request #5478: feat: provide skywalking logger plugin

2021-11-11 Thread GitBox


wu-sheng commented on a change in pull request #5478:
URL: https://github.com/apache/apisix/pull/5478#discussion_r747408864



##
File path: docs/en/latest/plugins/skywalking-logger.md
##
@@ -0,0 +1,117 @@
+---
+title: http-logger

Review comment:
   Is this the right title?




-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] dmsolr commented on a change in pull request #5478: feat: provide skywalking logger plugin

2021-11-11 Thread GitBox


dmsolr commented on a change in pull request #5478:
URL: https://github.com/apache/apisix/pull/5478#discussion_r747405003



##
File path: apisix/plugins/skywalking-logger.lua
##
@@ -0,0 +1,242 @@
+--
+-- 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 batch_processor = require("apisix.utils.batch-processor")
+local log_util= require("apisix.utils.log-util")
+local core= require("apisix.core")
+local http= require("resty.http")
+local url = require("net.url")
+local plugin  = require("apisix.plugin")
+
+local base64  = require("ngx.base64")
+local ngx_re  = require("ngx.re")
+
+local ngx  = ngx
+local tostring = tostring
+local tonumber = tonumber
+local ipairs   = ipairs
+local timer_at = ngx.timer.at
+
+local plugin_name = "skywalking-logger"
+local stale_timer_running = false
+local buffers = {}
+
+local schema = {
+type = "object",
+properties = {
+endpoint_addr = core.schema.uri_def,
+service_name = {type = "string", default = "APISIX"},
+service_instance_name = {type = "string", default = "APISIX Instance 
Name"},
+timeout = {type = "integer", minimum = 1, default = 3},
+name = {type = "string", default = "skywalking logger"},
+max_retry_count = {type = "integer", minimum = 0, default = 0},
+retry_delay = {type = "integer", minimum = 0, default = 1},
+buffer_duration = {type = "integer", minimum = 1, default = 60},
+inactive_timeout = {type = "integer", minimum = 1, default = 5},
+batch_max_size = {type = "integer", minimum = 1, default = 1000},
+include_req_body = {type = "boolean", default = false},
+},
+required = {"endpoint_addr"},
+}
+
+
+local metadata_schema = {
+type = "object",
+properties = {
+log_format = log_util.metadata_schema_log_format,
+},
+}
+
+
+local _M = {
+version = 0.1,
+priority = 408,
+name = plugin_name,
+schema = schema,
+metadata_schema = metadata_schema,
+}
+
+
+function _M.check_schema(conf, schema_type)
+if schema_type == core.schema.TYPE_METADATA then
+return core.schema.check(metadata_schema, conf)
+end
+return core.schema.check(schema, conf)
+end
+
+
+local function send_http_data(conf, log_message)
+local err_msg
+local res = true
+local url_decoded = url.parse(conf.endpoint_addr)
+local host = url_decoded.host
+local port = url_decoded.port
+
+core.log.info("sending a batch logs to ", conf.endpoint_addr)
+
+local httpc = http.new()
+httpc:set_timeout(conf.timeout * 1000)
+local ok, err = httpc:connect(host, port)
+
+if not ok then
+return false, "failed to connect to host[" .. host .. "] port["
+.. tostring(port) .. "] " .. err
+end
+
+local httpc_res, httpc_err = httpc:request({
+method = "POST",
+path = "/v3/logs",
+body = log_message,
+headers = {
+["Host"] = url_decoded.host,
+["Content-Type"] = "application/json",
+}
+})
+
+if not httpc_res then
+return false, "error while sending data to [" .. host .. "] port["
+.. tostring(port) .. "] " .. httpc_err
+end
+
+-- some error occurred in the server
+if httpc_res.status >= 400 then
+res =  false
+err_msg = "server returned status code[" .. httpc_res.status .. "] 
host["
+.. host .. "] port[" .. tostring(port) .. "] "
+.. "body[" .. httpc_res:read_body() .. "]"
+end
+
+return res, err_msg
+end
+
+
+-- remove stale objects from the memory after timer expires
+local function remove_stale_objects(premature)
+if premature then
+return
+end
+
+for key, batch in ipairs(buffers) do
+if #batch.entry_buffer.entries == 0 and #batch.batch_to_process == 0 
then
+core.log.warn("removing batch processor stale object, conf: ",
+  core.json.delay_encode(key))
+buffers[key] = nil
+end
+end
+
+stale_timer_running = false
+end
+
+
+function _M.log(conf, ctx)
+local metadata = plugin.plugin_metadata(plugin_name)
+

[GitHub] [apisix] shuaijinchao edited a comment on issue #5474: proposal: support google cloud logging service plugin

2021-11-11 Thread GitBox


shuaijinchao edited a comment on issue #5474:
URL: https://github.com/apache/apisix/issues/5474#issuecomment-965962436


   Name
    
   plugin name is: `google-logging`
   
   Configuration
   
   
   ```json
   {
   "auth_config": {
   "private_key": "***"
   "client_email": "***"
   "project_id": "***"
   "token_uri": "***"
   },
   "auth_file": "/path/to/google-service-account.json",
   "resource": {
   "type": "global"
   },
   "log_id": "cloudresourcemanager.googleapis.com%2Factivity",
   "batch_max_size": 200,
   "batch_max_size": 10,
   }
   ```
   
   - `auth_config`  the google service account 
config(Semi-optional, one of `auth_config` or `auth_file` must be configured)
   - `auth_config.private_key`  the private key parameters of the Google 
service account
   - `auth_config.client_email` the client email parameters of the Google 
service account
   - `auth_config.project_id`the project id parameters of the Google 
service account
   - `auth_config.token_uri`the token uri parameters of the Google service 
account
   - `auth_file`path to the google service account json 
file(Semi-optional, one of `auth_config` or `auth_file` must be configured)
   - `resource`the Google monitor resource, refer to: 
https://cloud.google.com/logging/docs/reference/v2/rest/v2/MonitoredResource
   - `log_id`  google logging id, refer to: 
https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry
   - `batch_max_size`   batch queue max number of bearer entries
   - `batch_timeout`   batch queue timeout of bearer entries
   
   
   Details
   
   
   1. Obtain and assemble request information in the APISIX Log phase
   2. To interact with google logging service for the first time, you need to 
request token information. After obtaining the token, it will be cached in the 
memory of the working node.
   3. After obtaining a valid token, put the request information into the batch 
processing queue. When the batch processing queue triggers the batch_max_size 
or batch_timeout threshold, the data in the queue is synchronized to the google 
cloud logging service
   4. Before each request is sent, check whether the token is about to time 
out, and refresh the token if it will time out.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #2204: chore: update setup script for e2e tests (ginkgo)

2021-11-11 Thread GitBox


codecov-commenter edited a comment on pull request #2204:
URL: https://github.com/apache/apisix-dashboard/pull/2204#issuecomment-966194766


   # 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2204?src=pr=h1_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 Report
   > Merging 
[#2204](https://codecov.io/gh/apache/apisix-dashboard/pull/2204?src=pr=desc_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 (168ef8a) into 
[master](https://codecov.io/gh/apache/apisix-dashboard/commit/ad7e3e79f47945c9ec7c042b46d48c3b2994a9fa?el=desc_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 (ad7e3e7) will **decrease** coverage by `2.75%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-dashboard/pull/2204/graphs/tree.svg?width=650=150=pr=Q1HERXN96P_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-dashboard/pull/2204?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
   
   ```diff
   @@Coverage Diff @@
   ##   master#2204  +/-   ##
   ==
   - Coverage   65.16%   62.40%   -2.76% 
   ==
 Files 184   57 -127 
 Lines7257 3905-3352 
 Branches  8240 -824 
   ==
   - Hits 4729 2437-2292 
   + Misses   2244 1185-1059 
   + Partials  284  283   -1 
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | backend-e2e-test | `44.63% <ø> (-0.21%)` | :arrow_down: |
   | backend-unit-test | `49.13% <ø> (ø)` | |
   | frontend-e2e-test | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click 
here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment)
 to find out more.
   
   | [Impacted 
Files](https://codecov.io/gh/apache/apisix-dashboard/pull/2204?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 | Coverage Δ | |
   |---|---|---|
   | 
[api/internal/core/server/server.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2204/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc2VydmVyL3NlcnZlci5nbw==)
 | `44.68% <0.00%> (-17.03%)` | :arrow_down: |
   | 
[web/src/libs/iconfont.js](https://codecov.io/gh/apache/apisix-dashboard/pull/2204/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9saWJzL2ljb25mb250Lmpz)
 | | |
   | 
[web/src/pages/Consumer/List.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2204/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9Db25zdW1lci9MaXN0LnRzeA==)
 | | |
   | 
[web/src/pages/Route/transform.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/2204/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS90cmFuc2Zvcm0udHM=)
 | | |
   | 
[web/src/components/Upstream/components/Scheme.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2204/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbXBvbmVudHMvU2NoZW1lLnRzeA==)
 | | |
   | 
[web/src/components/Plugin/UI/limit-conn.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2204/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1BsdWdpbi9VSS9saW1pdC1jb25uLnRzeA==)
 | | |
   | 
[web/src/components/Plugin/PluginPage.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2204/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1BsdWdpbi9QbHVnaW5QYWdlLnRzeA==)
 | | |
   | 
[web/src/pages/SSL/components/Step2/index.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2204/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9TU0wvY29tcG9uZW50cy9TdGVwMi9pbmRleC50c3g=)
 | | |
   | 

[GitHub] [apisix] zhukexingkong closed issue #5487: request help: APISIX TCP/UDP 动态代理中怎么使任意的客户端IP动态连接到不同tcp server

2021-11-11 Thread GitBox


zhukexingkong closed issue #5487:
URL: https://github.com/apache/apisix/issues/5487


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] zhukexingkong commented on issue #5487: request help: APISIX TCP/UDP 动态代理中怎么使任意的客户端IP动态连接到不同tcp server

2021-11-11 Thread GitBox


zhukexingkong commented on issue #5487:
URL: https://github.com/apache/apisix/issues/5487#issuecomment-966199922


   谢谢


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix-dashboard] codecov-commenter commented on pull request #2204: chore: update setup script for e2e tests (ginkgo)

2021-11-11 Thread GitBox


codecov-commenter commented on pull request #2204:
URL: https://github.com/apache/apisix-dashboard/pull/2204#issuecomment-966194766


   # 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2204?src=pr=h1_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 Report
   > Merging 
[#2204](https://codecov.io/gh/apache/apisix-dashboard/pull/2204?src=pr=desc_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 (168ef8a) into 
[master](https://codecov.io/gh/apache/apisix-dashboard/commit/ad7e3e79f47945c9ec7c042b46d48c3b2994a9fa?el=desc_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 (ad7e3e7) will **decrease** coverage by `16.03%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-dashboard/pull/2204/graphs/tree.svg?width=650=150=pr=Q1HERXN96P_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-dashboard/pull/2204?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
   
   ```diff
   @@ Coverage Diff @@
   ##   master#2204   +/-   ##
   ===
   - Coverage   65.16%   49.13%   -16.04% 
   ===
 Files 184   41  -143 
 Lines7257 3171 -4086 
 Branches  8240  -824 
   ===
   - Hits 4729 1558 -3171 
   + Misses   2244 1413  -831 
   + Partials  284  200   -84 
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | backend-e2e-test | `?` | |
   | backend-unit-test | `49.13% <ø> (ø)` | |
   | frontend-e2e-test | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click 
here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment)
 to find out more.
   
   | [Impacted 
Files](https://codecov.io/gh/apache/apisix-dashboard/pull/2204?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 | Coverage Δ | |
   |---|---|---|
   | 
[api/main.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2204/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-YXBpL21haW4uZ28=)
 | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | 
[api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2204/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=)
 | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | 
[api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2204/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv)
 | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | 
[api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2204/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv)
 | `0.00% <0.00%> (-70.00%)` | :arrow_down: |
   | 
[api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2204/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==)
 | `0.00% <0.00%> (-68.19%)` | :arrow_down: |
   | 
[api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2204/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=)
 | `0.00% <0.00%> (-58.52%)` | :arrow_down: |
   | 
[api/internal/utils/consts/api\_error.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2204/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL2NvbnN0cy9hcGlfZXJyb3IuZ28=)
 | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
   | 
[api/internal/handler/tool/tool.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2204/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvdG9vbC90b29sLmdv)
 | `60.00% <0.00%> (-40.00%)` | 

[GitHub] [apisix] shuaijinchao edited a comment on issue #4077: passive healthcheck not working after configuration changing

2021-11-11 Thread GitBox


shuaijinchao edited a comment on issue #4077:
URL: https://github.com/apache/apisix/issues/4077#issuecomment-966193860


   > > @Ben0625 Could you try the `2.5` version? And test it whether it can be 
reproduced in `2.5`?
   > 
   > We get the same problems on the apisix 2.8
   > 
   > I found a bug in 
[api7/lua-resty-healthcheck@`master`/lib/resty/healthcheck.lua](https://github.com/api7/lua-resty-healthcheck/blob/master/lib/resty/healthcheck.lua?rgh-link-date=2021-11-10T08%3A27%3A57Z)
 The content of var `defaults` will be modified when not assigned the passive 
or active config item
   > 
   > Reproduce the bug: nginx.conf
   > 
   > ```lua
   > daemon off;
   > worker_processes  1;
   > error_log stderr;
   > events {
   > worker_connections 1024;
   > }
   > http {
   > access_log off;
   > server {
   > listen 19000;
   > location / {
   > default_type text/html;
   > content_by_lua '
   > ngx.say("Hello, World!")
   > ';
   > log_by_lua '
   > local check = require("check")
   > ';
   > }
   > }
   > }
   > ```
   > 
   > check.lua
   > 
   > ```lua
   > local cjson = require("cjson.safe")
   > 
   > -- copy from: 
https://github.com/api7/lua-resty-healthcheck/blob/master/lib/resty/healthcheck.lua#L1162
   > 
--
   > -- Create health-checkers
   > 
--
   > 
   > 
   > local NO_DEFAULT = {}
   > local MAXNUM = 2^31 - 1
   > 
   > 
   > local function fail(ctx, k, msg)
   >   ctx[#ctx + 1] = k
   >   error(table.concat(ctx, ".") .. ": " .. msg, #ctx + 1)
   > end
   > 
   > 
   > local function fill_in_settings(opts, defaults, ctx)
   >   ctx = ctx or {}
   >   local obj = {}
   >   for k, default in pairs(defaults) do
   > local v = opts[k]
   > 
   > -- basic type-check of configuration
   > if default ~= NO_DEFAULT
   > and v ~= nil
   > and type(v) ~= type(default) then
   >   fail(ctx, k, "invalid value")
   > end
   > 
   > if v ~= nil then
   >   if type(v) == "table" then
   > if default[1] then -- do not recurse on arrays
   >   obj[k] = v
   > else
   >   ctx[#ctx + 1] = k
   >   obj[k] = fill_in_settings(v, default, ctx)
   >   ctx[#ctx + 1] = nil
   > end
   >   else
   > if type(v) == "number" and (v < 0 or v > MAXNUM) then
   >   fail(ctx, k, "must be between 0 and " .. MAXNUM)
   > end
   > obj[k] = v
   >   end
   > elseif default ~= NO_DEFAULT then
   >   obj[k] = default
   > end
   > 
   >   end
   >   return obj
   > end
   > 
   > 
   > local defaults = {
   >   name = NO_DEFAULT,
   >   shm_name = NO_DEFAULT,
   >   type = NO_DEFAULT,
   >   status_ver = 0,
   >   checks = {
   > active = {
   >   type = "http",
   >   timeout = 1,
   >   concurrency = 10,
   >   http_path = "/",
   >   https_verify_certificate = true,
   >   healthy = {
   > interval = 0, -- 0 = disabled by default
   > http_statuses = { 200, 302 },
   > successes = 2,
   >   },
   >   unhealthy = {
   > interval = 0, -- 0 = disabled by default
   > http_statuses = { 429, 404,
   >   500, 501, 502, 503, 504, 505 },
   > tcp_failures = 2,
   > timeouts = 3,
   > http_failures = 5,
   >   },
   >   req_headers = {""},
   > },
   > passive = {
   >   type = "http",
   >   healthy = {
   > http_statuses = { 200, 201, 202, 203, 204, 205, 206, 207, 208, 226,
   >   300, 301, 302, 303, 304, 305, 306, 307, 308 },
   > successes = 5,
   >   },
   >   unhealthy = {
   > http_statuses = { 429, 500, 503 },
   > tcp_failures = 2,
   > timeouts = 7,
   > http_failures = 5,
   >   },
   > },
   >   },
   > }
   > 
   > 
   > local function to_set(tbl, key)
   >   local set = {}
   >   for _, item in ipairs(tbl[key]) do
   > set[item] = true
   >   end
   >   tbl[key] = set
   > end
   > 
   > 
   >   -- In the below is my code
   > local option_no_passive  =  cjson.decode([[
   > {
   > "checks":
   > {
   > 
"active":{"unhealthy":{"tcp_Failures":3,"http_statuses":[500,501,502,503,504,505],"timeouts":3,"interval":100,"tcp_failures":2,"http_failures":3},"concurrency":10,"http_path":"\/healthz","https_verify_certificate":true,"port":9080,"type":"http","healthy":{"interval":5,"successes":1,"http_statuses":[200,201,202,203,204,205,206,207,208,226,300,301,302,303,304,305,306,307,308,400,401,403,404,405,415,429]},"host":"healthcheck","timeout":5}
   > },
   > 

[GitHub] [apisix] shuaijinchao commented on issue #4077: passive healthcheck not working after configuration changing

2021-11-11 Thread GitBox


shuaijinchao commented on issue #4077:
URL: https://github.com/apache/apisix/issues/4077#issuecomment-966193860


   > > @Ben0625 Could you try the `2.5` version? And test it whether it can be 
reproduced in `2.5`?
   > 
   > We get the same problems on the apisix 2.8
   > 
   > I found a bug in 
[api7/lua-resty-healthcheck@`master`/lib/resty/healthcheck.lua](https://github.com/api7/lua-resty-healthcheck/blob/master/lib/resty/healthcheck.lua?rgh-link-date=2021-11-10T08%3A27%3A57Z)
 The content of var `defaults` will be modified when not assigned the passive 
or active config item
   > 
   > Reproduce the bug: nginx.conf
   > 
   > ```lua
   > daemon off;
   > worker_processes  1;
   > error_log stderr;
   > events {
   > worker_connections 1024;
   > }
   > http {
   > access_log off;
   > server {
   > listen 19000;
   > location / {
   > default_type text/html;
   > content_by_lua '
   > ngx.say("Hello, World!")
   > ';
   > log_by_lua '
   > local check = require("check")
   > ';
   > }
   > }
   > }
   > ```
   > 
   > check.lua
   > 
   > ```lua
   > local cjson = require("cjson.safe")
   > 
   > -- copy from: 
https://github.com/api7/lua-resty-healthcheck/blob/master/lib/resty/healthcheck.lua#L1162
   > 
--
   > -- Create health-checkers
   > 
--
   > 
   > 
   > local NO_DEFAULT = {}
   > local MAXNUM = 2^31 - 1
   > 
   > 
   > local function fail(ctx, k, msg)
   >   ctx[#ctx + 1] = k
   >   error(table.concat(ctx, ".") .. ": " .. msg, #ctx + 1)
   > end
   > 
   > 
   > local function fill_in_settings(opts, defaults, ctx)
   >   ctx = ctx or {}
   >   local obj = {}
   >   for k, default in pairs(defaults) do
   > local v = opts[k]
   > 
   > -- basic type-check of configuration
   > if default ~= NO_DEFAULT
   > and v ~= nil
   > and type(v) ~= type(default) then
   >   fail(ctx, k, "invalid value")
   > end
   > 
   > if v ~= nil then
   >   if type(v) == "table" then
   > if default[1] then -- do not recurse on arrays
   >   obj[k] = v
   > else
   >   ctx[#ctx + 1] = k
   >   obj[k] = fill_in_settings(v, default, ctx)
   >   ctx[#ctx + 1] = nil
   > end
   >   else
   > if type(v) == "number" and (v < 0 or v > MAXNUM) then
   >   fail(ctx, k, "must be between 0 and " .. MAXNUM)
   > end
   > obj[k] = v
   >   end
   > elseif default ~= NO_DEFAULT then
   >   obj[k] = default
   > end
   > 
   >   end
   >   return obj
   > end
   > 
   > 
   > local defaults = {
   >   name = NO_DEFAULT,
   >   shm_name = NO_DEFAULT,
   >   type = NO_DEFAULT,
   >   status_ver = 0,
   >   checks = {
   > active = {
   >   type = "http",
   >   timeout = 1,
   >   concurrency = 10,
   >   http_path = "/",
   >   https_verify_certificate = true,
   >   healthy = {
   > interval = 0, -- 0 = disabled by default
   > http_statuses = { 200, 302 },
   > successes = 2,
   >   },
   >   unhealthy = {
   > interval = 0, -- 0 = disabled by default
   > http_statuses = { 429, 404,
   >   500, 501, 502, 503, 504, 505 },
   > tcp_failures = 2,
   > timeouts = 3,
   > http_failures = 5,
   >   },
   >   req_headers = {""},
   > },
   > passive = {
   >   type = "http",
   >   healthy = {
   > http_statuses = { 200, 201, 202, 203, 204, 205, 206, 207, 208, 226,
   >   300, 301, 302, 303, 304, 305, 306, 307, 308 },
   > successes = 5,
   >   },
   >   unhealthy = {
   > http_statuses = { 429, 500, 503 },
   > tcp_failures = 2,
   > timeouts = 7,
   > http_failures = 5,
   >   },
   > },
   >   },
   > }
   > 
   > 
   > local function to_set(tbl, key)
   >   local set = {}
   >   for _, item in ipairs(tbl[key]) do
   > set[item] = true
   >   end
   >   tbl[key] = set
   > end
   > 
   > 
   >   -- In the below is my code
   > local option_no_passive  =  cjson.decode([[
   > {
   > "checks":
   > {
   > 
"active":{"unhealthy":{"tcp_Failures":3,"http_statuses":[500,501,502,503,504,505],"timeouts":3,"interval":100,"tcp_failures":2,"http_failures":3},"concurrency":10,"http_path":"\/healthz","https_verify_certificate":true,"port":9080,"type":"http","healthy":{"interval":5,"successes":1,"http_statuses":[200,201,202,203,204,205,206,207,208,226,300,301,302,303,304,305,306,307,308,400,401,403,404,405,415,429]},"host":"healthcheck","timeout":5}
   > },
   > 

[GitHub] [apisix-dashboard] bisakhmondal opened a new pull request #2204: chore: update setup script for e2e tests (ginkgo)

2021-11-11 Thread GitBox


bisakhmondal opened a new pull request #2204:
URL: https://github.com/apache/apisix-dashboard/pull/2204


   Please answer these questions before submitting a pull request, **or your PR 
will get closed**.
   This script was created to aid the developers with the environment and 
config required for testing e2e tests on ginkgo suite locally. This script was 
not maintained for a long time. So it is updated accordingly and made it work 
again.
   
![image](https://user-images.githubusercontent.com/41498427/141283801-9194e2fe-c1a3-4cda-a674-adc03002114e.png)
   
   
![image](https://user-images.githubusercontent.com/41498427/141283850-db1327f4-7a6f-45e2-97b0-ad6791221d33.png)
   
   
   **Why submit this pull request?**
   
   - [ ] Bugfix
   - [ ] New feature provided
   - [ ] Improve performance
   - [x] Backport patches
   
   **What changes will this PR take into?**
   
   Please update this section with detailed description.
   
   **Related issues**
   
   fix/resolve #0001
   
   **Checklist:**
   
   - [x] 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?
   - [x] Is this PR backward compatible? If it is not backward compatible, 
please discuss on the mailing list first
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix-ingress-controller] nic-6443 opened a new pull request #754: fix: wrong var type in response_rewrite e2e

2021-11-11 Thread GitBox


nic-6443 opened a new pull request #754:
URL: https://github.com/apache/apisix-ingress-controller/pull/754


   Please answer these questions before submitting a pull request
   
   - Why submit this pull request?
   - [x] Bugfix
   - [ ] New feature provided
   - [ ] Improve performance
   - [ ] Backport patches
   
   - Related issues
   see https://github.com/apache/apisix/issues/5370


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix-ingress-controller] codecov-commenter commented on pull request #753: fix: use independent dns service for UDP e2e test

2021-11-11 Thread GitBox


codecov-commenter commented on pull request #753:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/753#issuecomment-966185018


   # 
[Codecov](https://codecov.io/gh/apache/apisix-ingress-controller/pull/753?src=pr=h1_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 Report
   > Merging 
[#753](https://codecov.io/gh/apache/apisix-ingress-controller/pull/753?src=pr=desc_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 (a17917d) into 
[master](https://codecov.io/gh/apache/apisix-ingress-controller/commit/da30386c9a4335a82723b46fe7b1342bf0f42867?el=desc_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 (da30386) will **increase** coverage by `0.30%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-ingress-controller/pull/753/graphs/tree.svg?width=650=150=pr=WPLQXPY3V0_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-ingress-controller/pull/753?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
   
   ```diff
   @@Coverage Diff @@
   ##   master #753  +/-   ##
   ==
   + Coverage   31.69%   31.99%   +0.30% 
   ==
 Files  65   65  
 Lines6639 6639  
   ==
   + Hits 2104 2124  +20 
   + Misses   4280 4267  -13 
   + Partials  255  248   -7 
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/apisix-ingress-controller/pull/753?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 | Coverage Δ | |
   |---|---|---|
   | 
[pkg/apisix/route.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/753/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-cGtnL2FwaXNpeC9yb3V0ZS5nbw==)
 | `37.76% <0.00%> (+2.09%)` | :arrow_up: |
   | 
[pkg/apisix/cluster.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/753/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-cGtnL2FwaXNpeC9jbHVzdGVyLmdv)
 | `30.75% <0.00%> (+3.50%)` | :arrow_up: |
   | 
[pkg/apisix/plugin.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/753/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-cGtnL2FwaXNpeC9wbHVnaW4uZ28=)
 | `100.00% <0.00%> (+20.00%)` | :arrow_up: |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-ingress-controller/pull/753?src=pr=continue_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-ingress-controller/pull/753?src=pr=footer_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation).
 Last update 
[da30386...a17917d](https://codecov.io/gh/apache/apisix-ingress-controller/pull/753?src=pr=lastupdated_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation).
 Read the [comment 
docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation).
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] shuaijinchao commented on issue #4077: passive healthcheck not working after configuration changing

2021-11-11 Thread GitBox


shuaijinchao commented on issue #4077:
URL: https://github.com/apache/apisix/issues/4077#issuecomment-966184678


   > > @Ben0625 Could you try the `2.5` version? And test it whether it can be 
reproduced in `2.5`?
   > 
   > I tried the Apisix 2.5 version but not use the dashboard 2.5 version. I 
just connect to the same etcd and it can be reproduced. Let me provide more 
details. Step 1. Set a route with two upstreams(/test.do) and healthcheck 
active configuration(/check.do) through dashboard. Step 2. Send a request to 
trigger creating new checker. By looking at the log output before and after 
to_set() function:
   > 
   > > defaults.checks.passive.unhealthy.http_statuses before to_set() function:
   > > {
   > > 1 = 429,
   > > 2 = 500,
   > > 3 = 503,
   > > }
   > > defaults.checks.passive.unhealthy.http_statuses after to_set() function:
   > > {
   > > 429 = true,
   > > 500 = true,
   > > 503 = true,
   > > }
   > 
   > Step 3. Edit the same route on dashboard and do not change any 
configuration and commit. Step 4. Send a request to trigger creating new 
checker. By looking at the log output before and after to_set() function:
   > 
   > > defaults.checks.passive.unhealthy.http_statuses before to_set() function:
   > > {
   > > 429 = true,
   > > 500 = true,
   > > 503 = true,
   > > }
   > > defaults.checks.passive.unhealthy.http_statuses after to_set() function:
   > > {
   > > }
   > 
   > The configuration in etcd(/apisix/routes/350659784246034728): 
{"id":"350659784246034728","create_time":1618539118,"update_time":1618902032,"uris":["/test.do"],"name":"test","methods":["GET","HEAD","POST","PUT","DELETE","OPTIONS","PATCH"],"vars":[],"upstream":{"nodes":[{"host":"172.25.69.182","port":8080,"weight":1},{"host":"172.25.70.116","port":8080,"weight":1}],"timeout":{"connect":6000,"read":6000,"send":6000},"type":"roundrobin","checks":{"active":{"healthy":{"interval":100,"successes":4},"host":"aaa.com","http_path":"/check.do","timeout":3,"unhealthy":{"http_failures":5,"interval":3}
   
   -
   
   Following the steps you provided, I tested it through the CLI and Dashboard 
in the APISIX2.8 version, and this problem was not reproduced.
   
   
![image](https://user-images.githubusercontent.com/8529452/141281871-dd738d26-d04c-4cd7-bfec-8a2ec471793a.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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix-helm-chart] tokers commented on issue #177: Real-ip plug error: need to build APISIX-OpenResty to support setting real ip

2021-11-11 Thread GitBox


tokers commented on issue #177:
URL: 
https://github.com/apache/apisix-helm-chart/issues/177#issuecomment-966183777


   > @tokers I have enabled the real-IP plugin, but an error occurs: need to 
build APISIX-OpenResty to support setting real ip. It is said in the QQ group 
that Apisix lacks the client. Lua module, I wonder whether There is no 
OpenResty in Apisix or what I need to configure ?
   
   The current docker image doesn't base on the patched OpenResty, so some 
features like the real-ip plugin won't support, it'll be support soon. cc 
@imjoey 


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] tokers commented on issue #5485: Proposal: support Apache OpenWhisk serverless framework plugin

2021-11-11 Thread GitBox


tokers commented on issue #5485:
URL: https://github.com/apache/apisix/issues/5485#issuecomment-966181266


   Is it more suitable to extend the Upstream so that these serverless 
platforms can be supported as the standard backends.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix-ingress-controller] tokers commented on issue #749: ApisixRoute does not write to etcd and is not shown on dashboard

2021-11-11 Thread GitBox


tokers commented on issue #749:
URL: 
https://github.com/apache/apisix-ingress-controller/issues/749#issuecomment-966180218


   Please provide the steps to reproduce problems.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix-ingress-controller] tokers commented on issue #750: request help: how to access istio services (demo: Bookinfo)?

2021-11-11 Thread GitBox


tokers commented on issue #750:
URL: 
https://github.com/apache/apisix-ingress-controller/issues/750#issuecomment-966179573


   @jikunchong See 
https://apisix.apache.org/docs/ingress-controller/references/apisix_route_v2beta1/#service-resolve-granularity.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix-ingress-controller] tokers commented on a change in pull request #753: fix: use independent dns service for UDP e2e test

2021-11-11 Thread GitBox


tokers commented on a change in pull request #753:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/753#discussion_r747372786



##
File path: test/e2e/scaffold/k8s.go
##
@@ -467,3 +470,30 @@ func (s *Scaffold) newAPISIXTunnels() error {
 func (s *Scaffold) Namespace() string {
return s.kubectlOptions.Namespace
 }
+
+func (s *Scaffold) EnsureNumEndpointsReady(t testing.TestingT, endpointsName 
string, desired int) {
+   e, err := k8s.GetKubernetesClientFromOptionsE(t, s.kubectlOptions)
+   assert.Nil(t, err, "get kubernetes client")
+   statusMsg := fmt.Sprintf("Wait for endpoints %s to be ready.", 
endpointsName)
+   message := retry.DoWithRetry(
+   t,
+   statusMsg,
+   20,
+   5*time.Second,
+   func() (string, error) {
+   endpoints, err := 
e.CoreV1().Endpoints(s.Namespace()).Get(context.Background(), endpointsName, 
metav1.GetOptions{})
+   if err != nil {
+   return "", err
+   }
+   readyNum := 0
+   for _, subset := range endpoints.Subsets {
+   readyNum += len(subset.Addresses)
+   }
+   if readyNum == desired {
+   return "Service is now available", nil
+   }
+   return "Endpoints not ready yet", nil

Review comment:
   Add the expected number and the actual number to the message, it's 
useful to troubleshoot issues.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] bzp2010 commented on issue #5485: Proposal: support Apache OpenWhisk serverless framework plugin

2021-11-11 Thread GitBox


bzp2010 commented on issue #5485:
URL: https://github.com/apache/apisix/issues/5485#issuecomment-966177462


   > So the request is terminated by APISIX and won't be proxied to the 
upstream, if we use this plugin?
   
   Yes, I think so.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] tokers commented on issue #5357: request help: Could Apache APISIX process traffic control with tcp/ip protocol?

2021-11-11 Thread GitBox


tokers commented on issue #5357:
URL: https://github.com/apache/apisix/issues/5357#issuecomment-966174965


   > > > Is apisix able process traffic control with tcp/ip protocol?
   > > 
   > > 
   > > Yes, you can use the `limit-conn` plugin in the stream sub-system, see 
https://github.com/apache/apisix/blob/master/apisix/stream/plugins/limit-conn.lua.
   > > However, it's not feasible to limit the bandwidth through APISIX stream 
plugins, you may have to write your own.
   > 
   > thanks, the limit-conn plugin works well for tcp/ip,any other traffic 
control plugin for tcp/ip traffic?
   
   If I remember correctly, currently, we can just use 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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] tokers commented on issue #5485: Proposal: support Apache OpenWhisk serverless framework plugin

2021-11-11 Thread GitBox


tokers commented on issue #5485:
URL: https://github.com/apache/apisix/issues/5485#issuecomment-966173546


   So the request is terminated by APISIX and won't be proxied to the upstream, 
if we use this 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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] windyrjc commented on issue #5343: request help: kafka logger supports logging request body

2021-11-11 Thread GitBox


windyrjc commented on issue #5343:
URL: https://github.com/apache/apisix/issues/5343#issuecomment-966173038


   Other phase like filter_by_lua may rewrite request and response by other 
plugin. If we get request_body and response_body in filter_by_lua and set it in 
ctx,it may cause performance 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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] tokers commented on issue #5484: docker install api-gateway faild.

2021-11-11 Thread GitBox


tokers commented on issue #5484:
URL: https://github.com/apache/apisix/issues/5484#issuecomment-966171799


   The error was mostly caused by the mount file or directory doesn't exist, 
make sure the `pwd/example/apisix_conf/config.yaml` and 
`pwd/example/apisix_log` existing.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] tokers commented on issue #5487: request help: APISIX TCP/UDP 动态代理中怎么使任意的客户端IP动态连接到不同tcp server

2021-11-11 Thread GitBox


tokers commented on issue #5487:
URL: https://github.com/apache/apisix/issues/5487#issuecomment-966169457


   Just remove the `remote_addr` field .


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




[GitHub] [apisix] tokers commented on issue #5343: request help: kafka logger supports logging request body

2021-11-11 Thread GitBox


tokers commented on issue #5343:
URL: https://github.com/apache/apisix/issues/5343#issuecomment-966168473


   > core.request.get_body and core.response.hold_body_chunk can't �be used in 
'log_by_lua' phase,it seems that we can logging log it in other phase or set 
request_body and response_body in ctx. Does it have a better way?
   
   Do this in an early phase, say, `access` phase.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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




  1   2   >