📝 记录 Gitea 凭证与推送手册

- 00_账号与API: 新增 Gitea(CKB NAS) fnvtk/Zhiqun1984
- references: Gitea推送_卡若AI调用手册.md 供下次调用
- auto_sync_gitea: 移除 timeout 限制

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-02-15 22:54:38 +08:00
parent a857785f58
commit 6bcbcb3d1a
3 changed files with 75 additions and 5 deletions

View File

@@ -103,18 +103,15 @@ log "提交成功:${CHANGED_COUNT} 个文件变更"
# ============================================
# Step 4: 推送到 Gitea
# ============================================
# 设置超时 60 秒
timeout 60 git push "$REMOTE" "$BRANCH" --quiet 2>&1
git push "$REMOTE" "$BRANCH" --quiet 2>&1
PUSH_RESULT=$?
if [ $PUSH_RESULT -eq 0 ]; then
log "推送成功 → $REMOTE/$BRANCH"
elif [ $PUSH_RESULT -eq 124 ]; then
log "警告推送超时60秒下次重试"
else
# 如果推送失败(可能远程有差异),尝试 force push
log "推送失败code=$PUSH_RESULT),尝试强制推送..."
timeout 60 git push "$REMOTE" "$BRANCH" --force --quiet 2>&1
git push "$REMOTE" "$BRANCH" --force --quiet 2>&1
if [ $? -eq 0 ]; then
log "强制推送成功 → $REMOTE/$BRANCH"
else

View File

@@ -0,0 +1,63 @@
# Gitea 推送 — 卡若AI 调用手册
> 凭证与接口记录,下次调用直接读本文件 + 00_账号与API索引 § Gitea
> 路径:`_共享模块/references/Gitea推送_卡若AI调用手册.md`
---
## 一、凭证(来自 00_账号与API索引
| 项 | 值 |
|----|-----|
| 地址 | http://open.quwanzhi.com:3000 |
| 账号 | fnvtk |
| 密码 | Zhiqun1984 |
| SSH 端口 | 22201 |
---
## 二、推送方式
### 2.1 SSH 推送(推荐,无需 token
```bash
# 远程 URL 格式
ssh://fnvtk@open.quwanzhi.com:22201/volume1/git/github/fnvtk/{仓库名}.git
# 推送命令(需 sshpass 或 SSH 密钥)
GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no -o KexAlgorithms=+diffie-hellman-group1-sha1 -o Ciphers=+aes256-cbc -p 22201" \
sshpass -p 'Zhiqun1984' git push gitea main
```
### 2.2 HTTP 推送(账号密码嵌入 URL
```bash
git remote add gitea "http://fnvtk:Zhiqun1984@open.quwanzhi.com:3000/fnvtk/{仓库名}.git"
git push gitea main
```
> ⚠️ Gitea 默认禁用「推送即创建」,新建仓库需先 SSH 到 NAS 手动创建 bare 仓库。
### 2.3 新建仓库SSH 到 NAS
```bash
sshpass -p 'Zhiqun1984' ssh -o StrictHostKeyChecking=no -o KexAlgorithms=+diffie-hellman-group1-sha1 -o Ciphers=+aes256-cbc -p 22201 fnvtk@open.quwanzhi.com \
"mkdir -p /volume1/git/github/fnvtk/新仓库名.git && cd /volume1/git/github/fnvtk/新仓库名.git && git init --bare && echo 'ref: refs/heads/main' > HEAD"
```
---
## 三、已配置仓库
| 仓库 | 路径 | 远程名 |
|------|------|--------|
| 卡若AI | /Users/karuo/Documents/个人/卡若AI | gitea |
| 分布式算力矩阵 | /Users/karuo/Documents/1、金项目/3、自营项目/分布式算力矩阵 | gitea |
---
## 四、卡若AI 调用流程
1. 读本文件 + `00_账号与API索引` § Gitea
2. 取凭证fnvtk / Zhiqun1984
3. 推送:`sshpass -p 'Zhiqun1984' git push gitea main`(或对应 remote 名)

View File

@@ -62,6 +62,16 @@
|----|-----|
| API Key | `AIzaSyCPARryq8o6MKptLoT4STAvCsRB7uZuOK8` |
### GiteaCKB NAS 自建 Git
| 项 | 值 |
|----|-----|
| 地址 | http://open.quwanzhi.com:3000 |
| 账号 | `fnvtk` |
| 密码 | `Zhiqun1984` |
| SSH 推送 | `ssh://fnvtk@open.quwanzhi.com:22201/volume1/git/github/fnvtk/{repo}.git` |
| HTTP 推送 | `http://fnvtk:Zhiqun1984@open.quwanzhi.com:3000/fnvtk/{repo}.git` |
| 说明 | 卡若AI 下次调用直接读本表推送;新建仓库需 SSH 到 NAS 执行 `mkdir -p /volume1/git/github/fnvtk/xxx.git && cd xxx.git && git init --bare` |
---
## 二、数据库(明文)