-
Notifications
You must be signed in to change notification settings - Fork 82
I am curious how to recognize the external folder path of customs plugin. #145
Comments
Using https://github.com/eyolas/kong-plugin-referer.git instead of https://github.com/Kong/kong-plugin, $ git clone https://github.com/Kong/kong-vagrant
$ cd kong-vagrant
$ git clone https://github.com/Kong/kong
$ git clone https://github.com/eyolas/kong-plugin-referer.git
$ mv kong-plugin-referer kong-plugin # for Vagrantfile
$ vagrant up
$ vagrant ssh
$ cd /kong
$ make dev
$ export KONG_PLUGINS=bundled,referer
$ cd /kong
$ bin/kong migrations bootstrap
$ bin/kong start $ curl -X POST http://kong:8001/apis/{api}/plugins \
--data "name=referer" \
--data "config.referers=mockbin.com, *.mockbin.com"
HTTP/1.1 400 Bad Request
Date: Fri, 12 Jun 2020 08:35:25 GMT
Content-Type: application/json; charset=utf-8
Connection: keep-alive
Access-Control-Allow-Origin: *
Server: kong/2.0.4
Content-Length: 249
X-Kong-Admin-Latency: 221
{"message":"schema violation (name: plugin ' referer' not enabled; add it to the 'plugins' configuration property)","name":"schema violation","fields":{"name":"plugin ' referer' not enabled; add it to the 'plugins' configuration property"},"code":2} |
I think the custom plugin hasn't been installed in the system, so it couldn't be recognized by kong.
Refer to https://docs.konghq.com/2.0.x/plugin-development/distribution/#installing-the-plugin |
It should not need to be installed in this enviornment, since the mapped folder
|
@youngkiu your post doesn't make sense?
the above still has "/apis/" which has been deprecated, and also placeholders If you are working with an older version of Kong, make sure the installed version matches the source code in the repo export MY_VERSION=1.3.1
# checkout the right source version
git clone https://github.com/Kong/kong
cd kong
git checkout $MY_VERSION
cd ..
# build vagrant box with the corresponding Kong binaries
KONG_VERSION=$MY_VERSION vagrant up also there is a variable for the plugin source, so instead of; $ git clone https://github.com/eyolas/kong-plugin-referer.git
$ mv kong-plugin-referer kong-plugin # for Vagrantfile
$ vagrant up you can do: git clone https://github.com/eyolas/kong-plugin-referer.git
KONG_PLUGIN_PATH=./kong-plugin-referer vagrant up See docs here: https://github.com/Kong/kong-vagrant#environment-variables-and-configuration |
Thank you for the very kind explanation. However, the expected LUA-related environment variables were not seen. |
I was using the revision shown above, but I updated it to the revision shown below.
|
I found LUA_PATH in the provision.sh file. Then, I ran the following command. It seems to be fully installed now. Sorry for the late reply. |
what's the difference between vagrant provision and vagrant provision? |
@zffocussss sorry I didn't get your question? can you elaborate? |
When the directory structure is the same as above,
Although it is said to set environment variables,
How to recognize the folder path of customs plugin
located in external folder(kong-plugin/kong/plugins/myplugin/) of kong,
not located in subfolder(kong/kong/plugins/myplugin/) of kong?
The text was updated successfully, but these errors were encountered: