chore(deploy): standardize assistant default port to 5174

This commit is contained in:
jeffusion
2026-03-24 12:59:59 +08:00
committed by 路遥知码力
parent 9964614b5e
commit 9567501369
10 changed files with 34 additions and 34 deletions

View File

@@ -1,8 +1,10 @@
# 应用配置 # 应用配置
PORT=3000 PORT=5174
# DATABASE_PATH=./data/assistant.db # 可选,默认为 ./data/assistant.db # 可选,默认为 ./data/assistant.db
ENCRYPTION_KEY= # 必填,运行 openssl rand -hex 32 生成 # DATABASE_PATH=./data/assistant.db
# 必填,运行 openssl rand -hex 32 生成
ENCRYPTION_KEY=
# 所有其他配置Gitea连接、飞书通知、Webhook密钥、管理员密码、审查引擎、记忆系统等 # 所有其他配置Gitea连接、飞书通知、Webhook密钥、管理员密码、审查引擎、记忆系统等
# 均通过 Web 管理后台进行配置。 # 均通过 Web 管理后台进行配置。
# 启动服务后访问 http://localhost:3000 进行配置。 # 启动服务后访问 http://localhost:5174 进行配置。

View File

@@ -57,6 +57,6 @@ COPY --from=frontend-builder /app/frontend/dist ./public
# Codex CLI binary (statically linked musl build) # Codex CLI binary (statically linked musl build)
COPY --from=codex-downloader /usr/local/bin/codex /usr/local/bin/codex COPY --from=codex-downloader /usr/local/bin/codex /usr/local/bin/codex
EXPOSE 3000 EXPOSE 5174
CMD ["bun", "run", "start"] CMD ["bun", "run", "start"]

View File

@@ -53,13 +53,16 @@ cd gitea-ai-assistant
bun install 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 ### Configuration
Create a `.env` file with only infrastructure-level settings: Create a `.env` file with only infrastructure-level settings:
```bash ```bash
# Server port # Server port
PORT=3000 PORT=5174
# REQUIRED: encryption key for API key storage (generate with: openssl rand -hex 32) # REQUIRED: encryption key for API key storage (generate with: openssl rand -hex 32)
ENCRYPTION_KEY= ENCRYPTION_KEY=
@@ -68,7 +71,7 @@ ENCRYPTION_KEY=
# DATABASE_PATH=./data/assistant.db # 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. See [Configuration Reference](#configuration-reference) for all options.
@@ -83,14 +86,14 @@ bun run start # Production mode
**Option 1: Admin Dashboard (Recommended)** **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) 2. Log in with the admin password (default: `password` — change it in the dashboard)
3. Click "Enable" on repositories to auto-configure webhooks 3. Click "Enable" on repositories to auto-configure webhooks
**Option 2: Manual Configuration** **Option 2: Manual Configuration**
In Gitea repository settings, add a webhook: 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` - **Content Type**: `application/json`
- **Secret**: Same as the Webhook Secret configured in the dashboard - **Secret**: Same as the Webhook Secret configured in the dashboard
- **Events**: "Pull Request" and "Status" - **Events**: "Pull Request" and "Status"
@@ -187,7 +190,7 @@ Agent review execution model (current):
```bash ```bash
docker build -t gitea-assistant . 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 ### Docker Compose

View File

@@ -46,19 +46,11 @@ services:
- NODE_ENV=production - NODE_ENV=production
- GITEA_API_URL=http://gitea:3000/api/v1 - GITEA_API_URL=http://gitea:3000/api/v1
- GITEA_ACCESS_TOKEN=${E2E_GITEA_TOKEN:-placeholder} - GITEA_ACCESS_TOKEN=${E2E_GITEA_TOKEN:-placeholder}
- PORT=3000 - PORT=5174
ports: ports:
- "3334:3000" - "3334:5174"
healthcheck: 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
start_period: 5s
ports:
- "3334:3000"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"]
interval: 5s interval: 5s
timeout: 3s timeout: 3s
retries: 10 retries: 10

View File

@@ -8,7 +8,7 @@ services:
container_name: gitea-assistant container_name: gitea-assistant
ports: ports:
- "3000:3000" - "5174:5174"
volumes: volumes:
- assistant_data:/app/data - assistant_data:/app/data
env_file: env_file:
@@ -19,7 +19,7 @@ services:
restart: unless-stopped restart: unless-stopped
healthcheck: healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"] test: ["CMD", "curl", "-f", "http://localhost:5174/api/health"]
interval: 30s interval: 30s
timeout: 5s timeout: 5s
retries: 3 retries: 3

View File

@@ -53,13 +53,16 @@ cd gitea-ai-assistant
bun install bun install
``` ```
> 在仓库根目录执行 `bun install` 会通过 `postinstall` 自动安装 `frontend` 依赖。
> 若你的环境跳过生命周期脚本,请额外执行一次 `bun run bootstrap`。
### 配置说明 ### 配置说明
创建 `.env` 文件,仅填写基础设施级别的配置: 创建 `.env` 文件,仅填写基础设施级别的配置:
```bash ```bash
# 服务端口 # 服务端口
PORT=3000 PORT=5174
# 必填API Key 加密存储密钥(运行 openssl rand -hex 32 生成) # 必填API Key 加密存储密钥(运行 openssl rand -hex 32 生成)
ENCRYPTION_KEY= ENCRYPTION_KEY=
@@ -68,7 +71,7 @@ ENCRYPTION_KEY=
# DATABASE_PATH=./data/assistant.db # 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`,请在后台及时修改) 2. 使用管理员密码登录(默认:`password`,请在后台及时修改)
3. 点击仓库对应的「启用」按钮自动配置 Webhook 3. 点击仓库对应的「启用」按钮自动配置 Webhook
**方式二:手动配置** **方式二:手动配置**
在 Gitea 仓库设置中添加 Webhook 在 Gitea 仓库设置中添加 Webhook
- **URL**: `http://your-server:3000/webhook/gitea` - **URL**: `http://your-server:5174/webhook/gitea`
- **内容类型**: `application/json` - **内容类型**: `application/json`
- **密钥**: 与管理后台中配置的 Webhook 密钥相同 - **密钥**: 与管理后台中配置的 Webhook 密钥相同
- **触发事件**: 「Pull Request」和「Status」 - **触发事件**: 「Pull Request」和「Status」
@@ -187,7 +190,7 @@ LLM 提供商和模型通过**管理后台** Web 界面进行配置:
```bash ```bash
docker build -t gitea-assistant . 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 ### Docker Compose

