Plugin Market Data Source
About 299 wordsAbout 1 min
In CNB, a plugin is essentially a Docker image.
The Plugin Market is the portal for aggregating and displaying plugins for users to browse and select.
Data Source
A plugin data source is a JSON-formatted array, where each element represents a plugin.
Administrators configure multiple data sources by category at Admin Panel → Backend Management → Feature Configuration → Document Data Source Management.
The example below shows the complete structure of a single plugin element:
[
{
"id": "cnbcool/hello-world",
"name": "hello world",
"description": "A simple plugin demo",
"tags": ["demo"],
"readme": "https://raw.example.com/cnb/plugins/cnbcool/hello-world/README.md",
"logo": "https://raw.example.com/cnb/plugins/cnbcool/hello-world/logo.png",
"source": "https://cnb.cool/cnb/plugins/cnbcool/hello-world",
"bugs": "https://cnb.cool/cnb/plugins/cnbcool/hello-world/-/issues",
"images": "https://hub.docker.com/r/cnbcool/hello-world/tags"
}
]| Field | Description |
|---|---|
id | Unique plugin ID, usually formatted as org/plugin |
name | Plugin display name |
description | Plugin summary shown on the plugin card |
tags | Plugin tags for classification and search |
readme | Raw URL of the plugin README for usage instructions |
logo | Raw URL of the plugin logo |
source | Plugin source repository URL |
bugs | Plugin issue feedback URL |
images | URL listing available tags of the plugin image |
Example Project
Manually maintaining multiple plugins in a single JSON file is inconvenient. Refer to the Example Project: organize plugins in separate directories and use a pipeline to automatically aggregate them into plugins.json.
The aggregated output of the example project looks like:
[
{
"id": "hello-world",
"name": "hello world",
"description": "A simple plugin demo",
"tags": ["demo"],
"readme": "https://cnb.cool/examples/ecosystem/plugins-data-source/-/git/raw/main/plugins/hello-world/README.md",
"logo": "https://cnb.cool/examples/ecosystem/plugins-data-source/-/git/raw/main/plugins/hello-world/logo.png",
"source": "https://cnb.cool/cnb/plugins/cnbcool/hello-world",
"bugs": "https://cnb.cool/cnb/plugins/cnbcool/hello-world/-/issues",
"images": "https://hub.docker.com/r/cnbcool/hello-world/tags"
}
]