[GitHub] [apisix] Marco-Zheng commented on issue #4063: bug: the route which was create by dashboard is invalid

2021-04-15 Thread GitBox


Marco-Zheng commented on issue #4063:
URL: https://github.com/apache/apisix/issues/4063#issuecomment-820927624


   > > You can use APISIX 2.4 + APISIX dashboard 2.5
   > > @tokers
   > > What is the version requirement for the ingress controller?
   > 
   > Just use apisix-ingress-controller `0.5.0` is OK.
   
   @tokers @spacewander Thanks a lot, i'll try to deploy your mentioned apisix 
version.


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

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




[GitHub] [apisix-ingress-controller] Firstsawyou commented on a change in pull request #375: add e2e test cases for referer-restriction plugin

2021-04-15 Thread GitBox


Firstsawyou commented on a change in pull request #375:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/375#discussion_r614577814



##
File path: test/e2e/plugins/referer-restriction.go
##
@@ -0,0 +1,200 @@
+// 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 plugins
+
+import (
+   "fmt"
+   "github.com/onsi/ginkgo"
+   "github.com/stretchr/testify/assert"
+   "net/http"
+
+   "github.com/apache/apisix-ingress-controller/test/e2e/scaffold"
+)
+
+var _ = ginkgo.Describe("referer-restriction plugin", func() {
+   opts := {
+   Name:"default",
+   Kubeconfig:  scaffold.GetKubeconfig(),
+   APISIXConfigPath:"testdata/apisix-gw-config.yaml",
+   APISIXDefaultConfigPath: 
"testdata/apisix-gw-config-default.yaml",
+   IngressAPISIXReplicas:   1,
+   HTTPBinServicePort:  80,
+   APISIXRouteVersion:  "apisix.apache.org/v2alpha1",
+   }
+   s := scaffold.NewScaffold(opts)
+   ginkgo.It("referer-restriction plugin configuration whitelist list", 
func() {
+   backendSvc, backendPorts := s.DefaultHTTPBackend()
+   ar := fmt.Sprintf(`
+apiVersion: apisix.apache.org/v2alpha1
+kind: ApisixRoute
+metadata:
+ name: httpbin-route
+spec:
+ http:
+ - name: rule1
+   match:
+ hosts:
+ - httpbin.org
+ paths:
+   - /ip
+   backends:
+   - serviceName: %s
+ servicePort: %d
+ weight: 10
+   plugins:
+   - name: referer-restriction
+ enable: true
+ config:
+   whitelist:
+ - test.com
+ - "*.foo.com"
+`, backendSvc, backendPorts[0])
+
+   assert.Nil(ginkgo.GinkgoT(), s.CreateResourceFromString(ar))
+
+   err := s.EnsureNumApisixUpstreamsCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of 
upstreams")
+   err = s.EnsureNumApisixRoutesCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of routes")
+
+   // "Referer" match passed
+   resp := s.NewAPISIXClient().GET("/ip").
+   WithHeader("Host", "httpbin.org").
+   WithHeader("Referer", "http://test.com;).
+   Expect()
+   resp.Status(http.StatusOK)
+   resp.Body().Contains("origin")
+
+   // "Referer" match failed
+   resp = s.NewAPISIXClient().GET("/ip").
+   WithHeader("Host", "httpbin.org").
+   WithHeader("Referer", "http://www.test.com;).
+   Expect()
+   resp.Status(http.StatusForbidden)
+   resp.Body().Contains("Your referer host is not allowed")
+
+   // "Referer" match passed
+   resp = s.NewAPISIXClient().GET("/ip").
+   WithHeader("Host", "httpbin.org").
+   WithHeader("Referer", "http://www.foo.com;).
+   Expect()
+   resp.Status(http.StatusOK)
+   resp.Body().Contains("origin")
+
+   // "Refere" is missing

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.

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




[GitHub] [apisix-ingress-controller] Firstsawyou commented on a change in pull request #375: add e2e test cases for referer-restriction plugin

2021-04-15 Thread GitBox


Firstsawyou commented on a change in pull request #375:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/375#discussion_r614577747



##
File path: test/e2e/plugins/referer-restriction.go
##
@@ -0,0 +1,200 @@
+// 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 plugins
+
+import (
+   "fmt"
+   "github.com/onsi/ginkgo"
+   "github.com/stretchr/testify/assert"
+   "net/http"

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.

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




[GitHub] [apisix] tokers commented on issue #4063: bug: the route which was create by dashboard is invalid

2021-04-15 Thread GitBox


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


   > You can use APISIX 2.4 + APISIX dashboard 2.5
   > 
   > @tokers
   > What is the version requirement for the ingress controller?
   
   Just use apisix-ingress-controller `0.5.0` is OK.


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

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




[GitHub] [apisix] dickens7 commented on issue #4040: skywalking plugin attribute service_instance_name hard-coded

2021-04-15 Thread GitBox


dickens7 commented on issue #4040:
URL: https://github.com/apache/apisix/issues/4040#issuecomment-820924599


   ok, assign it to me.


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

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




[GitHub] [apisix-ingress-controller] tokers commented on a change in pull request #375: add e2e test cases for referer-restriction plugin

2021-04-15 Thread GitBox


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



##
File path: test/e2e/plugins/referer-restriction.go
##
@@ -0,0 +1,200 @@
+// 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 plugins
+
+import (
+   "fmt"
+   "github.com/onsi/ginkgo"
+   "github.com/stretchr/testify/assert"
+   "net/http"
+
+   "github.com/apache/apisix-ingress-controller/test/e2e/scaffold"
+)
+
+var _ = ginkgo.Describe("referer-restriction plugin", func() {
+   opts := {
+   Name:"default",
+   Kubeconfig:  scaffold.GetKubeconfig(),
+   APISIXConfigPath:"testdata/apisix-gw-config.yaml",
+   APISIXDefaultConfigPath: 
"testdata/apisix-gw-config-default.yaml",
+   IngressAPISIXReplicas:   1,
+   HTTPBinServicePort:  80,
+   APISIXRouteVersion:  "apisix.apache.org/v2alpha1",
+   }
+   s := scaffold.NewScaffold(opts)
+   ginkgo.It("referer-restriction plugin configuration whitelist list", 
func() {
+   backendSvc, backendPorts := s.DefaultHTTPBackend()
+   ar := fmt.Sprintf(`
+apiVersion: apisix.apache.org/v2alpha1
+kind: ApisixRoute
+metadata:
+ name: httpbin-route
+spec:
+ http:
+ - name: rule1
+   match:
+ hosts:
+ - httpbin.org
+ paths:
+   - /ip
+   backends:
+   - serviceName: %s
+ servicePort: %d
+ weight: 10
+   plugins:
+   - name: referer-restriction
+ enable: true
+ config:
+   whitelist:
+ - test.com
+ - "*.foo.com"
+`, backendSvc, backendPorts[0])
+
+   assert.Nil(ginkgo.GinkgoT(), s.CreateResourceFromString(ar))
+
+   err := s.EnsureNumApisixUpstreamsCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of 
upstreams")
+   err = s.EnsureNumApisixRoutesCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of routes")
+
+   // "Referer" match passed
+   resp := s.NewAPISIXClient().GET("/ip").
+   WithHeader("Host", "httpbin.org").
+   WithHeader("Referer", "http://test.com;).
+   Expect()
+   resp.Status(http.StatusOK)
+   resp.Body().Contains("origin")
+
+   // "Referer" match failed
+   resp = s.NewAPISIXClient().GET("/ip").
+   WithHeader("Host", "httpbin.org").
+   WithHeader("Referer", "http://www.test.com;).
+   Expect()
+   resp.Status(http.StatusForbidden)
+   resp.Body().Contains("Your referer host is not allowed")
+
+   // "Referer" match passed
+   resp = s.NewAPISIXClient().GET("/ip").
+   WithHeader("Host", "httpbin.org").
+   WithHeader("Referer", "http://www.foo.com;).
+   Expect()
+   resp.Status(http.StatusOK)
+   resp.Body().Contains("origin")
+
+   // "Refere" is missing

Review comment:
   Typo: `Referer`.

##
File path: test/e2e/plugins/referer-restriction.go
##
@@ -0,0 +1,200 @@
+// 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 plugins
+
+import (
+   "fmt"
+   "github.com/onsi/ginkgo"
+   

[GitHub] [apisix] Firstsawyou commented on a change in pull request #4060: feat: update skywalking componentId

2021-04-15 Thread GitBox


Firstsawyou commented on a change in pull request #4060:
URL: https://github.com/apache/apisix/pull/4060#discussion_r614574061



##
File path: apisix/plugins/skywalking.lua
##
@@ -17,6 +17,7 @@
 local sw_tracer = require("skywalking.tracer")
 local core = require("apisix.core")
 local process = require("ngx.process")
+local Span = require('skywalking.span')

Review comment:
   I think it would be better to keep the style uniform.
   
   ```suggestion
   local Span = require("skywalking.span")
   ```




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

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




[GitHub] [apisix-docker] tokers merged pull request #159: feat: automate upload image to Dockerhub

2021-04-15 Thread GitBox


tokers merged pull request #159:
URL: https://github.com/apache/apisix-docker/pull/159


   


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

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




[apisix-docker] branch master updated: feat: automate upload image to Dockerhub (#159)

2021-04-15 Thread tokers
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 155cd24  feat: automate upload image to Dockerhub (#159)
155cd24 is described below

commit 155cd24fb9fd8cb28b7bd643b5dd4fd740cc4511
Author: qian0817 
AuthorDate: Fri Apr 16 13:42:50 2021 +0800

feat: automate upload image to Dockerhub (#159)
---
 .github/workflows/apisix_push_docker_hub.yaml| 24 
 .github/workflows/dashboard_push_docker_hub.yaml | 19 +++
 Makefile | 16 ++--
 3 files changed, 57 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/apisix_push_docker_hub.yaml 
b/.github/workflows/apisix_push_docker_hub.yaml
new file mode 100644
index 000..abf3b6c
--- /dev/null
+++ b/.github/workflows/apisix_push_docker_hub.yaml
@@ -0,0 +1,24 @@
+name: Push apisix to Docker image
+on:
+  release:
+types: [ published ]
+jobs:
+  build:
+runs-on: ubuntu-latest
+strategy:
+  matrix:
+platform:
+  - alpine
+  - centos
+
+steps:
+  - name: Check out the repo
+uses: actions/checkout@v2
+
+  - name: Login
+run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login --username=${{ 
secrets.DOCKER_USERNAME }} --password-stdin
+
+  - name: Push apisix image to Docker Hub
+run:
+  make build-on-${{ matrix.platform }}
+  make push-on-${{ matrix.platform }}
diff --git a/.github/workflows/dashboard_push_docker_hub.yaml 
b/.github/workflows/dashboard_push_docker_hub.yaml
new file mode 100644
index 000..9db5c52
--- /dev/null
+++ b/.github/workflows/dashboard_push_docker_hub.yaml
@@ -0,0 +1,19 @@
+name: Push apisix dashboard to Docker image
+on:
+  release:
+types: [ published ]
+jobs:
+  build:
+runs-on: ubuntu-latest
+
+steps:
+  - name: Check out the repo
+uses: actions/checkout@v2
+
+  - name: Login
+run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login --username=${{ 
secrets.DOCKER_USERNAME }} --password-stdin
+
+  - name: Push apisix dashboard image to Docker Hub
+run:
+  make build-on-dashboard
+  make push-on-dashboard
diff --git a/Makefile b/Makefile
index a14f0c8..9294026 100644
--- a/Makefile
+++ b/Makefile
@@ -38,12 +38,20 @@ build-on-alpine:
 build-on-alpine-local:
docker build -t $(IMAGE_NAME):$(APISIX_VERSION)-alpine-local 
--build-arg APISIX_PATH=${APISIX_PATH} -f ./alpine-local/Dockerfile .  
 
+### push-on-centos:   Push apache/apisix:xx-centos image
+push-on-centos:
+   docker push $(IMAGE_NAME):$(APISIX_VERSION)-centos
+
+### push-on-alpine:   Push apache/apisix:xx-alpine image
+push-on-alpine:
+   docker push $(IMAGE_NAME):$(APISIX_VERSION)-alpine
+
 ### save-centos-tar:  tar apache/apisix:xx-centos image
 save-centos-tar:
mkdir -p package
docker save -o ./package/$(IMAGE_TAR_NAME)_$(APISIX_VERSION)-centos.tar 
$(IMAGE_NAME):$(APISIX_VERSION)-centos
 
-### save-alpine-tar:  tar apaceh/apisix:xx-alpine image
+### save-alpine-tar:  tar apache/apisix:xx-alpine image
 save-alpine-tar:
mkdir -p package
docker save -o ./package/$(IMAGE_TAR_NAME)_$(APISIX_VERSION)-alpine.tar 
$(IMAGE_NAME):$(APISIX_VERSION)-alpine
@@ -52,7 +60,11 @@ save-alpine-tar:
 build-dashboard:
docker build -t 
$(APISIX_DASHBOARD_IMAGE_NAME):$(APISIX_DASHBOARD_VERSION) -f 
./dashboard/Dockerfile .
 
-### save-dashboard-tar:  tar apaceh/apisix-dashboard:tag image
+### push-dashboard: Push apache/dashboard:tag image
+push-dashboard:
+   docker push $(APISIX_DASHBOARD_IMAGE_NAME):$(APISIX_DASHBOARD_VERSION)
+
+### save-dashboard-tar:  tar apache/apisix-dashboard:tag image
 save-dashboard-tar:
mkdir -p package
docker save -o 
./package/$(APISIX_DASHBOARD_IMAGE_TAR_NAME)_$(APISIX_DASHBOARD_VERSION).tar 
$(APISIX_DASHBOARD_IMAGE_NAME):$(APISIX_DASHBOARD_VERSION)


[GitHub] [apisix-ingress-controller] tokers opened a new pull request #382: ci: add codeql

2021-04-15 Thread GitBox


tokers opened a new pull request #382:
URL: https://github.com/apache/apisix-ingress-controller/pull/382


   Please answer these questions before submitting a pull request
   
   - Why submit this pull request?
   - [ ] Bugfix
   - [ ] New feature provided
   - [ ] Improve performance
   - [ ] Backport patches
   
   - Related issues
   
   ___
   ### Bugfix
   - Description
   
   - How to fix?
   
   ___
   ### New feature or improvement
   - Describe the details and related test reports.
   
   ___
   ### Backport patches
   - Why need to backport?
   
   - Source branch
   
   - Related commits and pull requests
   
   - Target branch
   


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

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




[GitHub] [apisix] Firstsawyou commented on issue #4065: 404 Not Found

2021-04-15 Thread GitBox


Firstsawyou commented on issue #4065:
URL: https://github.com/apache/apisix/issues/4065#issuecomment-820892280


   What is the route configuration in your etcd?
   What is the log information of access.log?


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

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




[GitHub] [apisix] spacewander commented on issue #4063: bug: the route which was create by dashboard is invalid

2021-04-15 Thread GitBox


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


   You can use APISIX 2.4 + APISIX dashboard 2.5
   
   @tokers 
   What is the version requirement for the ingress controller?


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

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




[GitHub] [apisix-ingress-controller] Firstsawyou commented on a change in pull request #375: add e2e test cases for referer-restriction plugin

2021-04-15 Thread GitBox


Firstsawyou commented on a change in pull request #375:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/375#discussion_r614545260



##
File path: test/e2e/plugins/referer-restriction.go
##
@@ -0,0 +1,183 @@
+// 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 plugins
+
+import (
+   "fmt"
+   "github.com/onsi/ginkgo"
+   "github.com/stretchr/testify/assert"
+   "net/http"
+
+   "github.com/apache/apisix-ingress-controller/test/e2e/scaffold"
+)
+
+var _ = ginkgo.Describe("referer-restriction plugin", func() {
+   opts := {
+   Name:"default",
+   Kubeconfig:  scaffold.GetKubeconfig(),
+   APISIXConfigPath:"testdata/apisix-gw-config.yaml",
+   APISIXDefaultConfigPath: 
"testdata/apisix-gw-config-default.yaml",
+   IngressAPISIXReplicas:   1,
+   HTTPBinServicePort:  80,
+   APISIXRouteVersion:  "apisix.apache.org/v2alpha1",
+   }
+   s := scaffold.NewScaffold(opts)
+   ginkgo.It("referer-restriction plugin configuration whitelist list", 
func() {
+   backendSvc, backendPorts := s.DefaultHTTPBackend()
+   ar := fmt.Sprintf(`
+apiVersion: apisix.apache.org/v2alpha1
+kind: ApisixRoute
+metadata:
+ name: httpbin-route
+spec:
+ http:
+ - name: rule1
+   match:
+ hosts:
+ - httpbin.org
+ paths:
+   - /ip
+   backends:
+   - serviceName: %s
+ servicePort: %d
+ weight: 10
+   plugins:
+   - name: referer-restriction
+ enable: true
+ config:
+   whitelist:
+ - test.com
+ - "*.foo.com"
+`, backendSvc, backendPorts[0])
+
+   assert.Nil(ginkgo.GinkgoT(), s.CreateResourceFromString(ar))
+
+   err := s.EnsureNumApisixUpstreamsCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of 
upstreams")
+   err = s.EnsureNumApisixRoutesCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of routes")
+
+   // Referer match passed
+   resp := s.NewAPISIXClient().GET("/ip").
+   WithHeader("Host", "httpbin.org").
+   WithHeader("Referer", "http://test.com;).
+   Expect()
+   resp.Status(http.StatusOK)
+   resp.Body().Contains("origin")
+
+   // Referer match failed
+   resp = s.NewAPISIXClient().GET("/ip").
+   WithHeader("Host", "httpbin.org").
+   WithHeader("Referer", "http://www.test.com;).
+   Expect()
+   resp.Status(http.StatusForbidden)
+
+   // Referer match passed
+   resp = s.NewAPISIXClient().GET("/ip").
+   WithHeader("Host", "httpbin.org").
+   WithHeader("Referer", "http://www.foo.com;).
+   Expect()
+   resp.Status(http.StatusOK)
+   resp.Body().Contains("origin")
+   })
+
+   ginkgo.It("the bypass_missing field is true", func() {
+   backendSvc, backendPorts := s.DefaultHTTPBackend()
+   ar := fmt.Sprintf(`
+apiVersion: apisix.apache.org/v2alpha1
+kind: ApisixRoute
+metadata:
+ name: httpbin-route
+spec:
+ http:
+ - name: rule1
+   match:
+ hosts:
+ - httpbin.org
+ paths:
+   - /ip
+   backends:
+   - serviceName: %s
+ servicePort: %d
+ weight: 10
+   plugins:
+   - name: referer-restriction
+ enable: true
+ config:
+   whitelist:
+ - test.com
+   bypass_missing: true
+`, backendSvc, backendPorts[0])
+
+   assert.Nil(ginkgo.GinkgoT(), s.CreateResourceFromString(ar))
+
+   err := s.EnsureNumApisixUpstreamsCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of 
upstreams")
+   err = s.EnsureNumApisixRoutesCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of routes")
+
+   // Referer is missing
+   resp := s.NewAPISIXClient().GET("/ip").WithHeader("Host", 
"httpbin.org").Expect()
+   

[GitHub] [apisix-ingress-controller] Firstsawyou commented on a change in pull request #375: add e2e test cases for referer-restriction plugin

2021-04-15 Thread GitBox


Firstsawyou commented on a change in pull request #375:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/375#discussion_r614545161



##
File path: test/e2e/plugins/referer-restriction.go
##
@@ -0,0 +1,183 @@
+// 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 plugins
+
+import (
+   "fmt"
+   "github.com/onsi/ginkgo"
+   "github.com/stretchr/testify/assert"
+   "net/http"
+
+   "github.com/apache/apisix-ingress-controller/test/e2e/scaffold"
+)
+
+var _ = ginkgo.Describe("referer-restriction plugin", func() {
+   opts := {
+   Name:"default",
+   Kubeconfig:  scaffold.GetKubeconfig(),
+   APISIXConfigPath:"testdata/apisix-gw-config.yaml",
+   APISIXDefaultConfigPath: 
"testdata/apisix-gw-config-default.yaml",
+   IngressAPISIXReplicas:   1,
+   HTTPBinServicePort:  80,
+   APISIXRouteVersion:  "apisix.apache.org/v2alpha1",
+   }
+   s := scaffold.NewScaffold(opts)
+   ginkgo.It("referer-restriction plugin configuration whitelist list", 
func() {
+   backendSvc, backendPorts := s.DefaultHTTPBackend()
+   ar := fmt.Sprintf(`
+apiVersion: apisix.apache.org/v2alpha1
+kind: ApisixRoute
+metadata:
+ name: httpbin-route
+spec:
+ http:
+ - name: rule1
+   match:
+ hosts:
+ - httpbin.org
+ paths:
+   - /ip
+   backends:
+   - serviceName: %s
+ servicePort: %d
+ weight: 10
+   plugins:
+   - name: referer-restriction
+ enable: true
+ config:
+   whitelist:
+ - test.com
+ - "*.foo.com"
+`, backendSvc, backendPorts[0])
+
+   assert.Nil(ginkgo.GinkgoT(), s.CreateResourceFromString(ar))
+
+   err := s.EnsureNumApisixUpstreamsCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of 
upstreams")
+   err = s.EnsureNumApisixRoutesCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of routes")
+

Review comment:
   Upadted.




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

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




[GitHub] [apisix] Marco-Zheng commented on issue #4063: bug: the route which was create by dashboard is invalid

2021-04-15 Thread GitBox


Marco-Zheng commented on issue #4063:
URL: https://github.com/apache/apisix/issues/4063#issuecomment-820889821


   > It is a known issue. The dashboard in the helm chart is too old:
   > 
https://github.com/apache/apisix-helm-chart/blob/e26517c5302d3d839c2f483a211c60dd55d43c0d/charts/apisix-dashboard/values.yaml#L27
   > 
   > We will fix it once a new dashboard version is released (none of the 
releases of dashboard support APISIX 2.5 yet).
   
   Ok, it main caused per `var:[]`
   
![image](https://user-images.githubusercontent.com/52538259/114969606-4ccc8480-9eab-11eb-91a9-c46dbc4c972f.png)
   
   So, which version is ok at this time, or we need deploy apisix & apisix 
dashboard & apisix ingress controller & etcd in k8s without using 
apisix-helm-chart?


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

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




[GitHub] [apisix] spacewander commented on issue #4040: skywalking plugin attribute service_instance_name hard-coded

2021-04-15 Thread GitBox


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


   @dickens7 
   PR is welcome!


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

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




[GitHub] [apisix] spacewander commented on a change in pull request #4053: docs: fix broken links in FAQ

2021-04-15 Thread GitBox


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



##
File path: docs/en/latest/FAQ.md
##
@@ -35,7 +35,7 @@ In addition, APISIX has dynamic routing and hot loading of 
plug-ins, which is es
 
 ## What's the performance of APISIX?
 
-One of the goals of APISIX design and development is the highest performance 
in the industry. Specific test data can be found 
here:[benchmark](https://github.com/apache/apisix/blob/master/benchmark.md)
+One of the goals of APISIX design and development is the highest performance 
in the industry. Specific test data can be found 
here:[benchmark](https://github.com/apache/apisix/blob/master/docs/en/latest/benchmark.md)

Review comment:
   We can use `[benchmark](benchmark.md)` directly?




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

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




[GitHub] [apisix] spacewander commented on issue #4063: bug: the route which was create by dashboard is invalid

2021-04-15 Thread GitBox


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


   It is a known issue. The dashboard in the helm chart is too old:
   
https://github.com/apache/apisix-helm-chart/blob/e26517c5302d3d839c2f483a211c60dd55d43c0d/charts/apisix-dashboard/values.yaml#L27
   
   We will fix it once a new dashboard version is released (none of the 
releases of dashboard support APISIX 2.5 yet).


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

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




[GitHub] [apisix] ychdesign commented on issue #3988: bug: limit-count may prevent more requests by mistake that should access normally in High concurrency scenarios

2021-04-15 Thread GitBox


ychdesign commented on issue #3988:
URL: https://github.com/apache/apisix/issues/3988#issuecomment-820888124


   > 不知道为什么会将这几行代码去掉?
   > 
   > ```lua
   > local ok, err = red:set_keepalive(1, 100)
   > if not ok then
   > return nil, err
   > end
   > ```
   > 
   > @ychdesign
   
   sorry. I ignored it by mistake. would you make a pr to solve that?


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

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




[GitHub] [apisix] dickens7 closed issue #4066: bug: Advanced route matching condition is invalid

2021-04-15 Thread GitBox


dickens7 closed issue #4066:
URL: https://github.com/apache/apisix/issues/4066


   


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

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




[GitHub] [apisix] dickens7 commented on issue #4066: bug: Advanced route matching condition is invalid

2021-04-15 Thread GitBox


dickens7 commented on issue #4066:
URL: https://github.com/apache/apisix/issues/4066#issuecomment-820877538


   i see, 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.

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




[GitHub] [apisix-ingress-controller] Firstsawyou commented on a change in pull request #375: add e2e test cases for referer-restriction plugin

2021-04-15 Thread GitBox


Firstsawyou commented on a change in pull request #375:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/375#discussion_r614530842



##
File path: test/e2e/plugins/referer-restriction.go
##
@@ -0,0 +1,183 @@
+// 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 plugins
+
+import (
+   "fmt"
+   "github.com/onsi/ginkgo"
+   "github.com/stretchr/testify/assert"
+   "net/http"
+
+   "github.com/apache/apisix-ingress-controller/test/e2e/scaffold"
+)
+
+var _ = ginkgo.Describe("referer-restriction plugin", func() {
+   opts := {
+   Name:"default",
+   Kubeconfig:  scaffold.GetKubeconfig(),
+   APISIXConfigPath:"testdata/apisix-gw-config.yaml",
+   APISIXDefaultConfigPath: 
"testdata/apisix-gw-config-default.yaml",
+   IngressAPISIXReplicas:   1,
+   HTTPBinServicePort:  80,
+   APISIXRouteVersion:  "apisix.apache.org/v2alpha1",
+   }
+   s := scaffold.NewScaffold(opts)
+   ginkgo.It("referer-restriction plugin configuration whitelist list", 
func() {
+   backendSvc, backendPorts := s.DefaultHTTPBackend()
+   ar := fmt.Sprintf(`
+apiVersion: apisix.apache.org/v2alpha1
+kind: ApisixRoute
+metadata:
+ name: httpbin-route
+spec:
+ http:
+ - name: rule1
+   match:
+ hosts:
+ - httpbin.org
+ paths:
+   - /ip
+   backends:
+   - serviceName: %s
+ servicePort: %d
+ weight: 10
+   plugins:
+   - name: referer-restriction
+ enable: true
+ config:
+   whitelist:
+ - test.com
+ - "*.foo.com"
+`, backendSvc, backendPorts[0])
+
+   assert.Nil(ginkgo.GinkgoT(), s.CreateResourceFromString(ar))
+
+   err := s.EnsureNumApisixUpstreamsCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of 
upstreams")
+   err = s.EnsureNumApisixRoutesCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of routes")
+
+   // Referer match passed
+   resp := s.NewAPISIXClient().GET("/ip").
+   WithHeader("Host", "httpbin.org").
+   WithHeader("Referer", "http://test.com;).
+   Expect()
+   resp.Status(http.StatusOK)
+   resp.Body().Contains("origin")
+
+   // Referer match failed
+   resp = s.NewAPISIXClient().GET("/ip").
+   WithHeader("Host", "httpbin.org").
+   WithHeader("Referer", "http://www.test.com;).
+   Expect()
+   resp.Status(http.StatusForbidden)
+
+   // Referer match passed
+   resp = s.NewAPISIXClient().GET("/ip").
+   WithHeader("Host", "httpbin.org").
+   WithHeader("Referer", "http://www.foo.com;).
+   Expect()
+   resp.Status(http.StatusOK)
+   resp.Body().Contains("origin")
+   })
+
+   ginkgo.It("the bypass_missing field is true", func() {
+   backendSvc, backendPorts := s.DefaultHTTPBackend()
+   ar := fmt.Sprintf(`
+apiVersion: apisix.apache.org/v2alpha1
+kind: ApisixRoute
+metadata:
+ name: httpbin-route
+spec:
+ http:
+ - name: rule1
+   match:
+ hosts:
+ - httpbin.org
+ paths:
+   - /ip
+   backends:
+   - serviceName: %s
+ servicePort: %d
+ weight: 10
+   plugins:
+   - name: referer-restriction
+ enable: true
+ config:
+   whitelist:
+ - test.com
+   bypass_missing: true
+`, backendSvc, backendPorts[0])
+
+   assert.Nil(ginkgo.GinkgoT(), s.CreateResourceFromString(ar))
+
+   err := s.EnsureNumApisixUpstreamsCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of 
upstreams")
+   err = s.EnsureNumApisixRoutesCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of routes")
+
+   // Referer is missing
+   resp := s.NewAPISIXClient().GET("/ip").WithHeader("Host", 
"httpbin.org").Expect()
+   

[GitHub] [apisix-ingress-controller] Firstsawyou commented on a change in pull request #375: add e2e test cases for referer-restriction plugin

2021-04-15 Thread GitBox


Firstsawyou commented on a change in pull request #375:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/375#discussion_r614530376



##
File path: test/e2e/plugins/referer-restriction.go
##
@@ -0,0 +1,183 @@
+// 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 plugins
+
+import (
+   "fmt"
+   "github.com/onsi/ginkgo"
+   "github.com/stretchr/testify/assert"
+   "net/http"
+
+   "github.com/apache/apisix-ingress-controller/test/e2e/scaffold"
+)
+
+var _ = ginkgo.Describe("referer-restriction plugin", func() {
+   opts := {
+   Name:"default",
+   Kubeconfig:  scaffold.GetKubeconfig(),
+   APISIXConfigPath:"testdata/apisix-gw-config.yaml",
+   APISIXDefaultConfigPath: 
"testdata/apisix-gw-config-default.yaml",
+   IngressAPISIXReplicas:   1,
+   HTTPBinServicePort:  80,
+   APISIXRouteVersion:  "apisix.apache.org/v2alpha1",
+   }
+   s := scaffold.NewScaffold(opts)
+   ginkgo.It("referer-restriction plugin configuration whitelist list", 
func() {
+   backendSvc, backendPorts := s.DefaultHTTPBackend()
+   ar := fmt.Sprintf(`
+apiVersion: apisix.apache.org/v2alpha1
+kind: ApisixRoute
+metadata:
+ name: httpbin-route
+spec:
+ http:
+ - name: rule1
+   match:
+ hosts:
+ - httpbin.org
+ paths:
+   - /ip
+   backends:
+   - serviceName: %s
+ servicePort: %d
+ weight: 10
+   plugins:
+   - name: referer-restriction
+ enable: true
+ config:
+   whitelist:
+ - test.com
+ - "*.foo.com"
+`, backendSvc, backendPorts[0])
+
+   assert.Nil(ginkgo.GinkgoT(), s.CreateResourceFromString(ar))
+
+   err := s.EnsureNumApisixUpstreamsCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of 
upstreams")
+   err = s.EnsureNumApisixRoutesCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of routes")
+
+   // Referer match passed
+   resp := s.NewAPISIXClient().GET("/ip").
+   WithHeader("Host", "httpbin.org").
+   WithHeader("Referer", "http://test.com;).

Review comment:
   The global match `host` is used. If host has `'*'` as a wildcard, it 
will do special processing before global matching.




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

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




[GitHub] [apisix] Marco-Zheng commented on issue #4063: bug: the route which was create by dashboard is invalid

2021-04-15 Thread GitBox


Marco-Zheng commented on issue #4063:
URL: https://github.com/apache/apisix/issues/4063#issuecomment-820872377


   > You should check whether there is route data created by Dashboard in etcd?
   
   Like this:
   
{"update_time":1618539226,"create_time":1618539226,"host":"httpbin.org","upstream_id":"51","uri":"\/patient\/patient\/*","status":1,"priority":0,"id":"10"}
   /apisix/routes/350662478968914814
   
{"id":"350662478968914814","create_time":1618540724,"update_time":1618540724,"uris":["/member/member/*"],"name":"test","methods":["GET","HEAD","POST","PUT","DELETE","OPTIONS","PATCH"],"hosts":["httpbin.org"],"vars":[],"upstream_id":"51","status":1}


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

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




[GitHub] [apisix] Marco-Zheng commented on issue #4063: bug: the route which was create by dashboard is invalid

2021-04-15 Thread GitBox


Marco-Zheng commented on issue #4063:
URL: https://github.com/apache/apisix/issues/4063#issuecomment-820872234


   > You should check whether there is route data created by Dashboard in etcd?
   
   I also check the etcd, two route are all exsist 
   
![image](https://user-images.githubusercontent.com/52538259/114965161-a1b7cd00-9ea2-11eb-8472-bfd5e7e09dae.png)
   


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

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




[GitHub] [apisix] zwjzxh520 edited a comment on issue #3988: bug: limit-count may prevent more requests by mistake that should access normally in High concurrency scenarios

2021-04-15 Thread GitBox


zwjzxh520 edited a comment on issue #3988:
URL: https://github.com/apache/apisix/issues/3988#issuecomment-820871643


   不知道为什么会将这几行代码去掉?
   
   ```lua
   local ok, err = red:set_keepalive(1, 100)
   if not ok then
   return nil, err
   end
   ```
   
   @ychdesign 


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

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




[GitHub] [apisix] zwjzxh520 commented on issue #3988: bug: limit-count may prevent more requests by mistake that should access normally in High concurrency scenarios

2021-04-15 Thread GitBox


zwjzxh520 commented on issue #3988:
URL: https://github.com/apache/apisix/issues/3988#issuecomment-820871643


   不知道为什么会将这几行代码去掉?
   ` local ok, err = red:set_keepalive(1, 100)
   if not ok then
   return nil, err
   end`


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

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




[GitHub] [apisix] Firstsawyou commented on issue #4066: bug: Advanced route matching condition is invalid

2021-04-15 Thread GitBox


Firstsawyou commented on issue #4066:
URL: https://github.com/apache/apisix/issues/4066#issuecomment-820869984


   Different routes have the same uri, if you want to set advanced routing 
rules to match, then you need to set advanced routing rules for them at the 
same time. Here are some examples of routing rules, you can refer to: 
https://github.com/apache/apisix/blob/master/docs/en/latest/router-radixtree.md#4-different-routes-have-the-same-uri


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

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




[GitHub] [apisix] Marco-Zheng commented on issue #4063: bug: the route which was create by dashboard is invalid

2021-04-15 Thread GitBox


Marco-Zheng commented on issue #4063:
URL: https://github.com/apache/apisix/issues/4063#issuecomment-820868240


   > Could you see this route on dashboard ?
   
   I have written down the detailed reproduction process on below comment


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

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




[GitHub] [apisix] Marco-Zheng commented on issue #4063: bug: the route which was create by dashboard is invalid

2021-04-15 Thread GitBox


Marco-Zheng commented on issue #4063:
URL: https://github.com/apache/apisix/issues/4063#issuecomment-820867456


   > You should check whether there is route data created by Dashboard in etcd?
   
   In order to make it clear , i delete all route and will try to reenact the 
bug
   - Firstlly, i add a route by apisix admin api (not on dashboard) as below 
and it show on dashboard successfully.
   
![image](https://user-images.githubusercontent.com/52538259/114963392-3ae4e480-9e9f-11eb-83aa-c5354f546216.png)
   
![image](https://user-images.githubusercontent.com/52538259/114963234-d9bd1100-9e9e-11eb-9d3f-985453a631b4.png)
   Then i send a request, the route was found(only one route) 
   
![image](https://user-images.githubusercontent.com/52538259/114963532-8f885f80-9e9f-11eb-928f-7f45cb26e863.png)
   
   - Then i create a route on dashboard as below, only route path change 
   
![image](https://user-images.githubusercontent.com/52538259/114963740-f73eaa80-9e9f-11eb-84ee-144fd91340d5.png)
   Here has two route as below
   
![image](https://user-images.githubusercontent.com/52538259/114963810-1c331d80-9ea0-11eb-9204-c94538d24196.png)
   Then i send a request, as you can see, the route not found..
   
![image](https://user-images.githubusercontent.com/52538259/114963866-3bca4600-9ea0-11eb-9ce8-d766acd2bb59.png)
   


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

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




[GitHub] [apisix] hozaifaaoud edited a comment on issue #4065: 404 Not Found

2021-04-15 Thread GitBox


hozaifaaoud edited a comment on issue #4065:
URL: https://github.com/apache/apisix/issues/4065#issuecomment-820841773


   I tried this curl http://127.0.0.1:9090/testrouting
   and here is the response
   
![image](https://user-images.githubusercontent.com/79872781/114963695-9b5b2e00-9e6d-11eb-9cd7-c3edbd8257cd.png)
   could you please help... why it does not work when calling it from the 
APISIX... this url   curl http://127.0.0.1:9080/testrouting???
   
   
   
   [image: Mailtrack]
   

   Sender
   notified by
   Mailtrack
   

   04/16/21,
   03:24:24 AM
   
   On Fri, Apr 16, 2021 at 3:17 AM Yuelin Zheng ***@***.***>
   wrote:
   
   > It looks like your upstream does not have the /testrouting API. You
   > should try to request curl http://127.0.0.1:9090/testrouting to see if
   > the access is successful?
   >
   > —
   > You are receiving this because you authored the thread.
   > Reply to this email directly, view it on GitHub
   > , or
   > unsubscribe
   > 

   > .
   >
   


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

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




[GitHub] [apisix-dashboard] juzhiyuan commented on pull request #1763: chore(deps): bump actions/cache from v2.1.4 to v2.1.5

2021-04-15 Thread GitBox


juzhiyuan commented on pull request #1763:
URL: https://github.com/apache/apisix-dashboard/pull/1763#issuecomment-820861512


   may help this bot to merge 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.

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




[GitHub] [apisix] Marco-Zheng commented on issue #4063: bug: the route which was create by dashboard is invalid

2021-04-15 Thread GitBox


Marco-Zheng commented on issue #4063:
URL: https://github.com/apache/apisix/issues/4063#issuecomment-820860512


   > You should check whether there is route data created by Dashboard in etcd?
   
   
   
   > Could you see this route on dashboard ?
   
   Yes, i can see the route.


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

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




[GitHub] [apisix-docker] starsz commented on pull request #159: feat: automate upload image to Dockerhub

2021-04-15 Thread GitBox


starsz commented on pull request #159:
URL: https://github.com/apache/apisix-docker/pull/159#issuecomment-820860238


   > However, due to Apache rules, there are chances that we are not allowed to 
use Github Actions provided by docker. So we might need to use Docker API to 
write the auto-upload scripts.
   
   As the issue said.
   Can we do this in Github action? @Yiyiyimu 


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

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




[GitHub] [apisix] hozaifaaoud commented on issue #4054: 503 Service Temporarily Unavailable

2021-04-15 Thread GitBox


hozaifaaoud commented on issue #4054:
URL: https://github.com/apache/apisix/issues/4054#issuecomment-820855609


   yes I tried accessing the service directly 
   my test API is up and running in this port  9090
   here is the request
   curl  http://127.0.0.1:9090/
   and here is the response 
   
![image](https://user-images.githubusercontent.com/79872781/114960899-42d56200-9e68-11eb-9907-43ebba2bff3c.png)
   


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

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




[GitHub] [apisix] dickens7 opened a new issue #4066: bug: Advanced route matching condition is invalid

2021-04-15 Thread GitBox


dickens7 opened a new issue #4066:
URL: https://github.com/apache/apisix/issues/4066


   ### Issue description
   
   When the uri of the two routes are the same, the upstream is inconsistent. 
One is to set the advanced routing "header route", and one is ordinary route. 
When the weights of the two routes are the same or the weight of the ordinary 
route is greater than that of the advanced route, the advanced route cannot be 
hit. 
   
   ### Environment
   
   * apisix version (cmd: `apisix version`): 
2.5 
   
   * OS (cmd: `uname -a`):  
   Ubuntu 20.04
   
   * OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`):  
openresty/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): 
   
{"boot_time":1618294363,"etcd_version":"3.4.0","id":"79165099-6f97-4ab3-baf6-ac73f87b2d41","hostname":"apisix-778786b894-7krw9","last_report_time":1618537429,"version":"2.5","up_time":243104}
   
   * apisix-dashboard version, if have: 
   2.5


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

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




[GitHub] [apisix-ingress-controller] tokers commented on a change in pull request #375: add e2e test cases for referer-restriction plugin

2021-04-15 Thread GitBox


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



##
File path: test/e2e/plugins/referer-restriction.go
##
@@ -0,0 +1,183 @@
+// 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 plugins
+
+import (
+   "fmt"
+   "github.com/onsi/ginkgo"
+   "github.com/stretchr/testify/assert"
+   "net/http"
+
+   "github.com/apache/apisix-ingress-controller/test/e2e/scaffold"
+)
+
+var _ = ginkgo.Describe("referer-restriction plugin", func() {
+   opts := {
+   Name:"default",
+   Kubeconfig:  scaffold.GetKubeconfig(),
+   APISIXConfigPath:"testdata/apisix-gw-config.yaml",
+   APISIXDefaultConfigPath: 
"testdata/apisix-gw-config-default.yaml",
+   IngressAPISIXReplicas:   1,
+   HTTPBinServicePort:  80,
+   APISIXRouteVersion:  "apisix.apache.org/v2alpha1",
+   }
+   s := scaffold.NewScaffold(opts)
+   ginkgo.It("referer-restriction plugin configuration whitelist list", 
func() {
+   backendSvc, backendPorts := s.DefaultHTTPBackend()
+   ar := fmt.Sprintf(`
+apiVersion: apisix.apache.org/v2alpha1
+kind: ApisixRoute
+metadata:
+ name: httpbin-route
+spec:
+ http:
+ - name: rule1
+   match:
+ hosts:
+ - httpbin.org
+ paths:
+   - /ip
+   backends:
+   - serviceName: %s
+ servicePort: %d
+ weight: 10
+   plugins:
+   - name: referer-restriction
+ enable: true
+ config:
+   whitelist:
+ - test.com
+ - "*.foo.com"
+`, backendSvc, backendPorts[0])
+
+   assert.Nil(ginkgo.GinkgoT(), s.CreateResourceFromString(ar))
+
+   err := s.EnsureNumApisixUpstreamsCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of 
upstreams")
+   err = s.EnsureNumApisixRoutesCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of routes")
+
+   // Referer match passed
+   resp := s.NewAPISIXClient().GET("/ip").
+   WithHeader("Host", "httpbin.org").
+   WithHeader("Referer", "http://test.com;).
+   Expect()
+   resp.Status(http.StatusOK)
+   resp.Body().Contains("origin")
+
+   // Referer match failed
+   resp = s.NewAPISIXClient().GET("/ip").
+   WithHeader("Host", "httpbin.org").
+   WithHeader("Referer", "http://www.test.com;).
+   Expect()
+   resp.Status(http.StatusForbidden)
+
+   // Referer match passed
+   resp = s.NewAPISIXClient().GET("/ip").
+   WithHeader("Host", "httpbin.org").
+   WithHeader("Referer", "http://www.foo.com;).
+   Expect()
+   resp.Status(http.StatusOK)
+   resp.Body().Contains("origin")
+   })
+
+   ginkgo.It("the bypass_missing field is true", func() {
+   backendSvc, backendPorts := s.DefaultHTTPBackend()
+   ar := fmt.Sprintf(`
+apiVersion: apisix.apache.org/v2alpha1
+kind: ApisixRoute
+metadata:
+ name: httpbin-route
+spec:
+ http:
+ - name: rule1
+   match:
+ hosts:
+ - httpbin.org
+ paths:
+   - /ip
+   backends:
+   - serviceName: %s
+ servicePort: %d
+ weight: 10
+   plugins:
+   - name: referer-restriction
+ enable: true
+ config:
+   whitelist:
+ - test.com
+   bypass_missing: true
+`, backendSvc, backendPorts[0])
+
+   assert.Nil(ginkgo.GinkgoT(), s.CreateResourceFromString(ar))
+
+   err := s.EnsureNumApisixUpstreamsCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of 
upstreams")
+   err = s.EnsureNumApisixRoutesCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of routes")
+
+   // Referer is missing
+   resp := s.NewAPISIXClient().GET("/ip").WithHeader("Host", 
"httpbin.org").Expect()
+   resp.Status(http.StatusOK)

[GitHub] [apisix-dashboard] starsz commented on a change in pull request #1766: feat: support auto build rpm package for dashboard

2021-04-15 Thread GitBox


starsz commented on a change in pull request #1766:
URL: https://github.com/apache/apisix-dashboard/pull/1766#discussion_r614505087



##
File path: .github/workflows/auto-build-rpm.yml
##
@@ -0,0 +1,69 @@
+name: Auto Build RPM
+
+on:
+  push:
+branches: [master, 'release/**']
+paths-ignore:
+  - 'docs/**'
+  pull_request:
+branches: [master]
+paths-ignore:
+  - 'docs/**'
+
+jobs:
+  auto_build_rpm:
+name: auto build rpm package
+runs-on: ubuntu-latest
+
+services:
+  etcd:
+image: bitnami/etcd:3.4.0
+ports:
+  - 2379:2379
+  - 2380:2380
+env:
+  ALLOW_NONE_AUTHENTICATION: yes
+  ETCD_ADVERTISE_CLIENT_URLS: http://0.0.0.0:2379
+
+steps:
+- name: Check out code
+  uses: actions/checkout@v2
+
+- name: Extract branch name
+  if: ${{ startsWith(github.ref, 'refs/heads/release/') }}
+  id: branch_env
+  shell: bash
+  run: |
+echo "##[set-output name=version;]$(echo ${GITHUB_REF##*/})"
+
+- name: Build rpm package
+  run: |
+export VERSION=2.5

Review comment:
   Hard code ?

##
File path: .github/workflows/auto-build-rpm.yml
##
@@ -0,0 +1,69 @@
+name: Auto Build RPM
+
+on:
+  push:
+branches: [master, 'release/**']
+paths-ignore:
+  - 'docs/**'
+  pull_request:
+branches: [master]
+paths-ignore:
+  - 'docs/**'
+
+jobs:
+  auto_build_rpm:
+name: auto build rpm package
+runs-on: ubuntu-latest
+
+services:
+  etcd:
+image: bitnami/etcd:3.4.0
+ports:
+  - 2379:2379
+  - 2380:2380
+env:
+  ALLOW_NONE_AUTHENTICATION: yes
+  ETCD_ADVERTISE_CLIENT_URLS: http://0.0.0.0:2379
+
+steps:
+- name: Check out code
+  uses: actions/checkout@v2
+
+- name: Extract branch name
+  if: ${{ startsWith(github.ref, 'refs/heads/release/') }}
+  id: branch_env
+  shell: bash
+  run: |
+echo "##[set-output name=version;]$(echo ${GITHUB_REF##*/})"
+
+- name: Build rpm package
+  run: |
+export VERSION=2.5
+sudo gem install --no-document fpm
+git clone https://github.com/api7/apisix-build-tools.git
+cd apisix-build-tools
+make package type=rpm app=dashboard version=${VERSION} 
checkout=release/${VERSION}
+
+- name: Run centos7 docker and mapping apisix into container
+  run: |
+docker run -itd -v $PWD:/apisix-dashboard --name centos7Instance 
--net="host" docker.io/centos:7 /bin/bash
+
+- name: Install rpm package
+  run: |
+export VERSION=2.5

Review comment:
   Hard code ?

##
File path: .github/workflows/auto-build-rpm.yml
##
@@ -0,0 +1,69 @@
+name: Auto Build RPM
+
+on:
+  push:
+branches: [master, 'release/**']
+paths-ignore:
+  - 'docs/**'
+  pull_request:
+branches: [master]
+paths-ignore:
+  - 'docs/**'
+
+jobs:
+  auto_build_rpm:
+name: auto build rpm package
+runs-on: ubuntu-latest
+
+services:
+  etcd:
+image: bitnami/etcd:3.4.0
+ports:
+  - 2379:2379
+  - 2380:2380
+env:
+  ALLOW_NONE_AUTHENTICATION: yes
+  ETCD_ADVERTISE_CLIENT_URLS: http://0.0.0.0:2379
+
+steps:
+- name: Check out code
+  uses: actions/checkout@v2
+
+- name: Extract branch name
+  if: ${{ startsWith(github.ref, 'refs/heads/release/') }}
+  id: branch_env
+  shell: bash
+  run: |
+echo "##[set-output name=version;]$(echo ${GITHUB_REF##*/})"
+
+- name: Build rpm package
+  run: |
+export VERSION=2.5
+sudo gem install --no-document fpm
+git clone https://github.com/api7/apisix-build-tools.git
+cd apisix-build-tools
+make package type=rpm app=dashboard version=${VERSION} 
checkout=release/${VERSION}
+
+- name: Run centos7 docker and mapping apisix into container
+  run: |
+docker run -itd -v $PWD:/apisix-dashboard --name centos7Instance 
--net="host" docker.io/centos:7 /bin/bash
+
+- name: Install rpm package
+  run: |
+export VERSION=2.5
+docker exec centos7Instance bash -c "cd apisix-dashboard && yum 
install -y ./apisix-build-tools/output/apisix-dashboard-${VERSION}-0.x86_64.rpm"
+docker logs centos7Instance
+# Dependencies are attached with rpm, so revert `make deps`
+docker exec centos7Instance bash -c "cd /usr/local/apisix/dashboard/ 
&& nohup ./manager-api &"
+
+- name: Run test cases
+  run: |
+ls -l
+pwd

Review comment:
   Debug lines?




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

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




[GitHub] [apisix-ingress-controller] tokers commented on a change in pull request #375: add e2e test cases for referer-restriction plugin

2021-04-15 Thread GitBox


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



##
File path: test/e2e/plugins/referer-restriction.go
##
@@ -0,0 +1,183 @@
+// 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 plugins
+
+import (
+   "fmt"
+   "github.com/onsi/ginkgo"
+   "github.com/stretchr/testify/assert"
+   "net/http"
+
+   "github.com/apache/apisix-ingress-controller/test/e2e/scaffold"
+)
+
+var _ = ginkgo.Describe("referer-restriction plugin", func() {
+   opts := {
+   Name:"default",
+   Kubeconfig:  scaffold.GetKubeconfig(),
+   APISIXConfigPath:"testdata/apisix-gw-config.yaml",
+   APISIXDefaultConfigPath: 
"testdata/apisix-gw-config-default.yaml",
+   IngressAPISIXReplicas:   1,
+   HTTPBinServicePort:  80,
+   APISIXRouteVersion:  "apisix.apache.org/v2alpha1",
+   }
+   s := scaffold.NewScaffold(opts)
+   ginkgo.It("referer-restriction plugin configuration whitelist list", 
func() {
+   backendSvc, backendPorts := s.DefaultHTTPBackend()
+   ar := fmt.Sprintf(`
+apiVersion: apisix.apache.org/v2alpha1
+kind: ApisixRoute
+metadata:
+ name: httpbin-route
+spec:
+ http:
+ - name: rule1
+   match:
+ hosts:
+ - httpbin.org
+ paths:
+   - /ip
+   backends:
+   - serviceName: %s
+ servicePort: %d
+ weight: 10
+   plugins:
+   - name: referer-restriction
+ enable: true
+ config:
+   whitelist:
+ - test.com
+ - "*.foo.com"
+`, backendSvc, backendPorts[0])
+
+   assert.Nil(ginkgo.GinkgoT(), s.CreateResourceFromString(ar))
+
+   err := s.EnsureNumApisixUpstreamsCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of 
upstreams")
+   err = s.EnsureNumApisixRoutesCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of routes")
+
+   // Referer match passed
+   resp := s.NewAPISIXClient().GET("/ip").
+   WithHeader("Host", "httpbin.org").
+   WithHeader("Referer", "http://test.com;).
+   Expect()
+   resp.Status(http.StatusOK)
+   resp.Body().Contains("origin")
+
+   // Referer match failed
+   resp = s.NewAPISIXClient().GET("/ip").
+   WithHeader("Host", "httpbin.org").
+   WithHeader("Referer", "http://www.test.com;).
+   Expect()
+   resp.Status(http.StatusForbidden)
+
+   // Referer match passed
+   resp = s.NewAPISIXClient().GET("/ip").
+   WithHeader("Host", "httpbin.org").
+   WithHeader("Referer", "http://www.foo.com;).
+   Expect()
+   resp.Status(http.StatusOK)
+   resp.Body().Contains("origin")
+   })
+
+   ginkgo.It("the bypass_missing field is true", func() {
+   backendSvc, backendPorts := s.DefaultHTTPBackend()
+   ar := fmt.Sprintf(`
+apiVersion: apisix.apache.org/v2alpha1
+kind: ApisixRoute
+metadata:
+ name: httpbin-route
+spec:
+ http:
+ - name: rule1
+   match:
+ hosts:
+ - httpbin.org
+ paths:
+   - /ip
+   backends:
+   - serviceName: %s
+ servicePort: %d
+ weight: 10
+   plugins:
+   - name: referer-restriction
+ enable: true
+ config:
+   whitelist:
+ - test.com
+   bypass_missing: true
+`, backendSvc, backendPorts[0])
+
+   assert.Nil(ginkgo.GinkgoT(), s.CreateResourceFromString(ar))
+
+   err := s.EnsureNumApisixUpstreamsCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of 
upstreams")
+   err = s.EnsureNumApisixRoutesCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of routes")
+
+   // Referer is missing
+   resp := s.NewAPISIXClient().GET("/ip").WithHeader("Host", 
"httpbin.org").Expect()
+   resp.Status(http.StatusOK)

[GitHub] [apisix-ingress-controller] tokers commented on a change in pull request #375: add e2e test cases for referer-restriction plugin

2021-04-15 Thread GitBox


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



##
File path: test/e2e/plugins/referer-restriction.go
##
@@ -0,0 +1,183 @@
+// 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 plugins
+
+import (
+   "fmt"
+   "github.com/onsi/ginkgo"
+   "github.com/stretchr/testify/assert"
+   "net/http"
+
+   "github.com/apache/apisix-ingress-controller/test/e2e/scaffold"
+)
+
+var _ = ginkgo.Describe("referer-restriction plugin", func() {
+   opts := {
+   Name:"default",
+   Kubeconfig:  scaffold.GetKubeconfig(),
+   APISIXConfigPath:"testdata/apisix-gw-config.yaml",
+   APISIXDefaultConfigPath: 
"testdata/apisix-gw-config-default.yaml",
+   IngressAPISIXReplicas:   1,
+   HTTPBinServicePort:  80,
+   APISIXRouteVersion:  "apisix.apache.org/v2alpha1",
+   }
+   s := scaffold.NewScaffold(opts)
+   ginkgo.It("referer-restriction plugin configuration whitelist list", 
func() {
+   backendSvc, backendPorts := s.DefaultHTTPBackend()
+   ar := fmt.Sprintf(`
+apiVersion: apisix.apache.org/v2alpha1
+kind: ApisixRoute
+metadata:
+ name: httpbin-route
+spec:
+ http:
+ - name: rule1
+   match:
+ hosts:
+ - httpbin.org
+ paths:
+   - /ip
+   backends:
+   - serviceName: %s
+ servicePort: %d
+ weight: 10
+   plugins:
+   - name: referer-restriction
+ enable: true
+ config:
+   whitelist:
+ - test.com
+ - "*.foo.com"
+`, backendSvc, backendPorts[0])
+
+   assert.Nil(ginkgo.GinkgoT(), s.CreateResourceFromString(ar))
+
+   err := s.EnsureNumApisixUpstreamsCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of 
upstreams")
+   err = s.EnsureNumApisixRoutesCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of routes")
+
+   // Referer match passed
+   resp := s.NewAPISIXClient().GET("/ip").
+   WithHeader("Host", "httpbin.org").
+   WithHeader("Referer", "http://test.com;).
+   Expect()
+   resp.Status(http.StatusOK)
+   resp.Body().Contains("origin")
+
+   // Referer match failed
+   resp = s.NewAPISIXClient().GET("/ip").
+   WithHeader("Host", "httpbin.org").
+   WithHeader("Referer", "http://www.test.com;).
+   Expect()
+   resp.Status(http.StatusForbidden)
+
+   // Referer match passed
+   resp = s.NewAPISIXClient().GET("/ip").
+   WithHeader("Host", "httpbin.org").
+   WithHeader("Referer", "http://www.foo.com;).
+   Expect()
+   resp.Status(http.StatusOK)
+   resp.Body().Contains("origin")
+   })
+
+   ginkgo.It("the bypass_missing field is true", func() {
+   backendSvc, backendPorts := s.DefaultHTTPBackend()
+   ar := fmt.Sprintf(`
+apiVersion: apisix.apache.org/v2alpha1
+kind: ApisixRoute
+metadata:
+ name: httpbin-route
+spec:
+ http:
+ - name: rule1
+   match:
+ hosts:
+ - httpbin.org
+ paths:
+   - /ip
+   backends:
+   - serviceName: %s
+ servicePort: %d
+ weight: 10
+   plugins:
+   - name: referer-restriction
+ enable: true
+ config:
+   whitelist:
+ - test.com
+   bypass_missing: true
+`, backendSvc, backendPorts[0])
+
+   assert.Nil(ginkgo.GinkgoT(), s.CreateResourceFromString(ar))
+
+   err := s.EnsureNumApisixUpstreamsCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of 
upstreams")
+   err = s.EnsureNumApisixRoutesCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of routes")
+
+   // Referer is missing
+   resp := s.NewAPISIXClient().GET("/ip").WithHeader("Host", 
"httpbin.org").Expect()
+   resp.Status(http.StatusOK)

[GitHub] [apisix-ingress-controller] tokers commented on a change in pull request #375: add e2e test cases for referer-restriction plugin

2021-04-15 Thread GitBox


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



##
File path: test/e2e/plugins/referer-restriction.go
##
@@ -0,0 +1,183 @@
+// 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 plugins
+
+import (
+   "fmt"
+   "github.com/onsi/ginkgo"
+   "github.com/stretchr/testify/assert"
+   "net/http"
+
+   "github.com/apache/apisix-ingress-controller/test/e2e/scaffold"
+)
+
+var _ = ginkgo.Describe("referer-restriction plugin", func() {
+   opts := {
+   Name:"default",
+   Kubeconfig:  scaffold.GetKubeconfig(),
+   APISIXConfigPath:"testdata/apisix-gw-config.yaml",
+   APISIXDefaultConfigPath: 
"testdata/apisix-gw-config-default.yaml",
+   IngressAPISIXReplicas:   1,
+   HTTPBinServicePort:  80,
+   APISIXRouteVersion:  "apisix.apache.org/v2alpha1",
+   }
+   s := scaffold.NewScaffold(opts)
+   ginkgo.It("referer-restriction plugin configuration whitelist list", 
func() {
+   backendSvc, backendPorts := s.DefaultHTTPBackend()
+   ar := fmt.Sprintf(`
+apiVersion: apisix.apache.org/v2alpha1
+kind: ApisixRoute
+metadata:
+ name: httpbin-route
+spec:
+ http:
+ - name: rule1
+   match:
+ hosts:
+ - httpbin.org
+ paths:
+   - /ip
+   backends:
+   - serviceName: %s
+ servicePort: %d
+ weight: 10
+   plugins:
+   - name: referer-restriction
+ enable: true
+ config:
+   whitelist:
+ - test.com
+ - "*.foo.com"
+`, backendSvc, backendPorts[0])
+
+   assert.Nil(ginkgo.GinkgoT(), s.CreateResourceFromString(ar))
+
+   err := s.EnsureNumApisixUpstreamsCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of 
upstreams")
+   err = s.EnsureNumApisixRoutesCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of routes")
+
+   // Referer match passed
+   resp := s.NewAPISIXClient().GET("/ip").
+   WithHeader("Host", "httpbin.org").
+   WithHeader("Referer", "http://test.com;).
+   Expect()
+   resp.Status(http.StatusOK)
+   resp.Body().Contains("origin")
+
+   // Referer match failed
+   resp = s.NewAPISIXClient().GET("/ip").
+   WithHeader("Host", "httpbin.org").
+   WithHeader("Referer", "http://www.test.com;).
+   Expect()
+   resp.Status(http.StatusForbidden)
+
+   // Referer match passed
+   resp = s.NewAPISIXClient().GET("/ip").
+   WithHeader("Host", "httpbin.org").
+   WithHeader("Referer", "http://www.foo.com;).
+   Expect()
+   resp.Status(http.StatusOK)
+   resp.Body().Contains("origin")
+   })
+
+   ginkgo.It("the bypass_missing field is true", func() {
+   backendSvc, backendPorts := s.DefaultHTTPBackend()
+   ar := fmt.Sprintf(`
+apiVersion: apisix.apache.org/v2alpha1
+kind: ApisixRoute
+metadata:
+ name: httpbin-route
+spec:
+ http:
+ - name: rule1
+   match:
+ hosts:
+ - httpbin.org
+ paths:
+   - /ip
+   backends:
+   - serviceName: %s
+ servicePort: %d
+ weight: 10
+   plugins:
+   - name: referer-restriction
+ enable: true
+ config:
+   whitelist:
+ - test.com
+   bypass_missing: true
+`, backendSvc, backendPorts[0])
+
+   assert.Nil(ginkgo.GinkgoT(), s.CreateResourceFromString(ar))
+
+   err := s.EnsureNumApisixUpstreamsCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of 
upstreams")
+   err = s.EnsureNumApisixRoutesCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of routes")
+
+   // Referer is missing
+   resp := s.NewAPISIXClient().GET("/ip").WithHeader("Host", 
"httpbin.org").Expect()
+   resp.Status(http.StatusOK)

[GitHub] [apisix-ingress-controller] tokers commented on a change in pull request #375: add e2e test cases for referer-restriction plugin

2021-04-15 Thread GitBox


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



##
File path: test/e2e/plugins/referer-restriction.go
##
@@ -0,0 +1,183 @@
+// 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 plugins
+
+import (
+   "fmt"
+   "github.com/onsi/ginkgo"
+   "github.com/stretchr/testify/assert"
+   "net/http"
+
+   "github.com/apache/apisix-ingress-controller/test/e2e/scaffold"
+)
+
+var _ = ginkgo.Describe("referer-restriction plugin", func() {
+   opts := {
+   Name:"default",
+   Kubeconfig:  scaffold.GetKubeconfig(),
+   APISIXConfigPath:"testdata/apisix-gw-config.yaml",
+   APISIXDefaultConfigPath: 
"testdata/apisix-gw-config-default.yaml",
+   IngressAPISIXReplicas:   1,
+   HTTPBinServicePort:  80,
+   APISIXRouteVersion:  "apisix.apache.org/v2alpha1",
+   }
+   s := scaffold.NewScaffold(opts)
+   ginkgo.It("referer-restriction plugin configuration whitelist list", 
func() {
+   backendSvc, backendPorts := s.DefaultHTTPBackend()
+   ar := fmt.Sprintf(`
+apiVersion: apisix.apache.org/v2alpha1
+kind: ApisixRoute
+metadata:
+ name: httpbin-route
+spec:
+ http:
+ - name: rule1
+   match:
+ hosts:
+ - httpbin.org
+ paths:
+   - /ip
+   backends:
+   - serviceName: %s
+ servicePort: %d
+ weight: 10
+   plugins:
+   - name: referer-restriction
+ enable: true
+ config:
+   whitelist:
+ - test.com
+ - "*.foo.com"
+`, backendSvc, backendPorts[0])
+
+   assert.Nil(ginkgo.GinkgoT(), s.CreateResourceFromString(ar))
+
+   err := s.EnsureNumApisixUpstreamsCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of 
upstreams")
+   err = s.EnsureNumApisixRoutesCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of routes")
+
+   // Referer match passed
+   resp := s.NewAPISIXClient().GET("/ip").
+   WithHeader("Host", "httpbin.org").
+   WithHeader("Referer", "http://test.com;).

Review comment:
   But the rule you configured doesn't contains the scheme. I mean, does it 
use regex pattern or glob match?




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

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




[GitHub] [apisix-ingress-controller] Firstsawyou commented on a change in pull request #375: add e2e test cases for referer-restriction plugin

2021-04-15 Thread GitBox


Firstsawyou commented on a change in pull request #375:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/375#discussion_r614497370



##
File path: test/e2e/plugins/referer-restriction.go
##
@@ -0,0 +1,183 @@
+// 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 plugins
+
+import (
+   "fmt"
+   "github.com/onsi/ginkgo"
+   "github.com/stretchr/testify/assert"
+   "net/http"
+
+   "github.com/apache/apisix-ingress-controller/test/e2e/scaffold"
+)
+
+var _ = ginkgo.Describe("referer-restriction plugin", func() {
+   opts := {
+   Name:"default",
+   Kubeconfig:  scaffold.GetKubeconfig(),
+   APISIXConfigPath:"testdata/apisix-gw-config.yaml",
+   APISIXDefaultConfigPath: 
"testdata/apisix-gw-config-default.yaml",
+   IngressAPISIXReplicas:   1,
+   HTTPBinServicePort:  80,
+   APISIXRouteVersion:  "apisix.apache.org/v2alpha1",
+   }
+   s := scaffold.NewScaffold(opts)
+   ginkgo.It("referer-restriction plugin configuration whitelist list", 
func() {
+   backendSvc, backendPorts := s.DefaultHTTPBackend()
+   ar := fmt.Sprintf(`
+apiVersion: apisix.apache.org/v2alpha1
+kind: ApisixRoute
+metadata:
+ name: httpbin-route
+spec:
+ http:
+ - name: rule1
+   match:
+ hosts:
+ - httpbin.org
+ paths:
+   - /ip
+   backends:
+   - serviceName: %s
+ servicePort: %d
+ weight: 10
+   plugins:
+   - name: referer-restriction
+ enable: true
+ config:
+   whitelist:
+ - test.com
+ - "*.foo.com"
+`, backendSvc, backendPorts[0])
+
+   assert.Nil(ginkgo.GinkgoT(), s.CreateResourceFromString(ar))
+
+   err := s.EnsureNumApisixUpstreamsCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of 
upstreams")
+   err = s.EnsureNumApisixRoutesCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of routes")
+

Review comment:
   Ok, Got it.

##
File path: test/e2e/plugins/referer-restriction.go
##
@@ -0,0 +1,183 @@
+// 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 plugins
+
+import (
+   "fmt"
+   "github.com/onsi/ginkgo"
+   "github.com/stretchr/testify/assert"
+   "net/http"
+
+   "github.com/apache/apisix-ingress-controller/test/e2e/scaffold"
+)
+
+var _ = ginkgo.Describe("referer-restriction plugin", func() {
+   opts := {
+   Name:"default",
+   Kubeconfig:  scaffold.GetKubeconfig(),
+   APISIXConfigPath:"testdata/apisix-gw-config.yaml",
+   APISIXDefaultConfigPath: 
"testdata/apisix-gw-config-default.yaml",
+   IngressAPISIXReplicas:   1,
+   HTTPBinServicePort:  80,
+   APISIXRouteVersion:  "apisix.apache.org/v2alpha1",
+   }
+   s := scaffold.NewScaffold(opts)
+   ginkgo.It("referer-restriction plugin configuration whitelist list", 
func() {
+   backendSvc, backendPorts := s.DefaultHTTPBackend()
+   ar := fmt.Sprintf(`
+apiVersion: apisix.apache.org/v2alpha1
+kind: ApisixRoute
+metadata:
+ name: httpbin-route
+spec:
+ http:
+ - name: rule1
+   match:
+ hosts:
+ - httpbin.org
+ paths:
+   - /ip
+   backends:
+   - serviceName: %s
+ servicePort: 

[GitHub] [apisix] tokers commented on issue #4054: 503 Service Temporarily Unavailable

2021-04-15 Thread GitBox


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


   > Thank you for your response,
   > 
   > I applied your solution.
   > 
   > And I tried calling the API using :
   > 
   > curl http://127.0.0.1:9080/testrouting
   > 
   > then  I faced this issue
   > 
   > 
![image](https://user-images.githubusercontent.com/79872781/114926850-21a54f00-9e31-11eb-892b-77fa6dcaac5a.png)
   > 
   > could you please help me?
   > 
   > 
   
   Have you ever tried to access the upstream endpoint directly? It seems like 
this 404 response is not generated by apisix.


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

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




[GitHub] [apisix-ingress-controller] Firstsawyou commented on a change in pull request #375: add e2e test cases for referer-restriction plugin

2021-04-15 Thread GitBox


Firstsawyou commented on a change in pull request #375:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/375#discussion_r614495594



##
File path: test/e2e/plugins/referer-restriction.go
##
@@ -0,0 +1,183 @@
+// 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 plugins
+
+import (
+   "fmt"
+   "github.com/onsi/ginkgo"
+   "github.com/stretchr/testify/assert"
+   "net/http"
+
+   "github.com/apache/apisix-ingress-controller/test/e2e/scaffold"
+)
+
+var _ = ginkgo.Describe("referer-restriction plugin", func() {
+   opts := {
+   Name:"default",
+   Kubeconfig:  scaffold.GetKubeconfig(),
+   APISIXConfigPath:"testdata/apisix-gw-config.yaml",
+   APISIXDefaultConfigPath: 
"testdata/apisix-gw-config-default.yaml",
+   IngressAPISIXReplicas:   1,
+   HTTPBinServicePort:  80,
+   APISIXRouteVersion:  "apisix.apache.org/v2alpha1",
+   }
+   s := scaffold.NewScaffold(opts)
+   ginkgo.It("referer-restriction plugin configuration whitelist list", 
func() {
+   backendSvc, backendPorts := s.DefaultHTTPBackend()
+   ar := fmt.Sprintf(`
+apiVersion: apisix.apache.org/v2alpha1
+kind: ApisixRoute
+metadata:
+ name: httpbin-route
+spec:
+ http:
+ - name: rule1
+   match:
+ hosts:
+ - httpbin.org
+ paths:
+   - /ip
+   backends:
+   - serviceName: %s
+ servicePort: %d
+ weight: 10
+   plugins:
+   - name: referer-restriction
+ enable: true
+ config:
+   whitelist:
+ - test.com
+ - "*.foo.com"
+`, backendSvc, backendPorts[0])
+
+   assert.Nil(ginkgo.GinkgoT(), s.CreateResourceFromString(ar))
+
+   err := s.EnsureNumApisixUpstreamsCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of 
upstreams")
+   err = s.EnsureNumApisixRoutesCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of routes")
+
+   // Referer match passed
+   resp := s.NewAPISIXClient().GET("/ip").
+   WithHeader("Host", "httpbin.org").
+   WithHeader("Referer", "http://test.com;).

Review comment:
   The `Referer` header needs to contain `scheme` + `host`, I refer to it 
here: 
https://github.com/apache/apisix/blob/master/t/plugin/referer-restriction.t#L51-L90




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

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




[GitHub] [apisix] hozaifaaoud edited a comment on issue #4065: 404 Not Found

2021-04-15 Thread GitBox


hozaifaaoud edited a comment on issue #4065:
URL: https://github.com/apache/apisix/issues/4065#issuecomment-820841773


   I tried this curl http://127.0.0.1:9090/testrouting
   and here is the response
   
![image](https://user-images.githubusercontent.com/79872781/114958475-61852a00-9e63-11eb-9eaa-acc0dcf0a098.png)
   
   
   
   
   
   [image: Mailtrack]
   

   Sender
   notified by
   Mailtrack
   

   04/16/21,
   03:24:24 AM
   
   On Fri, Apr 16, 2021 at 3:17 AM Yuelin Zheng ***@***.***>
   wrote:
   
   > It looks like your upstream does not have the /testrouting API. You
   > should try to request curl http://127.0.0.1:9090/testrouting to see if
   > the access is successful?
   >
   > —
   > You are receiving this because you authored the thread.
   > Reply to this email directly, view it on GitHub
   > , or
   > unsubscribe
   > 

   > .
   >
   


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

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




[GitHub] [apisix] hozaifaaoud commented on issue #4065: 404 Not Found

2021-04-15 Thread GitBox


hozaifaaoud commented on issue #4065:
URL: https://github.com/apache/apisix/issues/4065#issuecomment-820841773


   I tried this curl http://127.0.0.1:9090/testrouting
   and here is the response
   [image: image.png]
   
   
   
   
   [image: Mailtrack]
   

   Sender
   notified by
   Mailtrack
   

   04/16/21,
   03:24:24 AM
   
   On Fri, Apr 16, 2021 at 3:17 AM Yuelin Zheng ***@***.***>
   wrote:
   
   > It looks like your upstream does not have the /testrouting API. You
   > should try to request curl http://127.0.0.1:9090/testrouting to see if
   > the access is successful?
   >
   > —
   > You are receiving this because you authored the thread.
   > Reply to this email directly, view it on GitHub
   > , or
   > unsubscribe
   > 

   > .
   >
   


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

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




[GitHub] [apisix-ingress-controller] tokers closed issue #377: client address cannot be automatically resolved to upstream by apisix-ingress-conroller

2021-04-15 Thread GitBox


tokers closed issue #377:
URL: https://github.com/apache/apisix-ingress-controller/issues/377


   


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

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




[GitHub] [apisix-ingress-controller] tokers commented on issue #377: client address cannot be automatically resolved to upstream by apisix-ingress-conroller

2021-04-15 Thread GitBox


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


   > > @Marco-Zheng How did you use your APISIX? If you use it by configuring 
objects in apisix-dashboard, you should submit issue to apisix repo.
   > 
   > > 
   > 
   > > If you're using apisix-ingress-controller, please paste related 
information like apisix-ingress-controller version, how you create this route 
(ApisixRoute or Ingress).
   > 
   > 
   > 
   > There has an another question, may i know if can config the node domain/IP 
as below 
   > 
   > `medcloud-dev.dental-practice-patient`
   > 
   > 
![image](https://user-images.githubusercontent.com/52538259/114889641-dee97400-9e3c-11eb-96cd-831226ae8be1.png)
   > 
   > medcloud-dev is namespace of service 
   > 
   > dental-practice-patient is name of service
   > 
   > 
   
   Yep, FQDN can be resolved by apisix. I saw you submitted another issue in 
apisix repo, I will close this 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.

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




[GitHub] [apisix] tokers commented on issue #4063: bug: the route which was create by dashboard is invalid

2021-04-15 Thread GitBox


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


   Could you see this route on dashboard ?


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

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




[GitHub] [apisix] hozaifaaoud commented on issue #4054: 503 Service Temporarily Unavailable

2021-04-15 Thread GitBox


hozaifaaoud commented on issue #4054:
URL: https://github.com/apache/apisix/issues/4054#issuecomment-820840548


   here is the configuration file :
   
   apisix:
 node_listen: 9080  # APISIX listening port
 enable_ipv6: false
   
 allow_admin:  # 
http://nginx.org/en/docs/http/ngx_http_access_module.html#allow
   - 0.0.0.0/0  # We need to restrict ip access rules for 
security. 0.0.0.0/0 is for test.
   
 admin_key:
   - name: "admin"
 key: edd1c9f034335f136f87ad84b625c8f1
 role: admin # admin: manage all configuration data
 # viewer: only can view configuration data
   - name: "viewer"
 key: 4054f7cf07e344346cd3f287985e76a2
 role: viewer
   
   etcd:
 host:   # it's possible to define multiple etcd 
hosts addresses of the same etcd cluster.
   - "http://etcd:2379; # multiple etcd address
 prefix: "/apisix"   # apisix configurations prefix
 timeout: 30 # 30 seconds
   
   if there are any other configurations you need... please let me know.


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

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




[GitHub] [apisix-ingress-controller] tokers commented on a change in pull request #375: add e2e test cases for referer-restriction plugin

2021-04-15 Thread GitBox


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



##
File path: test/e2e/plugins/referer-restriction.go
##
@@ -0,0 +1,183 @@
+// 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 plugins
+
+import (
+   "fmt"
+   "github.com/onsi/ginkgo"
+   "github.com/stretchr/testify/assert"
+   "net/http"
+
+   "github.com/apache/apisix-ingress-controller/test/e2e/scaffold"
+)
+
+var _ = ginkgo.Describe("referer-restriction plugin", func() {
+   opts := {
+   Name:"default",
+   Kubeconfig:  scaffold.GetKubeconfig(),
+   APISIXConfigPath:"testdata/apisix-gw-config.yaml",
+   APISIXDefaultConfigPath: 
"testdata/apisix-gw-config-default.yaml",
+   IngressAPISIXReplicas:   1,
+   HTTPBinServicePort:  80,
+   APISIXRouteVersion:  "apisix.apache.org/v2alpha1",
+   }
+   s := scaffold.NewScaffold(opts)
+   ginkgo.It("referer-restriction plugin configuration whitelist list", 
func() {
+   backendSvc, backendPorts := s.DefaultHTTPBackend()
+   ar := fmt.Sprintf(`
+apiVersion: apisix.apache.org/v2alpha1
+kind: ApisixRoute
+metadata:
+ name: httpbin-route
+spec:
+ http:
+ - name: rule1
+   match:
+ hosts:
+ - httpbin.org
+ paths:
+   - /ip
+   backends:
+   - serviceName: %s
+ servicePort: %d
+ weight: 10
+   plugins:
+   - name: referer-restriction
+ enable: true
+ config:
+   whitelist:
+ - test.com
+ - "*.foo.com"
+`, backendSvc, backendPorts[0])
+
+   assert.Nil(ginkgo.GinkgoT(), s.CreateResourceFromString(ar))
+
+   err := s.EnsureNumApisixUpstreamsCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of 
upstreams")
+   err = s.EnsureNumApisixRoutesCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of routes")
+
+   // Referer match passed
+   resp := s.NewAPISIXClient().GET("/ip").
+   WithHeader("Host", "httpbin.org").
+   WithHeader("Referer", "http://test.com;).
+   Expect()
+   resp.Status(http.StatusOK)
+   resp.Body().Contains("origin")
+
+   // Referer match failed
+   resp = s.NewAPISIXClient().GET("/ip").
+   WithHeader("Host", "httpbin.org").
+   WithHeader("Referer", "http://www.test.com;).
+   Expect()
+   resp.Status(http.StatusForbidden)
+
+   // Referer match passed
+   resp = s.NewAPISIXClient().GET("/ip").
+   WithHeader("Host", "httpbin.org").
+   WithHeader("Referer", "http://www.foo.com;).
+   Expect()
+   resp.Status(http.StatusOK)
+   resp.Body().Contains("origin")
+   })
+
+   ginkgo.It("the bypass_missing field is true", func() {
+   backendSvc, backendPorts := s.DefaultHTTPBackend()
+   ar := fmt.Sprintf(`
+apiVersion: apisix.apache.org/v2alpha1
+kind: ApisixRoute
+metadata:
+ name: httpbin-route
+spec:
+ http:
+ - name: rule1
+   match:
+ hosts:
+ - httpbin.org
+ paths:
+   - /ip
+   backends:
+   - serviceName: %s
+ servicePort: %d
+ weight: 10
+   plugins:
+   - name: referer-restriction
+ enable: true
+ config:
+   whitelist:
+ - test.com
+   bypass_missing: true
+`, backendSvc, backendPorts[0])
+
+   assert.Nil(ginkgo.GinkgoT(), s.CreateResourceFromString(ar))
+
+   err := s.EnsureNumApisixUpstreamsCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of 
upstreams")
+   err = s.EnsureNumApisixRoutesCreated(1)
+   assert.Nil(ginkgo.GinkgoT(), err, "Checking number of routes")
+
+   // Referer is missing
+   resp := s.NewAPISIXClient().GET("/ip").WithHeader("Host", 
"httpbin.org").Expect()
+   resp.Status(http.StatusOK)

[GitHub] [apisix] Firstsawyou commented on issue #4065: 404 Not Found

2021-04-15 Thread GitBox


Firstsawyou commented on issue #4065:
URL: https://github.com/apache/apisix/issues/4065#issuecomment-820839851


   It looks like your upstream does not have the `/testrouting` API. You should 
try to request `curl http://127.0.0.1:9090/testrouting` to see if the access is 
successful?


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

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




[GitHub] [apisix] Firstsawyou commented on issue #4054: 503 Service Temporarily Unavailable

2021-04-15 Thread GitBox


Firstsawyou commented on issue #4054:
URL: https://github.com/apache/apisix/issues/4054#issuecomment-820837225


   You should provide detailed configuration information to facilitate 
troubleshooting.


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

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




[GitHub] [apisix-ingress-controller] Firstsawyou commented on pull request #375: add e2e test cases for referer-restriction plugin

2021-04-15 Thread GitBox


Firstsawyou commented on pull request #375:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/375#issuecomment-820834958


   @tokers  @gxthrj  Please take a look when you are free.


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

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




[GitHub] [apisix] KishaniKandasamy commented on a change in pull request #4053: docs: fix broken links in FAQ

2021-04-15 Thread GitBox


KishaniKandasamy commented on a change in pull request #4053:
URL: https://github.com/apache/apisix/pull/4053#discussion_r614312462



##
File path: docs/en/latest/FAQ.md
##
@@ -318,7 +318,7 @@ The high availability of APISIX can be divided into two 
parts:
 
 ## Why does the `make deps` command fail in source installation?
 
-When executing the `make deps` command, an error such as the one shown below 
occurs. This is caused by the missing openresty's `openssl` development kit, 
you need to install it first. Please refer to the 
[install-dependencies.md](install-dependencies.md) document for installation.
+When executing the `make deps` command, an error such as the one shown below 
occurs. This is caused by the missing openresty's `openssl` development kit, 
you need to install it first. Please refer to the 
[install-dependencies.md](https://github.com/apache/apisix/blob/master/docs/en/latest/install-dependencies.md)
 document for installation.

Review comment:
I will fix this




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

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




[GitHub] [apisix] KishaniKandasamy commented on a change in pull request #4053: docs: fix broken links in FAQ

2021-04-15 Thread GitBox


KishaniKandasamy commented on a change in pull request #4053:
URL: https://github.com/apache/apisix/pull/4053#discussion_r614359338



##
File path: docs/en/latest/FAQ.md
##
@@ -318,7 +318,7 @@ The high availability of APISIX can be divided into two 
parts:
 
 ## Why does the `make deps` command fail in source installation?
 
-When executing the `make deps` command, an error such as the one shown below 
occurs. This is caused by the missing openresty's `openssl` development kit, 
you need to install it first. Please refer to the 
[install-dependencies.md](install-dependencies.md) document for installation.
+When executing the `make deps` command, an error such as the one shown below 
occurs. This is caused by the missing openresty's `openssl` development kit, 
you need to install it first. Please refer to the [install 
dependencies](install-dependencies.md) document for installation.

Review comment:
   I think It will work




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

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




[GitHub] [apisix] hozaifaaoud opened a new issue #4065: 404 Not Found

2021-04-15 Thread GitBox


hozaifaaoud opened a new issue #4065:
URL: https://github.com/apache/apisix/issues/4065


   ### Issue description
   
   ### Environment
   
   * apisix version (cmd: `apisix version`): APISIX/2.3
   * OS (cmd: `uname -a`): #60-Ubuntu
   * OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`):
   * etcd version, if have (cmd: run `curl 
http://127.0.0.1:9090/v1/server_info` to get the info from server-info API):
   * apisix-dashboard version, if have:
   Hi all,
   I am new to APISIX.
   I just trying to create a route to an API the is up and running on my local 
machine.
   the details of the route are :
   curl http://127.0.0.1:9080/apisix/admin/routes/2 -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '
   {
   "uri": "/testrouting",
   "upstream": {
   "type": "roundrobin",
   "nodes": {
   "127.0.0.1:9090": 1
   }
   }
   }'
   this return that the route created successfully.
   when I am trying to access the route using this link:
   "curl http://127.0.0.1:9080/testrouting;
   then I faced this issue
   
![image](https://user-images.githubusercontent.com/79872781/114931517-a181e800-9e36-11eb-8ee0-96634b872321.png)
   could you please help me?
   


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

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




[GitHub] [apisix] hozaifaaoud removed a comment on issue #4054: 503 Service Temporarily Unavailable

2021-04-15 Thread GitBox


hozaifaaoud removed a comment on issue #4054:
URL: https://github.com/apache/apisix/issues/4054#issuecomment-820695697


   > The addresses in upstream nodes need to be configured with a domain name 
or IP. Your route should be created like this:
   > 
   > ```shell
   > curl http://127.0.0.1:9080/apisix/admin/routes/2 -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '
   > {
   > "uri": "/testrouting",
   > "upstream": {
   > "type": "roundrobin",
   > "nodes": {
   > "127.0.0.1:9090": 1
   > }
   > }
   > }'
   > ```
   
   


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

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




[GitHub] [apisix] hozaifaaoud closed issue #4054: 503 Service Temporarily Unavailable

2021-04-15 Thread GitBox


hozaifaaoud closed issue #4054:
URL: https://github.com/apache/apisix/issues/4054


   


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

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




[GitHub] [apisix] hozaifaaoud commented on issue #4054: 503 Service Temporarily Unavailable

2021-04-15 Thread GitBox


hozaifaaoud commented on issue #4054:
URL: https://github.com/apache/apisix/issues/4054#issuecomment-820695697


   > The addresses in upstream nodes need to be configured with a domain name 
or IP. Your route should be created like this:
   > 
   > ```shell
   > curl http://127.0.0.1:9080/apisix/admin/routes/2 -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '
   > {
   > "uri": "/testrouting",
   > "upstream": {
   > "type": "roundrobin",
   > "nodes": {
   > "127.0.0.1:9090": 1
   > }
   > }
   > }'
   > ```
   
   


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

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




[GitHub] [apisix] hozaifaaoud edited a comment on issue #4054: 503 Service Temporarily Unavailable

2021-04-15 Thread GitBox


hozaifaaoud edited a comment on issue #4054:
URL: https://github.com/apache/apisix/issues/4054#issuecomment-820651525


   Thank you for your response,
   I applied your solution.
   And I tried calling the API using :
   curl http://127.0.0.1:9080/testrouting
   then  I faced this issue
   
![image](https://user-images.githubusercontent.com/79872781/114926850-21a54f00-9e31-11eb-892b-77fa6dcaac5a.png)
   could you please help me?
   


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

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




[GitHub] [apisix] hozaifaaoud edited a comment on issue #4054: 503 Service Temporarily Unavailable

2021-04-15 Thread GitBox


hozaifaaoud edited a comment on issue #4054:
URL: https://github.com/apache/apisix/issues/4054#issuecomment-820651525


   Thank you for your response,
   I applied your solution.
   And I tried calling the API using :
   curl http://127.0.0.1:9080/testrouting
   then  I faced this issue
   
![image](https://user-images.githubusercontent.com/79872781/114921608-0a636300-9e2b-11eb-8fc0-bf1bb522a3b2.png)
   could you please help me?
   


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

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




[GitHub] [apisix] KishaniKandasamy commented on a change in pull request #4053: docs: fix broken links in FAQ

2021-04-15 Thread GitBox


KishaniKandasamy commented on a change in pull request #4053:
URL: https://github.com/apache/apisix/pull/4053#discussion_r614312462



##
File path: docs/en/latest/FAQ.md
##
@@ -318,7 +318,7 @@ The high availability of APISIX can be divided into two 
parts:
 
 ## Why does the `make deps` command fail in source installation?
 
-When executing the `make deps` command, an error such as the one shown below 
occurs. This is caused by the missing openresty's `openssl` development kit, 
you need to install it first. Please refer to the 
[install-dependencies.md](install-dependencies.md) document for installation.
+When executing the `make deps` command, an error such as the one shown below 
occurs. This is caused by the missing openresty's `openssl` development kit, 
you need to install it first. Please refer to the 
[install-dependencies.md](https://github.com/apache/apisix/blob/master/docs/en/latest/install-dependencies.md)
 document for installation.

Review comment:
   Yes . I will fix this




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

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




[GitHub] [apisix] hozaifaaoud commented on issue #4054: 503 Service Temporarily Unavailable

2021-04-15 Thread GitBox


hozaifaaoud commented on issue #4054:
URL: https://github.com/apache/apisix/issues/4054#issuecomment-820651525


   Thank you for your response,
   I tried your solution and currently, I am facing this issue
   
![image](https://user-images.githubusercontent.com/79872781/114921608-0a636300-9e2b-11eb-8fc0-bf1bb522a3b2.png)
   could you please help me?
   


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

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




[GitHub] [apisix-ingress-controller] codecov-io edited a comment on pull request #375: add e2e test cases for referer-restriction plugin

2021-04-15 Thread GitBox


codecov-io edited a comment on pull request #375:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/375#issuecomment-820271842


   # 
[Codecov](https://codecov.io/gh/apache/apisix-ingress-controller/pull/375?src=pr=h1_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 Report
   > Merging 
[#375](https://codecov.io/gh/apache/apisix-ingress-controller/pull/375?src=pr=desc_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 (bcdf7d8) into 
[master](https://codecov.io/gh/apache/apisix-ingress-controller/commit/207f05999045025df5484c79c8afd3db4dea1d14?el=desc_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 (207f059) will **decrease** coverage by `3.08%`.
   > The diff coverage is `54.00%`.
   
   > :exclamation: Current head bcdf7d8 differs from pull request most recent 
head fa12ca3. Consider uploading reports for the commit fa12ca3 to get more 
accurate results
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-ingress-controller/pull/375/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/375?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
   
   ```diff
   @@Coverage Diff @@
   ##   master #375  +/-   ##
   ==
   - Coverage   42.88%   39.80%   -3.09% 
   ==
 Files  37   38   +1 
 Lines3262 3108 -154 
   ==
   - Hits 1399 1237 -162 
   - Misses   1715 1726  +11 
   + Partials  148  145   -3 
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/apisix-ingress-controller/pull/375?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation)
 | Coverage Δ | |
   |---|---|---|
   | 
[pkg/ingress/endpoint.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/375/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-cGtnL2luZ3Jlc3MvZW5kcG9pbnQuZ28=)
 | `0.00% <ø> (ø)` | |
   | 
[pkg/kube/translation/apisix\_ssl.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/375/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-cGtnL2t1YmUvdHJhbnNsYXRpb24vYXBpc2l4X3NzbC5nbw==)
 | `0.00% <0.00%> (ø)` | |
   | 
[pkg/kube/translation/translator.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/375/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-cGtnL2t1YmUvdHJhbnNsYXRpb24vdHJhbnNsYXRvci5nbw==)
 | `51.38% <20.00%> (-4.68%)` | :arrow_down: |
   | 
[pkg/kube/translation/apisix\_route.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/375/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-cGtnL2t1YmUvdHJhbnNsYXRpb24vYXBpc2l4X3JvdXRlLmdv)
 | `46.26% <44.44%> (+0.18%)` | :arrow_up: |
   | 
[pkg/apisix/ssl.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/375/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-cGtnL2FwaXNpeC9zc2wuZ28=)
 | `35.29% <45.45%> (-4.98%)` | :arrow_down: |
   | 
[pkg/apisix/route.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/375/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-cGtnL2FwaXNpeC9yb3V0ZS5nbw==)
 | `33.33% <50.00%> (-12.68%)` | :arrow_down: |
   | 
[pkg/apisix/upstream.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/375/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-cGtnL2FwaXNpeC91cHN0cmVhbS5nbw==)
 | `33.33% <53.84%> (-14.72%)` | :arrow_down: |
   | 
[pkg/apisix/cache/memdb.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/375/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-cGtnL2FwaXNpeC9jYWNoZS9tZW1kYi5nbw==)
 | `66.66% <100.00%> (-1.15%)` | :arrow_down: |
   | 
[pkg/apisix/resource.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/375/diff?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=The+Apache+Software+Foundation#diff-cGtnL2FwaXNpeC9yZXNvdXJjZS5nbw==)
 | `51.42% <100.00%> (-28.09%)` | :arrow_down: |
   

[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1781: feat: rewrite route-with-jwt-plugin-test using ginkgo

2021-04-15 Thread GitBox


netlify[bot] edited a comment on pull request #1781:
URL: https://github.com/apache/apisix-dashboard/pull/1781#issuecomment-820443115


   Deploy preview for *apisix-dashboard* ready!
   
   Built with commit ce46ff11dec4321771dd349c7dd4b6af612db50b
   
   https://deploy-preview-1781--apisix-dashboard.netlify.app


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

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




[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1781: feat: rewrite route-with-jwt-plugin-test using ginkgo

2021-04-15 Thread GitBox


netlify[bot] edited a comment on pull request #1781:
URL: https://github.com/apache/apisix-dashboard/pull/1781#issuecomment-820443115


   Deploy preview for *apisix-dashboard* processing.
   
   Building with commit ce46ff11dec4321771dd349c7dd4b6af612db50b
   
   
https://app.netlify.com/sites/apisix-dashboard/deploys/607867094dc64822cc4a


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

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




[GitHub] [apisix] Firstsawyou opened a new issue #4064: docs(jwt-auth): Improve the picture in the jwt-auth plugin

2021-04-15 Thread GitBox


Firstsawyou opened a new issue #4064:
URL: https://github.com/apache/apisix/issues/4064


   # Improve Docs
   
   ## Please describe which part of docs should be improved or typo fixed
   
   As shown in the picture below, the configuration in the picture where the 
jwt-auth plug-in is added to the consumer page is not standardized. 
   
   https://user-images.githubusercontent.com/52862365/114901098-0ba28900-9e47-11eb-8ee4-62c5930e7ed3.png;>
   
   ## Describe the solution you'd like
   
   Update the picture above.
   We need the following configuration:
   
   https://user-images.githubusercontent.com/52862365/114900753-c0887600-9e46-11eb-92dc-88da0b92c278.png;>
   
   
   


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

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




[GitHub] [apisix] Firstsawyou commented on issue #4063: bug: the route which was create by dashboard is invalid

2021-04-15 Thread GitBox


Firstsawyou commented on issue #4063:
URL: https://github.com/apache/apisix/issues/4063#issuecomment-820532352


   You should check whether there is route data created by Dashboard in etcd?


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

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




[GitHub] [apisix-ingress-controller] Marco-Zheng commented on issue #377: client address cannot be automatically resolved to upstream by apisix-ingress-conroller

2021-04-15 Thread GitBox


Marco-Zheng commented on issue #377:
URL: 
https://github.com/apache/apisix-ingress-controller/issues/377#issuecomment-820490060


   > @Marco-Zheng How did you use your APISIX? If you use it by configuring 
objects in apisix-dashboard, you should submit issue to apisix repo.
   > 
   > If you're using apisix-ingress-controller, please paste related 
information like apisix-ingress-controller version, how you create this route 
(ApisixRoute or Ingress).
   
   There has an another question, may i know if can config the node domain/IP 
as below 
   `medcloud-dev.dental-practice-patient`
   
![image](https://user-images.githubusercontent.com/52538259/114889641-dee97400-9e3c-11eb-96cd-831226ae8be1.png)
   medcloud-dev is namespace of service 
   dental-practice-patient is name of service
   


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

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




[GitHub] [apisix-docker] qian0817 commented on pull request #159: feat: automate upload image to Dockerhub

2021-04-15 Thread GitBox


qian0817 commented on pull request #159:
URL: https://github.com/apache/apisix-docker/pull/159#issuecomment-820488583


   @membphis fixed


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

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




[GitHub] [apisix] Marco-Zheng opened a new issue #4063: bug: the route which was create by dashboard is invalid

2021-04-15 Thread GitBox


Marco-Zheng opened a new issue #4063:
URL: https://github.com/apache/apisix/issues/4063


   ### Issue description
   Here has a problem, i configure the route /patient/patient/* as below , but 
it also said that 404 Route Not Found
   curl -i -X GET http://ip:host/patient/patient/id -H "Host: httpbin.org" -H 
'apikey: superSecretAPIKey'
   
   
   It was amazing that there had no route of /get which i was update 
to/patient/patient/* can get the reseult..
   curl -i -X GET http://ip:host/get -H "Host: httpbin.org" -H 'apikey: 
superSecretAPIKey'
   
   there has only one etcd which was run by APISIX Helm Chart, i thought that 
`/get ` path was created by api (/admin/route)
   but path `patient/patient/id` was created by dashboard, so i tired to create 
`patient/patient/id` by using api (/admin/route),
   it's work! just 404 per another question
   
   so why the path which was create by dashboard is invalid.
   
   ### Environment
   * use APISIX Helm Chart


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

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




[GitHub] [apisix-docker] membphis commented on a change in pull request #159: feat: automate upload image to Dockerhub

2021-04-15 Thread GitBox


membphis commented on a change in pull request #159:
URL: https://github.com/apache/apisix-docker/pull/159#discussion_r614131005



##
File path: .github/workflows/apisix_push_docker_hub.yaml
##
@@ -0,0 +1,24 @@
+name: Push apisix to Docker image
+on:
+  release:
+types: [ published ]
+jobs:
+  build:
+runs-on: ubuntu-latest
+strategy:
+  matrix:
+platform:
+  - alpine
+  - centos
+
+steps:
+  - name: Check out the repo
+uses: actions/checkout@v2
+
+  - name: Login
+run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login --username=${{ 
secrets.DOCKER_USERNAME }} --password-stdin
+
+  - name: Push apisix image to Docker Hub
+run:
+  make build-on-${{ matrix.platform }}
+  make push-on-${{ matrix.platform }}

Review comment:
   we'd better add a blank line at the end of file

##
File path: .github/workflows/dashboard_push_docker_hub.yaml
##
@@ -0,0 +1,19 @@
+name: Push apisix dashboard to Docker image
+on:
+  release:
+types: [ published ]
+jobs:
+  build:
+runs-on: ubuntu-latest
+
+steps:
+  - name: Check out the repo
+uses: actions/checkout@v2
+
+  - name: Login
+run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login --username=${{ 
secrets.DOCKER_USERNAME }} --password-stdin
+
+  - name: Push apisix dashboard image to Docker Hub
+run:
+  make build-on-dashboard
+  make push-on-dashboard

Review comment:
   ditto




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

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




[GitHub] [apisix-ingress-controller] Marco-Zheng commented on issue #377: client address cannot be automatically resolved to upstream by apisix-ingress-conroller

2021-04-15 Thread GitBox


Marco-Zheng commented on issue #377:
URL: 
https://github.com/apache/apisix-ingress-controller/issues/377#issuecomment-820477524


   > @Marco-Zheng How did you use your APISIX? If you use it by configuring 
objects in apisix-dashboard, you should submit issue to apisix repo.
   > 
   > If you're using apisix-ingress-controller, please paste related 
information like apisix-ingress-controller version, how you create this route 
(ApisixRoute or Ingress).
   
   I'm no sure which part cause this problem. i'll also submit issue to apisix 
repo


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

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




[GitHub] [apisix-ingress-controller] Marco-Zheng commented on issue #377: client address cannot be automatically resolved to upstream by apisix-ingress-conroller

2021-04-15 Thread GitBox


Marco-Zheng commented on issue #377:
URL: 
https://github.com/apache/apisix-ingress-controller/issues/377#issuecomment-820474106


   > @Marco-Zheng How did you use your APISIX? If you use it by configuring 
objects in apisix-dashboard, you should submit issue to apisix repo.
   > 
   > If you're using apisix-ingress-controller, please paste related 
information like apisix-ingress-controller version, how you create this route 
(ApisixRoute or Ingress).
   
   Actually, i create the route on dashboard, but i tried to deploy the apisix 
and apisix dashboard only on aliyun server, it worked well, but i tried to use 
apisix-helm-chart and deploy all service, then meet that problem.


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

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




[GitHub] [apisix] dickens7 commented on issue #4040: skywalking plugin attribute service_instance_name hard-coded

2021-04-15 Thread GitBox


dickens7 commented on issue #4040:
URL: https://github.com/apache/apisix/issues/4040#issuecomment-820472127


   > @dickens7 Do you mean set `service_instance_name ` with the real APISIX 
instance name? 
   > 
   > For example, In k8s set `service_instance_name` with APISIX pod name.
   
   yes, it's necessary when there are many nodes.


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

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




[GitHub] [apisix] Firstsawyou commented on issue #4032: request help:I need a demo for authz-keycloak

2021-04-15 Thread GitBox


Firstsawyou commented on issue #4032:
URL: https://github.com/apache/apisix/issues/4032#issuecomment-820465488


   > 401 with error:{"error":"invalid_grant","error_description":"Invalid 
bearer token"}
   > get auth/realms/apisix/.well-known/uma2-configuration
   > "grant_types_supported": [
   > "authorization_code",
   > "implicit",
   > "refresh_token",
   > "password",
   > "client_credentials"
   > ],
   > how to add grant_type :urn:ietf:params:oauth:grant-type:uma-ticket
   
   Did you check if the `access token` is valid?
   Or provide your configuration information?


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

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




[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1767: change: remove listen.host from api/conf/conf.yaml

2021-04-15 Thread GitBox


netlify[bot] edited a comment on pull request #1767:
URL: https://github.com/apache/apisix-dashboard/pull/1767#issuecomment-819160964


   Deploy preview for *apisix-dashboard* ready!
   
   Built with commit 223ff913c25e8b9d1fd06cca2bf2ceb9a3152b64
   
   https://deploy-preview-1767--apisix-dashboard.netlify.app


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

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




[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1767: change: remove listen.host from api/conf/conf.yaml

2021-04-15 Thread GitBox


netlify[bot] edited a comment on pull request #1767:
URL: https://github.com/apache/apisix-dashboard/pull/1767#issuecomment-819160964


   Deploy preview for *apisix-dashboard* processing.
   
   Building with commit 223ff913c25e8b9d1fd06cca2bf2ceb9a3152b64
   
   
https://app.netlify.com/sites/apisix-dashboard/deploys/607849c31b5a090007b19531


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

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




[GitHub] [apisix] gxthrj commented on issue #4040: skywalking plugin attribute service_instance_name hard-coded

2021-04-15 Thread GitBox


gxthrj commented on issue #4040:
URL: https://github.com/apache/apisix/issues/4040#issuecomment-820453179


   @dickens7 Do you mean set `service_instance_name ` with the real APISIX 
instance name? 
   
   For example, In k8s set `service_instance_name` with APISIX pod name.


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

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




[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1781: feat: rewrite route-with-jwt-plugin-test using ginkgo

2021-04-15 Thread GitBox


netlify[bot] edited a comment on pull request #1781:
URL: https://github.com/apache/apisix-dashboard/pull/1781#issuecomment-820443115


   Deploy preview for *apisix-dashboard* ready!
   
   Built with commit 4f19323a9a0a4916e32c270045614274622bbcca
   
   https://deploy-preview-1781--apisix-dashboard.netlify.app


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

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




[GitHub] [apisix-dashboard] netlify[bot] commented on pull request #1781: feat: rewrite route-with-jwt-plugin-test using ginkgo

2021-04-15 Thread GitBox


netlify[bot] commented on pull request #1781:
URL: https://github.com/apache/apisix-dashboard/pull/1781#issuecomment-820443115


   Deploy preview for *apisix-dashboard* processing.
   
   Building with commit 4f19323a9a0a4916e32c270045614274622bbcca
   
   
https://app.netlify.com/sites/apisix-dashboard/deploys/60784654a13b6300086772e7


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

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




[GitHub] [apisix-dashboard] bisakhmondal opened a new pull request #1781: feat: rewrite route-with-jwt-plugin-test using ginkgo

2021-04-15 Thread GitBox


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


   Please answer these questions before submitting a pull request, **or your PR 
will get closed**.
   
   **Why submit this pull request?**
   
   - [ ] Bugfix
   - [x] New feature provided
   - [ ] Improve performance
   - [ ] Backport patches
   
   **What changes will this PR take into?**
   
   Please update this section with detailed description.
   
   **Related issues**
   #1500 
   
   **Checklist:**
   
   - [ ] Did you explain what problem does this PR solve? Or what new features 
have been added?
   - [x] Have you added corresponding test cases?
   - [ ] Have you modified the corresponding document?
   - [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.

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




[GitHub] [apisix] vincenthcui closed issue #4041: request help: grpc-transcode 是否支持 proto 文件组织

2021-04-15 Thread GitBox


vincenthcui closed issue #4041:
URL: https://github.com/apache/apisix/issues/4041


   


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

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




[GitHub] [apisix] tokers commented on issue #4049: request help:Questions about route matching

2021-04-15 Thread GitBox


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


   > So the `var` match doesn't fulfill my requirement. whether `uris` can be 
support matched regular expression , or the end match? I think this kind of 
need is quite common.
   
   This is another problem about how to write correct regex pattern. What about 
`"^/$|/.+\\.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




[GitHub] [apisix] tokers edited a comment on issue #4049: request help:Questions about route matching

2021-04-15 Thread GitBox


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


   > So the `var` match doesn't fulfill my requirement. whether `uris` can be 
support matched regular expression , or the end match? I think this kind of 
need is quite common.
   
   This is another problem about how to write correct regex pattern. What about 
`"^/$|/.+\\.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




[GitHub] [apisix-ingress-controller] tokers merged pull request #380: fix: correctly translate ingress in extensions/v1beta1 group version

2021-04-15 Thread GitBox


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


   


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

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




[GitHub] [apisix-ingress-controller] tokers closed issue #381: bug: panic when translate ingress version

2021-04-15 Thread GitBox


tokers closed issue #381:
URL: https://github.com/apache/apisix-ingress-controller/issues/381


   


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

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




[apisix-ingress-controller] branch master updated: fix: correctly translate ingress in extensions/v1beta1 group version (#380)

2021-04-15 Thread tokers
This is an automated email from the ASF dual-hosted git repository.

tokers 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 43e4d11  fix: correctly translate ingress in extensions/v1beta1 group 
version (#380)
43e4d11 is described below

commit 43e4d11dfafb900c74b7e38a675371d052614177
Author: Vincent 
AuthorDate: Thu Apr 15 21:32:57 2021 +0800

fix: correctly translate ingress in extensions/v1beta1 group version (#380)

fix #365
---
 pkg/kube/translation/translator.go | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/pkg/kube/translation/translator.go 
b/pkg/kube/translation/translator.go
index 4a6765a..f134050 100644
--- a/pkg/kube/translation/translator.go
+++ b/pkg/kube/translation/translator.go
@@ -192,8 +192,14 @@ func (t *translator) TranslateUpstreamNodes(endpoints 
*corev1.Endpoints, port in
 }
 
 func (t *translator) TranslateIngress(ing kube.Ingress) ([]*apisixv1.Route, 
[]*apisixv1.Upstream, error) {
-   if ing.GroupVersion() == kube.IngressV1 {
+   switch ing.GroupVersion() {
+   case kube.IngressV1:
return t.translateIngressV1(ing.V1())
+   case kube.IngressV1beta1:
+   return t.translateIngressV1beta1(ing.V1beta1())
+   case kube.IngressExtensionsV1beta1:
+   return 
t.translateIngressExtensionsV1beta1(ing.ExtensionsV1beta1())
+   default:
+   return nil, nil, fmt.Errorf("translator: source group version 
not supported: %s", ing.GroupVersion())
}
-   return t.translateIngressV1beta1(ing.V1beta1())
 }


[GitHub] [apisix-ingress-controller] tokers commented on pull request #374: fix: add compatibility logic for empty array when unmarshal json string to route

2021-04-15 Thread GitBox


tokers commented on pull request #374:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/374#issuecomment-820424691


   @okaybase Merged, many 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.

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




[GitHub] [apisix-ingress-controller] tokers merged pull request #374: fix: add compatibility logic for empty array when unmarshal json string to route

2021-04-15 Thread GitBox


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


   


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

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




[apisix-ingress-controller] branch master updated (98d0162 -> 3a7eb8c)

2021-04-15 Thread tokers
This is an automated email from the ASF dual-hosted git repository.

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


from 98d0162  feat:add labels for resources (#378)
 add 3a7eb8c  fix: add compatibility logic for empty array when unmarshal 
json string to route (#374)

No new revisions were added by this update.

Summary of changes:
 pkg/apisix/resource_test.go  | 22 ++
 pkg/apisix/route.go  |  2 ++
 pkg/types/apisix/v1/types.go | 42 --
 3 files changed, 56 insertions(+), 10 deletions(-)


[GitHub] [apisix-dashboard] Marco-Zheng opened a new issue #1780: bug: domain name/ip was disappeared after update

2021-04-15 Thread GitBox


Marco-Zheng opened a new issue #1780:
URL: https://github.com/apache/apisix-dashboard/issues/1780


   ### Issue description
   
   Question 1: I update the domian name -> medcloud-dev.dental-practice-patient
   and click the submit button, then i click update button again, the domian 
name/ip was disappeared after update
   
   Question 2: What the  domian name/IP i should write in when i use 
k8cluster?if `medcloud-dev.dental-practice-patient` is supported? 
`medcloud-dev` is the namespace of service and `dental-practice-patient` is 
service name.
   
   
![image](https://user-images.githubusercontent.com/52538259/114858444-0aa83200-9e1c-11eb-932d-1cf2040d232a.png)
   
![image](https://user-images.githubusercontent.com/52538259/114858489-1a277b00-9e1c-11eb-8dc1-4ed9b732451b.png)
   
   ### Environment
   
   * use apisix-helm-chart
   


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

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




[apisix] branch master updated: ci: cancel duplicate workflow to reduce CI queue time (#4050)

2021-04-15 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 0a86700  ci: cancel duplicate workflow to reduce CI queue time (#4050)
0a86700 is described below

commit 0a8670041a6e9ea51f808c60bd4f375f656900e8
Author: Shuyang Wu 
AuthorDate: Thu Apr 15 21:21:43 2021 +0800

ci: cancel duplicate workflow to reduce CI queue time (#4050)
---
 .github/actions/cancel-workflow-runs  |  1 +
 .github/workflows/chaos.yml   |  3 +++
 .github/workflows/workflow-cancel.yml | 27 +++
 .gitmodules   |  3 +++
 4 files changed, 34 insertions(+)

diff --git a/.github/actions/cancel-workflow-runs 
b/.github/actions/cancel-workflow-runs
new file mode 16
index 000..8248bc1
--- /dev/null
+++ b/.github/actions/cancel-workflow-runs
@@ -0,0 +1 @@
+Subproject commit 8248bc1feff049e98c0e6a96889b147199c38203
diff --git a/.github/workflows/chaos.yml b/.github/workflows/chaos.yml
index 867160b..b972676 100644
--- a/.github/workflows/chaos.yml
+++ b/.github/workflows/chaos.yml
@@ -12,6 +12,9 @@ jobs:
 runs-on: ubuntu-latest
 steps:
   - uses: actions/checkout@v2
+with:
+  submodules: recursive
+
   - name: setup go
 uses: actions/setup-go@v2.1.3
 with:
diff --git a/.github/workflows/workflow-cancel.yml 
b/.github/workflows/workflow-cancel.yml
new file mode 100644
index 000..b60ec24
--- /dev/null
+++ b/.github/workflows/workflow-cancel.yml
@@ -0,0 +1,27 @@
+name: Cancelling Duplicates
+on:
+  workflow_run:
+workflows:
+  - 'CI'
+  - 'CI Centos7'
+  - 'Chaos Test'
+  - 'fuzzing'
+types: ['requested']
+
+jobs:
+  cancel-duplicate-workflow-runs:
+name: "Cancel duplicate workflow runs"
+runs-on: ubuntu-latest
+steps:
+  - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
+uses: actions/checkout@v2
+with:
+  submodules: recursive
+
+  - uses: ./.github/actions/cancel-workflow-runs
+name: "Cancel duplicate workflow runs"
+with:
+  cancelMode: allDuplicates
+  token: ${{ secrets.GITHUB_TOKEN }}
+  sourceRunId: ${{ github.event.workflow_run.id }}
+  skipEventTypes: '["push"]'
diff --git a/.gitmodules b/.gitmodules
index beb354b..27d141c 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,6 @@
 [submodule "t/toolkit"]
path = t/toolkit
url = https://github.com/api7/test-toolkit.git
+[submodule ".github/actions/cancel-workflow-runs"]
+   path = .github/actions/cancel-workflow-runs
+   url = https://github.com/potiuk/cancel-workflow-runs


[GitHub] [apisix] spacewander merged pull request #4050: ci: cancel duplicate workflow to reduce CI queue time

2021-04-15 Thread GitBox


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


   


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

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




[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1767: change: remove listen.host from api/conf/conf.yaml

2021-04-15 Thread GitBox


netlify[bot] edited a comment on pull request #1767:
URL: https://github.com/apache/apisix-dashboard/pull/1767#issuecomment-819160964


   Deploy preview for *apisix-dashboard* ready!
   
   Built with commit 7f7a0fa9be47f3975d4e59dd4adf6f1dcfeb6806
   
   https://deploy-preview-1767--apisix-dashboard.netlify.app


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

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




[GitHub] [apisix-dashboard] netlify[bot] edited a comment on pull request #1767: change: remove listen.host from api/conf/conf.yaml

2021-04-15 Thread GitBox


netlify[bot] edited a comment on pull request #1767:
URL: https://github.com/apache/apisix-dashboard/pull/1767#issuecomment-819160964


   Deploy preview for *apisix-dashboard* processing.
   
   Building with commit 7f7a0fa9be47f3975d4e59dd4adf6f1dcfeb6806
   
   
https://app.netlify.com/sites/apisix-dashboard/deploys/6078362d54195300073d1d5f


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

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




[GitHub] [apisix] kongjun01 edited a comment on issue #4049: request help:Questions about route matching

2021-04-15 Thread GitBox


kongjun01 edited a comment on issue #4049:
URL: https://github.com/apache/apisix/issues/4049#issuecomment-820394230


   So the `var` match doesn't fulfill my requirement. whether `uris` can be 
support matched regular expression , or the end match? I think this kind of 
need is quite common.


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

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




[GitHub] [apisix] kongjun01 commented on issue #4049: request help:Questions about route matching

2021-04-15 Thread GitBox


kongjun01 commented on issue #4049:
URL: https://github.com/apache/apisix/issues/4049#issuecomment-820394230


   So the `var` match doesn't fulfill my requirement. whether `uris` can be 
support matched regular expression , or the end match?


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




  1   2   >