Skip to main content

A web UI for managing NoneBot runtime config, loaded plugins, and plugin store entries.

Project description

nonebot-plugin-webui

一个面向 NoneBot2 的 WebUI 插件雏形,目标是集中管理 NoneBot 运行配置、已加载插件、插件设置与插件商店。

当前能力

  • 挂载到 FastAPI 驱动提供的 server_app
  • 查看 NoneBot 运行信息
  • 查看已读取的配置项,并自动遮蔽疑似密钥、令牌、密码字段
  • 查看已加载插件与 PluginMetadata
  • 从 NoneBot 官方 registry 拉取插件商店列表,并给出 nb plugin install 命令
  • 提供 WebUI 虚拟聊天环境,可触发 NoneBot matcher
  • 内置 /ai 命令,可通过 WebUI 模型提供商配置调用 OpenAI 兼容大模型

使用方式

安装到你的 NoneBot 项目环境后,在入口中加载插件:

nonebot.load_plugin("nonebot_plugin_webui")

确保项目使用 FastAPI 驱动,例如:

DRIVER=~fastapi

启动 NoneBot 后访问:

http://127.0.0.1:8080/webui

Docker

本地构建并启动:

docker compose up -d --build

启动后访问:

http://127.0.0.1:8080/webui

Release 发布并成功推送 PyPI 后,GitHub Actions 会从 PyPI 安装同版本包并推送镜像到 Docker Hub:

<dockerhub-namespace>/nonebot-plugin-webui:<release-tag>

非预发布版本还会额外推送 latest 标签。

需要在 GitHub 仓库 Secrets 中配置:

DOCKERHUB_USERNAME
DOCKERHUB_TOKEN

配置

WEBUI_PATH=/webui
WEBUI_STORE_URL=https://registry.nonebot.dev/plugins.json
WEBUI_STORE_TIMEOUT=10

# 可选:启用 WebUI 登录保护
# 设置后访问 WebUI 需要输入该令牌
WEBUI_ACCESS_TOKEN=change-me

# 登录账号固定为 admin,初始密码为 WEBUI_ACCESS_TOKEN。
# 数据库不可用时也会使用这个本地保底密码登录。

# 数据库配置不放在 .env 中。
# WebUI 默认使用 .nonebot-plugin-webui/webui.sqlite3,
# 可在 WebUI 的“配置 / 数据库”面板中修改并测试连接。

# 可选:作为 WebUI 模型提供商设置的回退值
# 推荐直接在 WebUI 的“模型”页面配置
WEBUI_AI_API_KEY=sk-...
WEBUI_AI_BASE_URL=https://api.openai.com/v1
WEBUI_AI_MODEL=gpt-4o-mini

AI 模型提供商设置会保存到运行目录下:

.nonebot-plugin-webui/webui.sqlite3

数据库连接配置会保存到运行目录下的本地 JSON 文件,作为启动期保底配置:

.nonebot-plugin-webui/database.json

如果数据库不可用,WebUI 会回退读取 .nonebot-plugin-webui/settings.json,并允许使用本地保底登录令牌进入界面修复数据库配置。

路线图

  • 支持编辑 .env / .env.* 配置文件并生成变更预览
  • 为插件配置类生成可编辑表单
  • 调用 nb-cli 安装、更新、卸载插件
  • 增加鉴权与访问控制
  • 前端迁移到正式构建链并补充更完整的状态管理

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonebot_plugin_webui-0.1.4.tar.gz (2.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nonebot_plugin_webui-0.1.4-py3-none-any.whl (1.3 MB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_webui-0.1.4.tar.gz.

File metadata

  • Download URL: nonebot_plugin_webui-0.1.4.tar.gz
  • Upload date:
  • Size: 2.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nonebot_plugin_webui-0.1.4.tar.gz
Algorithm Hash digest
SHA256 a2fcfee35dde79ef4d13294973b243689410aabd319233f476bc3c8dcfafd287
MD5 68959f66a2b027c31167769230ade103
BLAKE2b-256 103462ae2024105f3cf46a71c8b25aec3a508aabf441482b827e79940d039681

See more details on using hashes here.

Provenance

The following attestation bundles were made for nonebot_plugin_webui-0.1.4.tar.gz:

Publisher: release.yml on Coloynle/nonebot-plugin-webui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nonebot_plugin_webui-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_webui-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f4320667e71963c6e42cf0e404045dfaeda030524e362d27fbc4eae53ecf1079
MD5 07cbf905ba6b386834d5b93d36e2e739
BLAKE2b-256 632f5447d1ea015f9885d51de409710f0755a03e1be81a9f057900e44b721d5d

See more details on using hashes here.

Provenance

The following attestation bundles were made for nonebot_plugin_webui-0.1.4-py3-none-any.whl:

Publisher: release.yml on Coloynle/nonebot-plugin-webui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page