Giter Site home page Giter Site logo

eolinker / goku_lite Goto Github PK

View Code? Open in Web Editor NEW
3.1K 137.0 603.0 86.06 MB

A Powerful HTTP API Gateway in pure golang!Goku API Gateway (中文名:悟空 API 网关)是一个基于 Golang开发的微服务网关,能够实现高性能 HTTP API 转发、服务编排、多租户管理、API 访问权限控制等目的,拥有强大的自定义插件系统可以自行扩展,并且提供友好的图形化配置界面,能够快速帮助企业进行 API 服务治理、提高 API 服务的稳定性和安全性。

Home Page: https://www.eolinker.com/product/api_gateway/

License: GNU General Public License v3.0

Go 94.30% Shell 0.43% Smarty 0.01% Ruby 0.03% Assembly 2.12% Makefile 0.06% Python 0.01% Dockerfile 0.02% HTML 0.14% Perl 0.19% C 0.08% SCSS 2.62%
gateway api-gateway goku proxy microservices middleware api

goku_lite's People

Contributors

dot-liu avatar hmzzrcs avatar mhxw avatar rolealiu avatar scarqin avatar supermario1990 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

goku_lite's Issues

ce版本v3.0.1 bug

管理端与node节点的 心跳机制 导致的 一直简历连接没有释放连接资源的bug。
导致以但运行超过限制打开文件描述符。就会停止服务。

从日志来看是1秒一次的心跳导致的。

2019/09/29 23:45:40 http: Accept error: accept tcp 127.0.0.1:9903: accept4: too many open files; retrying in 1s

编译报错,不知道怎么回事

build/cmd/build-node.sh
ls: cannot access /mnt/gocode/src/goku-api-gateway/app/plugins/: No such file or directory
build goku-node:go build -o /mnt/gocode/src/goku-api-gateway/out/goku-node-2019101216-15fd948/goku-node /mnt/gocode/src/goku-api-gateway/app/goku-node
can't load package: package /mnt/gocode/src/goku-api-gateway/app/goku-node: import "/mnt/gocode/src/goku-api-gateway/app/goku-node": cannot import absolute path

是诚心开源么

  • 没有QQ群或者微信群,issue也不活跃,有问题都不知道哪里获得回答
  • README中很多链接已经不对了,也不进行维护的,比如部署教程、快速入门教程和源码编译教程
  • API 微服务网关平台教程这个文档里面是企业版和开源版本混搭的,和最新开源的docker镜像也是对不上的,很混乱

Few questions regarding goku

Hello,

I was planning to introduce API gateway in my existing application.
I was going over different API gateways,
I have few queries

  1. is this project actively maintained?
  2. Are there plugins available for LDAP authentication and authorization?
  3. If plugins are not available, can I create my custom plugins using golang?

Thanks in advance!

node build failed

sh build-node.sh

github.com/eolinker/goku-api-gateway/node/console

node/console/config.go:29:10: undefined: Console
node/console/config.go:58:10: undefined: Console
node/console/console.go:17:6: ConfigCallbackFunc redeclared in this block
previous declaration at node/console/config.go:19:6

node build failed!!

尝试编译node工程,但是编译脚本报错,以下为错误信息:

github.com/eolinker/goku-api-gateway/node/console
node/console/config.go:29:10: undefined: Console
node/console/config.go:58:10: undefined: Console
node/console/console.go:17:6: ConfigCallbackFunc redeclared in this block previous declaration at node/console/config.go:19:6

build/cmd/build-console.sh

build/cmd/build-console.sh [3.1]
build/cmd/build-console.sh
build console:go build -o /root/go-workspace/src/github.com/eolinker/goku-api-gateway/out/console-[3.1]/console /root/go-workspace/src/github.com/eolinker/goku-api-gateway/app/console
cp: 无法获取"/root/go-workspace/src/github.com/eolinker/goku-api-gateway/app/console/static/*" 的文件状态(stat): 没有那个文件或目录

实现访问限速和重定向

请教一个问题:如何实现访问一个uri,然后跳转到另一个location上,另外对这个uri进行限速。具体应该怎么配置

使用consul服务发现,拉取的服务地址有误

在consul_catalog.go中

hosts[i] = d.instanceFactory.General(instance.Node.Address, instance.Service.Port, 1)

应该是

hosts[i] = d.instanceFactory.General(instance.Service.Address, instance.Service.Port, 1)

这样才对把?

您好,策略组ID支持自定义或者不显示在路由上面吗?

因为随机出来的这个KLxiHu策略组id,发给别人,不太好理解,而且如果不想改变原来已有的api路径,怎么做到无缝切换?是需要在nginx前面再加一层转发吗?

例如,开始给别人的api是:

https://api.apishop.net/common/oil/getOilPriceToday

切换成goku-api-gateway之后,仍然想使用这个地址,而不用下面的地址:

http://192.168.199.232:6602/demo_gateway/KLxiHu/common/oil/getOilPriceToday

is it support window system?

is it support windows system? I run go build goku-ce.go , something has error
$ go build goku-ce.go
# goku-ce/goku goku\endless.go:62:3: undefined: syscall.SIGUSR1 goku\endless.go:63:3: undefined: syscall.SIGUSR2 goku\endless.go:66:3: undefined: syscall.SIGTSTP goku\endless.go:113:5: undefined: syscall.SIGUSR1 goku\endless.go:114:5: undefined: syscall.SIGUSR2 goku\endless.go:117:5: undefined: syscall.SIGTSTP goku\endless.go:121:5: undefined: syscall.SIGUSR1 goku\endless.go:122:5: undefined: syscall.SIGUSR2 goku\endless.go:125:5: undefined: syscall.SIGTSTP goku\endless.go:225:3: undefined: syscall.Kill goku\endless.go:225:3: too many errors

macOS docker 启动失败cannot assign requested address

看着overview来的,文档创建goku-ce专属网络使用的是172.18.12.0,但是提示的是

Error response from daemon: Pool overlaps with other one on this address space

然后我就把18改为255,创建成功,之后运行

docker run -dt -p 7000:7000 \
-v /apigateway/:/app/goku-ce/console/work \
-e GOKU_ADMIN_PASSWORD=123456 \
--network=goku-ce \
--ip 172.255.12.2 \
--name goku-ce-console \
eolinker/goku-api-gateway-ce-console

看logs提示

[2019-12-09 18:06:03] [TRAC] Listen:  7000
[2019-12-09 18:06:03] [TRAC] Start Successfully!
[2019-12-09 18:06:03] [FATA] listen tcp 172.18.12.2:7005: bind: cannot assign requested address

[ASK] Translation

Hello,
just tried this after I tried used Kong, any suggestion how to translate UI Interface?

启用开放策略时候异常

docker image id:bd617fc66c8a
eolinker/goku-api-gateway-ce-node latest bd617fc66c8a

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0xae29a5]

goroutine 22 [running]:
github.com/eolinker/goku-api-gateway/node/gateway.genFactory(0xc0004745b0, 0xcedf80, 0x12e3e00, 0x0)
/golang/src/github.com/eolinker/goku-api-gateway/node/gateway/router.go:169 +0x75
github.com/eolinker/goku-api-gateway/node/gateway.Parse(0xc0004745b0, 0xcedf80, 0x12e3e00, 0xc000429e68, 0xc000429e90, 0x9458d6, 0xc0000a1510)
/golang/src/github.com/eolinker/goku-api-gateway/node/gateway/router.go:29 +0x4c
github.com/eolinker/goku-api-gateway/node/server.(*Server).FlushRouter(0xc000085310, 0xc0004745b0)
/golang/src/github.com/eolinker/goku-api-gateway/node/server/server.go:99 +0x56
github.com/eolinker/goku-api-gateway/node/console.(*Console).AddListen.func1(0xb4e740, 0xc0004745b0)
/golang/src/github.com/eolinker/goku-api-gateway/node/console/config.go:62 +0x40
github.com/eolinker/goku-api-gateway/common/listener.(*Listener).Call(0xc000066080, 0xb4e740, 0xc0004745b0)
/golang/src/github.com/eolinker/goku-api-gateway/common/listener/listener.go:47 +0xb6
github.com/eolinker/goku-api-gateway/node/console.listenConfig.func1(0xcfc260, 0xc0000a0a40, 0xc00009a180, 0x2a, 0x7ffceeda9e65, 0x20)
/golang/src/github.com/eolinker/goku-api-gateway/node/console/config.go:96 +0x12b
created by github.com/eolinker/goku-api-gateway/node/console.listenConfig
/golang/src/github.com/eolinker/goku-api-gateway/node/console/config.go:75 +0x168
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0xae29a5]

