diff --git a/AGENTS.md b/AGENTS.md index 88b9335..bc58dfd 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -551,6 +551,40 @@ shellcheck scripts/*.sh monitor/**/*.sh **注意**: Hook 只檢查 error 等級的 shellcheck 問題,style 警告會顯示但不阻擋提交。 +## Gitea Sync + +主要 sync 管道為 Gitea:`http://192.168.110.200:3000/admin/momentry_core.git` + +### 產生 Access Token(首次設定) + +```bash +# admin 帳號密碼為 AccusysTest! +TOKEN=$(curl -s -X POST "http://192.168.110.200:3000/api/v1/users/admin/tokens" \ + -u "admin:AccusysTest!" \ + -H "Content-Type: application/json" \ + -d '{"name":"m5max128_push","scopes":["write:repository"]}' | jq -r '.sha1') +echo $TOKEN +``` + +### 設定 Remote + +```bash +# 用 token 取代密碼 +git remote add origin http://admin:TOKEN@192.168.110.200:3000/admin/momentry_core.git + +# 同步 +git pull origin main +git push origin main +``` + +### Token 記錄 + +| 機器 | Token | +|------|-------| +| M5Max128 | `a7cf946148063c2bfa8d59ad629ae541813f0db8` | + +**注意**: Token 有 write:repository scope,勿外洩。如需新增 token 給其他機器,各自產自己的 token。 + ## Release Workflow ### Release 前準備