feat(deployment): add Fly.io deployment configuration and docs (#60)

This commit is contained in:
l1shen
2026-07-09 11:19:57 +08:00
committed by GitHub
parent 21ca29081b
commit 128f8926d9
8 changed files with 304 additions and 14 deletions
+18
View File
@@ -0,0 +1,18 @@
.codex/
.git/
.github/
.tmp/
.wrangler/
node_modules/
web/node_modules/
dist/
coverage/
catalog/
data/
src/providers/registry.generated.ts
wrangler.local.jsonc
.DS_Store
.env
.env.*
*.log
*.tsbuildinfo
+14 -3
View File
@@ -24,7 +24,8 @@ Use the [Connector SDK](https://github.com/oomol-lab/connector-sdk) from app cod
HTTP/OpenAPI from custom clients, and the Web Console for administration and debugging.
- Keep credentials, scopes, schemas, policies, and run logs inside an inspectable runtime.
- Run locally, on Cloudflare-compatible infrastructure, or through OOMOL's hosted runtime.
- Run locally, on Fly.io, on Cloudflare-compatible infrastructure, or through OOMOL's hosted
runtime.
- Use the same provider ids, Action ids, schemas, and contracts across open-source and commercial
SaaS deployments.
@@ -37,8 +38,8 @@ HTTP/OpenAPI from custom clients, and the Web Console for administration and deb
source.
- Runtime controls for connection identity, scopes, runtime tokens, action allow/block policies,
temporary file transit, and redacted run logs.
- Deployment options for local Docker or Node.js, Cloudflare Workers with D1/R2/Static Assets, and
OOMOL's hosted runtime.
- Deployment options for local Docker or Node.js, Fly.io with persistent SQLite storage,
Cloudflare Workers with D1/R2/Static Assets, and OOMOL's hosted runtime.
## Where It Fits
@@ -98,6 +99,7 @@ safe account labels, and execution results needed for the run.
| Path | Best for | Includes |
| ---------------------------- | --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Open-source self-host | Developers and teams that want full control | Local Docker or Node runtime, SQLite storage, MCP, HTTP, OpenAPI, and Web Console |
| Fly.io self-host | Teams that want a hosted Docker runtime | Node Docker runtime, SQLite storage on a Fly volume, TLS, health checks, MCP, HTTP, OpenAPI, and Web Console |
| Cloudflare-compatible deploy | Teams that want a lightweight hosted runtime | Workers runtime, D1 state, R2 transit files, and Static Assets for the console |
| [OOMOL](https://oomol.com/) | Teams blocked by OAuth approval or launch deadlines | Hosted auth and runtime infrastructure with the same provider and Action contracts; compatible with the open-source interface for later private or self-hosted deployment |
@@ -173,6 +175,14 @@ files, and Static Assets for the Web Console.
See [docs/cloudflare.md](docs/cloudflare.md) for resource creation, migrations, secrets, local Worker
preview, and remote deployment.
## Fly.io Deployment
OpenConnector can also run on Fly.io with the Node Docker runtime and persistent SQLite storage on a
Fly volume.
See [docs/fly-io.md](docs/fly-io.md) for app creation, volume setup, secrets, deployment, custom
domains, and scaling.
## Want to Use It Directly?
The paths above are for teams integrating connectors into their own products, runtimes, or
@@ -196,6 +206,7 @@ create, and sync across connected tools.
- [Developer tools](docs/sdk-cli.md)
- [Gmail OAuth and SDK tutorial](docs/gmail-oauth-sdk.md)
- [Runtime API and MCP](docs/runtime-api.md)
- [Fly.io deployment](docs/fly-io.md)
- [Cloudflare deployment](docs/cloudflare.md)
- [Configuration](docs/configuration.md)
- [Credentials and OAuth](docs/credentials.md)
+14 -4
View File
@@ -25,8 +25,8 @@ hosts d'agents, HTTP/OpenAPI pour les clients personnalisés, et la Web Console
l'administration et le débogage.
- Gardez credentials, scopes, schemas, policies et run logs dans un runtime inspectable.
- Exécutez-le en local, sur une infrastructure compatible Cloudflare ou via le runtime hébergé
d'OOMOL.
- Exécutez-le en local, sur Fly.io, sur une infrastructure compatible Cloudflare ou via le runtime
hébergé d'OOMOL.
- Utilisez les mêmes provider ids, Action ids, schemas et contracts entre les déploiements open
source et SaaS commercial.
@@ -40,8 +40,8 @@ l'administration et le débogage.
executor source chargé à la demande.
- Des runtime controls pour la production : connection identity, scopes, runtime tokens, action
allow/block policies, transit temporaire de fichiers et journaux d'exécution masqués.
- Un déploiement via Docker ou Node.js en local, Cloudflare Workers / D1 / R2 / Static Assets, ou le
runtime hébergé d'OOMOL.
- Des options de déploiement via Docker ou Node.js en local, Fly.io avec stockage SQLite persistant,
Cloudflare Workers / D1 / R2 / Static Assets, ou le runtime hébergé d'OOMOL.
## Où L'utiliser
@@ -102,6 +102,7 @@ nécessaires à la run.
| Parcours | Idéal pour | Inclus |
| --------------------------------- | ------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Open source self-host | Développeurs et équipes qui veulent un contrôle total | Runtime Docker ou Node local, stockage SQLite, MCP, HTTP, OpenAPI et Web Console |
| Fly.io self-host | Équipes qui veulent un runtime Docker hébergé | Runtime Docker Node, stockage SQLite sur un volume Fly, TLS, health checks, MCP, HTTP, OpenAPI et Web Console |
| Déploiement compatible Cloudflare | Équipes qui veulent un runtime hébergé léger | Workers runtime, état D1, fichiers de transit R2 et Static Assets pour la console |
| [OOMOL](https://oomol.com/) | Équipes bloquées par l'approbation OAuth ou les délais de lancement | Auth hébergée et infrastructure runtime avec les mêmes provider et Action contracts ; compatible avec l'interface open source pour un déploiement privé ou self-hosted ultérieur |
@@ -174,6 +175,14 @@ gère les fichiers de transit et Static Assets sert la Web Console.
Consultez [cloudflare.md](cloudflare.md) pour la création des ressources, les migrations, les
secrets, la preview Worker locale et le déploiement distant.
## Déploiement Fly.io
OpenConnector peut aussi être déployé sur Fly.io avec le runtime Docker Node et un stockage SQLite
persistant sur un volume Fly.
Consultez [fly-io.md](fly-io.md) pour créer l'app Fly, configurer le volume et les secrets,
déployer, définir un domaine personnalisé et ajuster le scaling.
## Vous voulez l'utiliser directement ?
Les parcours ci-dessus s'adressent aux équipes qui intègrent le connector dans leurs produits,
@@ -197,6 +206,7 @@ synchroniser dans les outils connectés en natural language.
- [Outils développeur](sdk-cli.md)
- [Tutoriel Gmail OAuth et SDK (anglais)](gmail-oauth-sdk.md)
- [Runtime API et MCP](runtime-api.md)
- [Déploiement Fly.io](fly-io.md)
- [Déploiement Cloudflare](cloudflare.md)
- [Configuration](configuration.md)
- [Credentials et OAuth](credentials.md)
+13 -2
View File
@@ -24,7 +24,7 @@ Agent の relay には [oo CLI](https://github.com/oomol-lab/oo-cli)、Agent hos
MCP、custom client には HTTP/OpenAPI、管理とデバッグにはローカル Web Console を使います。
- credential、scope、schema、policy、実行ログを検査可能な runtime 内に保持します。
- ローカル、Cloudflare 互換 infrastructure、または OOMOL hosted runtime で実行できます。
- ローカル、Fly.io、Cloudflare 互換 infrastructure、または OOMOL hosted runtime で実行できます。
- オープンソース版と commercial SaaS 版で同じ provider id、Action id、schema、contract を使います。
## 提供するもの
@@ -35,7 +35,8 @@ MCP、custom client には HTTP/OpenAPI、管理とデバッグにはローカ
- 検査、拡張できる Action contract:request/response schema、required scope、遅延読み込みされる executor source。
- 本番利用向けの runtime control:connection identity、scope、runtime token、action allow/block
policy、一時ファイル転送、redacted run log。
- ローカル Docker / Node.js、Cloudflare Workers / D1 / R2 / Static Assets、OOMOL hosted runtime へのデプロイ。
- ローカル Docker / Node.js、Fly.io の永続 SQLite、Cloudflare Workers / D1 / R2 / Static Assets、OOMOL hosted
runtime へのデプロイ。
## 適している場面
@@ -90,6 +91,7 @@ App と Agent は Action を発見し、schema と scope を確認し、connecti
| パス | 適している対象 | 含まれるもの |
| --------------------------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| オープンソース self-host | 完全な制御を求める開発者とチーム | ローカル Docker または Node runtime、SQLite storage、MCP、HTTP、OpenAPI、Web Console |
| Fly.io self-host | hosted Docker runtime を求めるチーム | Node Docker runtime、Fly volume 上の SQLite storage、TLS、health check、MCP、HTTP、OpenAPI、Web Console |
| Cloudflare 互換デプロイ | 軽量な hosted runtime を求めるチーム | Workers runtime、D1 state、R2 transit file、console 用 Static Assets |
| [OOMOL](https://oomol.com/) | OAuth 承認やローンチ期限に制約があるチーム | Hosted auth と runtime infrastructure。同じ provider と Action contract を使い、後で private または self-hosted deployment へ移行できるオープンソース互換 interface |
@@ -160,6 +162,14 @@ OpenConnector は Cloudflare にデプロイできます。Workers が runtime
resource 作成、migration、secret、ローカル Worker preview、remote deployment については
[cloudflare.md](cloudflare.md) を参照してください。
## Fly.io デプロイ
OpenConnector は Fly.io にもデプロイできます。Node Docker runtime を使い、SQLite data を Fly
volume に永続化します。
Fly app 作成、volume、secret、deployment、custom domain、scaling については
[fly-io.md](fly-io.md) を参照してください。
## 先に接続せず直接使う場合
上記の path は、connector を自分たちの product、runtime、または enterprise infrastructure に統合する
@@ -181,6 +191,7 @@ account を接続すれば、自然言語で connected tool を検索、整理
- [開発者向けツール](sdk-cli.md)
- [Gmail OAuth と SDK チュートリアル(英語)](gmail-oauth-sdk.md)
- [Runtime API と MCP](runtime-api.md)
- [Fly.io デプロイ](fly-io.md)
- [Cloudflare デプロイ](cloudflare.md)
- [設定](configuration.md)
- [Credential と OAuth](credentials.md)
+14 -3
View File
@@ -24,7 +24,8 @@ local-agent relay — [oo CLI](https://github.com/oomol-lab/oo-cli), для agen
custom clients — HTTP/OpenAPI, а для администрирования и отладки — локальную Web Console.
- Держите credentials, scopes, schemas, policies и run logs внутри проверяемого runtime.
- Запускайте локально, в Cloudflare-совместимой инфраструктуре или через hosted runtime OOMOL.
- Запускайте локально, на Fly.io, в Cloudflare-совместимой инфраструктуре или через hosted runtime
OOMOL.
- Используйте одни и те же provider ids, Action ids, schemas и contracts в open-source и
commercial SaaS deployments.
@@ -38,8 +39,8 @@ custom clients — HTTP/OpenAPI, а для администрирования и
lazy-loaded executor source.
- Runtime controls для production: connection identity, scopes, runtime tokens, action allow/block
policies, временный транзит файлов и редактированные журналы запусков.
- Развертывание через локальный Docker или Node.js, Cloudflare Workers / D1 / R2 / Static Assets и
hosted runtime OOMOL.
- Варианты развертывания через локальный Docker или Node.js, Fly.io с persistent SQLite storage,
Cloudflare Workers / D1 / R2 / Static Assets и hosted runtime OOMOL.
## Где Это Уместно
@@ -99,6 +100,7 @@ flowchart LR
| Путь | Лучше всего подходит для | Включает |
| ------------------------------------ | ------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Open-source self-host | Разработчиков и команд, которым нужен полный контроль | Локальный Docker или Node runtime, SQLite storage, MCP, HTTP, OpenAPI и Web Console |
| Fly.io self-host | Команд, которым нужен hosted Docker runtime | Node Docker runtime, SQLite storage на Fly volume, TLS, health checks, MCP, HTTP, OpenAPI и Web Console |
| Cloudflare-совместимое развертывание | Команд, которым нужен легкий hosted runtime | Workers runtime, состояние D1, транзитные файлы R2 и Static Assets для console |
| [OOMOL](https://oomol.com/) | Команд, ограниченных OAuth approval или сроками запуска | Hosted auth и runtime infrastructure с теми же provider и Action contracts; совместимость с open-source interface для последующего private или self-hosted deployment |
@@ -170,6 +172,14 @@ OpenConnector можно развернуть на Cloudflare: Workers запу
Создание ресурсов, migrations, secrets, локальная Worker preview и remote deployment описаны в
[cloudflare.md](cloudflare.md).
## Развертывание Fly.io
OpenConnector также можно развернуть на Fly.io с Node Docker runtime и persistent SQLite storage на
Fly volume.
Создание Fly app, настройка volume, secrets, deployment, custom domain и scaling описаны в
[fly-io.md](fly-io.md).
## Хотите Использовать Напрямую?
Пути выше предназначены для команд, которые интегрируют connector в свои продукты, runtimes или
@@ -193,6 +203,7 @@ CLI, MCP либо HTTP API.
- [Инструменты разработчика](sdk-cli.md)
- [Руководство Gmail OAuth и SDK (на английском)](gmail-oauth-sdk.md)
- [Runtime API и MCP](runtime-api.md)
- [Развертывание Fly.io](fly-io.md)
- [Развертывание Cloudflare](cloudflare.md)
- [Configuration](configuration.md)
- [Credentials и OAuth](credentials.md)
+11 -2
View File
@@ -24,7 +24,7 @@ Agent 和应用。
HTTP/OpenAPI;管理和调试使用本地 Web 控制台。
- 把 credential、scope、schema、policy 和运行日志保留在可检查的 runtime 里。
- 支持本地运行、Cloudflare 兼容基础设施部署,也可以使用 OOMOL 托管 runtime。
- 支持本地运行、Fly.io 部署、Cloudflare 兼容基础设施部署,也可以使用 OOMOL 托管 runtime。
- 开源版和商业 SaaS 版共享同一套 provider id、Action id、schema 和契约。
## 提供什么
@@ -34,7 +34,8 @@ HTTP/OpenAPI;管理和调试使用本地 Web 控制台。
- 支持 API key、OAuth2、自定义凭据,以及无需鉴权的 provider。
- 可以审查和扩展的 Action 契约:请求/响应 schema、required scope 和按需加载的 executor 源码。
- 面向生产的 runtime 控制:connection identity、scope、runtime token、action allow/block policy、临时文件中转和脱敏运行日志。
- 部署方式覆盖本地 Docker 或 Node.js、Cloudflare Workers/D1/R2/Static Assets,以及 OOMOL 托管 runtime。
- 部署方式覆盖本地 Docker 或 Node.js、Fly.io 持久化 SQLite、Cloudflare Workers/D1/R2/Static
Assets,以及 OOMOL 托管 runtime。
## 适合什么场景
@@ -87,6 +88,7 @@ secret 保留在运行时边界内;Agent 拿到本次运行所需的 metadata
| 路径 | 适合谁 | 提供什么 |
| --------------------------- | ------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| 开源自托管 | 希望完全掌控基础设施的开发者和团队 | 本地 Docker 或 Node runtime、SQLite 存储、MCP、HTTP、OpenAPI 和 Web 控制台 |
| Fly.io 自托管 | 希望使用托管 Docker runtime 的团队 | Node Docker runtime、Fly volume 上的 SQLite 存储、TLS、健康检查、MCP、HTTP、OpenAPI 和 Web 控制台 |
| Cloudflare 兼容部署 | 希望快速获得轻量托管运行时的团队 | Workers runtime、D1 状态存储、R2 文件中转和控制台 Static Assets |
| [OOMOL](https://oomol.com/) | 被 OAuth 申请周期或上线时间卡住的团队 | 托管鉴权和运行时基础设施,使用同一套 provider 和 Action 契约;接口与开源版兼容,后续可迁移到私有化或自托管部署 |
@@ -156,6 +158,12 @@ Assets 承载 Web 控制台。
Cloudflare 资源创建、migration、secret、本地 Worker preview 和远程部署步骤见
[cloudflare.md](cloudflare.md)。
## Fly.io 部署
OpenConnector 也可以部署到 Fly.io:使用 Node Docker runtime,并把 SQLite 数据持久化到 Fly volume。
Fly app 创建、volume、secret、部署、自定义域名和扩缩容步骤见 [fly-io.md](fly-io.md)。
## 不想先接入?可以直接使用 Wanta
上面的路径更适合把 connector 接入自己的产品、runtime 或企业基础设施。如果你只是想先体验连接各种
@@ -177,6 +185,7 @@ HTTP API。
- [开发者工具](sdk-cli.md)
- [Gmail OAuth 和 SDK 接入教程](gmail-oauth-sdk.zh-CN.md)
- [Runtime API 和 MCP](runtime-api.md)
- [Fly.io 部署](fly-io.md)
- [Cloudflare 部署](cloudflare.md)
- [配置项](configuration.md)
- [凭据和 OAuth](credentials.md)
+185
View File
@@ -0,0 +1,185 @@
# Fly.io Deployment
OpenConnector can run on Fly.io as the Node Docker runtime with persistent SQLite storage. Fly
provides TLS termination, remote Docker builds, health checks, rolling deploys, and optional custom
domains.
This deployment uses the repository's `docker/Dockerfile`, the Fly app config in `fly.toml`, and a
Fly volume mounted at `/app/data`.
## Prerequisites
- A Fly.io account.
- `flyctl` installed and authenticated with `fly auth login`.
- Docker available locally, or Fly remote builders enabled.
- A public origin for OAuth callback URLs, such as `https://api.example.com` or the default
`https://<app>.fly.dev` hostname.
## Create The App
Create a Fly app without deploying yet:
```bash
fly apps create my-open-connector
```
Fly app names are globally unique. If you choose a different name, update the `app` field in
`fly.toml` before deploying:
```toml
app = "my-open-connector"
```
## Create Persistent Storage
The Docker image stores runtime data in `/app/data`. Create a Fly volume with the same source name
as `fly.toml`:
```bash
fly volumes create open_connector_data \
--region iad \
--size 1 \
--app my-open-connector
```
Increase `--size` if you expect large run logs, many stored credentials, or heavy temporary file
transit usage.
## Set Secrets
Store production secrets with Fly instead of committing them to `fly.toml`:
```bash
OOMOL_CONNECT_ENCRYPTION_KEY=$(openssl rand -base64 32)
OOMOL_CONNECT_ADMIN_TOKEN=$(openssl rand -base64 32)
OOMOL_CONNECT_RUNTIME_TOKEN=$(openssl rand -base64 32)
fly secrets set \
OOMOL_CONNECT_ORIGIN="https://my-open-connector.fly.dev" \
OOMOL_CONNECT_ENCRYPTION_KEY="$OOMOL_CONNECT_ENCRYPTION_KEY" \
OOMOL_CONNECT_ADMIN_TOKEN="$OOMOL_CONNECT_ADMIN_TOKEN" \
OOMOL_CONNECT_RUNTIME_TOKEN="$OOMOL_CONNECT_RUNTIME_TOKEN" \
--app my-open-connector
```
Keep `OOMOL_CONNECT_ENCRYPTION_KEY` in a password manager or another external secrets vault. If the
key is lost, encrypted credentials and OAuth client secrets in the SQLite database cannot be
recovered.
Optional runtime policy can also be set as secrets:
```bash
fly secrets set \
OOMOL_CONNECT_ALLOWED_ACTIONS="github.*,hackernews.*" \
OOMOL_CONNECT_ALLOWED_PROXIES="github" \
--app my-open-connector
```
See [configuration.md](configuration.md) for the full environment variable reference.
## Deploy
Deploy from the repository root:
```bash
fly deploy --config fly.toml --remote-only
```
The Fly config uses:
- `docker/Dockerfile` for the image build.
- `internal_port = 3000` for the Node runtime.
- `/health` for HTTP health checks.
- `/app/data` as the mounted persistent data directory.
## Verify The Runtime
Check the health endpoint:
```bash
curl https://my-open-connector.fly.dev/health
```
The expected response is:
```json
{ "ok": true }
```
View logs when diagnosing deployment or startup issues:
```bash
fly logs --app my-open-connector
```
## Configure OAuth Redirects
For OAuth2 providers, set `OOMOL_CONNECT_ORIGIN` to the public origin users will access. The runtime
builds provider callback URLs from that origin and `/oauth/callback`.
For example, with:
```bash
OOMOL_CONNECT_ORIGIN="https://api.example.com"
```
the OAuth callback URL is:
```text
https://api.example.com/oauth/callback
```
Add that exact callback URL to each provider OAuth app.
## Custom Domain
Register the domain with Fly:
```bash
fly certs add api.example.com --app my-open-connector
```
Fly prints the DNS records to create. After DNS is ready, update the public origin:
```bash
fly secrets set \
OOMOL_CONNECT_ORIGIN="https://api.example.com" \
--app my-open-connector
```
Check certificate status:
```bash
fly certs check api.example.com --app my-open-connector
```
## Updating
Deploy new versions from the repository root:
```bash
git pull
fly deploy --config fly.toml --remote-only
```
The mounted volume keeps `connect.sqlite` and transit files across deployments.
## Scaling
`fly.toml` defaults to suspending the single machine when idle:
```toml
[http_service]
min_machines_running = 0
```
For production traffic that should avoid cold starts, keep one machine running:
```toml
[http_service]
min_machines_running = 1
```
Keep the machine count at one for the default SQLite deployment. Fly volumes are attached to
individual machines, so horizontal scaling requires a separate shared storage design. For this
repository's default Fly setup, prefer increasing the VM size before adding more machines.
+35
View File
@@ -0,0 +1,35 @@
# Change this to the globally unique Fly app name you create with `fly apps create`.
app = "my-open-connector"
primary_region = "iad"
[build]
dockerfile = "docker/Dockerfile"
[env]
NODE_ENV = "production"
PORT = "3000"
HOST = "0.0.0.0"
OOMOL_CONNECT_DATA_DIR = "/app/data"
[mounts]
source = "open_connector_data"
destination = "/app/data"
[http_service]
internal_port = 3000
force_https = true
auto_stop_machines = "suspend"
auto_start_machines = true
min_machines_running = 0
[[http_service.checks]]
interval = "30s"
timeout = "5s"
grace_period = "10s"
method = "GET"
path = "/health"
protocol = "http"
[[vm]]
size = "shared-cpu-1x"
memory = "512mb"