Files
xianyu-hunter-hermes-skill/skill/xianyu-hunter-monitor/references/gitea-portable-package-sync-2026-05.md
T
chick efd6eb8fb9 Fix xianyu QR login refresh
Exclude tiny QR-login icon candidates, expose captured QR dimensions in the Web UI, and refresh the portable Hermes skill release archives.
2026-05-07 15:29:05 +08:00

5.0 KiB

Sync local xianyu-hunter changes into the Gitea portable package (2026-05)

Trigger

BOSS says “同步更新 gitea” after local xianyu-hunter project changes. In this setup the local working clone may still have upstream origin=https://github.com/Disrush/xianyu-hunter.git, while the public Gitea repo is the portable package:

https://gitea.chickliu.fun/Hermes/xianyu-hunter-hermes-skill

Do not push the messy local working clone directly to GitHub/upstream or to a new guessed Gitea repo. Update the existing portable package repo by cloning it to a temp workdir and rsyncing sanitized contents into project/xianyu-hunter/ plus the skill into skill/xianyu-hunter-monitor/.

Proven workflow

cd /Users/chick/.Hermes/workspace/research/xianyu-hunter

set -a
source ~/.hermes/env/gitea.env
set +a
OWNER="${GITEA_OWNER:-Hermes}"
REPO=xianyu-hunter-hermes-skill

rm -rf /tmp/xianyu-hunter-gitea-sync
git clone "$GITEA_URL/$OWNER/$REPO.git" /tmp/xianyu-hunter-gitea-sync

SRC=/Users/chick/.Hermes/workspace/research/xianyu-hunter
DST=/tmp/xianyu-hunter-gitea-sync/project/xianyu-hunter
SKILL_SRC=/Users/chick/.hermes/skills/social-media/xianyu-hunter-monitor
SKILL_DST=/tmp/xianyu-hunter-gitea-sync/skill/xianyu-hunter-monitor

rsync -a --delete \
  --exclude='.git/' \
  --exclude='node_modules/' \
  --exclude='browser-data/' \
  --exclude='.runtime/' \
  --exclude='xianyu-server.log' \
  --exclude='*.log' \
  --exclude='data/config.json' \
  --exclude='data/tasks.json' \
  --exclude='data/notify-config.json' \
  --exclude='reports/*.md' \
  "$SRC/" "$DST/"

mkdir -p "$DST/reports"
touch "$DST/reports/.gitkeep"
rsync -a --delete "$SKILL_SRC/" "$SKILL_DST/"

Preserve/restore package examples that should remain committed even if absent locally, e.g. project/xianyu-hunter/data/notify-config.example.json:

cat > /tmp/xianyu-hunter-gitea-sync/project/xianyu-hunter/data/notify-config.example.json <<'EOF'
{
  "enabled": false,
  "notifyOnlyGood": true,
  "minScore": 75,
  "channels": []
}
EOF

Refresh the package .gitignore so runtime data cannot be committed:

cat > /tmp/xianyu-hunter-gitea-sync/.gitignore <<'EOF'
.DS_Store
node_modules/
browser-data/
.runtime/
*.log
project/xianyu-hunter/node_modules/
project/xianyu-hunter/browser-data/
project/xianyu-hunter/.runtime/
project/xianyu-hunter/data/config.json
project/xianyu-hunter/data/tasks.json
project/xianyu-hunter/data/notify-config.json
project/xianyu-hunter/reports/*.md
EOF

Verification before commit

cd /tmp/xianyu-hunter-gitea-sync
node --check project/xianyu-hunter/server.mjs
node --check project/xianyu-hunter/lib/login.mjs
node --check project/xianyu-hunter/lib/hermes_optimizer.mjs
node --check project/xianyu-hunter/public/app.js

git status --short --ignored
git ls-files | grep -E 'browser-data|data/(config|tasks|notify-config)\.json|node_modules|\.runtime|reports/.*\.md' || true

Expected sensitive-file grep output is empty. Review git diff --stat and representative diffs before committing.

Commit and push safely

cd /tmp/xianyu-hunter-gitea-sync
git config user.name 'Hermes Agent'
git config user.email 'Hermes@Hermes.Hermes'
git add .
git commit -m 'feat: update xianyu web login and Hermes optimizer'

git remote set-url origin "https://${GITEA_USERNAME:-Hermes}:${GITEA_TOKEN}@${GITEA_URL#https://}/$OWNER/$REPO.git"
git push origin main
# scrub token immediately
git remote set-url origin "$GITEA_URL/$OWNER/$REPO.git"
git remote -v

Commit pushed during the notification-link fix:

ad48715664900040e8b92f3d987357694fea2835
fix: make xianyu notifications per-item with clickable links

Representative files to raw-verify for this class of update:

for f in \
  project/xianyu-hunter/lib/links.mjs \
  project/xianyu-hunter/lib/notifier.mjs \
  skill/xianyu-hunter-monitor/references/per-item-notifications-feishu-links-2026-05.md \
  project/xianyu-hunter/data/notify-config.example.json; do
  curl -sS -L -o /tmp/gitea_raw_check \
    -w "$f HTTP %{http_code} size=%{size_download}\n" \
    "$GITEA_URL/$OWNER/$REPO/raw/branch/main/$f"
done

Also confirm project/xianyu-hunter/lib/notifier.mjs raw content contains perItem, maxNotifyItems, and 打开闲鱼商品.

Post-push verification

curl -sS -H "Authorization: token $GITEA_TOKEN" \
  -o /tmp/gitea_repo_verify.json \
  -w 'HTTP %{http_code} size=%{size_download}\n' \
  "$GITEA_URL/api/v1/repos/$OWNER/$REPO"

git ls-remote "$GITEA_URL/$OWNER/$REPO.git" HEAD refs/heads/main

for f in \
  project/xianyu-hunter/lib/hermes_optimizer.mjs \
  project/xianyu-hunter/lib/login.mjs \
  skill/xianyu-hunter-monitor/references/web-qr-source-and-hermes-optimize-2026-05.md; do
  curl -sS -L -o /tmp/gitea_raw_check \
    -w "$f HTTP %{http_code} size=%{size_download}\n" \
    "$GITEA_URL/$OWNER/$REPO/raw/branch/main/$f"
done

Report the repo URL, commit hash, and verification results back to BOSS in the final visible reply. Do not leave an empty response after tool calls.