goroutine 1 [running]:
github.com/eolinker/goku-api-gateway/node/gateway.genFactory(0xc00010c1a0, 0xcedf80, 0x12e3e00, 0x0)
/golang/src/github.com/eolinker/goku-api-gateway/node/gateway/router.go:169 +0x75
github.com/eolinker/goku-api-gateway/node/gateway.Parse(0xc00010c1a0, 0xcedf80, 0x12e3e00, 0x1, 0x2, 0xc00002d760, 0x1)
/golang/src/github.com/eolinker/goku-api-gateway/node/gateway/router.go:29 +0x4c
github.com/eolinker/goku-api-gateway/node/server.(*Server).ServerWidthConfig(0xc00002d580, 0xc00010c1a0, 0x0, 0x0)
/golang/src/github.com/eolinker/goku-api-gateway/node/server/server.go:69 +0xc6
github.com/eolinker/goku-api-gateway/node/server.(*Server).ServerWidthConsole(0xc00002d580, 0xc00008a870, 0x7ffda944ce49, 0x10)
/golang/src/github.com/eolinker/goku-api-gateway/node/server/server.go:57 +0xf9
main.main()
/golang/src/github.com/eolinker/goku-api-gateway/app/node/main.go:25 +0x1d9

插件管理

从控制管理插件对安装升级,以及自动识别

bind: cannot assign requested address

node节点启动的时候,会报console 7005端口不能分配的问题
这个确认过是在同一个子网内,直接启动失败
listen tcp 172.19.12.2:7005: bind: cannot assign requested address

不支持其他数据库吗

是否支持其他数据库呢?出了mysql,还有PostgreSQL,sqlite,或者嵌入式数据库boltdb/bardger/leveldb等等

3.1.0 增加插件错误

panic(0x9c5cc0, 0x109d050) /usr/local/go/src/runtime/panic.go:522 +0x1b5 github.com/eolinker/goku-api-gateway/console/module/plugin/plugin-config.CheckConfig(0xc0001c630b, 0x10, 0x10f5f08, 0x0, 0x0, 0x0, 0x4, 0x2) /home/lvyou/goku/goku_code/goku-api-gateway/console/module/plugin/plugin-config/config.go:41 +0x50e github.com/eolinker/goku-api-gateway/console/controller/plugin.AddPlugin(0xb0d060, 0xc0001ae380, 0xc000304100) /home/lvyou/goku/goku_code/goku-api-gateway/console/controller/plugin/plugin.go:64 +0x2f4 net/http.HandlerFunc.ServeHTTP(0xa716d0, 0xb0d060, 0xc0001ae380, 0xc000304100) /usr/local/go/src/net/http/server.go:1995 +0x44 net/http.(*ServeMux).ServeHTTP(0x10d8b20, 0xb0d060, 0xc0001ae380, 0xc000304100) /usr/local/go/src/net/http/server.go:2375 +0x1d6 net/http.serverHandler.ServeHTTP(0xc0000ddee0, 0xb0d060, 0xc0001ae380, 0xc000304100) /usr/local/go/src/net/http/server.go:2774 +0xa8 net/http.(*conn).serve(0xc00023a0a0, 0xb0e5a0, 0xc0004061c0) /usr/local/go/src/net/http/server.go:1878 +0x851 created by net/http.(*Server).Serve /usr/local/go/src/net/http/server.go:2884 +0x2f4

duplicate instance

console 和node 不能在同一台电脑 的dokcer 中运行呀,错误duplicate instance

json格式转发好像有问题

Body为Raw数据是表示json格式的,但是在代码中this.isJSON = false,
// Set raw message body
// NOTICE: it is the users' responsability to set the correct Content-Type header
func (this *request) SetRawBody(body []byte) Request {
this.isJSON = false
this.body = body
return this
}

api编排支持类型问题

看了文档,目前编排策略都是支持返回是一个object的,
是因为不支持list吗?还是说当前仅支持object的编排

[ERROR]Missing Strategy ID!

