Files
certd/packages/plugins/plugin-center/README.md
xiaojunnuo a1344245cd chore:
2024-04-15 13:53:05 +08:00

66 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 贡献插件
## 1.本地调试运行
安装依赖包:
```shell
# 设置环境变量
npm config set node_sqlite3_binary_host_mirror "https://registry.npmmirror.com/-/binary/sqlite3"
cd certd
# 安装依赖
pnpm install
```
启动 server:
```shell
cd packages/ui/certd-server
npm run dev
```
启动 client:
```shell
cd packages/ui/certd-client
npm run dev
# 会自动打开浏览器,确认正常运行
```
## 开发插件
进入 `packages/plugins/plugin-center/src`
### 1.复制demo目录作为你的插件目录
比如你想做cloudflare的插件那么你可以复制demo目录将其命名成cloudflare。
### 2. access授权
如果这是一个新的平台它应该有授权方式比如accessKey accessSecret之类的
参考`demo/access.ts` 修改为你要做的平台的`access`
这样用户就可以在certd后台中创建这种授权凭证了
### 3. dns-provider
如果域名是这个平台进行解析的那么你需要实现dns-provider
参考`demo/dns-provider.ts` 修改为你要做的平台的`dns-provider`
### 4. deploy-plugin
如果这个平台有需要部署证书的地方
参考`demo/deploy-plugin.ts` 修改为你要做的平台的`deploy-plugin`
### 5. 增加导入
`./src/你的插件目录/index.ts`中增加你的插件import
```ts
export * from './dns-provider'
export * from './plugin-test'
export * from './access'
````
`./src/index.ts`import
```ts
export * from "./你的插件目录"
```
## 重启服务进行调试
刷新浏览器,检查你的插件是否工作正常, 确保能够正常进行证书申请和部署
## 提交PR
我们将尽快审核PR