@intlayer/docs 9.0.0-canary.10 → 9.0.0-canary.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/cjs/generated/docs.entry.cjs +20 -0
  2. package/dist/cjs/generated/docs.entry.cjs.map +1 -1
  3. package/dist/esm/generated/docs.entry.mjs +20 -0
  4. package/dist/esm/generated/docs.entry.mjs.map +1 -1
  5. package/dist/types/generated/docs.entry.d.ts +1 -0
  6. package/dist/types/generated/docs.entry.d.ts.map +1 -1
  7. package/docs/ar/intlayer_CMS.md +16 -1
  8. package/docs/ar/releases/v9.md +58 -1
  9. package/docs/ar/self_hosting.md +349 -0
  10. package/docs/bn/intlayer_CMS.md +570 -0
  11. package/docs/bn/releases/v9.md +358 -0
  12. package/docs/cs/releases/v9.md +358 -0
  13. package/docs/de/intlayer_CMS.md +117 -1
  14. package/docs/de/releases/v9.md +61 -1
  15. package/docs/de/self_hosting.md +349 -0
  16. package/docs/en/intlayer_CMS.md +171 -1
  17. package/docs/en/releases/v9.md +45 -2
  18. package/docs/en/self_hosting.md +349 -0
  19. package/docs/en-GB/intlayer_CMS.md +16 -1
  20. package/docs/en-GB/releases/v9.md +47 -2
  21. package/docs/en-GB/self_hosting.md +349 -0
  22. package/docs/es/intlayer_CMS.md +117 -1
  23. package/docs/es/releases/v9.md +61 -1
  24. package/docs/es/self_hosting.md +349 -0
  25. package/docs/fr/intlayer_CMS.md +117 -1
  26. package/docs/fr/releases/v9.md +61 -1
  27. package/docs/fr/self_hosting.md +349 -0
  28. package/docs/hi/intlayer_CMS.md +16 -1
  29. package/docs/hi/releases/v9.md +59 -1
  30. package/docs/hi/self_hosting.md +349 -0
  31. package/docs/id/releases/v9.md +31 -1
  32. package/docs/id/self_hosting.md +349 -0
  33. package/docs/it/intlayer_CMS.md +117 -1
  34. package/docs/it/releases/v9.md +61 -1
  35. package/docs/it/self_hosting.md +349 -0
  36. package/docs/ja/intlayer_CMS.md +191 -10
  37. package/docs/ja/releases/v9.md +31 -1
  38. package/docs/ja/self_hosting.md +349 -0
  39. package/docs/ko/intlayer_CMS.md +189 -6
  40. package/docs/ko/releases/v9.md +30 -1
  41. package/docs/ko/self_hosting.md +349 -0
  42. package/docs/nl/releases/v9.md +358 -0
  43. package/docs/pl/intlayer_CMS.md +16 -1
  44. package/docs/pl/releases/v9.md +58 -1
  45. package/docs/pl/self_hosting.md +349 -0
  46. package/docs/pt/intlayer_CMS.md +117 -1
  47. package/docs/pt/releases/v9.md +61 -1
  48. package/docs/pt/self_hosting.md +349 -0
  49. package/docs/ru/intlayer_CMS.md +196 -15
  50. package/docs/ru/releases/v9.md +59 -1
  51. package/docs/ru/self_hosting.md +349 -0
  52. package/docs/tr/intlayer_CMS.md +16 -1
  53. package/docs/tr/releases/v9.md +46 -1
  54. package/docs/tr/self_hosting.md +349 -0
  55. package/docs/uk/intlayer_CMS.md +16 -1
  56. package/docs/uk/releases/v9.md +58 -1
  57. package/docs/uk/self_hosting.md +349 -0
  58. package/docs/vi/releases/v9.md +31 -1
  59. package/docs/vi/self_hosting.md +349 -0
  60. package/docs/zh/releases/v9.md +31 -1
  61. package/docs/zh/self_hosting.md +349 -0
  62. package/package.json +6 -6
  63. package/src/generated/docs.entry.ts +20 -0
