入门指南
复制包含安装步骤和该插件完整 Markdown 指南的配置 prompt。
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-updater`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/updater/self-hosted/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
本文档将介绍如何运行你自己的自动更新服务器。
如果你觉得这些内容有帮助,请考虑支持我的工作,成为 Github 赞助者.
我赌了一把,把在这里构建的所有 code 都开源,而不是把它设为付费内容。我相信,通过开放而非对抗和隐藏,我们可以让世界变得更好。
此外,我想专注于 Capgo 工具链,并把它做成一项开放透明的业务。
但为了实现这一点,需要我们每个人(包括你)都出一份力 🥹。
如果 Capgo 不适合你,那就自己承担成本, 支持一位自力更生的开发者 按你的方式。
功能对齐
章节标题:“功能对等”如果你选择自建服务器,将失去 5 分钟快速配置流程。
你需要自行实现所有这些功能。
| 功能 | Capgo | 自托管 |
|---|---|---|
| 更新 | ✅ | 🚧 |
| 自动回滚 | ✅ | 🚧 |
| 失败邮件提醒 | ✅ | 🚧 |
| 通道 | ✅ | 🚧 |
| 渠道覆盖 | ✅ | 🚧 |
| 设备覆盖 | ✅ | 🚧 |
| 渠道设置 | ✅ | 🚧 |
| 设备设置 | ✅ | 🚧 |
| 自定义 ID | ✅ | 🚧 |
| 自动设置渠道 | ✅ | 🚧 |
| API 渠道 | ✅ | 🚧 |
| 更新统计 | ✅ | 🚧 |
| 下载失败统计 | ✅ | 🚧 |
| App 使用统计 | ✅ | 🚧 |
| 更新加密 | ✅ | 🚧 |
| 增量(manifest)更新 | ✅ | ❌ |
请注意,你不能同时使用 Capgo 云端和你自己的服务器。
在自动和手动之间选择
标题为“选择自动或手动模式”的章节在自动模式下,部分逻辑由原生 code 处理,更新决策在服务器端完成。这种方式更安全,支持细粒度更新、向单个设备或设备组进行部分部署等。
在手动模式下,所有逻辑均由 JS 处理。
安装 Capacitor updater
标题为“安装 Capacitor 更新器”的章节npm install @capgo/capacitor-updaternpx cap sync准备你的 bundle
标题为“准备你的 bundle”的章节要向应用发送更新,你需要先把它打包成 zip。 要确保 zip 没问题,最好使用 Capgo CLI 来打包。
npx @capgo/cli@latest bundle zip你需要自行从你的服务器托管这个 zip 文件。
从“入门指南”继续
章节标题“从入门继续”如果你正在使用 入门指南 要规划迁移和企业运营,请将其与 使用 @capgo/capacitor-updater 用于“使用 @capgo/capacitor-updater”中的原生能力, Capgo 企业版 用于 Capgo Enterprise 中的产品工作流, Ionic Enterprise 插件替代方案 用于 Ionic Enterprise 插件替代方案的产品工作流, Capgo 替代方案 适用于 Capgo Alternatives 的产品工作流,以及 Capgo 咨询 适用于 Capgo Consulting 的产品工作流。