Files
deploy-ops/04-环境变量和注意事项.md

85 lines
2.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 环境变量和注意事项
## 当前环境变量清单(/lobehub/.env
### 核心域名
```
APP_URL=https://suyushi.top
INTERNAL_APP_URL=http://localhost:3210
LOBE_PORT=3210
```
### 安全密钥
```
KEY_VAULTS_SECRET=<openssl rand -base64 32 生成>
AUTH_SECRET=<openssl rand -base64 32 生成>
```
### 数据库
```
POSTGRES_PASSWORD=<密码>
LOBE_DB_NAME=lobechat
DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@postgresql:5432/${LOBE_DB_NAME}
```
### AI 模型
```
DEEPSEEK_API_KEY=sk-b2788f9928e64162911a9be0141acd2e
DEEPSEEK_PROXY_URL=https://api.deepseek.com/v1
OPENAI_API_KEY=sk-b2788f9928e64162911a9be0141acd2e
OPENAI_PROXY_URL=https://api.deepseek.com/v1
OPENAI_MODEL_LIST=-all,+deepseek-v4-flash=DeepSeek V4 Flash<131072:fc>
```
### 提供商开关
```
ENABLED_OPENAI=1
其他所有 ENABLED_* = 0
```
### 界面
```
FEATURE_FLAGS=-market,-welcome_suggest
```
## 踩坑记录
| 坑 | 原因 | 解决 |
|------|------|------|
| `.env` 修改后不生效 | `docker compose restart` 不重新读 .env | 用 `docker compose down lobe && docker compose up -d lobe` |
| KEY_VAULTS_SECRET 报错 | 手动填的字符串不合法 | 必须用 `openssl rand -base64 32` 生成 |
| rustfs-init 失败 | 缺少 bucket.config.json | 改 docker-compose.yml 跳过该依赖 |
| nginx 端口 80 被占 | lobe 之前占用了 80 | `fuser -k 80/tcp` 杀进程 |
| APP_URL=https 重定向到 HTTPS | lobe 把 HTTP 请求重定向到 HTTPS | 先设 HTTP,配完 nginx + SSL 再改回 HTTPS |
| SearXNG 反复重启 | 配置问题 | 不影响核心功能,可忽略 |
| 夸克浏览器打不开 | 浏览器兼容性 | 用 Chrome/Safari |
## DNS 管理
注册商:Namesilo
API Key`b53438acc2344d7ccc8a2e9e312a9e0e766f59c46badde7abdf572c7bf15a09e`
### DNS 列表 API
```bash
curl "https://www.namesilo.com/api/dnsListRecords?version=1&type=json&key=<KEY>&domain=suyushi.top"
```
### 添加记录
```bash
curl "https://www.namesilo.com/api/dnsAddRecord?version=1&type=json&key=<KEY>&domain=suyushi.top&rrtype=A&rrhost=&rrvalue=8.210.128.95&rrttl=3600"
```
### 删除记录
```bash
curl "https://www.namesilo.com/api/dnsDeleteRecord?version=1&type=json&key=<KEY>&domain=suyushi.top&rrid=<RECORD_ID>"
```
## 月度费用
| 项目 | 月费 |
|------|------|
| 阿里云轻量香港服务器 | ~39元 |
| 域名 suyushi.top | ~2元(年摊) |
| DeepSeek API | ~30-50元 |
| **合计** | **~70-90元** |