Comments (9)
It should not need to be installed in this enviornment, since the mapped folder /kong-plugin
is already in the Lua path, so Kong should pick it up
$ vagrant ssh
vagrant@ubuntu-bionic:/kong$ printenv | grep LUA_
LUA_PATH=/kong/?.lua;/kong/?/init.lua;/kong-plugin/?.lua;/kong-plugin/?/init.lua;;
vagrant@ubuntu-bionic:/kong$
from kong-vagrant.
Using https://github.com/eyolas/kong-plugin-referer.git instead of https://github.com/Kong/kong-plugin,
I experimented as follows, but an error occurs.
$ 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}
from kong-vagrant.
I think the custom plugin hasn't been installed in the system, so it couldn't be recognized by kong.
Using luarocks to install it as follows:
$ cd kong-plugin
$ luarocks make
Refer to https://docs.konghq.com/2.0.x/plugin-development/distribution/#installing-the-plugin
from kong-vagrant.
@youngkiu your post doesn't make sense?
curl -X POST http://kong:8001/apis/{api}/plugins \
--data "name=referer" \
--data "config.referers=mockbin.com, *.mockbin.com"
the above still has "/apis/" which has been deprecated, and also placeholders {api}
, so that is not what you executed
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
from kong-vagrant.
Thank you for the very kind explanation.
$ mv kong-plugin-referer kong-plugin # for Vagrantfile
Without executing the above command, I understood what would be like below.
KONG_PLUGIN_PATH=./kong-plugin-referer vagrant up
However, the expected LUA-related environment variables were not seen.
$ vagrant ssh vagrant@ubuntu-bionic:~$ printenv LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36: SSH_CONNECTION=10.0.2.2 59109 10.0.2.15 22 LESSCLOSE=/usr/bin/lesspipe %s %s LANG=C.UTF-8 XDG_SESSION_ID=5 USER=vagrant PWD=/home/vagrant HOME=/home/vagrant LC_TERMINAL=iTerm2 SSH_CLIENT=10.0.2.2 59109 22 LC_TERMINAL_VERSION=3.3.12 XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop SSH_TTY=/dev/pts/0 MAIL=/var/mail/vagrant TERM=xterm-256color SHELL=/bin/bash SHLVL=1 LOGNAME=vagrant XDG_RUNTIME_DIR=/run/user/1000 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin LESSOPEN=| /usr/bin/lesspipe %s _=/usr/bin/printenv
from kong-vagrant.
kong-vagrant: 6e789de (HEAD -> master, tag: 2.0.4) chore(*) bump Kong to 2.0.4
kong: f37b6516 (HEAD -> master) fix(go) reload killed plugin instance
I was using the revision shown above, but I updated it to the revision shown below.
However, even after, LUA-related environment variables were not seen.
kong-vagrant: 5f8bd87 (HEAD -> master, origin/master, origin/HEAD) fix(readme) fix example curl command in README.md (#161)
kong: 4c1a1ea8 (HEAD -> master, origin/master, origin/HEAD) chore(docs) drop "development", no longer relevant (#6499)
from kong-vagrant.
I found LUA_PATH in the provision.sh file.
# Adjust LUA_PATH to find the source and plugin dev setup
echo "export LUA_PATH=\"/kong/?.lua;/kong/?/init.lua;/kong-plugin/?.lua;/kong-plugin/?/init.lua;;\"" >> /home/vagrant/.bash_profile
Then, I ran the following command.
$ vagrant provision
It seems to be fully installed now.
$ vagrant ssh
vagrant@ubuntu-bionic:~$ printenv | grep LUA
LUA_PATH=/kong/?.lua;/kong/?/init.lua;/kong-plugin/?.lua;/kong-plugin/?/init.lua;;
Sorry for the late reply.
from kong-vagrant.
vagrant
what's the difference between vagrant provision and vagrant provision?
from kong-vagrant.
@zffocussss sorry I didn't get your question? can you elaborate?
from kong-vagrant.
Related Issues (20)
- License not present HOT 1
- "Try Kong" instructions not working HOT 6
- no file at: /etc/kong/kong.conf HOT 6
- Make dev fails with latest Kong rockspec (1.1.0) due to dependency on lyaml HOT 2
- Package 'oracle-java8-installer' has no installation candidate HOT 8
- invalid parameter "transparent" in nginx-kong.conf HOT 3
- reuseport: command not found HOT 3
- `kong migrations bootstrap` fails with `Error: proxy_listen must be of form:...` HOT 2
- dev does not correspond to KONG_VERSION HOT 4
- KONG_VERSION 1.4.3 installation does not work due missing deb package HOT 2
- Tagging kong-vagrant stable versions to avoid breaking changes HOT 1
- Guru-Meditation Error on VirtualBox 6.1 HOT 3
- I can not load my custom plugins on Windows platform HOT 3
- on plugin 'myplugin': myplugin plugin is enabled but not installed HOT 2
- kong-vagrant tag policy and bintray sunset effect on older tags. HOT 3
- Silent Error HOT 3
- Installing from Vagrant idle installing HOT 5
- myplugin tests fail with "[postgres error] ERROR: relation "apis" does not exist" HOT 4
- vagrant up fails HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kong-vagrant.