修改配置
This commit is contained in:
@@ -213,6 +213,52 @@ maxRetry: 10
|
||||
EOF
|
||||
success " mongodb.yml → ${MONGO_HOST}:${MONGO_PORT}/${MONGO_DATABASE}"
|
||||
|
||||
# chat-rpc-chat.yml — liveKit 配置(Token 签发给 App 用于视频会议)
|
||||
CHAT_RPC_CHAT="$CHAT_CONF/chat-rpc-chat.yml"
|
||||
if [[ -f "$CHAT_RPC_CHAT" ]]; then
|
||||
cp "$CHAT_RPC_CHAT" "${CHAT_RPC_CHAT}.bak"
|
||||
python3 - "$CHAT_RPC_CHAT" <<PYEOF
|
||||
import re, sys
|
||||
path = sys.argv[1]
|
||||
content = open(path).read()
|
||||
# 替换 liveKit 块的 url / key / secret
|
||||
content = re.sub(r'(liveKit:\n url:\s*).*', r'\1"${LIVEKIT_URL}"', content)
|
||||
content = re.sub(r'(liveKit:.*?\n url:.*?\n key:\s*).*', r'\1"${LIVEKIT_API_KEY}"', content, flags=re.DOTALL)
|
||||
content = re.sub(r'(liveKit:.*?\n url:.*?\n key:.*?\n secret:\s*).*', r'\1"${LIVEKIT_API_SECRET}"', content, flags=re.DOTALL)
|
||||
open(path, 'w').write(content)
|
||||
PYEOF
|
||||
success " chat-rpc-chat.yml → liveKit url=${LIVEKIT_URL}, key=${LIVEKIT_API_KEY} (备份: .bak)"
|
||||
else
|
||||
warn " chat-rpc-chat.yml 不存在,跳过"
|
||||
fi
|
||||
|
||||
# MongoDB system_configs — 写入 liveKit 配置(open-im-server 管理操作使用)
|
||||
# open-im-server meeting.go 从此读取配置来踢人、查人数等
|
||||
step "MongoDB system_configs 初始化 liveKit"
|
||||
python3 - <<PYEOF
|
||||
import sys
|
||||
try:
|
||||
from pymongo import MongoClient
|
||||
uri = "mongodb://${MONGO_USERNAME}:${MONGO_PASSWORD}@${MONGO_HOST}:${MONGO_PORT}/${MONGO_DATABASE}?authSource=${MONGO_AUTHSOURCE}&directConnection=true"
|
||||
client = MongoClient(uri, serverSelectionTimeoutMS=5000)
|
||||
db = client["${MONGO_DATABASE}"]
|
||||
col = db["system_configs"]
|
||||
livekit_value = '{"key":"${LIVEKIT_API_KEY}","secret":"${LIVEKIT_API_SECRET}","url":"${LIVEKIT_URL}"}'
|
||||
col.update_one(
|
||||
{"key": "liveKit"},
|
||||
{"\$set": {"key": "liveKit", "value": livekit_value, "value_type": "json"}},
|
||||
upsert=True
|
||||
)
|
||||
print(" system_configs[liveKit] 写入成功")
|
||||
client.close()
|
||||
except ImportError:
|
||||
print(" [WARN] pymongo 未安装,跳过 MongoDB 初始化(可后续手动写入)")
|
||||
sys.exit(0)
|
||||
except Exception as e:
|
||||
print(f" [WARN] MongoDB 写入失败: {e}(可后续手动写入)")
|
||||
sys.exit(0)
|
||||
PYEOF
|
||||
|
||||
# ──────────────────────────────────────────────────────────────────────────────
|
||||
# meetingmsg
|
||||
# ──────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
19
README.md
19
README.md
@@ -94,6 +94,8 @@ vim .env.deploy-test
|
||||
./deploy-test/07-start-frontend.sh
|
||||
```
|
||||
|
||||
> **pc(Electron)依赖安装**:首次在**无 GitHub SSH 密钥**的服务器上部署时,请先执行 `./deploy-test/00-init-tools.sh`(会配置将 GitHub SSH 地址重写为 HTTPS),或见下文「pc 前端 yarn install 失败」。`pc` 目录统一使用 **Yarn**;若存在 `package-lock.json` 会触发 Yarn 混用警告,可删除该文件后仅保留 `yarn.lock`。
|
||||
|
||||
---
|
||||
|
||||
## 配置文件(`.env.deploy-test`)
|
||||
@@ -266,6 +268,23 @@ TENCENT_SDK_SECRET_KEY=xxx
|
||||
|
||||
## 故障排查
|
||||
|
||||
### pc 前端 `yarn install` 失败(Git SSH / Host key verification failed)
|
||||
|
||||
现象示例:`git ls-remote ... ssh://git@github.com/electron/node-gyp.git` → `Host key verification failed` 或 `Could not read from remote repository`。
|
||||
|
||||
| 说明 | 处理 |
|
||||
|------|------|
|
||||
| **锁文件** | 仓库中 `pc/yarn.lock`、`pc/package-lock.json` 已将 `@electron/node-gyp` 的 `resolved` 固定为 **`git+https://github.com/electron/node-gyp.git#...`**(无需 SSH)。请拉取最新代码后再执行 `yarn install`。 |
|
||||
| **环境** | 首次部署请执行 `./deploy-test/00-init-tools.sh`,脚本内会通过 `git config url.*.insteadOf` 将 `git+ssh://`、`ssh://git@github.com/`、`git@github.com:` 重写为 `https://github.com/`。 |
|
||||
| **仍失败** | 手动执行(与 `00-init-tools.sh` 一致):<br>`git config --global url."https://github.com/".insteadOf "git+ssh://git@github.com/"`<br>`git config --global url."https://github.com/".insteadOf "ssh://git@github.com/"`<br>`git config --global url."https://github.com/".insteadOf "git@github.com:"` |
|
||||
| **包管理器** | `pc` 使用 **Yarn**。若同时存在 `package-lock.json`,Yarn 会警告混用锁文件;可删除 `pc/package-lock.json`,仅保留 `yarn.lock`(与团队约定一致即可)。 |
|
||||
|
||||
```bash
|
||||
cd pc && rm -rf node_modules && yarn install
|
||||
```
|
||||
|
||||
### 其他
|
||||
|
||||
```bash
|
||||
# 验证 MongoDB / S3 连接
|
||||
./deploy-test/check-conn.sh
|
||||
|
||||
Reference in New Issue
Block a user