You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by ch...@apache.org on 2021/05/23 10:13:28 UTC

[apisix-dashboard] branch release/2.6.1 created (now 485fcd3)

This is an automated email from the ASF dual-hosted git repository.

chenjunxu pushed a change to branch release/2.6.1
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git.


      at 485fcd3  docs: add CHANGELOG for 2.6.1

This branch includes the following new commits:

     new 2360b52  fix: use remote address instead of client ip (#1831)
     new e40977f  chore: cherry-pick 9728a430193331d135da4fd5661cd4100308afbf
     new 1bbf3ae  chore: update version no
     new 485fcd3  docs: add CHANGELOG for 2.6.1

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[apisix-dashboard] 02/04: chore: cherry-pick 9728a430193331d135da4fd5661cd4100308afbf

Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit e40977f85297827efc0c3639c12e698d951aeea9
Author: liuxiran <li...@apache.org>
AuthorDate: Tue May 18 17:36:39 2021 +0800

    chore: cherry-pick 9728a430193331d135da4fd5661cd4100308afbf
---
 api/internal/route.go                              |  2 --
 .../route_online_debug_suite_test.go               |  2 +-
 docs/en/latest/USER_GUIDE.md                       | 28 ----------------------
 web/src/pages/Route/List.tsx                       |  8 +------
 4 files changed, 2 insertions(+), 38 deletions(-)

diff --git a/api/internal/route.go b/api/internal/route.go
index ff101f0..c286743 100644
--- a/api/internal/route.go
+++ b/api/internal/route.go
@@ -35,7 +35,6 @@ import (
 	"github.com/apisix/manager-api/internal/handler/label"
 	"github.com/apisix/manager-api/internal/handler/plugin_config"
 	"github.com/apisix/manager-api/internal/handler/route"
-	"github.com/apisix/manager-api/internal/handler/route_online_debug"
 	"github.com/apisix/manager-api/internal/handler/schema"
 	"github.com/apisix/manager-api/internal/handler/server_info"
 	"github.com/apisix/manager-api/internal/handler/service"
@@ -70,7 +69,6 @@ func SetUpRouter() *gin.Engine {
 		healthz.NewHandler,
 		authentication.NewHandler,
 		global_rule.NewHandler,
-		route_online_debug.NewHandler,
 		server_info.NewHandler,
 		label.NewHandler,
 		data_loader.NewHandler,
diff --git a/api/test/e2enew/route_online_debug/route_online_debug_suite_test.go b/api/test/e2enew/route_online_debug/route_online_debug_suite_test.go
index 06b97a0..219d8d3 100644
--- a/api/test/e2enew/route_online_debug/route_online_debug_suite_test.go
+++ b/api/test/e2enew/route_online_debug/route_online_debug_suite_test.go
@@ -28,7 +28,7 @@ import (
 
 func TestRoute(t *testing.T) {
 	gomega.RegisterFailHandler(ginkgo.Fail)
-	ginkgo.RunSpecs(t, "route online debug suite")
+	//ginkgo.RunSpecs(t, "route online debug suite")
 }
 
 var _ = ginkgo.AfterSuite(func() {
diff --git a/docs/en/latest/USER_GUIDE.md b/docs/en/latest/USER_GUIDE.md
index b37b4e9..9058cd9 100644
--- a/docs/en/latest/USER_GUIDE.md
+++ b/docs/en/latest/USER_GUIDE.md
@@ -49,34 +49,6 @@ The Route module aims to control routes by UI instead of calling APIs.
 
 ![route-create-done-list-en](https://user-images.githubusercontent.com/40708551/112923280-a0a94080-912b-11eb-8b83-3960778ecf8a.png)
 
-### Online debug
-
-We can debug a route both published or offline with the online debug function, which is located in the routes list page.
-
-1. Debug a published route
-
-![route-debug-published](../../assets/images/route-debug-published.png)
-
-2. Debug a offline route
-
-![route-debug-offline](https://user-images.githubusercontent.com/40708551/112923419-e5cd7280-912b-11eb-8e7e-57c3c4fe31ef.png)
-
-3. Debug a published route with query params
-
-![route-debug-query-params](../../assets/images/route-debug-query-params.png)
-
-4. Debug a published route with header params
-
-![route-debug-header-params](../../assets/images/route-debug-header-params.png)
-
-5. Debug a published route with body params
-
-![route-debug-body-params](../../assets/images/route-debug-body-params.png)
-
-6. Debug a published route with basic auth
-
-![route-debug-basic-auth](../../assets/images/route-debug-basic-auth.png)
-
 ## Setting
 
 ![setting](https://user-images.githubusercontent.com/40708551/112923561-22996980-912c-11eb-926f-45177500eb65.png)
diff --git a/web/src/pages/Route/List.tsx b/web/src/pages/Route/List.tsx
index c494478..bff638f 100644
--- a/web/src/pages/Route/List.tsx
+++ b/web/src/pages/Route/List.tsx
@@ -35,7 +35,7 @@ import {
   Dropdown,
 } from 'antd';
 import { history, useIntl } from 'umi';
-import { PlusOutlined, BugOutlined, ExportOutlined, ImportOutlined, DownOutlined } from '@ant-design/icons';
+import { PlusOutlined, ExportOutlined, ImportOutlined, DownOutlined } from '@ant-design/icons';
 import { js_beautify } from 'js-beautify';
 import yaml from 'js-yaml';
 import moment from 'moment';
@@ -204,12 +204,6 @@ const Page: React.FC = () => {
           setUploadFileList([]);
           setShowImportModal(true);
         }
-      }, {
-        name: formatMessage({ id: 'page.route.onlineDebug' }),
-        icon: <BugOutlined />,
-        onClick: () => {
-          setDebugDrawVisible(true)
-        }
       }
     ]
 

[apisix-dashboard] 03/04: chore: update version no

Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 1bbf3ae334ab48482005691cd6bcab7f1509bd21
Author: nic-chen <jo...@163.com>
AuthorDate: Sun May 23 18:04:46 2021 +0800

    chore: update version no
---
 README.md                               | 2 +-
 api/VERSION                             | 2 +-
 api/internal/utils/consts/versionMap.go | 9 +++++----
 docs/en/latest/deploy.md                | 2 +-
 docs/en/latest/develop.md               | 2 +-
 web/package.json                        | 2 +-
 6 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/README.md b/README.md
index 0011d3a..de160e6 100644
--- a/README.md
+++ b/README.md
@@ -31,7 +31,7 @@
 
 - The master version should be used with Apache APISIX master version.
 
-- The latest released version is [2.6](https://apisix.apache.org/downloads/) and should be used with [Apache APISIX 2.5](https://apisix.apache.org/downloads/). It is not recommended to use with other Apache APISIX versions.
+- The latest released version is [2.6.1](https://apisix.apache.org/downloads/) and should be used with [Apache APISIX 2.5](https://apisix.apache.org/downloads/). It is not recommended to use with other Apache APISIX versions.
 
 ## What's Apache APISIX Dashboard
 
diff --git a/api/VERSION b/api/VERSION
index 5154b3f..6a6a3d8 100644
--- a/api/VERSION
+++ b/api/VERSION
@@ -1 +1 @@
-2.6
+2.6.1
diff --git a/api/internal/utils/consts/versionMap.go b/api/internal/utils/consts/versionMap.go
index 038fe3e..3862a70 100644
--- a/api/internal/utils/consts/versionMap.go
+++ b/api/internal/utils/consts/versionMap.go
@@ -21,8 +21,9 @@ package consts
 	Val is apisix version
 */
 var VersionMap = map[string]string{
-	"2.3": "2.2",
-	"2.4": "2.3",
-	"2.5": "2.4",
-	"2.6": "2.5",
+	"2.3":   "2.2",
+	"2.4":   "2.3",
+	"2.5":   "2.4",
+	"2.6":   "2.5",
+	"2.6.1": "2.5",
 }
diff --git a/docs/en/latest/deploy.md b/docs/en/latest/deploy.md
index b5a2e68..49e965f 100644
--- a/docs/en/latest/deploy.md
+++ b/docs/en/latest/deploy.md
@@ -45,7 +45,7 @@ $ go env -w GOPROXY=https://goproxy.cn,direct
 ## Clone the project
 
 ```sh
-$ git clone -b release/2.6 https://github.com/apache/apisix-dashboard.git
+$ git clone -b release/2.6.1 https://github.com/apache/apisix-dashboard.git
 ```
 
 ## Build
diff --git a/docs/en/latest/develop.md b/docs/en/latest/develop.md
index 5c3d642..60cf32f 100644
--- a/docs/en/latest/develop.md
+++ b/docs/en/latest/develop.md
@@ -30,7 +30,7 @@ Before development, refer to this [guide](./deploy.md) to install dependencies.
 ## Clone the project
 
 ```sh
-$ git clone -b release/2.6 https://github.com/apache/apisix-dashboard.git
+$ git clone -b release/2.6.1 https://github.com/apache/apisix-dashboard.git
 ```
 
 ## Start developing
diff --git a/web/package.json b/web/package.json
index 23337e4..ba7735d 100644
--- a/web/package.json
+++ b/web/package.json
@@ -1,6 +1,6 @@
 {
   "name": "apisix-dashboard",
-  "version": "2.6.0",
+  "version": "2.6.1",
   "private": true,
   "description": "Dashboard for Apache APISIX",
   "scripts": {

[apisix-dashboard] 04/04: docs: add CHANGELOG for 2.6.1

Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 485fcd3c8894a15f46834ef6198ae8f6cc4cc4cc
Author: nic-chen <jo...@163.com>
AuthorDate: Sun May 23 18:12:10 2021 +0800

    docs: add CHANGELOG for 2.6.1
---
 CHANGELOG.md | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6528d7d..6f6279f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,6 +19,7 @@
 
 # Table of Contents
 
+- [2.6.1](#261)
 - [2.6.0](#260)
 - [2.5.0](#250)
 - [2.4.0](#240)
@@ -30,6 +31,16 @@
 - [1.5.0](#150)
 - [1.0.0](#100)
 
+# 2.6.1
+
+This release mainly contains bugfixes.
+
+`Manager API` 2.6.1 should be used with [Apache APISIX 2.5](https://apisix.apache.org/downloads/). It is not recommended to use with other Apache APISIX versions.
+
+### Bugfix
+- Fix: use remote address instead of client ip [#1831](https://github.com/apache/apisix-dashboard/pull/1831)
+- Fix: turn off online debug [#1903](https://github.com/apache/apisix-dashboard/pull/1903)
+
 # 2.6.0
 
 This release mainly improves UI and UE, bugfix and adds test cases.

[apisix-dashboard] 01/04: fix: use remote address instead of client ip (#1831)

Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 2360b5287635ae9136a006c2b1788368547cd5cf
Author: Peter Zhu <st...@gmail.com>
AuthorDate: Fri Apr 30 15:07:18 2021 +0800

    fix: use remote address instead of client ip (#1831)
---
 api/internal/filter/ip_filter.go      |  6 +++++-
 api/internal/filter/ip_filter_test.go | 19 +++++++++++++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/api/internal/filter/ip_filter.go b/api/internal/filter/ip_filter.go
index de62cf5..2d07dea 100644
--- a/api/internal/filter/ip_filter.go
+++ b/api/internal/filter/ip_filter.go
@@ -19,6 +19,7 @@ package filter
 import (
 	"net"
 	"net/http"
+	"strings"
 
 	"github.com/gin-gonic/gin"
 
@@ -81,7 +82,10 @@ func checkIP(ipStr string, ips map[string]bool, subnets []*subnet) bool {
 func IPFilter() gin.HandlerFunc {
 	ips, subnets := generateIPSet(conf.AllowList)
 	return func(c *gin.Context) {
-		ipStr := c.ClientIP()
+		var ipStr string
+		if ip, _, err := net.SplitHostPort(strings.TrimSpace(c.Request.RemoteAddr)); err == nil {
+			ipStr = ip
+		}
 
 		if len(conf.AllowList) < 1 {
 			c.Next()
diff --git a/api/internal/filter/ip_filter_test.go b/api/internal/filter/ip_filter_test.go
index f9de048..dad4da6 100644
--- a/api/internal/filter/ip_filter_test.go
+++ b/api/internal/filter/ip_filter_test.go
@@ -17,6 +17,7 @@
 package filter
 
 import (
+	"net/http/httptest"
 	"testing"
 
 	"github.com/gin-gonic/gin"
@@ -55,4 +56,22 @@ func TestIPFilter_Handle(t *testing.T) {
 	})
 	w = performRequest(r, "GET", "/test")
 	assert.Equal(t, 200, w.Code)
+
+	// should forbidden
+	conf.AllowList = []string{"127.0.0.1"}
+	r = gin.New()
+	r.Use(IPFilter())
+	r.GET("/test", func(c *gin.Context) {})
+
+	req := httptest.NewRequest("GET", "/test", nil)
+	req.Header.Set("X-Forwarded-For", "127.0.0.1")
+	w = httptest.NewRecorder()
+	r.ServeHTTP(w, req)
+	assert.Equal(t, 403, w.Code)
+
+	req = httptest.NewRequest("GET", "/test", nil)
+	req.Header.Set("X-Real-Ip", "127.0.0.1")
+	w = httptest.NewRecorder()
+	r.ServeHTTP(w, req)
+	assert.Equal(t, 403, w.Code)
 }