View File

@@ -823,7 +823,7 @@ Day 6.5: 旧代码清理完毕文档更新Ready for review
# .env.example仅保留启动参数 # .env.example仅保留启动参数
# 应用启动参数(不可通过 UI 设置) # 应用启动参数(不可通过 UI 设置)
PORT=3000 PORT=5174
WEBHOOK_SECRET=your_webhook_secret WEBHOOK_SECRET=your_webhook_secret
DATABASE_PATH=./data/assistant.db # SQLite 文件路径 DATABASE_PATH=./data/assistant.db # SQLite 文件路径

View File

@@ -11,6 +11,6 @@ RUN bun install --no-frozen-lockfile
COPY src ./src COPY src ./src
COPY tsconfig.json . COPY tsconfig.json .
EXPOSE 3000 EXPOSE 5174
CMD ["bun", "run", "start"] CMD ["bun", "run", "start"]

View File

@@ -162,7 +162,7 @@ curl -sf -X POST "${GITEA_URL}/api/v1/repos/${ADMIN_USER}/${REPO_NAME}/hooks" \
\"active\": true, \"active\": true,
\"events\": [\"pull_request\"], \"events\": [\"pull_request\"],
\"config\": { \"config\": {
\"url\": \"http://assistant:3000/webhook/gitea\", \"url\": \"http://assistant:5174/webhook/gitea\",
\"content_type\": \"json\", \"content_type\": \"json\",
\"secret\": \"${WEBHOOK_SECRET}\" \"secret\": \"${WEBHOOK_SECRET}\"
} }

View File

@@ -9,7 +9,7 @@ metadata:
app.kubernetes.io/name: gitea-assistant app.kubernetes.io/name: gitea-assistant
app.kubernetes.io/part-of: gitea-assistant app.kubernetes.io/part-of: gitea-assistant
data: data:
PORT: "3000" PORT: "5174"
# All settings (Gitea connection, webhook secret, admin password, review engine, # All settings (Gitea connection, webhook secret, admin password, review engine,
# Feishu, memory, etc.) are managed through the Admin Dashboard Web UI. # Feishu, memory, etc.) are managed through the Admin Dashboard Web UI.
# They are auto-seeded with secure defaults on first boot. # They are auto-seeded with secure defaults on first boot.
@@ -38,7 +38,7 @@ spec:
image: ghcr.io/jeffusion/gitea-ai-assistant:latest image: ghcr.io/jeffusion/gitea-ai-assistant:latest
ports: ports:
- name: http - name: http
containerPort: 3000 containerPort: 5174
protocol: TCP protocol: TCP
envFrom: envFrom:
- configMapRef: - configMapRef:
@@ -92,6 +92,6 @@ spec:
app.kubernetes.io/name: gitea-assistant app.kubernetes.io/name: gitea-assistant
ports: ports:
- name: http - name: http
port: 3000 port: 5174
targetPort: http targetPort: http
protocol: TCP protocol: TCP