mirror of
https://github.com/jeffusion/gitea-ai-assistant.git
synced 2026-03-27 10:05:50 +00:00
chore(deploy): standardize assistant default port to 5174
This commit is contained in:
10
.env.example
10
.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 进行配置。
|
||||
|
||||
@@ -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"]
|
||||
|
||||
13
README.md
13
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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 文件路径
|
||||
|
||||
|
||||
@@ -11,6 +11,6 @@ RUN bun install --no-frozen-lockfile
|
||||
COPY src ./src
|
||||
COPY tsconfig.json .
|
||||
|
||||
EXPOSE 3000
|
||||
EXPOSE 5174
|
||||
|
||||
CMD ["bun", "run", "start"]
|
||||
|
||||
@@ -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}\"
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user