[GitHub] [incubator-apisix-dashboard] jiezaizone commented on issue #108: npm run build 后访问异常

2019-12-30 Thread GitBox
jiezaizone commented on issue #108: npm run build 后访问异常
URL: 
https://github.com/apache/incubator-apisix-dashboard/issues/108#issuecomment-569876937
 
 
   我特意拿了一台新的服务器测试一下,还是一样的问题。
   新的服务器,新拉的代码,直接`yarn install && yarn run build:prod`,运行还是一样的问题。
   我自己mac、服务器centos7都是一样的。
   
![image](https://user-images.githubusercontent.com/2897/71612805-b012a480-2bdd-11ea-9205-334aafa7fcb0.png)
   
   
![image](https://user-images.githubusercontent.com/2897/71612780-907b7c00-2bdd-11ea-9c1c-cc7c231cef8b.png)
   
![image](https://user-images.githubusercontent.com/2897/71612837-e8b27e00-2bdd-11ea-8ac3-c37308648b40.png)
   
   
![image](https://user-images.githubusercontent.com/2897/71612826-ca4c8280-2bdd-11ea-99c8-226ed81bd884.png)
   
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-apisix-dashboard] jiezaizone commented on issue #108: npm run build 后访问异常

2019-12-30 Thread GitBox
jiezaizone commented on issue #108: npm run build 后访问异常
URL: 
https://github.com/apache/incubator-apisix-dashboard/issues/108#issuecomment-569873055
 
 
   > 
![image](https://user-images.githubusercontent.com/2106987/71566234-de668600-2af0-11ea-8879-053cf5c8a045.png)
   > 
   > It seems some files cannot retrieve.
   
   nginx.conf
   ```
   user  nginx;
   worker_processes  1;
   error_log  /var/log/nginx/error.log warn;
   pid/var/run/nginx.pid;
   events {
 worker_connections  1024;
   }
   http {
 include   /etc/nginx/mime.types;
 default_type  application/octet-stream;
 log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
   '$status $body_bytes_sent "$http_referer" '
   '"$http_user_agent" "$http_x_forwarded_for"';
 access_log  /var/log/nginx/access.log  main;
 sendfileon;
 keepalive_timeout  65;
 server {
   listen   80;
   server_name  localhost;
   location / {
 root   /app;
 index  index.html;
 try_files $uri $uri/ /index.html;
   }
   error_page   500 502 503 504  /50x.html;
   location = /50x.html {
 root   /usr/share/nginx/html;
   }
 }
   }
   
   ```


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-apisix] codlin closed issue #1008: request help: jwt-auth-cn.md

2019-12-30 Thread GitBox
codlin closed issue #1008: request help: jwt-auth-cn.md
URL: https://github.com/apache/incubator-apisix/issues/1008
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-apisix] codlin commented on issue #1008: request help: jwt-auth-cn.md

2019-12-30 Thread GitBox
codlin commented on issue #1008: request help: jwt-auth-cn.md
URL: 
https://github.com/apache/incubator-apisix/issues/1008#issuecomment-569860484
 
 
   谢谢


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-apisix] totemofwolf commented on issue #976: Added password support for plugin limit-count-redis

2019-12-30 Thread GitBox
totemofwolf commented on issue #976: Added password support for plugin 
limit-count-redis
URL: https://github.com/apache/incubator-apisix/pull/976#issuecomment-569853096
 
 
   > @totemofwolf here is the correct test cases.
   > 
   > It works fine on my local machine.
   > 
   > ```shell
   > + prove t/plugin/limit-count-redis.t
   > t/plugin/limit-count-redis.t .. ok
   > All tests successful.
   > Files=1, Tests=36,  6 wallclock secs ( 0.03 usr  0.00 sys +  0.76 cusr  
0.99 csys =  1.78 CPU)
   > Result: PASS
   > ```
   > 
   > ```
   > === TEST 7: up the limit for TEST 6
   > --- pipelined_requests eval
   > ["GET /hello_new", "GET /hello_new", "GET /hello_new", "GET /hello_new"]
   > --- error_code eval
   > [500, 500, 500, 500]
   > 
   > 
   > 
   > === TEST 8: up the limit for TEST 6
   > --- request
   > GET /hello_new
   > --- error_code eval
   > 500
   > --- response_body
   > {"1":"ERR invalid password","error_msg":"failed to limit count: "}
   > --- error_log
   > failed to limit req: ERR invalid password
   > ```
   
   . 
   I'm on the way to make my local `prove` works with such `.t` files now ;-)
   
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-apisix] membphis commented on issue #1008: request help: jwt-auth-cn.md

2019-12-30 Thread GitBox
membphis commented on issue #1008: request help: jwt-auth-cn.md
URL: 
https://github.com/apache/incubator-apisix/issues/1008#issuecomment-569847188
 
 
   For gateways, consumers here are usually partners or channel sources. For 
example, a.com or b.com.
   
   对于网关,这里的 consumer 通常是合作伙伴或渠道来源。 例如,a.com 或 b.com 这种使用域名做主体区分。


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-apisix] membphis edited a comment on issue #976: Added password support for plugin limit-count-redis