@@ -0,0 +1,349 @@
1
+ ---
2
+ createdAt: 2026-06-30
3
+ updatedAt: 2026-06-30
4
+ title: 自托管 Intlayer
5
+ description: 通过一条命令在您自己的基础设施上运行完整的 Intlayer 实例。无需 Intlayer Cloud 账户。
6
+ keywords:
7
+ - 自托管
8
+ - Docker
9
+ - Docker Compose
10
+ - Intlayer
11
+ - CMS
12
+ - 安装
13
+ - 基础设施
14
+ slugs:
15
+ - doc
16
+ - self-hosting
17
+ author: aymericzip
18
+ ---
19
+
20
+ # 自托管 Intlayer
21
+
22
+ Intlayer 可以完全在您自己的基础设施上运行——无需 Intlayer Cloud 账户。只需一条命令即可启动一个生产就绪的堆栈:
23
+
24
+ ```sh
25
+ curl -fsSL https://intlayer.org/install.sh | sh
26
+ ```
27
+
28
+ 安装程序会下载 `docker-compose.yml` 和 `.env` 文件,自动生成所需的密钥,并使用 `docker compose up -d` 启动所有容器。
29
+
30
+ ## 目录
31
+
32
+ <TOC/>
33
+
34
+ ---
35
+
36
+ ## 架构
37
+
38
+ ```
39
+ ┌─────────────────────────────┐
40
+ browser ──────▶ │ app (TanStack Start) :3000│ ──┐
41
+ └─────────────────────────────┘ │ VITE_BACKEND_URL
42
+ ┌─────────────────────────────┐ │
43
+ │ backend (Fastify/Bun) :3100│ ◀─┘
44
+ └──────────────┬──────────────┘
45
+ ┌──────────┬─────────┼──────────┬───────────┐
46
+ ▼ ▼ ▼ ▼ ▼
47
+ mongo:27017 redis:6379 minio:9000 mailpit:1025 Chromium
48
+ (1-node RS) (S3 API) (SMTP) (in-image)
49
+ minio:9001 mailpit:8025
50
+ (console) (web UI)
51
+ ```
52
+
53
+ Chromium(用于 Puppeteer 屏幕截图生成)捆绑在后端镜像中——无需单独的容器。
54
+
55
+ ---
56
+
57
+ ## 先决条件
58
+
59
+ - **Docker** ≥ 24 和 **Docker Compose** ≥ v2。如果其中任何一个缺失,安装程序将打印安装链接并退出。
60
+ - 主机上端口 `3000`、`3100`、`8025`、`9000` 和 `9001` 可用。
61
+ - Linux 或 macOS 主机(或 Windows 上的 WSL2)。
62
+
63
+ ---
64
+
65
+ ## 快速开始
66
+
67
+ ```sh
68
+ curl -fsSL https://intlayer.org/install.sh | sh
69
+ ```
70
+
71
+ 安装程序执行以下操作:
72
+
73
+ 1. 检查 `docker` 和 `docker compose` 是否存在。
74
+ 2. 将 `docker-compose.yml` 和 `.env.example` 下载到 `./intlayer/` 目录中。
75
+ 3. 如果不存在 `.env` 文件,则复制示例文件并使用 `openssl rand` 为 `BETTER_AUTH_SECRET`、`S3_ACCESS_KEY_ID` 和 `S3_SECRET_ACCESS_KEY` 生成随机密钥。
76
+ 4. 运行 `docker compose pull` + `docker compose up -d`。
77
+ 5. 打印 URL:仪表盘 `:3000`、API `:3100`、电子邮件 UI `:8025`、MinIO 控制台 `:9001`。
78
+
79
+ 堆栈启动后,打开 **http://localhost:3000** 并创建您的第一个账户。
80
+
81
+ ---
82
+
83
+ ## 服务
84
+
85
+ | 服务 | 镜像 | 主机端口 | 用途 |
86
+ | ----------- | --------------------------------- | ------------------------------ | ---------------------------------- |
87
+ | **app** | 从 `apps/app/Dockerfile` 构建 | `3000` | TanStack Start 仪表盘 (CMS UI) |
88
+ | **backend** | 从 `apps/backend/Dockerfile` 构建 | `3100` | Fastify REST API (`/health` 端点) |
89
+ | **mongo** | `mongo:7` | 内部 | 单节点副本集 (`rs0`) |
90
+ | **redis** | `redis:7-alpine` | 内部 | 任务队列 (BullMQ) 和缓存 (ioredis) |
91
+ | **minio** | `minio/minio` | `9000` (S3), `9001` (控制台) | 用于头像和截图的 S3 兼容对象存储 |
92
+ | **mailpit** | `axllent/mailpit` | `1025` (SMTP), `8025` (Web UI) | 本地事务性电子邮件接收器 |
93
+
94
+ 默认情况下,内部端口(mongo、redis)不会暴露给主机。
95
+
96
+ > MinIO 端口 `9000` 必须可从浏览器访问,因为上传的资产(头像、截图)直接从 `S3_PUBLIC_URL=http://localhost:9000/intlayer` 加载。
97
+
98
+ ---
99
+
100
+ ## 环境变量
101
+
102
+ 安装程序会生成一个即用型 `.env` 文件。下表描述了每个变量。
103
+
104
+ ### 必需(自动生成或提示)
105
+
106
+ | 变量 | 示例 | 描述 |
107
+ | ---------------------- | ----------------------------------------------- | -------------------------------- |
108
+ | `NODE_ENV` | `production` | 运行时环境 |
109
+ | `PORT` | `3100` | 后端监听端口 |
110
+ | `BACKEND_URL` | `http://localhost:3100` | 后端 API 的公共 URL |
111
+ | `APP_URL` | `http://localhost:3000` | 仪表盘的公共 URL |
112
+ | `DOMAIN` | `localhost` | Cookie 域 |
113
+ | `MONGODB_URI` | `mongodb://mongo:27017/intlayer?replicaSet=rs0` | 完整的 MongoDB 连接 URI |
114
+ | `REDIS_URL` | `redis://redis:6379` | Redis 连接 URL |
115
+ | `BETTER_AUTH_SECRET` | _(已生成)_ | 用于会话签名的 32 字节密钥 |
116
+ | `MAIL_PROVIDER` | `smtp` | 邮件传输方式:`smtp` 或 `resend` |
117
+ | `MAIL_SMTP_HOST` | `mailpit` | SMTP 主机名 (Mailpit 容器名称) |
118
+ | `MAIL_SMTP_PORT` | `1025` | SMTP 端口 |
119
+ | `MAIL_FROM` | `Intlayer <no-reply@localhost>` | 发件人地址 |
120
+ | `S3_ENDPOINT` | `http://minio:9000` | S3 兼容端点 |
121
+ | `S3_PUBLIC_URL` | `http://localhost:9000/intlayer` | 用于浏览器资产加载的公共 URL |
122
+ | `S3_BUCKET_NAME` | `intlayer` | 存储桶名称 |
123
+ | `S3_ACCESS_KEY_ID` | _(已生成)_ | MinIO 访问密钥 |
124
+ | `S3_SECRET_ACCESS_KEY` | _(已生成)_ | MinIO 秘密密钥 |
125
+ | `VITE_BACKEND_URL` | `http://localhost:3100` | 构建时嵌入到仪表盘中的后端 URL |
126
+ | `VITE_DOMAIN` | `localhost` | 构建时嵌入到仪表盘中的域 |
127
+
128
+ ### 可选(缺少时功能会优雅降级)
129
+
130
+ | 变量 | 功能 |
131
+ | -------------------------------------------------------- | ------------------------------------------------------ |
132
+ | `OPENAI_API_KEY` | AI 辅助翻译和内容审计 |
133
+ | `STRIPE_SECRET_KEY`, `STRIPE_WEBHOOK_SECRET`, `STRIPE_*` | 账单和订阅管理 |
134
+ | `RESEND_API_KEY` | 通过 Resend 发送事务性电子邮件(设置后会覆盖 Mailpit) |
135
+ | `GITHUB_CLIENT_ID`, `GITHUB_CLIENT_SECRET` | GitHub OAuth 登录 |
136
+ | `GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_SECRET` | Google OAuth 登录 |
137
+ | `GITLAB_CLIENT_ID`, `GITLAB_CLIENT_SECRET` | GitLab OAuth 登录 |
138
+ | `MICROSOFT_CLIENT_ID`, `MICROSOFT_CLIENT_SECRET` | Microsoft OAuth 登录 |
139
+ | `LINKEDIN_CLIENT_ID`, `LINKEDIN_CLIENT_SECRET` | LinkedIn OAuth 登录 |
140
+ | `ATLASSIAN_CLIENT_ID`, `ATLASSIAN_CLIENT_SECRET` | Atlassian OAuth 登录 |
141
+
142
+ ---
143
+
144
+ ## 连接您的 Intlayer 项目
145
+
146
+ 堆栈运行后,将您的项目指向自托管的后端和仪表盘,而不是 `intlayer.org`。
147
+
148
+ ### 项目配置
149
+
150
+ ```typescript fileName="intlayer.config.ts" codeFormat={["typescript", "esm", "commonjs"]}
151
+ import type { IntlayerConfig } from "intlayer";
152
+
153
+ const config: IntlayerConfig = {
154
+ editor: {
155
+ clientId: process.env.INTLAYER_CLIENT_ID,
156
+ clientSecret: process.env.INTLAYER_CLIENT_SECRET,
157
+
158
+ /**
159
+ * 自托管 CMS 仪表盘的 URL。
160
+ * 默认值: https://app.intlayer.org
161
+ */
162
+ cmsURL: process.env.INTLAYER_CMS_URL, // e.g. http://localhost:3000
163
+
164
+ /**
165
+ * 自托管后端 API 的 URL。
166
+ * 默认值: https://back.intlayer.org
167
+ */
168
+ backendURL: process.env.INTLAYER_BACKEND_URL, // e.g. http://localhost:3100
169
+ },
170
+ };
171
+
172
+ export default config;
173
+ ```
174
+
175
+ 在您项目的 `.env` 中设置环境变量:
176
+
177
+ ```sh
178
+ INTLAYER_CMS_URL=http://localhost:3000
179
+ INTLAYER_BACKEND_URL=http://localhost:3100
180
+ INTLAYER_CLIENT_ID=<your-client-id>
181
+ INTLAYER_CLIENT_SECRET=<your-client-secret>
182
+ ```
183
+
184
+ 在您的自托管仪表盘中,通过 `http://localhost:3000/projects` 下的 **项目 → 访问密钥** 创建访问凭据。
185
+
186
+ ### `@intlayer/api` SDK
187
+
188
+ 以编程方式使用 `@intlayer/api` SDK 时,明确传递 `backendURL`:
189
+
190
+ ```typescript fileName="cms.ts" codeFormat="typescript"
191
+ import { createIntlayerCMS } from "@intlayer/api";
192
+ import { dictionaryEndpoint } from "@intlayer/api/dictionary";
193
+
194
+ const cms = createIntlayerCMS({
195
+ editor: {
196
+ clientId: process.env.INTLAYER_CLIENT_ID,
197
+ clientSecret: process.env.INTLAYER_CLIENT_SECRET,
198
+ backendURL: process.env.INTLAYER_BACKEND_URL, // http://localhost:3100
199
+ },
200
+ });
201
+
202
+ const { data: dictionaries } = await dictionaryEndpoint(cms).getDictionaries();
203
+ ```
204
+
205
+ ---
206
+
207
+ ## 升级
208
+
209
+ 在现有部署上重新运行安装程序会执行滚动升级:
210
+
211
+ ```sh
212
+ curl -fsSL https://intlayer.org/install.sh | sh
213
+ ```
214
+
215
+ 这会拉取最新镜像并使用 `docker compose pull && docker compose up -d` 重启容器。现有卷(`mongo-data`、`redis-data`、`minio-data`)会保留——不会丢失数据。
216
+
217
+ 要在 `./intlayer/` 目录中手动升级:
218
+
219
+ ```sh
220
+ docker compose pull
221
+ docker compose up -d
222
+ ```
223
+
224
+ ---
225
+
226
+ ## 备份与恢复
227
+
228
+ 所有持久化数据都存储在三个命名 Docker 卷中。
229
+
230
+ ### 备份
231
+
232
+ ```sh
233
+ docker run --rm \
234
+ -v intlayer_mongo-data:/data \
235
+ -v "$(pwd)":/backup \
236
+ busybox tar czf /backup/mongo-data.tar.gz /data
237
+
238
+ docker run --rm \
239
+ -v intlayer_redis-data:/data \
240
+ -v "$(pwd)":/backup \
241
+ busybox tar czf /backup/redis-data.tar.gz /data
242
+
243
+ docker run --rm \
244
+ -v intlayer_minio-data:/data \
245
+ -v "$(pwd)":/backup \
246
+ busybox tar czf /backup/minio-data.tar.gz /data
247
+ ```
248
+
249
+ ### 恢复
250
+
251
+ ```sh
252
+ docker run --rm \
253
+ -v intlayer_mongo-data:/data \
254
+ -v "$(pwd)":/backup \
255
+ busybox tar xzf /backup/mongo-data.tar.gz -C /
256
+
257
+ # 对 redis-data 和 minio-data 重复此操作
258
+ ```
259
+
260
+ ---
261
+
262
+ ## 使用反向代理 (Nginx / Caddy)
263
+
264
+ 对于生产部署,请在应用和后端容器前放置一个反向代理,而不是直接暴露它们。
265
+
266
+ ### Nginx 示例
267
+
268
+ ```nginx
269
+ server {
270
+ listen 80;
271
+ server_name cms.example.com;
272
+
273
+ location / {
274
+ proxy_pass http://localhost:3000;
275
+ proxy_set_header Host $host;
276
+ proxy_set_header X-Real-IP $remote_addr;
277
+ }
278
+ }
279
+
280
+ server {
281
+ listen 80;
282
+ server_name api.example.com;
283
+
284
+ location / {
285
+ proxy_pass http://localhost:3100;
286
+ proxy_set_header Host $host;
287
+ proxy_set_header X-Real-IP $remote_addr;
288
+ }
289
+ }
290
+ ```
291
+
292
+ 更新以下 `.env` 变量以匹配您的公共域名:
293
+
294
+ ```sh
295
+ BACKEND_URL=https://api.example.com
296
+ APP_URL=https://cms.example.com
297
+ DOMAIN=example.com
298
+ VITE_BACKEND_URL=https://api.example.com
299
+ VITE_DOMAIN=example.com
300
+ ```
301
+
302
+ > `VITE_*` 变量在构建时被嵌入到仪表盘镜像中。如果在镜像构建后更改它们,您需要重建 `app` 镜像 (`docker compose build app`) 或使用运行时配置注入。
303
+
304
+ ---
305
+
306
+ ## 故障排除
307
+
308
+ ### 后端首次启动时崩溃循环
309
+
310
+ MongoDB 和 Redis 必须在后端启动前保持健康。compose 文件使用带有 `condition: service_healthy` 的 `depends_on`。如果您看到后端重复重启,请检查 `mongo` 和 `redis` 的健康检查是否通过:
311
+
312
+ ```sh
313
+ docker compose ps
314
+ docker compose logs mongo
315
+ docker compose logs redis
316
+ ```
317
+
318
+ ### 仪表盘无法连接到 API
319
+
320
+ 验证 `VITE_BACKEND_URL` 是否与后端可以从**浏览器**(而非 Docker 网络)访问的 URL 匹配。如果您更改了后端端口或添加了反向代理,请重建仪表盘镜像:
321
+
322
+ ```sh
323
+ docker compose build app
324
+ docker compose up -d app
325
+ ```
326
+
327
+ ### 电子邮件未发送
328
+
329
+ 默认情况下,所有出站电子邮件都会被 Mailpit 捕获。打开 `http://localhost:8025` 查看已发送的消息。要发送真实电子邮件,请在 `.env` 中设置 `MAIL_PROVIDER=resend` 和 `RESEND_API_KEY=<your-key>`,然后重启后端:
330
+
331
+ ```sh
332
+ docker compose restart backend
333
+ ```
334
+
335
+ ### MinIO 存储桶缺失
336
+
337
+ 如果 `minio-init` 一次性服务未运行(或在 MinIO 准备好之前运行),请手动创建存储桶:
338
+
339
+ ```sh
340
+ docker compose run --rm minio-init
341
+ ```
342
+
343
+ ---
344
+
345
+ ## 有用链接
346
+
347
+ - [Intlayer CMS 文档](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/intlayer_CMS.md)
348
+ - [配置参考](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/configuration.md)
349
+ - [CMS SDK — `@intlayer/api`](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/intlayer_CMS.md#programmatic-access-with-the-intlayerapi-sdk)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/docs",
3
- "version": "9.0.0-canary.10",
3
+ "version": "9.0.0-canary.11",
4
4
  "private": false,
5
5
  "description": "Intlayer documentation",
6
6
  "keywords": [
@@ -73,13 +73,13 @@
73
73
  "watch": "webpack --config ./webpack.config.ts --watch"
74
74
  },
75
75
  "dependencies": {
76
- "@intlayer/config": "9.0.0-canary.10",
77
- "@intlayer/core": "9.0.0-canary.10",
78
- "@intlayer/types": "9.0.0-canary.10"
76
+ "@intlayer/config": "9.0.0-canary.11",
77
+ "@intlayer/core": "9.0.0-canary.11",
78
+ "@intlayer/types": "9.0.0-canary.11"
79
79
  },
80
80
  "devDependencies": {
81
- "@intlayer/api": "9.0.0-canary.10",
82
- "@intlayer/cli": "9.0.0-canary.10",
81
+ "@intlayer/api": "9.0.0-canary.11",
82
+ "@intlayer/cli": "9.0.0-canary.11",
83
83
  "@types/node": "25.9.4",
84
84
  "@utils/ts-config": "1.0.4",
85
85
  "@utils/ts-config-types": "1.0.4",
@@ -4216,6 +4216,26 @@ export const docsEntry = {
4216
4216
  vi: readLocale('roadmap.md', 'vi'),
4217
4217
  uk: readLocale('roadmap.md', 'uk'),
4218
4218
  } as unknown as Record<LocalesValues, Promise<string>>,
4219
+ './docs/en/self_hosting.md': {
4220
+ en: readLocale('self_hosting.md', 'en'),
4221
+ ru: readLocale('self_hosting.md', 'ru'),
4222
+ ja: readLocale('self_hosting.md', 'ja'),
4223
+ fr: readLocale('self_hosting.md', 'fr'),
4224
+ ko: readLocale('self_hosting.md', 'ko'),
4225
+ zh: readLocale('self_hosting.md', 'zh'),
4226
+ es: readLocale('self_hosting.md', 'es'),
4227
+ de: readLocale('self_hosting.md', 'de'),
4228
+ ar: readLocale('self_hosting.md', 'ar'),
4229
+ it: readLocale('self_hosting.md', 'it'),
4230
+ 'en-GB': readLocale('self_hosting.md', 'en-GB'),
4231
+ pt: readLocale('self_hosting.md', 'pt'),
4232
+ hi: readLocale('self_hosting.md', 'hi'),
4233
+ tr: readLocale('self_hosting.md', 'tr'),
4234
+ pl: readLocale('self_hosting.md', 'pl'),
4235
+ id: readLocale('self_hosting.md', 'id'),
4236
+ vi: readLocale('self_hosting.md', 'vi'),
4237
+ uk: readLocale('self_hosting.md', 'uk'),
4238
+ } as unknown as Record<LocalesValues, Promise<string>>,
4219
4239
  './docs/en/testing.md': {
4220
4240
  en: readLocale('testing.md', 'en'),
4221
4241
  ru: readLocale('testing.md', 'ru'),