From d130f351412bccb802531b22f4efb95bb5f7b658 Mon Sep 17 00:00:00 2001 From: "Dot.L" <824010343@qq.com> Date: Sat, 18 Jun 2022 22:30:22 +0800 Subject: [PATCH 01/48] Update README_CN.md --- README_CN.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README_CN.md b/README_CN.md index b4db254d..1f1d423c 100644 --- a/README_CN.md +++ b/README_CN.md @@ -104,6 +104,9 @@ wget https://github.com/eolinker/apinto/releases/download/v0.5.1/apinto-v0.5.1.l ./apinto start ``` +3.如需可视化界面请点击[Apinto Dashboard](https://github.com/eolinker/apinto-dashboard) + + - ### **联系我们** From 7f632c912f58c18ded00bfa8027945e8bdd0baba Mon Sep 17 00:00:00 2001 From: "Dot.L" <824010343@qq.com> Date: Sat, 18 Jun 2022 22:33:01 +0800 Subject: [PATCH 02/48] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index f3a4461f..8b3ec3ee 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,8 @@ wget https://github.com/eolinker/apinto/releases/download/v0.5.1/apinto-v0.5.1.l ./apinto start ``` +3.To configure the gateway through the visual interface, click [apinto dashboard](https://github.com/eolinker/apinto-dashboard) + ### Contact - **Help documentation**:[https://help.apinto.com](https://help.apinto.com) - **QQ group**: 725853895 From e85b7a6649cc6be80c66000f687167332ea8de1c Mon Sep 17 00:00:00 2001 From: chenjiekun Date: Mon, 20 Jun 2022 18:45:26 +0800 Subject: [PATCH 03/48] change default port --- build/resources/Dockerfile | 2 +- build/resources/config.yml.tmp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/resources/Dockerfile b/build/resources/Dockerfile index 21f8602a..06768416 100644 --- a/build/resources/Dockerfile +++ b/build/resources/Dockerfile @@ -4,7 +4,7 @@ FROM centos:latest MAINTAINER eolink #声明端口 -EXPOSE 9400 8080 +EXPOSE 9400 8099 #定义数据卷 VOLUME /var/lib/apinto diff --git a/build/resources/config.yml.tmp b/build/resources/config.yml.tmp index f01a5a56..28bfac37 100644 --- a/build/resources/config.yml.tmp +++ b/build/resources/config.yml.tmp @@ -1,5 +1,5 @@ listen: # node listen port - - 8080 + - 8099 admin: # openAPI request info scheme: http # listen scheme From fdabb55c16dd7bc82f0ce0cdb8fb51b49c5c49df Mon Sep 17 00:00:00 2001 From: Liujian <824010343@qq.com> Date: Mon, 20 Jun 2022 18:45:57 +0800 Subject: [PATCH 04/48] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dapinto=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E7=9A=84eosc=E7=89=88=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index e012d002..7ecabe09 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.16 require ( github.com/Shopify/sarama v1.32.0 - github.com/eolinker/eosc v0.5.0 + github.com/eolinker/eosc v0.5.1 github.com/go-basic/uuid v1.0.0 github.com/hashicorp/consul/api v1.9.1 github.com/nsqio/go-nsq v1.1.0 From 78bf2d362c87181258de0e6e9de9678c89f363ee Mon Sep 17 00:00:00 2001 From: "Dot.L" <824010343@qq.com> Date: Tue, 21 Jun 2022 10:34:53 +0800 Subject: [PATCH 05/48] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8b3ec3ee..0c4c719b 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ In a word, Apinto API gateway enables the business development team to focus mor 1. Download and unzip the installation package (here is an example of the installation package of version v0.5.1) ``` -wget https://github.com/eolinker/apinto/releases/download/v0.5.1/apinto-v0.5.1.linux.x64.tar.gz && tar -zxvf apinto-v0.5.1.linux.x64.tar.gz && cd apinto +wget https://github.com/eolinker/apinto/releases/download/v0.6.1/apinto-v0.6.1.linux.x64.tar.gz && tar -zxvf apinto-v0.6.1.linux.x64.tar.gz && cd apinto ``` 2. Start gateway: From 276cfe7836e12e772b93ce859978ceaf24da8ad8 Mon Sep 17 00:00:00 2001 From: "Dot.L" <824010343@qq.com> Date: Tue, 21 Jun 2022 10:35:22 +0800 Subject: [PATCH 06/48] Update README_CN.md --- README_CN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_CN.md b/README_CN.md index 1f1d423c..703ff02b 100644 --- a/README_CN.md +++ b/README_CN.md @@ -95,7 +95,7 @@ Apinto是一个基于 Golang 开发的微服务网关,能够实现高性能 HT 1.下载安装包并解压(此处以v0.5.1版本的安装包示例) ``` -wget https://github.com/eolinker/apinto/releases/download/v0.5.1/apinto-v0.5.1.linux.x64.tar.gz && tar -zxvf apinto-v0.5.1.linux.x64.tar.gz && cd apinto +wget https://github.com/eolinker/apinto/releases/download/v0.6.1/apinto-v0.6.1.linux.x64.tar.gz && tar -zxvf apinto-v0.6.1.linux.x64.tar.gz && cd apinto ``` 2.启动网关: From 9dbd2a3f29b05aedda12375b0ea995e39f6eeea1 Mon Sep 17 00:00:00 2001 From: "Dot.L" <824010343@qq.com> Date: Wed, 22 Jun 2022 21:01:23 +0800 Subject: [PATCH 07/48] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0c4c719b..75335af6 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ In a word, Apinto API gateway enables the business development team to focus mor 1. Download and unzip the installation package (here is an example of the installation package of version v0.5.1) ``` -wget https://github.com/eolinker/apinto/releases/download/v0.6.1/apinto-v0.6.1.linux.x64.tar.gz && tar -zxvf apinto-v0.6.1.linux.x64.tar.gz && cd apinto +wget https://github.com/eolinker/apinto/releases/download/v0.6.2/apinto-v0.6.2.linux.x64.tar.gz && tar -zxvf apinto-v0.6.2.linux.x64.tar.gz && cd apinto ``` 2. Start gateway: From 9249010efeaa0776f19927767a9ea1f1b33f3837 Mon Sep 17 00:00:00 2001 From: "Dot.L" <824010343@qq.com> Date: Wed, 22 Jun 2022 21:01:52 +0800 Subject: [PATCH 08/48] Update README_CN.md --- README_CN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_CN.md b/README_CN.md index 703ff02b..1bb46ff8 100644 --- a/README_CN.md +++ b/README_CN.md @@ -95,7 +95,7 @@ Apinto是一个基于 Golang 开发的微服务网关,能够实现高性能 HT 1.下载安装包并解压(此处以v0.5.1版本的安装包示例) ``` -wget https://github.com/eolinker/apinto/releases/download/v0.6.1/apinto-v0.6.1.linux.x64.tar.gz && tar -zxvf apinto-v0.6.1.linux.x64.tar.gz && cd apinto +wget https://github.com/eolinker/apinto/releases/download/v0.6.2/apinto-v0.6.2.linux.x64.tar.gz && tar -zxvf apinto-v0.6.2.linux.x64.tar.gz && cd apinto ``` 2.启动网关: From 401363810097981b1985ee4addd98e64c5410469 Mon Sep 17 00:00:00 2001 From: "Dot.L" <824010343@qq.com> Date: Thu, 23 Jun 2022 18:33:30 +0800 Subject: [PATCH 09/48] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 75335af6..37d7c3b6 100644 --- a/README.md +++ b/README.md @@ -80,9 +80,9 @@ In a word, Apinto API gateway enables the business development team to focus mor ### Deployment -* Direct Deployment:[Deployment Tutorial](https://help-apinto.eolink.com/?path=/quick/arrange) -* [Quick Start Tutorial](https://help-apinto.eolink.com/?path=/quick/quick_course) -* [Source Code Compilation Tutorial](https://help-apinto.eolink.com/?path=/quick/arrange) +* Direct Deployment:[Deployment Tutorial](https://help.apinto.com/docs/apinto/quick/arrange) +* [Quick Start Tutorial](https://help.apinto.com/docs/apinto/quick/quick_course) +* [Source Code Compilation Tutorial](https://help.apinto.com/docs/apinto/quick/arrange) * Docker:Follow up support * Kubernetes:Follow up support From 42c6a2c632a24be7796b28f36ce7de639d5a7917 Mon Sep 17 00:00:00 2001 From: "Dot.L" <824010343@qq.com> Date: Thu, 23 Jun 2022 18:38:10 +0800 Subject: [PATCH 10/48] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 37d7c3b6..83a1e8f2 100644 --- a/README.md +++ b/README.md @@ -80,9 +80,9 @@ In a word, Apinto API gateway enables the business development team to focus mor ### Deployment -* Direct Deployment:[Deployment Tutorial](https://help.apinto.com/docs/apinto/quick/arrange) -* [Quick Start Tutorial](https://help.apinto.com/docs/apinto/quick/quick_course) -* [Source Code Compilation Tutorial](https://help.apinto.com/docs/apinto/quick/arrange) +* Direct Deployment:[Deployment Tutorial](https://help.apinto.com/docs/apinto/quick/arrange.html) +* [Quick Start Tutorial](https://help.apinto.com/docs/apinto/quick/quick_course.html) +* [Source Code Compilation Tutorial](https://help.apinto.com/docs/apinto/quick/arrange.html) * Docker:Follow up support * Kubernetes:Follow up support From 0fd268b6f032b1e5b9e6d769c703f653dd5ce9ec Mon Sep 17 00:00:00 2001 From: "Dot.L" <824010343@qq.com> Date: Thu, 23 Jun 2022 18:39:36 +0800 Subject: [PATCH 11/48] Update README_CN.md --- README_CN.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README_CN.md b/README_CN.md index 1bb46ff8..06228e2b 100644 --- a/README_CN.md +++ b/README_CN.md @@ -84,9 +84,9 @@ Apinto是一个基于 Golang 开发的微服务网关,能够实现高性能 HT ### 部署 -* 直接部署:[部署教程](https://help.apinto.com/?path=/quick/arrange) -* [快速入门教程](https://help.apinto.com/?path=/quick/quick_course) -* [源码编译教程](https://help.apinto.com/?path=/quick/arrange) +* 直接部署:[部署教程](https://help.apinto.com/docs/apinto/quick/arrange) +* [快速入门教程](https://help.apinto.com/docs/apinto/quick/quick_course) +* [源码编译教程](https://help.apinto.com/docs/apinto/quick/arrange) * Docker部署:后续支持 * Kubernetes部署:后续支持 @@ -110,7 +110,7 @@ wget https://github.com/eolinker/apinto/releases/download/v0.6.2/apinto-v0.6.2.l - ### **联系我们** -* **帮助文档**:[https://help.apinto.com](https://help.apinto.com/) +* **帮助文档**:[https://help.apinto.com](https://help.apinto.com/docs) - **QQ群**: 725853895 From 4a2f39dda0b2d026e12c80e4ce65cbdbb7e7f299 Mon Sep 17 00:00:00 2001 From: "Dot.L" <824010343@qq.com> Date: Thu, 23 Jun 2022 18:40:12 +0800 Subject: [PATCH 12/48] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 83a1e8f2..7379874d 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ wget https://github.com/eolinker/apinto/releases/download/v0.6.2/apinto-v0.6.2.l 3.To configure the gateway through the visual interface, click [apinto dashboard](https://github.com/eolinker/apinto-dashboard) ### Contact -- **Help documentation**:[https://help.apinto.com](https://help.apinto.com) +- **Help documentation**:[https://help.apinto.com](https://help.apinto.com/docs) - **QQ group**: 725853895 - **Slack**:[Join us](https://join.slack.com/t/slack-zer6755/shared_invite/zt-u7wzqp1u-aNA0XK9Bdb3kOpN03jRmYQ) - **Official website**:[https://www.apinto.com](https://www.apinto.com) From 960d0fa811c4717af729cbaad1d1da2ca100a161 Mon Sep 17 00:00:00 2001 From: Liujian <824010343@qq.com> Date: Sun, 26 Jun 2022 22:01:03 +0800 Subject: [PATCH 13/48] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/resources/apinto.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/build/resources/apinto.yml b/build/resources/apinto.yml index d490fb5a..6b2f489c 100644 --- a/build/resources/apinto.yml +++ b/build/resources/apinto.yml @@ -1,20 +1,20 @@ # 数据文件放置目录 -# data_dir: /var/lib/goku +# data_dir: /var/lib/apinto # pid文件放置地址 -# pid_dir: /var/run/goku/ +# pid_dir: /var/run/apinto/ # 日志放置目录 -# log_dir: /var/log/goku +# log_dir: /var/log/apinto # socket放置目录 -# socket_dir: /tmp/goku +# socket_dir: /tmp/apinto -# goku运行配置地址 -# config: /etc/goku/config.yml +# apinto运行配置地址 +# config: /etc/apinto/config.yml # 扩展仓库目录 -# extends_dir: /var/lib/goku/extenders/ +# extends_dir: /var/lib/apinto/extenders/ # 错误日志文件名 # error_log_name: error.log From 815a3472cb11ac18338cf888905e7bf7477e3782 Mon Sep 17 00:00:00 2001 From: Liujian <824010343@qq.com> Date: Sun, 26 Jun 2022 22:08:06 +0800 Subject: [PATCH 14/48] =?UTF-8?q?=E4=BF=AE=E6=94=B9mod=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index ec0a881e..28c0f3e3 100644 --- a/go.mod +++ b/go.mod @@ -84,4 +84,4 @@ require ( gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) -replace github.com/eolinker/eosc => ../eosc +//replace github.com/eolinker/eosc => ../eosc From 8fe72fc0391cdaac84fc1621b6e27f3836817342 Mon Sep 17 00:00:00 2001 From: "Dot.L" <824010343@qq.com> Date: Sun, 26 Jun 2022 22:28:14 +0800 Subject: [PATCH 15/48] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7379874d..0bb639ee 100644 --- a/README.md +++ b/README.md @@ -88,10 +88,10 @@ In a word, Apinto API gateway enables the business development team to focus mor ### Get start -1. Download and unzip the installation package (here is an example of the installation package of version v0.5.1) +1. Download and unzip the installation package (here is an example of the installation package of version v0.6.3) ``` -wget https://github.com/eolinker/apinto/releases/download/v0.6.2/apinto-v0.6.2.linux.x64.tar.gz && tar -zxvf apinto-v0.6.2.linux.x64.tar.gz && cd apinto +wget https://github.com/eolinker/apinto/releases/download/v0.6.3/apinto-v0.6.3.linux.x64.tar.gz && tar -zxvf apinto-v0.6.3.linux.x64.tar.gz && cd apinto ``` 2. Start gateway: From c92d4f5dd9a9c137b17ef6a7d50183bbdb4defce Mon Sep 17 00:00:00 2001 From: "Dot.L" <824010343@qq.com> Date: Sun, 26 Jun 2022 22:28:54 +0800 Subject: [PATCH 16/48] Update README_CN.md --- README_CN.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README_CN.md b/README_CN.md index 06228e2b..183b6c65 100644 --- a/README_CN.md +++ b/README_CN.md @@ -92,10 +92,10 @@ Apinto是一个基于 Golang 开发的微服务网关,能够实现高性能 HT ### 启动 -1.下载安装包并解压(此处以v0.5.1版本的安装包示例) +1.下载安装包并解压(此处以v0.6.3版本的安装包示例) ``` -wget https://github.com/eolinker/apinto/releases/download/v0.6.2/apinto-v0.6.2.linux.x64.tar.gz && tar -zxvf apinto-v0.6.2.linux.x64.tar.gz && cd apinto +wget https://github.com/eolinker/apinto/releases/download/v0.6.3/apinto-v0.6.3.linux.x64.tar.gz && tar -zxvf apinto-v0.6.3.linux.x64.tar.gz && cd apinto ``` 2.启动网关: From 5845a06081fc544986f4d9979b104d7b02836954 Mon Sep 17 00:00:00 2001 From: "Dot.L" <824010343@qq.com> Date: Fri, 1 Jul 2022 23:59:50 +0800 Subject: [PATCH 17/48] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0bb639ee..1ce1cae1 100644 --- a/README.md +++ b/README.md @@ -88,10 +88,10 @@ In a word, Apinto API gateway enables the business development team to focus mor ### Get start -1. Download and unzip the installation package (here is an example of the installation package of version v0.6.3) +1. Download and unzip the installation package (here is an example of the installation package of version v0.6.4) ``` -wget https://github.com/eolinker/apinto/releases/download/v0.6.3/apinto-v0.6.3.linux.x64.tar.gz && tar -zxvf apinto-v0.6.3.linux.x64.tar.gz && cd apinto +wget https://github.com/eolinker/apinto/releases/download/v0.6.4/apinto-v0.6.4.linux.x64.tar.gz && tar -zxvf apinto-v0.6.4.linux.x64.tar.gz && cd apinto ``` 2. Start gateway: From 492fc971220efd7466bed09f90767636165d729b Mon Sep 17 00:00:00 2001 From: "Dot.L" <824010343@qq.com> Date: Sat, 2 Jul 2022 00:01:45 +0800 Subject: [PATCH 18/48] Update README_CN.md --- README_CN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_CN.md b/README_CN.md index 183b6c65..c532c77a 100644 --- a/README_CN.md +++ b/README_CN.md @@ -95,7 +95,7 @@ Apinto是一个基于 Golang 开发的微服务网关,能够实现高性能 HT 1.下载安装包并解压(此处以v0.6.3版本的安装包示例) ``` -wget https://github.com/eolinker/apinto/releases/download/v0.6.3/apinto-v0.6.3.linux.x64.tar.gz && tar -zxvf apinto-v0.6.3.linux.x64.tar.gz && cd apinto +wget https://github.com/eolinker/apinto/releases/download/v0.6.4/apinto-v0.6.4.linux.x64.tar.gz && tar -zxvf apinto-v0.6.4.linux.x64.tar.gz && cd apinto ``` 2.启动网关: From 016fb9d7efc630f54b4d2e7d2673e70000cf05de Mon Sep 17 00:00:00 2001 From: "Dot.L" <824010343@qq.com> Date: Sat, 2 Jul 2022 00:02:01 +0800 Subject: [PATCH 19/48] Update README_CN.md --- README_CN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_CN.md b/README_CN.md index c532c77a..aefea954 100644 --- a/README_CN.md +++ b/README_CN.md @@ -92,7 +92,7 @@ Apinto是一个基于 Golang 开发的微服务网关,能够实现高性能 HT ### 启动 -1.下载安装包并解压(此处以v0.6.3版本的安装包示例) +1.下载安装包并解压(此处以v0.6.4版本的安装包示例) ``` wget https://github.com/eolinker/apinto/releases/download/v0.6.4/apinto-v0.6.4.linux.x64.tar.gz && tar -zxvf apinto-v0.6.4.linux.x64.tar.gz && cd apinto From e88d2f66750c0c42abdc974e112ab94a1bb54737 Mon Sep 17 00:00:00 2001 From: "Dot.L" <824010343@qq.com> Date: Thu, 28 Jul 2022 17:11:58 +0800 Subject: [PATCH 20/48] Update README_CN.md --- README_CN.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README_CN.md b/README_CN.md index aefea954..7975928c 100644 --- a/README_CN.md +++ b/README_CN.md @@ -11,6 +11,7 @@ Apinto是一个基于 Golang 开发的微服务网关,能够实现高性能 HT 注意:**main**分支为开发主要分支,频繁更新可能导致使用不稳定,若需要使用稳定版本,请查看[release](https://github.com/eolinker/apinto/releases) +**Apinto** 集合了配置和转发功能,使用者可以通过openAPI进行配置,也可通过可视化UI项目[Apinto Dashboard](https://github.com/eolinker/apinto-dashboard)进行配置,相关文档可点击[Apinto Dashboard部署文档](https://help.apinto.com/docs/dashboard/quick/arrange) ### 概况 | [English Introduction](https://github.com/eolinker/apinto/blob/main/README.md) - [为什么要使用Apinto](#为什么要使用Apinto "Apinto") From 56c1da7113f7776b725ce4f0680047df1cb32d43 Mon Sep 17 00:00:00 2001 From: "Dot.L" <824010343@qq.com> Date: Thu, 28 Jul 2022 17:17:01 +0800 Subject: [PATCH 21/48] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 1ce1cae1..7d463e2c 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,8 @@ Apinto is a microservice gateway developed based on golang. It can achieve the p **Note**:The **main** branch is the main development branch. Frequent updates may lead to unstable use. If you need to use a stable version, please look [release](https://github.com/eolinker/apinto/releases) +**Apinto** integrates configuration and forwarding functions. Users can configure it through OpenAPI or through visual UI items [apinto dashboard](https://github.com/eolinker/apinto-dashboard) for configuration, click [apinto dashboard deployment document](https://help.apinto.com/docs/dashboard/quick/arrange) for relevant documents + ### Summary / [中文介绍](https://github.com/eolinker/apinto/blob/main/README_CN.md) - [Why Apinto](#WhyApinto "Why Apinto") From adf89aea9b312993bc377bba9de34eaace36c4a8 Mon Sep 17 00:00:00 2001 From: Liujian <824010343@qq.com> Date: Sun, 31 Jul 2022 23:27:59 +0800 Subject: [PATCH 22/48] commit gitignore --- app/apinto/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/app/apinto/.gitignore b/app/apinto/.gitignore index 7125bd8b..e3fe6de9 100644 --- a/app/apinto/.gitignore +++ b/app/apinto/.gitignore @@ -4,3 +4,4 @@ apinto* /export/ /runtime_config/ /apinto +/tmp/ From eaa49d9a3b0233de5d53660c4bc3fe5e927920f7 Mon Sep 17 00:00:00 2001 From: Liujian <824010343@qq.com> Date: Sun, 31 Jul 2022 23:29:25 +0800 Subject: [PATCH 23/48] commit gitignore --- app/apinto/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/app/apinto/.gitignore b/app/apinto/.gitignore index c8ba35f8..e90d970a 100644 --- a/app/apinto/.gitignore +++ b/app/apinto/.gitignore @@ -6,3 +6,4 @@ apinto* /apinto /tmp/ /tmp_bak/ +/logs/ From b89548b453af72961661da4e12dfe9755d585778 Mon Sep 17 00:00:00 2001 From: "Dot.L" <824010343@qq.com> Date: Mon, 1 Aug 2022 11:23:00 +0800 Subject: [PATCH 24/48] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7d463e2c..5061c7f5 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ In a word, Apinto API gateway enables the business development team to focus mor 1. Download and unzip the installation package (here is an example of the installation package of version v0.6.4) ``` -wget https://github.com/eolinker/apinto/releases/download/v0.6.4/apinto-v0.6.4.linux.x64.tar.gz && tar -zxvf apinto-v0.6.4.linux.x64.tar.gz && cd apinto +wget https://github.com/eolinker/apinto/releases/download/v0.7.0/apinto-v0.7.0.linux.x64.tar.gz && tar -zxvf apinto-v0.7.0.linux.x64.tar.gz && cd apinto ``` 2. Start gateway: From 8eae0d4feff1437d707e47fd41ce95ad645a7f66 Mon Sep 17 00:00:00 2001 From: "Dot.L" <824010343@qq.com> Date: Mon, 1 Aug 2022 11:23:42 +0800 Subject: [PATCH 25/48] Update README_CN.md --- README_CN.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README_CN.md b/README_CN.md index 7975928c..005e86a6 100644 --- a/README_CN.md +++ b/README_CN.md @@ -93,10 +93,10 @@ Apinto是一个基于 Golang 开发的微服务网关,能够实现高性能 HT ### 启动 -1.下载安装包并解压(此处以v0.6.4版本的安装包示例) +1.下载安装包并解压(此处以v0.7.0版本的安装包示例) ``` -wget https://github.com/eolinker/apinto/releases/download/v0.6.4/apinto-v0.6.4.linux.x64.tar.gz && tar -zxvf apinto-v0.6.4.linux.x64.tar.gz && cd apinto +wget https://github.com/eolinker/apinto/releases/download/v0.7.0/apinto-v0.7.0.linux.x64.tar.gz && tar -zxvf apinto-v0.7.0.linux.x64.tar.gz && cd apinto ``` 2.启动网关: From dfee3d059ca9d8e1daf03e0b0b258941465a7b5c Mon Sep 17 00:00:00 2001 From: chenjiekun Date: Mon, 1 Aug 2022 17:58:34 +0800 Subject: [PATCH 26/48] APP=apinto --- build/resources/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/resources/Dockerfile b/build/resources/Dockerfile index e6e30cdf..a1de5da2 100644 --- a/build/resources/Dockerfile +++ b/build/resources/Dockerfile @@ -10,7 +10,7 @@ EXPOSE 9400 8099 VOLUME /var/lib/apinto #设置环境变量 -ENV APP=APINTO +ENV APP=apinto #解压网关程序压缩包 COPY ./apinto.linux.x64.tar.gz / From 935769f3ed57aa820e9b80a1769220652db68865 Mon Sep 17 00:00:00 2001 From: "Dot.L" <824010343@qq.com> Date: Tue, 2 Aug 2022 18:34:48 +0800 Subject: [PATCH 27/48] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5061c7f5..8ab79633 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ In a word, Apinto API gateway enables the business development team to focus mor ### Get start -1. Download and unzip the installation package (here is an example of the installation package of version v0.6.4) +1. Download and unzip the installation package (here is an example of the installation package of version v0.7.0) ``` wget https://github.com/eolinker/apinto/releases/download/v0.7.0/apinto-v0.7.0.linux.x64.tar.gz && tar -zxvf apinto-v0.7.0.linux.x64.tar.gz && cd apinto From 658b174b0084784f0b8c42e6dec5bcb8fafe4b34 Mon Sep 17 00:00:00 2001 From: Liujian <824010343@qq.com> Date: Sun, 7 Aug 2022 21:05:25 +0800 Subject: [PATCH 28/48] =?UTF-8?q?=E4=BF=AE=E6=94=B9eosc=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 3f7075fb..75086689 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.17 require ( github.com/Shopify/sarama v1.32.0 - github.com/eolinker/eosc v0.6.0 + github.com/eolinker/eosc v0.6.1 github.com/go-basic/uuid v1.0.0 github.com/hashicorp/consul/api v1.9.1 github.com/nsqio/go-nsq v1.1.0 From e8fbc7f0c48480b50b482f82bea3bf3b3e683e4d Mon Sep 17 00:00:00 2001 From: "Dot.L" <824010343@qq.com> Date: Sun, 7 Aug 2022 23:46:01 +0800 Subject: [PATCH 29/48] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8ab79633..7f797ecf 100644 --- a/README.md +++ b/README.md @@ -90,10 +90,10 @@ In a word, Apinto API gateway enables the business development team to focus mor ### Get start -1. Download and unzip the installation package (here is an example of the installation package of version v0.7.0) +1. Download and unzip the installation package (here is an example of the installation package of version v0.7.1) ``` -wget https://github.com/eolinker/apinto/releases/download/v0.7.0/apinto-v0.7.0.linux.x64.tar.gz && tar -zxvf apinto-v0.7.0.linux.x64.tar.gz && cd apinto +wget https://github.com/eolinker/apinto/releases/download/v0.7.1/apinto-v0.7.1.linux.x64.tar.gz && tar -zxvf apinto-v0.7.1.linux.x64.tar.gz && cd apinto ``` 2. Start gateway: From ce93faa3356c046bc01ee2a7065c8678faad4280 Mon Sep 17 00:00:00 2001 From: "Dot.L" <824010343@qq.com> Date: Sun, 7 Aug 2022 23:46:31 +0800 Subject: [PATCH 30/48] Update README_CN.md --- README_CN.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README_CN.md b/README_CN.md index 005e86a6..92708ce8 100644 --- a/README_CN.md +++ b/README_CN.md @@ -93,10 +93,10 @@ Apinto是一个基于 Golang 开发的微服务网关,能够实现高性能 HT ### 启动 -1.下载安装包并解压(此处以v0.7.0版本的安装包示例) +1.下载安装包并解压(此处以v0.7.1版本的安装包示例) ``` -wget https://github.com/eolinker/apinto/releases/download/v0.7.0/apinto-v0.7.0.linux.x64.tar.gz && tar -zxvf apinto-v0.7.0.linux.x64.tar.gz && cd apinto +wget https://github.com/eolinker/apinto/releases/download/v0.7.1/apinto-v0.7.1.linux.x64.tar.gz && tar -zxvf apinto-v0.7.1.linux.x64.tar.gz && cd apinto ``` 2.启动网关: From c1472ac4f351c9b2a42486d2f306d48ac97969e4 Mon Sep 17 00:00:00 2001 From: chenjiekun Date: Mon, 15 Aug 2022 18:43:53 +0800 Subject: [PATCH 31/48] alter centos version to 7.9.2009 --- build/resources/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/resources/Dockerfile b/build/resources/Dockerfile index a1de5da2..7ffbb204 100644 --- a/build/resources/Dockerfile +++ b/build/resources/Dockerfile @@ -1,6 +1,6 @@ # 名称:apinto镜像,携带了部署k8s集群所需要的脚本 # 创建时间:2022-3-30 -FROM centos:latest +FROM centos:7.9.2009 MAINTAINER eolink #声明端口 From 29701466db31e93ef07e24d6f90eef6b5c537ccc Mon Sep 17 00:00:00 2001 From: Liujian <824010343@qq.com> Date: Mon, 22 Aug 2022 09:43:07 +0800 Subject: [PATCH 32/48] =?UTF-8?q?=E4=BF=AE=E6=94=B9eosc=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E4=B8=BA0.6.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 75086689..7bd37690 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.17 require ( github.com/Shopify/sarama v1.32.0 - github.com/eolinker/eosc v0.6.1 + github.com/eolinker/eosc v0.6.2 github.com/go-basic/uuid v1.0.0 github.com/hashicorp/consul/api v1.9.1 github.com/nsqio/go-nsq v1.1.0 From 127972c8e651f4e911325bea766ae9a5f02f3ed2 Mon Sep 17 00:00:00 2001 From: "Dot.L" <824010343@qq.com> Date: Wed, 14 Sep 2022 18:04:37 +0800 Subject: [PATCH 33/48] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7f797ecf..6e078861 100644 --- a/README.md +++ b/README.md @@ -90,10 +90,10 @@ In a word, Apinto API gateway enables the business development team to focus mor ### Get start -1. Download and unzip the installation package (here is an example of the installation package of version v0.7.1) +1. Download and unzip the installation package (here is an example of the installation package of version v0.7.2) ``` -wget https://github.com/eolinker/apinto/releases/download/v0.7.1/apinto-v0.7.1.linux.x64.tar.gz && tar -zxvf apinto-v0.7.1.linux.x64.tar.gz && cd apinto +wget https://github.com/eolinker/apinto/releases/download/v0.7.2/apinto-v0.7.2.linux.x64.tar.gz && tar -zxvf apinto-v0.7.2.linux.x64.tar.gz && cd apinto ``` 2. Start gateway: From 0a37f5a4561cd216d048b55b7a299231a4345759 Mon Sep 17 00:00:00 2001 From: "Dot.L" <824010343@qq.com> Date: Wed, 14 Sep 2022 18:05:55 +0800 Subject: [PATCH 34/48] Update README_CN.md --- README_CN.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README_CN.md b/README_CN.md index 92708ce8..fb32fa03 100644 --- a/README_CN.md +++ b/README_CN.md @@ -93,10 +93,10 @@ Apinto是一个基于 Golang 开发的微服务网关,能够实现高性能 HT ### 启动 -1.下载安装包并解压(此处以v0.7.1版本的安装包示例) +1.下载安装包并解压(此处以v0.7.2版本的安装包示例) ``` -wget https://github.com/eolinker/apinto/releases/download/v0.7.1/apinto-v0.7.1.linux.x64.tar.gz && tar -zxvf apinto-v0.7.1.linux.x64.tar.gz && cd apinto +wget https://github.com/eolinker/apinto/releases/download/v0.7.2/apinto-v0.7.2.linux.x64.tar.gz && tar -zxvf apinto-v0.7.2.linux.x64.tar.gz && cd apinto ``` 2.启动网关: From 1bb65fd765c7c28a59fcdbeb11ad8df17f3e9a13 Mon Sep 17 00:00:00 2001 From: "Dot.L" <824010343@qq.com> Date: Mon, 19 Sep 2022 14:09:41 +0800 Subject: [PATCH 35/48] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6e078861..cff5b3d6 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,10 @@ Apinto API gateway has the following advantages: In a word, Apinto API gateway enables the business development team to focus more on business implementation. -[![Stargazers over time](https://starchart.cc/eolinker/apinto.svg)](#) +## Star History + +[![Star History Chart](https://api.star-history.com/svg?repos=eolinker/apinto&type=Date)](https://star-history.com/#eolinker/apinto&Date) + ### Feture From 3ea583ea77ff64d8fa72f35251acde55f8d328e6 Mon Sep 17 00:00:00 2001 From: "Dot.L" <824010343@qq.com> Date: Mon, 19 Sep 2022 14:10:23 +0800 Subject: [PATCH 36/48] Update README_CN.md --- README_CN.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README_CN.md b/README_CN.md index fb32fa03..d6f3043b 100644 --- a/README_CN.md +++ b/README_CN.md @@ -37,7 +37,10 @@ Apinto是一个基于 Golang 开发的微服务网关,能够实现高性能 HT 总而言之,Apinto 能让业务开发团队更加专注地实现业务。 -[![Stargazers over time](https://starchart.cc/eolinker/apinto.svg)](#) +### Star 历史 + +[![Star History Chart](https://api.star-history.com/svg?repos=eolinker/apinto&type=Date)](https://star-history.com/#eolinker/apinto&Date) + ### 产品特性 From 6d6fb3edbb71d61bf190ed8dd9adcf5accfef309 Mon Sep 17 00:00:00 2001 From: "Dot.L" <824010343@qq.com> Date: Mon, 19 Sep 2022 14:11:12 +0800 Subject: [PATCH 37/48] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cff5b3d6..2bbf87f4 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Apinto API gateway has the following advantages: In a word, Apinto API gateway enables the business development team to focus more on business implementation. -## Star History +### Star History [![Star History Chart](https://api.star-history.com/svg?repos=eolinker/apinto&type=Date)](https://star-history.com/#eolinker/apinto&Date) From 9c522915854abf8523e0f8c5ad055880afb7fc95 Mon Sep 17 00:00:00 2001 From: Liujian <824010343@qq.com> Date: Wed, 28 Sep 2022 18:50:18 +0800 Subject: [PATCH 38/48] =?UTF-8?q?=E4=BF=AE=E6=94=B9eosc=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index c7aaadf9..d19f2f35 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.17 require ( github.com/Shopify/sarama v1.32.0 - github.com/eolinker/eosc v0.6.2 + github.com/eolinker/eosc v0.7.0 github.com/go-basic/uuid v1.0.0 github.com/hashicorp/consul/api v1.9.1 github.com/nsqio/go-nsq v1.1.0 From 2047f6756a51439cc296b59b345fb961df476f5f Mon Sep 17 00:00:00 2001 From: Liujian <824010343@qq.com> Date: Sun, 9 Oct 2022 11:04:25 +0800 Subject: [PATCH 39/48] =?UTF-8?q?=E4=BF=AE=E6=94=B9eosc=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7=E4=B8=BA0.7.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index d19f2f35..3bc0e93b 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.17 require ( github.com/Shopify/sarama v1.32.0 - github.com/eolinker/eosc v0.7.0 + github.com/eolinker/eosc v0.7.1 github.com/go-basic/uuid v1.0.0 github.com/hashicorp/consul/api v1.9.1 github.com/nsqio/go-nsq v1.1.0 From 93e218b32b2074fdd04d0cb5c04b24beb3d09e19 Mon Sep 17 00:00:00 2001 From: "Dot.L" <824010343@qq.com> Date: Mon, 10 Oct 2022 11:18:58 +0800 Subject: [PATCH 40/48] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2bbf87f4..b6efbc95 100644 --- a/README.md +++ b/README.md @@ -93,10 +93,10 @@ In a word, Apinto API gateway enables the business development team to focus mor ### Get start -1. Download and unzip the installation package (here is an example of the installation package of version v0.7.2) +1. Download and unzip the installation package (here is an example of the installation package of version v0.8.0) ``` -wget https://github.com/eolinker/apinto/releases/download/v0.7.2/apinto-v0.7.2.linux.x64.tar.gz && tar -zxvf apinto-v0.7.2.linux.x64.tar.gz && cd apinto +wget https://github.com/eolinker/apinto/releases/download/v0.8.0/apinto-v0.8.0.linux.x64.tar.gz && tar -zxvf apinto-v0.8.0.linux.x64.tar.gz && cd apinto ``` 2. Start gateway: From 22abd1e17433f7b0264dd467e0c0f20f2937ca17 Mon Sep 17 00:00:00 2001 From: "Dot.L" <824010343@qq.com> Date: Mon, 10 Oct 2022 11:21:45 +0800 Subject: [PATCH 41/48] Update README_CN.md --- README_CN.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README_CN.md b/README_CN.md index d6f3043b..9e531156 100644 --- a/README_CN.md +++ b/README_CN.md @@ -91,15 +91,15 @@ Apinto是一个基于 Golang 开发的微服务网关,能够实现高性能 HT * 直接部署:[部署教程](https://help.apinto.com/docs/apinto/quick/arrange) * [快速入门教程](https://help.apinto.com/docs/apinto/quick/quick_course) * [源码编译教程](https://help.apinto.com/docs/apinto/quick/arrange) -* Docker部署:后续支持 +* [Docker部署](https://hub.docker.com/r/eolinker/apinto-gateway) * Kubernetes部署:后续支持 ### 启动 -1.下载安装包并解压(此处以v0.7.2版本的安装包示例) +1.下载安装包并解压(此处以v0.8.0版本的安装包示例) ``` -wget https://github.com/eolinker/apinto/releases/download/v0.7.2/apinto-v0.7.2.linux.x64.tar.gz && tar -zxvf apinto-v0.7.2.linux.x64.tar.gz && cd apinto +wget https://github.com/eolinker/apinto/releases/download/v0.8.0/apinto-v0.8.0.linux.x64.tar.gz && tar -zxvf apinto-v0.8.0.linux.x64.tar.gz && cd apinto ``` 2.启动网关: From 035b5327ee7619580a5ebe584f6da9495307c9d3 Mon Sep 17 00:00:00 2001 From: "Dot.L" <824010343@qq.com> Date: Mon, 10 Oct 2022 11:22:47 +0800 Subject: [PATCH 42/48] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b6efbc95..1a280361 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ In a word, Apinto API gateway enables the business development team to focus mor * Direct Deployment:[Deployment Tutorial](https://help.apinto.com/docs/apinto/quick/arrange.html) * [Quick Start Tutorial](https://help.apinto.com/docs/apinto/quick/quick_course.html) * [Source Code Compilation Tutorial](https://help.apinto.com/docs/apinto/quick/arrange.html) -* Docker:Follow up support +* [Docker](https://hub.docker.com/r/eolinker/apinto-gateway) * Kubernetes:Follow up support ### Get start From caf58b52410feeb0c94ca53c20523776b5b13129 Mon Sep 17 00:00:00 2001 From: Liujian <824010343@qq.com> Date: Thu, 13 Oct 2022 21:57:27 +0800 Subject: [PATCH 43/48] =?UTF-8?q?=E6=96=B0=E5=BB=BAgithub-actions=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=89=93=E5=8C=85=E5=8F=91=E7=89=88=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/actions.yaml | 68 ++++++++++++++++++++++++++++++++++ .goreleaser.yaml | 39 +++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 .github/workflows/actions.yaml create mode 100644 .goreleaser.yaml diff --git a/.github/workflows/actions.yaml b/.github/workflows/actions.yaml new file mode 100644 index 00000000..7be14326 --- /dev/null +++ b/.github/workflows/actions.yaml @@ -0,0 +1,68 @@ +name: packAndDockerImages +#触发机制,当main分支有创建tag时 +on: + release: + types: + - published +jobs: + releasePackage: + name: releaseOnGithub + runs-on: ubuntu-latest + steps: + - name: SetOutput #处理Tag字符串并存进outputs + id: vars + run: | + echo "tag=${GITHUB_REF#refs/*/v}" >> $GITHUB_OUTPUT + - name: SetUpGo + uses: actions/setup-go@v3 + with: + go-version: '1.17.3' + - name: Checkout #Checkout代码 + uses: actions/checkout@v3 + - name: GoTidy + run: go mod tidy + - name: Pack #运行打包脚本 + run: | + ./build/cmd/package.sh ${{ steps.vars.outputs.tag }} + - name: Create archives on Release #创建各种系统架构下的二进制包并上传至release assets + uses: goreleaser/goreleaser-action@v3.1.0 + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: List files + run: ls -a dist/ && echo ${{ secrets.GITHUB_TOKEN }} + dockerImage: + needs: [releasePackage] + name: buildDockerImage + runs-on: ubuntu-latest + steps: + - name: SetupGo + uses: actions/setup-go@v3 + with: + go-version: '1.17.3' + - uses: actions/checkout@v3 + - name: SetOutput + id: vars + run: echo "tag=${GITHUB_REF#refs/*/v}" >> $GITHUB_OUTPUT + - name: GoTidy + run: | + go mod tidy + - name: Pack #运行打包脚本并且将生成的tar包复制至Dockerfile所在目录 + run: | + ./build/cmd/package.sh ${{ steps.vars.outputs.tag }} + cp ./out/apinto-${{ steps.vars.outputs.tag }}.linux.x64.tar.gz ./build/resources/apinto.linux.x64.tar.gz + - name: Login Docker #登录docker + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} + - name: buildImage + run: | + docker build -t ${{ secrets.DOCKER_USERNAME }}/apinto-gateway:${{ steps.vars.outputs.tag }} -f ./build/resources/Dockerfile ./build/resources + - name: pushImage + run: | + docker push ${{ secrets.DOCKER_USERNAME }}/apinto-gateway:${{ steps.vars.outputs.tag }} + docker tag ${{ secrets.DOCKER_USERNAME }}/apinto-gateway:${{ steps.vars.outputs.tag }} ${{ secrets.DOCKER_USERNAME }}/apinto-gateway:latest + docker push ${{ secrets.DOCKER_USERNAME }}/apinto-gateway:latest \ No newline at end of file diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 00000000..b25216f1 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,39 @@ +# .goreleaser.yml +builds: + - id: apinto + goos: + - linux + - darwin + goarch: + - amd64 + - arm64 + - "386" + goarm: + - "6" + gomips: + - hardfloat + goamd64: + - v1 + targets: + - linux_arm64 + - linux_386 + - darwin_arm64 + dir: ./app/apinto + main: . + binary: apinto + builder: go + gobinary: go + ldflags: + - -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.builtBy=goreleaser +archives: + - id: default + format: tar.gz + wrap_in_directory: apinto + name_template: "{{ .ProjectName }}_{{ .Tag }}_{{ .Os }}_{{ .Arch }}" + files: + - src: 'build/resources/*' + dst: / + strip_parent: true +release: + name_template: "{{ .Tag }}" + mode: append \ No newline at end of file From 64e34a5a28221b8c9b23434f29c6d775e4d7b5ee Mon Sep 17 00:00:00 2001 From: "Dot.L" <824010343@qq.com> Date: Thu, 13 Oct 2022 22:11:13 +0800 Subject: [PATCH 44/48] Update actions.yaml --- .github/workflows/actions.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/actions.yaml b/.github/workflows/actions.yaml index 7be14326..8a5544d1 100644 --- a/.github/workflows/actions.yaml +++ b/.github/workflows/actions.yaml @@ -21,9 +21,6 @@ jobs: uses: actions/checkout@v3 - name: GoTidy run: go mod tidy - - name: Pack #运行打包脚本 - run: | - ./build/cmd/package.sh ${{ steps.vars.outputs.tag }} - name: Create archives on Release #创建各种系统架构下的二进制包并上传至release assets uses: goreleaser/goreleaser-action@v3.1.0 with: @@ -65,4 +62,4 @@ jobs: run: | docker push ${{ secrets.DOCKER_USERNAME }}/apinto-gateway:${{ steps.vars.outputs.tag }} docker tag ${{ secrets.DOCKER_USERNAME }}/apinto-gateway:${{ steps.vars.outputs.tag }} ${{ secrets.DOCKER_USERNAME }}/apinto-gateway:latest - docker push ${{ secrets.DOCKER_USERNAME }}/apinto-gateway:latest \ No newline at end of file + docker push ${{ secrets.DOCKER_USERNAME }}/apinto-gateway:latest From 939826eb1850c1ba8f789aefb0b9043eaf9cf1a7 Mon Sep 17 00:00:00 2001 From: Liujian <824010343@qq.com> Date: Fri, 14 Oct 2022 11:12:44 +0800 Subject: [PATCH 45/48] =?UTF-8?q?=E4=BF=AE=E6=94=B9github-actions=E6=89=93?= =?UTF-8?q?=E5=8C=85=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/actions.yaml | 5 ----- .goreleaser.yaml | 2 ++ go.mod | 18 +++++++----------- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/.github/workflows/actions.yaml b/.github/workflows/actions.yaml index 7be14326..2b38f035 100644 --- a/.github/workflows/actions.yaml +++ b/.github/workflows/actions.yaml @@ -21,9 +21,6 @@ jobs: uses: actions/checkout@v3 - name: GoTidy run: go mod tidy - - name: Pack #运行打包脚本 - run: | - ./build/cmd/package.sh ${{ steps.vars.outputs.tag }} - name: Create archives on Release #创建各种系统架构下的二进制包并上传至release assets uses: goreleaser/goreleaser-action@v3.1.0 with: @@ -31,8 +28,6 @@ jobs: args: release --rm-dist env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: List files - run: ls -a dist/ && echo ${{ secrets.GITHUB_TOKEN }} dockerImage: needs: [releasePackage] name: buildDockerImage diff --git a/.goreleaser.yaml b/.goreleaser.yaml index b25216f1..ef353e75 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -16,8 +16,10 @@ builds: - v1 targets: - linux_arm64 + - linux_amd64 - linux_386 - darwin_arm64 + - darwin_amd64 dir: ./app/apinto main: . binary: apinto diff --git a/go.mod b/go.mod index 3bc0e93b..5d8f1e66 100644 --- a/go.mod +++ b/go.mod @@ -22,6 +22,7 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.1.1 // indirect github.com/coreos/go-semver v0.3.0 // indirect + github.com/coreos/go-systemd/v22 v22.3.2 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dustin/go-humanize v1.0.0 // indirect @@ -29,13 +30,12 @@ require ( github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 // indirect github.com/eapache/queue v1.1.0 // indirect github.com/fatih/color v1.9.0 // indirect + github.com/form3tech-oss/jwt-go v3.2.3+incompatible // indirect github.com/ghodss/yaml v1.0.0 // indirect - github.com/go-ole/go-ole v1.2.6 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/btree v1.0.1 // indirect - github.com/google/gops v0.3.25 // indirect github.com/google/uuid v1.1.2 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect @@ -51,34 +51,31 @@ require ( github.com/jcmturner/gofork v1.0.0 // indirect github.com/jcmturner/gokrb5/v8 v8.4.2 // indirect github.com/jcmturner/rpc/v2 v2.0.3 // indirect + github.com/jonboulle/clockwork v0.2.2 // indirect + github.com/json-iterator/go v1.1.11 // indirect github.com/julienschmidt/httprouter v1.3.0 // indirect - github.com/keybase/go-ps v0.0.0-20190827175125-91aafc93ba19 // indirect github.com/klauspost/compress v1.14.4 // indirect github.com/kr/fs v0.1.0 // indirect - github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect github.com/mattn/go-colorable v0.1.6 // indirect github.com/mattn/go-isatty v0.0.12 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.1.2 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.1 // indirect github.com/pierrec/lz4 v2.6.1+incompatible // indirect - github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/prometheus/client_golang v1.11.1 // indirect github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.26.0 // indirect github.com/prometheus/procfs v0.6.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/russross/blackfriday/v2 v2.0.1 // indirect - github.com/shirou/gopsutil/v3 v3.22.4 // indirect github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect github.com/soheilhy/cmux v0.1.5 // indirect - github.com/tklauser/go-sysconf v0.3.10 // indirect - github.com/tklauser/numcpus v0.4.0 // indirect + github.com/stretchr/testify v1.7.1 // indirect github.com/urfave/cli/v2 v2.3.0 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 // indirect - github.com/xlab/treeprint v1.1.0 // indirect - github.com/yusufpapurcu/wmi v1.2.2 // indirect go.etcd.io/bbolt v1.3.6 // indirect go.etcd.io/etcd/api/v3 v3.5.4 // indirect go.etcd.io/etcd/client/pkg/v3 v3.5.5 // indirect @@ -105,7 +102,6 @@ require ( gopkg.in/sourcemap.v1 v1.0.5 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect - rsc.io/goversion v1.2.0 // indirect ) //replace github.com/eolinker/eosc => ../eosc From ed2474fb2e70b17070e58a273dd7c050009c9b9e Mon Sep 17 00:00:00 2001 From: Liujian <824010343@qq.com> Date: Tue, 18 Oct 2022 19:32:13 +0800 Subject: [PATCH 46/48] go mod tidy --- go.mod | 1 + 1 file changed, 1 insertion(+) diff --git a/go.mod b/go.mod index 1afb554d..3643f76b 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ go 1.17 require ( github.com/Shopify/sarama v1.32.0 + github.com/coocood/freecache v1.2.2 github.com/eolinker/eosc v0.7.1 github.com/go-basic/uuid v1.0.0 github.com/go-redis/redis/v8 v8.11.5 From 2d2fb2cd3b0e328e8fc16b73cd6f14824758c5dc Mon Sep 17 00:00:00 2001 From: Liujian <824010343@qq.com> Date: Fri, 4 Nov 2022 16:48:09 +0800 Subject: [PATCH 47/48] 1. Add anonymous application 2. Fix the confusion between api key and basic authentication IDs 3. When the program is started, the service discovers that the failure of node acquisition leads to the downtime of the admin process 4. When the forwarding node list is empty, the 503 status code is returned --- application/app.go | 1 - application/auth/apikey/factory.go | 6 ++-- application/auth/basic/factory.go | 6 ++-- drivers/app/app.go | 31 ++++++++++--------- drivers/app/config.go | 5 +-- drivers/app/driver.go | 6 +++- drivers/app/manager/manager.go | 16 ++++++++++ drivers/discovery/consul/consul.go | 20 ++++++------ drivers/discovery/eureka/eureka.go | 21 +++++++------ drivers/discovery/nacos/nacos.go | 23 +++++++------- drivers/plugins/app/app.go | 11 ++++++- drivers/router/http-router/handler.go | 3 +- .../http-router/http-complete/complate.go | 10 +++--- drivers/router/http-router/manager/manager.go | 3 +- go.mod | 2 +- 15 files changed, 101 insertions(+), 63 deletions(-) diff --git a/application/app.go b/application/app.go index a6bd4ac0..a08901b9 100644 --- a/application/app.go +++ b/application/app.go @@ -24,7 +24,6 @@ func init() { type IApp interface { Id() string - Name() string Labels() map[string]string Disable() bool IAppExecutor diff --git a/application/auth/apikey/factory.go b/application/auth/apikey/factory.go index 6c74a66b..496d37ab 100644 --- a/application/auth/apikey/factory.go +++ b/application/auth/apikey/factory.go @@ -13,7 +13,7 @@ var _ auth.IAuthFactory = (*factory)(nil) var driverName = "apikey" -//Register 注册auth驱动工厂 +// Register 注册auth驱动工厂 func Register() { auth.FactoryRegister(driverName, NewFactory()) } @@ -53,7 +53,7 @@ func (f *factory) Create(tokenName string, position string, rule interface{}) (a return a, nil } -//NewFactory 生成一个 auth_apiKey工厂 +// NewFactory 生成一个 auth_apiKey工厂 func NewFactory() auth.IAuthFactory { typ := reflect.TypeOf((*Config)(nil)) render, _ := schema.Generate(typ, nil) @@ -65,5 +65,5 @@ func NewFactory() auth.IAuthFactory { } func toId(tokenName, position string) string { - return fmt.Sprintf("%s@%s", tokenName, position) + return fmt.Sprintf("%s@%s@%s", tokenName, position, driverName) } diff --git a/application/auth/basic/factory.go b/application/auth/basic/factory.go index a38cce92..04857553 100644 --- a/application/auth/basic/factory.go +++ b/application/auth/basic/factory.go @@ -14,7 +14,7 @@ var _ auth.IAuthFactory = (*factory)(nil) var driverName = "basic" -//Register 注册auth驱动工厂 +// Register 注册auth驱动工厂 func Register() { auth.FactoryRegister(driverName, NewFactory()) } @@ -54,7 +54,7 @@ func (f *factory) Create(tokenName string, position string, rule interface{}) (a return a, nil } -//NewFactory 生成一个 auth_apiKey工厂 +// NewFactory 生成一个 auth_apiKey工厂 func NewFactory() auth.IAuthFactory { typ := reflect.TypeOf((*Config)(nil)) render, _ := schema.Generate(typ, nil) @@ -66,5 +66,5 @@ func NewFactory() auth.IAuthFactory { } func toId(tokenName, position string) string { - return fmt.Sprintf("%s@%s", tokenName, position) + return fmt.Sprintf("%s@%s@%s", tokenName, position, driverName) } diff --git a/drivers/app/app.go b/drivers/app/app.go index 914f0282..96d2eb2f 100644 --- a/drivers/app/app.go +++ b/drivers/app/app.go @@ -1,16 +1,17 @@ package app import ( - http_service "github.com/eolinker/eosc/eocontext/http-context" + "errors" "github.com/eolinker/apinto/application" "github.com/eolinker/apinto/application/auth" "github.com/eolinker/eosc" + http_service "github.com/eolinker/eosc/eocontext/http-context" ) type app struct { - id string - name string + id string + //name string driverIDs []string config *Config executor application.IAppExecutor @@ -23,10 +24,6 @@ func (a *app) Execute(ctx http_service.IHttpContext) error { return a.executor.Execute(ctx) } -func (a *app) Name() string { - return a.name -} - func (a *app) Labels() map[string]string { if a.config == nil { return nil @@ -70,14 +67,20 @@ func (a *app) Reset(conf interface{}, workers map[eosc.RequireId]eosc.IWorker) e } func (a *app) set(cfg *Config) error { - filters, users, err := createFilters(a.id, cfg.Auth) - if err != nil { - return err + + if cfg.Anonymous { + anonymousApp := appManager.AnonymousApp() + if anonymousApp != nil && anonymousApp.Id() != a.id { + return errors.New("anonymous app is already exists") + } + appManager.SetAnonymousApp(a) + } else { + filters, users, err := createFilters(a.id, cfg.Auth) + if err != nil { + return err + } + appManager.Set(a, filters, users) } - - //cfg.Labels["application"] = strings.TrimSuffix(app., "@app") - - appManager.Set(a, filters, users) e := newExecutor() e.append(newAdditionalParam(cfg.Additional)) a.executor = e diff --git a/drivers/app/config.go b/drivers/app/config.go index 4eaeaa09..c933db0c 100644 --- a/drivers/app/config.go +++ b/drivers/app/config.go @@ -14,10 +14,11 @@ import ( //Config App驱动配置 type Config struct { - Labels map[string]string `json:"labels" label:"应用标签"` + Anonymous bool `json:"anonymous" label:"匿名" ` Disable bool `json:"disable" label:"是否禁用"` Additional []*Additional `json:"additional" label:"额外参数"` - Auth []*Auth `json:"auth" label:"鉴权列表" eotype:"interface"` + Auth []*Auth `json:"auth" label:"鉴权列表" eotype:"interface" switch:"anonymous===false"` + Labels map[string]string `json:"labels" label:"应用标签"` } type Auth struct { diff --git a/drivers/app/driver.go b/drivers/app/driver.go index 5a58f783..a54df971 100644 --- a/drivers/app/driver.go +++ b/drivers/app/driver.go @@ -51,7 +51,7 @@ func (d *driver) Create(id, name string, v interface{}, workers map[eosc.Require } err = a.set(cfg) - return a, nil + return a, err } func checkConfig(v interface{}) (*Config, error) { @@ -59,6 +59,9 @@ func checkConfig(v interface{}) (*Config, error) { if !ok { return nil, errorConfigType } + if conf.Anonymous && len(conf.Auth) > 0 { + return nil, errors.New("it is anonymous app,auths should be empty") + } for _, a := range conf.Auth { err := application.CheckPosition(a.Position) if err != nil { @@ -71,5 +74,6 @@ func checkConfig(v interface{}) (*Config, error) { return nil, err } } + return conf, nil } diff --git a/drivers/app/manager/manager.go b/drivers/app/manager/manager.go index 66414a23..aeb734c7 100644 --- a/drivers/app/manager/manager.go +++ b/drivers/app/manager/manager.go @@ -19,6 +19,8 @@ type IManager interface { Set(app application.IApp, filters []application.IAuth, users map[string][]application.ITransformConfig) Del(appID string) Count() int + AnonymousApp() application.IApp + SetAnonymousApp(app application.IApp) } type Manager struct { @@ -28,6 +30,20 @@ type Manager struct { driverAlias map[string]string drivers []string locker sync.RWMutex + app application.IApp +} + +func (m *Manager) AnonymousApp() application.IApp { + m.locker.RLock() + app := m.app + m.locker.RUnlock() + return app +} + +func (m *Manager) SetAnonymousApp(app application.IApp) { + m.locker.Lock() + m.app = app + m.locker.Unlock() } func (m *Manager) Count() int { diff --git a/drivers/discovery/consul/consul.go b/drivers/discovery/consul/consul.go index d50dc2fc..8bd7dcaf 100644 --- a/drivers/discovery/consul/consul.go +++ b/drivers/discovery/consul/consul.go @@ -25,7 +25,7 @@ type consul struct { cancelFunc context.CancelFunc } -//Start 开始服务发现 +// Start 开始服务发现 func (c *consul) Start() error { ctx, cancelFunc := context.WithCancel(context.Background()) c.context = ctx @@ -65,7 +65,7 @@ func (c *consul) Start() error { return nil } -//Reset 重置consul实例配置 +// Reset 重置consul实例配置 func (c *consul) Reset(cfg interface{}, workers map[eosc.RequireId]eosc.IWorker) error { workerConfig, ok := cfg.(*Config) if !ok { @@ -78,13 +78,13 @@ func (c *consul) Reset(cfg interface{}, workers map[eosc.RequireId]eosc.IWorker) return nil } -//Stop 停止服务发现 +// Stop 停止服务发现 func (c *consul) Stop() error { c.cancelFunc() return nil } -//Remove 从所有服务app中移除目标app +// Remove 从所有服务app中移除目标app func (c *consul) Remove(id string) error { c.locker.Lock() defer c.locker.Unlock() @@ -95,7 +95,7 @@ func (c *consul) Remove(id string) error { return nil } -//GetApp 获取服务发现中目标服务的app +// GetApp 获取服务发现中目标服务的app func (c *consul) GetApp(serviceName string) (discovery.IApp, error) { var err error var has bool @@ -108,8 +108,8 @@ func (c *consul) GetApp(serviceName string) (discovery.IApp, error) { if !has { nodes, err = c.clients.getNodes(serviceName) if err != nil { - c.locker.Unlock() - return nil, err + log.Errorf("%s get %s node list error: %v", driverName, serviceName, err) + nodes = make(discovery.Nodes) } c.nodes.Set(serviceName, nodes) @@ -126,17 +126,17 @@ func (c *consul) GetApp(serviceName string) (discovery.IApp, error) { return app, nil } -//Create 创建目标服务的app +// Create 创建目标服务的app func (c *consul) Create(serviceName string, attrs map[string]string, nodes map[string]discovery.INode) (discovery.IApp, error) { return discovery.NewApp(nil, c, attrs, nodes), nil } -//Id 返回 worker id +// Id 返回 worker id func (c *consul) Id() string { return c.id } -//CheckSkill 检查目标能力是否存在 +// CheckSkill 检查目标能力是否存在 func (c *consul) CheckSkill(skill string) bool { return discovery.CheckSkill(skill) } diff --git a/drivers/discovery/eureka/eureka.go b/drivers/discovery/eureka/eureka.go index 186017e1..a5520e83 100644 --- a/drivers/discovery/eureka/eureka.go +++ b/drivers/discovery/eureka/eureka.go @@ -3,10 +3,11 @@ package eureka import ( "context" "fmt" - "github.com/eolinker/eosc/utils/config" "sync" "time" + "github.com/eolinker/eosc/utils/config" + "github.com/eolinker/eosc/log" "github.com/eolinker/apinto/discovery" @@ -24,7 +25,7 @@ type eureka struct { locker sync.RWMutex } -//GetApp 获取服务发现中目标服务的app +// GetApp 获取服务发现中目标服务的app func (e *eureka) GetApp(serviceName string) (discovery.IApp, error) { e.locker.RLock() nodes, ok := e.nodes.Get(serviceName) @@ -36,8 +37,8 @@ func (e *eureka) GetApp(serviceName string) (discovery.IApp, error) { // 开始重新获取 ns, err := e.client.GetNodeList(serviceName) if err != nil { - e.locker.Unlock() - return nil, err + log.Errorf("%s get %s node list error: %v", driverName, serviceName, err) + ns = make(discovery.Nodes) } e.nodes.Set(serviceName, ns) nodes = ns @@ -50,7 +51,7 @@ func (e *eureka) GetApp(serviceName string) (discovery.IApp, error) { return app, nil } -//Remove 从所有服务app中移除目标app +// Remove 从所有服务app中移除目标app func (e *eureka) Remove(id string) error { e.locker.Lock() defer e.locker.Unlock() @@ -62,12 +63,12 @@ func (e *eureka) Remove(id string) error { return nil } -//Id 返回 worker id +// Id 返回 worker id func (e *eureka) Id() string { return e.id } -//Start 开始服务发现 +// Start 开始服务发现 func (e *eureka) Start() error { ctx, cancelFunc := context.WithCancel(context.Background()) e.context = ctx @@ -104,7 +105,7 @@ func (e *eureka) Start() error { return nil } -//Reset 重置eureka实例配置 +// Reset 重置eureka实例配置 func (e *eureka) Reset(conf interface{}, workers map[eosc.RequireId]eosc.IWorker) error { cfg, ok := conf.(*Config) if !ok { @@ -114,13 +115,13 @@ func (e *eureka) Reset(conf interface{}, workers map[eosc.RequireId]eosc.IWorker return nil } -//Stop 停止服务发现 +// Stop 停止服务发现 func (e *eureka) Stop() error { e.cancelFunc() return nil } -//CheckSkill 检查目标能力是否存在 +// CheckSkill 检查目标能力是否存在 func (e *eureka) CheckSkill(skill string) bool { return discovery.CheckSkill(skill) } diff --git a/drivers/discovery/nacos/nacos.go b/drivers/discovery/nacos/nacos.go index 9507f837..907cc420 100644 --- a/drivers/discovery/nacos/nacos.go +++ b/drivers/discovery/nacos/nacos.go @@ -3,10 +3,11 @@ package nacos import ( "context" "fmt" - "github.com/eolinker/eosc/utils/config" "sync" "time" + "github.com/eolinker/eosc/utils/config" + "github.com/eolinker/eosc/log" "github.com/eolinker/apinto/discovery" @@ -28,7 +29,7 @@ type nacos struct { locker sync.RWMutex } -//Instance nacos 服务实例结构 +// Instance nacos 服务实例结构 type Instance struct { Hosts []struct { Valid bool `json:"valid"` @@ -40,17 +41,17 @@ type Instance struct { } } -//Id 返回 worker id +// Id 返回 worker id func (n *nacos) Id() string { return n.id } -//CheckSkill 检查目标能力是否存在 +// CheckSkill 检查目标能力是否存在 func (n *nacos) CheckSkill(skill string) bool { return discovery.CheckSkill(skill) } -//Start 开始服务发现 +// Start 开始服务发现 func (n *nacos) Start() error { ctx, cancelFunc := context.WithCancel(context.Background()) n.context = ctx @@ -88,7 +89,7 @@ func (n *nacos) Start() error { return nil } -//Reset 重置nacos实例配置 +// Reset 重置nacos实例配置 func (n *nacos) Reset(conf interface{}, workers map[eosc.RequireId]eosc.IWorker) error { cfg, ok := conf.(*Config) if !ok { @@ -98,13 +99,13 @@ func (n *nacos) Reset(conf interface{}, workers map[eosc.RequireId]eosc.IWorker) return nil } -//Stop 停止服务发现 +// Stop 停止服务发现 func (n *nacos) Stop() error { n.cancelFunc() return nil } -//Remove 从所有服务app中移除目标app +// Remove 从所有服务app中移除目标app func (n *nacos) Remove(id string) error { n.locker.Lock() defer n.locker.Unlock() @@ -115,7 +116,7 @@ func (n *nacos) Remove(id string) error { return nil } -//GetApp 获取服务发现中目标服务的app +// GetApp 获取服务发现中目标服务的app func (n *nacos) GetApp(serviceName string) (discovery.IApp, error) { n.locker.RLock() nodes, ok := n.nodes.Get(serviceName) @@ -126,8 +127,8 @@ func (n *nacos) GetApp(serviceName string) (discovery.IApp, error) { if !ok { ns, err := n.client.GetNodeList(serviceName) if err != nil { - n.locker.Unlock() - return nil, err + log.Errorf("%s get %s node list error: %v", driverName, serviceName, err) + ns = make(discovery.Nodes) } n.nodes.Set(serviceName, ns) diff --git a/drivers/plugins/app/app.go b/drivers/plugins/app/app.go index 71f87a77..ce0dd31c 100644 --- a/drivers/plugins/app/app.go +++ b/drivers/plugins/app/app.go @@ -41,9 +41,13 @@ func (a *App) DoHttpFilter(ctx http_service.IHttpContext, next eocontext.IChain) } func (a *App) auth(ctx http_service.IHttpContext) error { + if appManager.Count() < 1 { + return nil + } driver := ctx.Request().Header().GetHeader("Authorization-Type") filters := appManager.ListByDriver(driver) - if len(filters) < 1 && appManager.Count() > 0 { + + if len(filters) < 1 { filters = appManager.List() } for _, filter := range filters { @@ -67,6 +71,11 @@ func (a *App) auth(ctx http_service.IHttpContext) error { return user.App.Execute(ctx) } } + if app := appManager.AnonymousApp(); app != nil && !app.Disable() { + setLabels(ctx, app.Labels()) + ctx.SetLabel("application", app.Id()) + return app.Execute(ctx) + } return errors.New("invalid user") } diff --git a/drivers/router/http-router/handler.go b/drivers/router/http-router/handler.go index cba8e7f9..e8fe52f7 100644 --- a/drivers/router/http-router/handler.go +++ b/drivers/router/http-router/handler.go @@ -1,11 +1,12 @@ package http_router import ( + "net/http" + http_complete "github.com/eolinker/apinto/drivers/router/http-router/http-complete" "github.com/eolinker/apinto/service" "github.com/eolinker/eosc/eocontext" http_context "github.com/eolinker/eosc/eocontext/http-context" - "net/http" ) var completeCaller = http_complete.NewHttpCompleteCaller() diff --git a/drivers/router/http-router/http-complete/complate.go b/drivers/router/http-router/http-complete/complate.go index 2d165a85..4cb847ce 100644 --- a/drivers/router/http-router/http-complete/complate.go +++ b/drivers/router/http-router/http-complete/complate.go @@ -3,11 +3,12 @@ package http_complete import ( "errors" "fmt" + "strings" + "time" + "github.com/eolinker/eosc/eocontext" http_service "github.com/eolinker/eosc/eocontext/http-context" "github.com/eolinker/eosc/log" - "strings" - "time" ) var ( @@ -60,8 +61,9 @@ func (h *HttpComplete) Complete(org eocontext.EoContext) error { } node, err := balance.Select(ctx) if err != nil { - log.Error("select error: ", lastErr) - + log.Error("select error: ", err) + ctx.Response().SetStatus(501, "501") + ctx.Response().SetBody([]byte(err.Error())) return err } diff --git a/drivers/router/http-router/manager/manager.go b/drivers/router/http-router/manager/manager.go index 8ad7cfc6..4ec0b06d 100644 --- a/drivers/router/http-router/manager/manager.go +++ b/drivers/router/http-router/manager/manager.go @@ -63,7 +63,7 @@ func (m *Manager) Delete(id string) { var errNoCertificates = errors.New("tls: no certificates configured") -//NewManager 创建路由管理器 +// NewManager 创建路由管理器 func NewManager(tf traffic.ITraffic, listenCfg *config.ListensMsg, globalFilters eoscContext.IChainPro) *Manager { log.Debug("new router manager") m := &Manager{ @@ -127,6 +127,7 @@ func (m *Manager) FastHandler(port int, ctx *fasthttp.RequestCtx) { log.Debug("match has:", port) r.ServeHTTP(httpContext) } + httpContext.GetFinish().Finish(httpContext) } type NotFoundHandler struct { diff --git a/go.mod b/go.mod index 3643f76b..2e44ab4f 100644 --- a/go.mod +++ b/go.mod @@ -16,6 +16,7 @@ require ( github.com/satori/go.uuid v1.2.0 github.com/valyala/fasthttp v1.31.0 golang.org/x/crypto v0.0.0-20220214200702-86341886e292 + golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd ) require ( @@ -95,7 +96,6 @@ require ( go.uber.org/atomic v1.7.0 // indirect go.uber.org/multierr v1.6.0 // indirect go.uber.org/zap v1.19.1 // indirect - golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect golang.org/x/text v0.3.7 // indirect golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 // indirect From ec6ae0fb21dfd2baba379038a6042423fbbe1d21 Mon Sep 17 00:00:00 2001 From: Liujian <824010343@qq.com> Date: Fri, 4 Nov 2022 16:53:58 +0800 Subject: [PATCH 48/48] go mod tidy --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 2e44ab4f..3643f76b 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,6 @@ require ( github.com/satori/go.uuid v1.2.0 github.com/valyala/fasthttp v1.31.0 golang.org/x/crypto v0.0.0-20220214200702-86341886e292 - golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd ) require ( @@ -96,6 +95,7 @@ require ( go.uber.org/atomic v1.7.0 // indirect go.uber.org/multierr v1.6.0 // indirect go.uber.org/zap v1.19.1 // indirect + golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect golang.org/x/text v0.3.7 // indirect golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 // indirect