我创建了一个定制的kong插件,并试图在本地部署它。用Luarocks,Pongo和手动..。但有些人现在怎样才能做到。
分享我所遵循的步骤。
命令
luarocks make 日志
kong-check-x-header 1.0-1 depends on lua ~> 5.1 (5.1-1 provided by VM) kong-check-x-header 1.0-1 is now installed in /usr/local/Cellar/openresty@1.19.3.2/1.19.3.2/luarocks (license: Apache 2.0)
命令
luarocks pack kong-check-x-header 1.0-1日志
Packed: /Users/jaikratsinghtariyal/Sandbox/kong-check-x-header/kong-check-x-header-1.0-1.all.rock命令
luarocks install kong-check-x-header-1.0-1.all.rock日志
kong-check-x-header 1.0-1 depends on lua ~> 5.1 (5.1-1 provided by VM)
Error: /usr/local/Cellar/openresty@1.19.3.2/1.19.3.2/luarocks/lib/luarocks/rocks-5.1/kong-check-x-header/1.0-1/lua/kong/plugins/kong-check-x-header/schema.lua: No such file or directory在这件事上有不少days...struggling .这里需要一些助理。
GITHUB - https://github.com/jaikratsinghtariyal/kong-check-x-header
评论后的更新
按以下顺序发射的命令。
原木-
Creating kong-pongo_kong_run ... done
kong-plugin-check-x-header 1.0-1 depends on lua ~> 5.1 (5.1-1 provided by VM)
Stopping after installing dependencies for kong-plugin-check-x-header 1.0-1
Kong version: 2.5.0
kong-plugin-check-x-header 1.0-1 depends on lua ~> 5.1 (5.1-1 provided by VM)
kong-plugin-check-x-header 1.0-1 is now installed in /usr/local (license: Apache 2.0)
Packed: /kong-plugin/kong-plugin-check-x-header-1.0-1.all.rock`
shell
日志:-
kong-plugin-check-x-header 1.0-1 depends on lua ~> 5.1 (5.1-1 provided by VM)
kong-plugin-check-x-header 1.0-1 is now installed in /usr/local (license: Apache 2.0)除了kong start之外,所有命令都在工作。
日志-
Error:
/usr/local/share/lua/5.1/kong/cmd/start.lua:75: /usr/local/share/lua/5.1/kong/cmd/start.lua:64: nginx: [error] init_by_lua error: /usr/local/share/lua/5.1/kong/init.lua:515: error loading plugin schemas: on plugin 'kong-plugin-check-x-header': kong-plugin-check-x-header plugin is enabled but not installed;
no plugin found
stack traceback:
[C]: in function 'assert'
/usr/local/share/lua/5.1/kong/init.lua:515: in function 'init'
init_by_lua:3: in main chunk
stack traceback:
[C]: in function 'error'
/usr/local/share/lua/5.1/kong/cmd/start.lua:75: in function 'cmd_exec'
/usr/local/share/lua/5.1/kong/cmd/init.lua:88: in function </usr/local/share/lua/5.1/kong/cmd/init.lua:88>
[C]: in function 'xpcall'
/usr/local/share/lua/5.1/kong/cmd/init.lua:88: in function </usr/local/share/lua/5.1/kong/cmd/init.lua:45>
/kong/bin/kong:9: in function 'file_gen'
init_worker_by_lua:47: in function <init_worker_by_lua:45>
[C]: in function 'xpcall'
init_worker_by_lua:54: in function <init_worker_by_lua:52>发布于 2021-09-07 11:22:32
首先,要使用pongo,必须尊重文件路径和插件名称。
kong-check-x-header => kong-plugin-check-x-header
然后,您应该将文件放在正确的目录kong/plugins/check-x-header/中。
规范文件中有kong-check-header-x而不是check-x-header。
我认为您应该使用像pongo lint这样的linter来检测问题,例如,X-Auth-Token不能用作键,您应该更喜欢X_Auth_Token
https://stackoverflow.com/questions/69085647
复制相似问题