您好,我在部署一个console和node后,调用API报错[ERROR]Missing Strategy ID!,且我已经启动了开发策略,请问是哪里配置错了呢。

没有显示服务列表?

1、界面是否没有显示健康的服务列表?
2、在哪里设置服务的健康设置,例如心跳?
3.0.1

app/config/server.go listen_port config not working

I changed the listen_port from 7000 to a custom value 8001, however the console still listen to 7000.

From the code I can see, it log out the correct listen_port, but still use 7000

The file path is "/app/config/server.go", line 27

	port, has := conf.Get("listen_port")
	if has {
		go func() {
			log.Print("Listen: ", port)
			log.Print("Start Successfully!")
			err := http.ListenAndServe(":7000", router())

			ec <- err
		}()
	} else {
		log.Panic("[ERROR] Illegal listen port!")
	}

Please make the http listen to port ,thanks.

/app/console/static 在哪里

编译的时候看到 /build/cmd/build-console.sh 中需要 cp /app/console/static/* ,但是对应目录下没有该文件夹

同学,您这个项目引入了95个开源组件,存在4个漏洞,辛苦升级一下

检测到 eolinker/goku_lite 一共引入了95个开源组件,存在4个漏洞

漏洞标题:Go SSH拒绝服务漏洞
缺陷组件:golang.org/x/[email protected]
漏洞编号:CVE-2020-9283
漏洞描述:Go SSH是一个使用go语言开发的极度简洁的ssh工具,用于远程管理linux、unix等机器。
Go SSH存在拒绝服务漏洞,该漏洞源于网络系统或产品未对输入的数据进行正确的验证,攻击者可利用该漏洞导致拒绝服务条件,拒绝向合法用户提供服务。
国家漏洞库信息:https://www.cnvd.org.cn/flaw/show/CNVD-2020-14300
影响范围:(∞, 0.0.0-20200220183623-bac4c82f6975)
最小修复版本:0.0.0-20200220183623-bac4c82f6975
缺陷组件引入路径:main@->golang.org/x/[email protected]

另外还有4个漏洞,详细报告:https://mofeisec.com/jr?p=a0d0b7

Lack of documentation

Please complete the relevant documentation. I want to know how to use goku-api-gateway and the framework about goku-api-gateway, Thx!

是否支持mysql数据库?

mysql数据库不支持吗?
panic: need:[github.com/eolinker/goku-api-gateway/server/dao.dao.BalanceDao github.com/eolinker/goku-api-gateway/server/dao.dao.NodeDao github.com/eolinker/goku-api-gateway/server/dao.dao.APIDao github.com/eolinker/goku-api-gateway/server/dao.dao.GuestDao github.com/eolinker/goku-api-gateway/server/dao.dao.UserDao github.com/eolinker/goku-api-gateway/server/dao.dao.APIPluginDao github.com/eolinker/goku-api-gateway/server/dao.dao.StrategyDao github.com/eolinker/goku-api-gateway/server/dao.dao.APIGroupDao github.com/eolinker/goku-api-gateway/server/dao.dao.ProjectDao github.com/eolinker/goku-api-gateway/server/dao.dao.StrategyPluginDao github.com/eolinker/goku-api-gateway/server/dao.dao.VersionDao github.com/eolinker/goku-api-gateway/server/dao.dao.MonitorModulesDao github.com/eolinker/goku-api-gateway/server/dao.dao.ServiceDao github.com/eolinker/goku-api-gateway/server/dao.dao.PluginDao github.com/eolinker/goku-api-gateway/server/dao.dao.StrategyGroupDao github.com/eolinker/goku-api-gateway/server/dao.dao.ClusterDao github.com/eolinker/goku-api-gateway/server/dao.dao.NodeGroupDao github.com/eolinker/goku-api-gateway/server/dao.dao.VersionConfigDao github.com/eolinker/goku-api-gateway/server/dao.dao.GatewayDao github.com/eolinker/goku-api-gateway/server/dao.dao.ConfigLogDao github.com/eolinker/goku-api-gateway/server/dao.dao.APIStrategyDao github.com/eolinker/goku-api-gateway/server/dao.dao.ImportDao github.com/eolinker/goku-api-gateway/server/dao.dao.AuthDao github.com/eolinker/goku-api-gateway/server/dao.dao.BalanceUpdateDao]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.