From 95675013690bd325e84a4e2dbd5272174f3be169 Mon Sep 17 00:00:00 2001 From: jeffusion Date: Tue, 24 Mar 2026 12:59:59 +0800 Subject: [PATCH] chore(deploy): standardize assistant default port to 5174 --- .env.example | 10 ++++++---- Dockerfile | 2 +- README.md | 13 ++++++++----- docker-compose.e2e.yml | 14 +++----------- docker-compose.yml | 4 ++-- docs/README.zh-CN.md | 13 ++++++++----- docs/design/pluggable-llm-providers.md | 2 +- e2e/Dockerfile.e2e | 2 +- e2e/seed.sh | 2 +- k8s/gitea-assistant.yaml | 6 +++--- 10 files changed, 34 insertions(+), 34 deletions(-) diff --git a/.env.example b/.env.example index 09f9316..0e604be 100644 --- a/.env.example +++ b/.env.example @@ -1,8 +1,10 @@ # 应用配置 -PORT=3000 -# DATABASE_PATH=./data/assistant.db # 可选,默认为 ./data/assistant.db -ENCRYPTION_KEY= # 必填,运行 openssl rand -hex 32 生成 +PORT=5174 +# 可选,默认为 ./data/assistant.db +# DATABASE_PATH=./data/assistant.db +# 必填,运行 openssl rand -hex 32 生成 +ENCRYPTION_KEY= # 所有其他配置(Gitea连接、飞书通知、Webhook密钥、管理员密码、审查引擎、记忆系统等) # 均通过 Web 管理后台进行配置。 -# 启动服务后访问 http://localhost:3000 进行配置。 +# 启动服务后访问 http://localhost:5174 进行配置。 diff --git a/Dockerfile b/Dockerfile index f9d6483..96c2943 100644 --- a/Dockerfile +++ b/Dockerfile @@ -57,6 +57,6 @@ COPY --from=frontend-builder /app/frontend/dist ./public # Codex CLI binary (statically linked musl build) COPY --from=codex-downloader /usr/local/bin/codex /usr/local/bin/codex -EXPOSE 3000 +EXPOSE 5174 CMD ["bun", "run", "start"] diff --git a/README.md b/README.md index 1dc250c..7b7ac19 100644 --- a/README.md +++ b/README.md @@ -53,13 +53,16 @@ cd gitea-ai-assistant bun install ``` +> `bun install` at repository root now triggers frontend dependency installation automatically via `postinstall`. +> If your environment skips lifecycle scripts, run `bun run bootstrap` once. + ### Configuration Create a `.env` file with only infrastructure-level settings: ```bash # Server port -PORT=3000 +PORT=5174 # REQUIRED: encryption key for API key storage (generate with: openssl rand -hex 32) ENCRYPTION_KEY= @@ -68,7 +71,7 @@ ENCRYPTION_KEY= # DATABASE_PATH=./data/assistant.db ``` -> **All other configuration** (Gitea connection, webhook secret, admin password, review engine, Feishu, memory settings, etc.) is managed through the **Admin Dashboard Web UI** at `http://your-server:3000`. On first boot, all settings are seeded with secure defaults automatically. +> **All other configuration** (Gitea connection, webhook secret, admin password, review engine, Feishu, memory settings, etc.) is managed through the **Admin Dashboard Web UI** at `http://your-server:5174`. On first boot, all settings are seeded with secure defaults automatically. See [Configuration Reference](#configuration-reference) for all options. @@ -83,14 +86,14 @@ bun run start # Production mode **Option 1: Admin Dashboard (Recommended)** -1. Access `http://your-server:3000` +1. Access `http://your-server:5174` 2. Log in with the admin password (default: `password` — change it in the dashboard) 3. Click "Enable" on repositories to auto-configure webhooks **Option 2: Manual Configuration** In Gitea repository settings, add a webhook: -- **URL**: `http://your-server:3000/webhook/gitea` +- **URL**: `http://your-server:5174/webhook/gitea` - **Content Type**: `application/json` - **Secret**: Same as the Webhook Secret configured in the dashboard - **Events**: "Pull Request" and "Status" @@ -187,7 +190,7 @@ Agent review execution model (current): ```bash docker build -t gitea-assistant . -docker run -d -p 3000:3000 -v ./data:/app/data -e PORT=3000 gitea-assistant +docker run -d -p 5174:5174 -v ./data:/app/data -e PORT=5174 gitea-assistant ``` ### Docker Compose diff --git a/docker-compose.e2e.yml b/docker-compose.e2e.yml index e98a983..5144b55 100644 --- a/docker-compose.e2e.yml +++ b/docker-compose.e2e.yml @@ -46,19 +46,11 @@ services: - NODE_ENV=production - GITEA_API_URL=http://gitea:3000/api/v1 - GITEA_ACCESS_TOKEN=${E2E_GITEA_TOKEN:-placeholder} - - PORT=3000 + - PORT=5174 ports: - - "3334:3000" + - "3334:5174" healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"] - interval: 5s - timeout: 3s - retries: 10 - start_period: 5s - ports: - - "3334:3000" - healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"] + test: ["CMD", "curl", "-f", "http://localhost:5174/api/health"] interval: 5s timeout: 3s retries: 10 diff --git a/docker-compose.yml b/docker-compose.yml index 0fc889a..00e4d8a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,7 @@ services: container_name: gitea-assistant ports: - - "3000:3000" + - "5174:5174" volumes: - assistant_data:/app/data env_file: @@ -19,7 +19,7 @@ services: restart: unless-stopped healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"] + test: ["CMD", "curl", "-f", "http://localhost:5174/api/health"] interval: 30s timeout: 5s retries: 3 diff --git a/docs/README.zh-CN.md b/docs/README.zh-CN.md index 55c8542..3df739d 100644 --- a/docs/README.zh-CN.md +++ b/docs/README.zh-CN.md @@ -53,13 +53,16 @@ cd gitea-ai-assistant bun install ``` +> 在仓库根目录执行 `bun install` 会通过 `postinstall` 自动安装 `frontend` 依赖。 +> 若你的环境跳过生命周期脚本,请额外执行一次 `bun run bootstrap`。 + ### 配置说明 创建 `.env` 文件,仅填写基础设施级别的配置: ```bash # 服务端口 -PORT=3000 +PORT=5174 # 必填:API Key 加密存储密钥(运行 openssl rand -hex 32 生成) ENCRYPTION_KEY= @@ -68,7 +71,7 @@ ENCRYPTION_KEY= # DATABASE_PATH=./data/assistant.db ``` -> **所有其他配置**(Gitea 连接、Webhook 密钥、管理员密码、审查引擎、飞书、记忆系统等)均通过 **Web 管理后台** 在 `http://your-server:3000` 进行配置。首次启动时,所有设置会自动以安全的默认值进行初始化。 +> **所有其他配置**(Gitea 连接、Webhook 密钥、管理员密码、审查引擎、飞书、记忆系统等)均通过 **Web 管理后台** 在 `http://your-server:5174` 进行配置。首次启动时,所有设置会自动以安全的默认值进行初始化。 完整配置项请参阅 [配置参考](#配置参考)。 @@ -83,14 +86,14 @@ bun run start # 生产模式 **方式一:管理后台(推荐)** -1. 在浏览器中访问 `http://your-server:3000` +1. 在浏览器中访问 `http://your-server:5174` 2. 使用管理员密码登录(默认:`password`,请在后台及时修改) 3. 点击仓库对应的「启用」按钮自动配置 Webhook **方式二:手动配置** 在 Gitea 仓库设置中添加 Webhook: -- **URL**: `http://your-server:3000/webhook/gitea` +- **URL**: `http://your-server:5174/webhook/gitea` - **内容类型**: `application/json` - **密钥**: 与管理后台中配置的 Webhook 密钥相同 - **触发事件**: 「Pull Request」和「Status」 @@ -187,7 +190,7 @@ LLM 提供商和模型通过**管理后台** Web 界面进行配置: ```bash docker build -t gitea-assistant . -docker run -d -p 3000:3000 -v ./data:/app/data -e PORT=3000 gitea-assistant +docker run -d -p 5174:5174 -v ./data:/app/data -e PORT=5174 gitea-assistant ``` ### Docker Compose diff --git a/docs/design/pluggable-llm-providers.md b/docs/design/pluggable-llm-providers.md index 43b99d1..491eef9 100644 --- a/docs/design/pluggable-llm-providers.md +++ b/docs/design/pluggable-llm-providers.md @@ -823,7 +823,7 @@ Day 6.5: 旧代码清理完毕,文档更新,Ready for review # .env.example(仅保留启动参数) # 应用启动参数(不可通过 UI 设置) -PORT=3000 +PORT=5174 WEBHOOK_SECRET=your_webhook_secret DATABASE_PATH=./data/assistant.db # SQLite 文件路径 diff --git a/e2e/Dockerfile.e2e b/e2e/Dockerfile.e2e index 778535d..0bf816c 100644 --- a/e2e/Dockerfile.e2e +++ b/e2e/Dockerfile.e2e @@ -11,6 +11,6 @@ RUN bun install --no-frozen-lockfile COPY src ./src COPY tsconfig.json . -EXPOSE 3000 +EXPOSE 5174 CMD ["bun", "run", "start"] diff --git a/e2e/seed.sh b/e2e/seed.sh index ae7c377..25616fa 100755 --- a/e2e/seed.sh +++ b/e2e/seed.sh @@ -162,7 +162,7 @@ curl -sf -X POST "${GITEA_URL}/api/v1/repos/${ADMIN_USER}/${REPO_NAME}/hooks" \ \"active\": true, \"events\": [\"pull_request\"], \"config\": { - \"url\": \"http://assistant:3000/webhook/gitea\", + \"url\": \"http://assistant:5174/webhook/gitea\", \"content_type\": \"json\", \"secret\": \"${WEBHOOK_SECRET}\" } diff --git a/k8s/gitea-assistant.yaml b/k8s/gitea-assistant.yaml index cd13e2b..8040874 100644 --- a/k8s/gitea-assistant.yaml +++ b/k8s/gitea-assistant.yaml @@ -9,7 +9,7 @@ metadata: app.kubernetes.io/name: gitea-assistant app.kubernetes.io/part-of: gitea-assistant data: - PORT: "3000" + PORT: "5174" # All settings (Gitea connection, webhook secret, admin password, review engine, # Feishu, memory, etc.) are managed through the Admin Dashboard Web UI. # They are auto-seeded with secure defaults on first boot. @@ -38,7 +38,7 @@ spec: image: ghcr.io/jeffusion/gitea-ai-assistant:latest ports: - name: http - containerPort: 3000 + containerPort: 5174 protocol: TCP envFrom: - configMapRef: @@ -92,6 +92,6 @@ spec: app.kubernetes.io/name: gitea-assistant ports: - name: http - port: 3000 + port: 5174 targetPort: http protocol: TCP