From a008bb865b565bcae6e7f597d1beb6749bc653ac Mon Sep 17 00:00:00 2001 From: M5Max128 Date: Sat, 23 May 2026 02:37:19 +0800 Subject: [PATCH] feat: add Gitea to startup script, update AGENTS.md token - Add Gitea (port 3000) as step 10 in startup script - Update AGENTS.md Gitea token record --- AGENTS.md | 3 +-- scripts/start_momentry.sh | 30 +++++++++++++++++++++--------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 6cee131..ebdf62a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -581,8 +581,7 @@ git push origin main | 機器 | Token | |------|-------| -| M5Max128 | `a7cf946148063c2bfa8d59ad629ae541813f0db8` (write:repository) | -| M5Max128 (admin) | `b388aec114a93ae3ce752acf16a9ce678144541b` (write:repository + write:user) | +| M5Max128 | `c33768c4cc26c0f4c575dcce832e92e5cf192773` (write:repository + write:user) | **注意**: Token 有 write:repository scope,勿外洩。如需新增 token 給其他機器,各自產自己的 token。 diff --git a/scripts/start_momentry.sh b/scripts/start_momentry.sh index 82f7d70..1b5ade6 100755 --- a/scripts/start_momentry.sh +++ b/scripts/start_momentry.sh @@ -25,7 +25,7 @@ echo "" LOG_DIR="/Users/accusys/momentry/logs" # ── 1. PostgreSQL ── -echo -e "${YELLOW}[1/9] PostgreSQL${NC}" +echo -e "${YELLOW}[1/10] PostgreSQL${NC}" PG_DATA="/Users/accusys/momentry/var/postgresql" PG_BIN="/Users/accusys/pgsql/18.3/bin" if $PG_BIN/pg_isready -q 2>/dev/null; then @@ -37,7 +37,7 @@ else fi # ── 2. Redis ── -echo -e "${YELLOW}[2/9] Redis${NC}" +echo -e "${YELLOW}[2/10] Redis${NC}" if redis-cli ping 2>/dev/null | grep -q PONG; then echo -e " ${GREEN}✅${NC} already running" else @@ -47,7 +47,7 @@ else fi # ── 3. Qdrant ── -echo -e "${YELLOW}[3/9] Qdrant${NC}" +echo -e "${YELLOW}[3/10] Qdrant${NC}" QDRANT_BIN="/Users/accusys/momentry_resources/bin/qdrant" QDRANT_STORAGE="/Users/accusys/momentry/qdrant_storage" if curl -s -o /dev/null -w "%{http_code}" --connect-timeout 3 http://localhost:6333/healthz 2>/dev/null | grep -q 200; then @@ -66,7 +66,7 @@ else fi # ── 4. Qdrant Collection ── -echo -e "${YELLOW}[4/9] Qdrant Collection${NC}" +echo -e "${YELLOW}[4/10] Qdrant Collection${NC}" source "$ENV_FILE" 2>/dev/null || true COLLECTION="${QDRANT_COLLECTION:-momentry_dev_rule1_v2}" EXISTS=$(curl -s "http://localhost:6333/collections/$COLLECTION" 2>/dev/null | python3 -c "import sys,json; d=json.load(sys.stdin); print(d.get('result',{}).get('status','not_found'))" 2>/dev/null) @@ -80,7 +80,7 @@ curl -s "http://localhost:6333/collections/$COLLECTION" 2>/dev/null | python3 -c check "collection '$COLLECTION' ready" # ── 5. LLM (Gemma4 / llama.cpp) ── -echo -e "${YELLOW}[5/9] LLM Server (Gemma4)${NC}" +echo -e "${YELLOW}[5/10] LLM Server (Gemma4)${NC}" if curl -s -o /dev/null -w "%{http_code}" --connect-timeout 5 http://localhost:8082/health 2>/dev/null | grep -q 200; then echo -e " ${GREEN}✅${NC} already running" else @@ -98,7 +98,7 @@ else fi # ── 6. MariaDB ── -echo -e "${YELLOW}[6/9] MariaDB${NC}" +echo -e "${YELLOW}[6/10] MariaDB${NC}" MARIADB_BIN="/Users/accusys/momentry_resources/mariadb/bin/mariadbd" MARIADB_DATA="/Users/accusys/momentry/var/mysql" if [ -S /tmp/mysql.sock ] || /Users/accusys/momentry_resources/mariadb/bin/mariadb-admin ping --silent 2>/dev/null; then @@ -117,7 +117,7 @@ else fi # ── 7. Embedding Server ── -echo -e "${YELLOW}[7/9] EmbeddingGemma${NC}" +echo -e "${YELLOW}[7/10] EmbeddingGemma${NC}" if curl -s -o /dev/null -w "%{http_code}" --connect-timeout 5 http://localhost:11436/health 2>/dev/null | grep -q 200; then echo -e " ${GREEN}✅${NC} already running" else @@ -133,7 +133,7 @@ else fi # ── 8. Playground Server ── -echo -e "${YELLOW}[8/9] Playground API Server${NC}" +echo -e "${YELLOW}[8/10] Playground API Server${NC}" if curl -s -o /dev/null -w "%{http_code}" -H "X-API-Key: muser_68600856036340bcafc01930eb4bd839_1774418104_97221b69" --connect-timeout 5 http://127.0.0.1:3003/api/v1/agents/5w1h/status 2>/dev/null | grep -q 200; then echo -e " ${GREEN}✅${NC} already running" else @@ -144,7 +144,7 @@ else fi # ── 9. Caddy ── -echo -e "${YELLOW}[9/9] Caddy${NC}" +echo -e "${YELLOW}[9/10] Caddy${NC}" CADDY_BIN="/Users/accusys/momentry_resources/bin/caddy" CADDY_CONFIG="/Users/accusys/momentry/etc/Caddyfile" if curl -s -o /dev/null -w "%{http_code}" --connect-timeout 3 http://127.0.0.1:2019/config/ 2>/dev/null | grep -q 200; then @@ -155,6 +155,17 @@ else curl -s -o /dev/null -w "%{http_code}" --connect-timeout 3 http://127.0.0.1:2019/config/ 2>/dev/null | grep -q 200; check "started" fi +# ── 10. Gitea ── +echo -e "${YELLOW}[10/10] Gitea${NC}" +GITEA_BIN="/Users/accusys/momentry_resources/bin/gitea" +if curl -s -o /dev/null -w "%{http_code}" --connect-timeout 3 http://127.0.0.1:3000/api/v1/version 2>/dev/null | grep -q 200; then + echo -e " ${GREEN}✅${NC} already running" +else + "$GITEA_BIN" web --port 3000 > "$LOG_DIR/gitea.log" 2>&1 & + sleep 4 + curl -s -o /dev/null -w "%{http_code}" --connect-timeout 3 http://127.0.0.1:3000/api/v1/version 2>/dev/null | grep -q 200; check "started" +fi + echo "" if [ ${#FAILURES[@]} -eq 0 ]; then echo -e "${GREEN}====================================${NC}" @@ -176,4 +187,5 @@ echo " Qdrant: http://localhost:6333" echo " PostgreSQL: localhost:5432" echo " Redis: localhost:6379" echo " MariaDB: localhost:3306" +echo " Gitea: http://127.0.0.1:3000" echo ""