2019-12-30 Thread GitBox
membphis edited a comment on issue #976: Added password support for plugin 
limit-count-redis
URL: https://github.com/apache/incubator-apisix/pull/976#issuecomment-569845631
 
 
   @totemofwolf here is the correct test cases.
   
   It works fine on my local machine.
   
   ```shell
   + prove t/plugin/limit-count-redis.t
   t/plugin/limit-count-redis.t .. ok
   All tests successful.
   Files=1, Tests=36,  6 wallclock secs ( 0.03 usr  0.00 sys +  0.76 cusr  0.99 
csys =  1.78 CPU)
   Result: PASS
   ```
   
   ```
   === TEST 7: up the limit for TEST 6
   --- pipelined_requests eval
   ["GET /hello_new", "GET /hello_new", "GET /hello_new", "GET /hello_new"]
   --- error_code eval
   [500, 500, 500, 500]
   
   
   
   === TEST 8: up the limit for TEST 6
   --- request
   GET /hello_new
   --- error_code eval
   500
   --- response_body
   {"1":"ERR invalid password","error_msg":"failed to limit count: "}
   --- error_log
   failed to limit req: ERR invalid password
   ```


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-apisix] membphis commented on issue #976: Added password support for plugin limit-count-redis

2019-12-30 Thread GitBox
membphis commented on issue #976: Added password support for plugin 
limit-count-redis
URL: https://github.com/apache/incubator-apisix/pull/976#issuecomment-569845631
 
 
   @totemofwolf here is the correct test cases.
   
   ```
   === TEST 7: up the limit for TEST 6
   --- pipelined_requests eval
   ["GET /hello_new", "GET /hello_new", "GET /hello_new", "GET /hello_new"]
   --- error_code eval
   [500, 500, 500, 500]
   
   
   
   === TEST 8: up the limit for TEST 6
   --- request
   GET /hello_new
   --- error_code eval
   500
   --- response_body
   {"1":"ERR invalid password","error_msg":"failed to limit count: "}
   --- error_log
   failed to limit req: ERR invalid password
   ```


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[incubator-apisix] branch master updated: doc: fixed error in serverless plugin. (#1006)

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 1069c3d  doc: fixed error in serverless plugin. (#1006)
1069c3d is described below

commit 1069c3d32dbbaeaa87555d41a16f7ec54b623a96
Author: WenMing 
AuthorDate: Mon Dec 30 20:28:36 2019 +0800

doc: fixed error in serverless plugin. (#1006)
---
 doc/plugins/serverless-cn.md | 10 --
 doc/plugins/serverless.md|  2 +-
 lua/apisix/plugins/heartbeat.lua |  4 ++--
 3 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/doc/plugins/serverless-cn.md b/doc/plugins/serverless-cn.md
index e5b695c..c9f5f49 100644
--- a/doc/plugins/serverless-cn.md
+++ b/doc/plugins/serverless-cn.md
@@ -61,12 +61,10 @@ curl -i http://127.0.0.1:9080/apisix/admin/routes/1 -X PUT 
-d '
 {
 "uri": "/index.html",
 "plugins": {
-"plugins": {
-"serverless-pre-function": {
-"phase": "rewrite",
-"functions" : ["return function() ngx.log(ngx.ERR, 'serverless 
pre function'); end"]
-}
-},
+"serverless-pre-function": {
+"phase": "rewrite",
+"functions" : ["return function() ngx.log(ngx.ERR, \"serverless 
pre function\"); end"]
+}
 },
 "upstream": {
 "type": "roundrobin",
diff --git a/doc/plugins/serverless.md b/doc/plugins/serverless.md
index 239d8b1..e6cffda 100644
--- a/doc/plugins/serverless.md
+++ b/doc/plugins/serverless.md
@@ -75,7 +75,7 @@ curl -i http://127.0.0.1:9080/apisix/admin/routes/1 -X PUT -d 
'
 "plugins": {
 "serverless-pre-function": {
 "phase": "rewrite",
-"functions" : ["return function() ngx.log(ngx.ERR, 'serverless pre 
function'); end"]
+"functions" : ["return function() ngx.log(ngx.ERR, \"serverless 
pre function\"); end"]
 }
 },
 "upstream": {
diff --git a/lua/apisix/plugins/heartbeat.lua b/lua/apisix/plugins/heartbeat.lua
index b9275c3..66e0faa 100644
--- a/lua/apisix/plugins/heartbeat.lua
+++ b/lua/apisix/plugins/heartbeat.lua
@@ -75,7 +75,7 @@ local function report()
 end
 end
 
-core.log.warn(core.json.encode(etcd_version))
+core.log.info(core.json.encode(etcd_version))
 
 local info = {
 version = core.version,
@@ -92,7 +92,7 @@ local function report()
 core.log.error("failed to encode hearbeat information: ", err)
 return
 end
-core.log.warn("heartbeat body: ", args)
+core.log.info("heartbeat body: ", args)
 
 local res
 res, err = request_apisix_svr(args)



[GitHub] [incubator-apisix] membphis merged pull request #1006: doc: fixed error in serverless plugin.

2019-12-30 Thread GitBox
membphis merged pull request #1006: doc: fixed error in serverless plugin.
URL: https://github.com/apache/incubator-apisix/pull/1006
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-apisix] codlin opened a new issue #1008: request help: jwt-auth-cn.md

2019-12-30 Thread GitBox
codlin opened a new issue #1008: request help: jwt-auth-cn.md
URL: https://github.com/apache/incubator-apisix/issues/1008
 
 
   ### Issue description
   
小白求教,[请问这个文档](https://github.com/apache/incubator-apisix/blob/master/doc/plugins/jwt-auth-cn.md)中说的username指的是终端用户吗?
 
   如果一个网站有很多用户,一个个通过手动加不现实吧
   谢谢
   ### Environment
   
   * apisix version (cmd: `apisix version`):
   * OS:
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[incubator-apisix] branch master updated: bugfix: fix CIDR ip html escaped for real_ip_from in `apisix` (#1007)

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 101fe73  bugfix: fix CIDR ip html escaped for real_ip_from in `apisix` 
(#1007)
101fe73 is described below

commit 101fe73525d2ed29bc21c89f8bfd89e30f8ff399
Author: ChelinTsien 
AuthorDate: Mon Dec 30 17:51:55 2019 +0800

bugfix: fix CIDR ip html escaped for real_ip_from in `apisix` (#1007)

when the value of set_real_ip_from is CIDR, the {{real_ip}} will html 
escaped.
---
 bin/apisix | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/apisix b/bin/apisix
index 250534c..97f1a22 100755
--- a/bin/apisix
+++ b/bin/apisix
@@ -196,7 +196,7 @@ http {
 
 real_ip_header {* real_ip_header *};
 {% for _, real_ip in ipairs(real_ip_from) do %}
-set_real_ip_from {{real_ip}};
+set_real_ip_from {*real_ip*};
 {% end %}
 
 upstream apisix_backend {



[GitHub] [incubator-apisix] moonming merged pull request #1007: invaild value

2019-12-30 Thread GitBox
moonming merged pull request #1007: invaild value
URL: https://github.com/apache/incubator-apisix/pull/1007
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-apisix] moonming commented on issue #1007: invaild value

2019-12-30 Thread GitBox
moonming commented on issue #1007: invaild value
URL: https://github.com/apache/incubator-apisix/pull/1007#issuecomment-569629297
 
 
   @ChelinTsien good catch, thx


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-apisix] ChelinTsien opened a new pull request #1007: invaild value

2019-12-30 Thread GitBox
ChelinTsien opened a new pull request #1007: invaild value
URL: https://github.com/apache/incubator-apisix/pull/1007
 
 
   when the value of set_real_ip_from is CIDR, the {{real_ip}} will html 
escaped.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-apisix] totemofwolf commented on a change in pull request #976: Added password support for plugin limit-count-redis

2019-12-30 Thread GitBox
totemofwolf commented on a change in pull request #976: Added password support 
for plugin limit-count-redis
URL: https://github.com/apache/incubator-apisix/pull/976#discussion_r361920025
 
 

 ##
 File path: lua/apisix/plugins/limit-count/limit-count-redis.lua
 ##
 @@ -51,6 +51,13 @@ function _M.incoming(self, key)
 return false, err
 end
 
+if conf.redis_password and conf.redis_password ~= '' then
 
 Review comment:
   > we need to check if this sock was used for first time by API: 
https://github.com/openresty/lua-nginx-module#tcpsockgetreusedtimes
   > 
   > Call the `auth` if the `reusedtimes` equal 0.
   
   
   Yes, I did it as you mentioned like this:
   ```
   local count
   count, err = red:get_reused_times()
   if 0 == count then
   if conf.redis_password and conf.redis_password ~= '' then
   local ok, err = red:auth(conf.redis_password)
   if not ok then
   return nil, err
   end
   end
   elseif err then
   -- core.log.info(" err: ", err)
   return
   end
   ```
   
   but the test cases :  
https://travis-ci.org/apache/incubator-apisix/jobs/630846147  and output logs 
of apisix make me confused.
   ```
   
   apisix_1  | 2019/12/30 15:54:58 [error] 29#29: *2911 [lua] 
limit-count.lua:127: phase_fun(): failed to limit req: ERR invalid password, 
client: 1.2.3.4, server: , request: "POST /api/admin/login HTTP/2.0", host: 
"x.nsa.work", referrer: "https://x.nsa.work/admin/index.html;
   
   apisix_1  | 1.2.3.4 - - [30/Dec/2019:15:54:58 +0800] "POST /api/admin/login 
HTTP/2.0" x.nsa.work - /api/admin/login 500 29 610 
"https://x.nsa.work/admin/index.html; "Mozilla/5.0 (Macintosh; Intel Mac OS X 
10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.4 
Safari/605.1.15"  0.000 - "-"
   ```
   
   I'm wondering how to treat this pipelined_requests for ` Test 7 & 8 `
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services