Wire in GPU optimizations and Gitea↔GitHub sync

Ollama config (all 3 setup scripts):
- Models updated from Qwen 2.5 → Qwen 3.5 series (Feb 2026)
- Auto-detect multi-GPU: TOTAL_VRAM = per-card × count
- KV cache quantization (q8_0) + flash attention enabled by default
- Context windows scaled by total VRAM (4K→128K)
- RAG server CHAT_MODEL now uses detected model variable

Gitea↔GitHub sync (new):
- gitea-github-sync.sh: bidirectional mirror with --init wizard
- Modes: --pull-only, --push-only, --list (dry run), --repo single
- Auto-discovers repos from both platforms via API
- Systemd timer: --install-timer [interval] for scheduled sync
- MCP tool: gitea_github_sync() for on-demand from Claude/WebUI
- Sync script mounted read-only into mcp-server container
- .env gets GITEA_URL variable for sync script
- curl added to mcp-server container deps

https://claude.ai/code/session_01PtYTPherSJaxDEVPgF6Nxu
This commit is contained in:
Claude
2026-03-22 17:47:05 +00:00
parent 0f57690692
commit 8989815afa
5 changed files with 609 additions and 70 deletions
+19
View File
@@ -180,6 +180,25 @@ def github_api(method: str, endpoint: str, body: str = "") -> str:
except Exception:
return r.text
# ── Gitea ↔ GitHub sync ──────────────────────────────────────────────────────
@mcp.tool()
def gitea_github_sync(mode: str = "all", repo: str = "") -> str:
"""Run Gitea↔GitHub mirror sync. mode: all|pull|push|list. repo: optional owner/name."""
cmd = ["/app/gitea-github-sync.sh"]
if mode == "pull": cmd.append("--pull-only")
elif mode == "push": cmd.append("--push-only")
elif mode == "list": cmd.append("--list")
if repo:
cmd.extend(["--repo", repo])
try:
r = subprocess.run(cmd, capture_output=True, text=True, timeout=600,
env={**os.environ, "SYNC_ENV": "/app/.env"})
return (r.stdout + r.stderr).strip() or "Sync completed (no output)"
except subprocess.TimeoutExpired:
return "Sync timed out after 10 minutes"
except Exception as e:
return f"Sync failed: {e}"
# ── RAG ingest ────────────────────────────────────────────────────────────────
@mcp.tool()
def ingest_repo(url: str, name: str = "", branch: str = "main") -> str: