apisix-dashboard icon indicating copy to clipboard operation
apisix-dashboard copied to clipboard

request help: let custom plugin show in dashboard

Open maplessssy opened this issue 6 years ago • 18 comments

Issue description

I have added a custom plugin, how to let the custom plugin show in dashboard? image

image

thx for help.

Environment

  • apisix version (cmd: apisix version): 2.0
  • OS: mac os

maplessssy avatar Oct 30 '20 03:10 maplessssy

The plugin has been configured. image

maplessssy avatar Oct 30 '20 03:10 maplessssy

Hi, please follow those steps to have a check first:

  1. Get all plugin list
$ curl $API_HOST/apisix/admin/plugins
  1. Check if your cgi-proxy plugin is included in that list.

Looking forward to your feedback.

juzhiyuan avatar Oct 30 '20 03:10 juzhiyuan

BTW, please use the latest dashboard 2.0 RC2 to have a test.

https://github.com/apache/apisix-dashboard/blob/v2.0/docs/deploy.md

juzhiyuan avatar Oct 30 '20 04:10 juzhiyuan

@juzhiyuan here is output, seems like need a Authentication. image

maplessssy avatar Oct 30 '20 04:10 maplessssy

OK then, this error is returned from 2.0 RC2 may be, let's visit the dashboard then check this API:

image

juzhiyuan avatar Oct 30 '20 06:10 juzhiyuan

@justinmclean not found my custom plugin. image

{"code":0,"message":"","data":["limit-count","kafka-logger","request-validation","referer-restriction","zipkin","example-plugin","request-id","node-status","grpc-transcode","wolf-rbac","basic-auth","syslog","consumer-restriction","cors","openid-connect","hmac-auth","udp-logger","proxy-cache","fault-injection","proxy-mirror","proxy-rewrite","key-auth","log-rotate","response-rewrite","prometheus","tcp-logger","http-logger","authz-keycloak","limit-conn","uri-blocker","skywalking","redirect","batch-requests","limit-req","jwt-auth","echo","ip-restriction"],"request_id":"26dc294c-6e4f-480d-8763-322b136f0553"}

maplessssy avatar Oct 30 '20 06:10 maplessssy

Ok then this issue is not because of frontend, let’s cc @nic-chen @membphis to have more discussions with you :)

juzhiyuan avatar Oct 30 '20 08:10 juzhiyuan

@thekingofworld

need to re-generate json schema for your custom plugin.

here is how to use the tool to generate json schema:

https://github.com/apache/apisix-dashboard/blob/v2.0/docs/develop.md#sync-jsonschema

nic-chen avatar Oct 30 '20 08:10 nic-chen

Oh! That’s it!!! The Dashboard needs this tool to regenerate plugin schemas, this trick tip should be removed and improve this part in the future.

juzhiyuan avatar Oct 30 '20 09:10 juzhiyuan

@thekingofworld We have reproduced this problem in the local environment, thank you for your feedback.

idbeta avatar Nov 06 '20 08:11 idbeta

@thekingofworld We have reproduced this problem in the local environment, thank you for your feedback.

do you find an easier way to reproduce this issue? or as the reporter?

membphis avatar Nov 06 '20 15:11 membphis

I was confused with those labels. Welcome to split them into multiple different issues for easy tracking and fix.

@juzhiyuan @idbeta

image

membphis avatar Nov 06 '20 15:11 membphis

@thekingofworld We have reproduced this problem in the local environment, thank you for your feedback.

do you find an easier way to reproduce this issue? or as the reporter?

make a plugin with reference to example-plugin to reproduce the problem, update schema.json with schema-sync.sh and it will report an error

--2020-11-06 19:47:50--  https://github.com/apache/apisix/archive/2.0.zip
...
...
200 OK
...
...
Archive:  2.0.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of 2.0.zip or
        2.0.zip.zip, and cannot find 2.0.zip.ZIP, period.
mv: rename ./apisix-2.0/apisix/* to ./api/build-tools/apisix/*: No such file or directory
lua: schema-sync.lua:89: module 'apisix.schema_def' not found:
	no field package.preload['apisix.schema_def']
	no file '/usr/local/share/lua/5.3/apisix/schema_def.lua'
	no file '/usr/local/share/lua/5.3/apisix/schema_def/init.lua'
	no file '/usr/local/lib/lua/5.3/apisix/schema_def.lua'
	no file '/usr/local/lib/lua/5.3/apisix/schema_def/init.lua'
	no file './apisix/schema_def.lua'
	no file './apisix/schema_def/init.lua'
	no file '/usr/local/lib/lua/5.3/apisix/schema_def.so'
	no file '/usr/local/lib/lua/5.3/loadall.so'
	no file './apisix/schema_def.so'
	no file '/usr/local/lib/lua/5.3/apisix.so'
	no file '/usr/local/lib/lua/5.3/loadall.so'
	no file './apisix.so'
stack traceback:
	[C]: in function 'require'
	schema-sync.lua:89: in main chunk
	[C]: in ?
sync success:
/Users/idbeta/1106/apisix-dashboard/api/conf/schema.json

idbeta avatar Nov 09 '20 07:11 idbeta

@nic-chen is this a blocked issue?

moonming avatar Nov 09 '20 08:11 moonming

This issue is reported 3 times at least, so it's a blocked issue IMO.

juzhiyuan avatar Nov 09 '20 08:11 juzhiyuan

@idbeta please make a try with the latest branch v2.0, confirm if it works fine for you.

if it works fine, then we can close this issue.

membphis avatar Nov 09 '20 13:11 membphis

@thekingofworld welcome to make a try too, wait for your response ^_^

membphis avatar Nov 09 '20 13:11 membphis

fix by #676 #765

nic-chen avatar Nov 10 '20 08:11 nic-chen