refactor: centralize port config + fix 8082 conflict

- Add EMBED_URL, OLLAMA_URL, LLM_HEALTH_URL to config.rs
- Fix health.rs hardcoded ports → config references
- Fix sync_db.rs Ollama URL → config::OLLAMA_URL
- Create config/port_registry.tsv (single source of truth for ports)
- Remove Caddy 8082 proxy block (port belongs to LLM)
- Fix .env LLM_URL: localhost → 127.0.0.1 (avoid IPv6 Caddy conflict)
This commit is contained in:
M5Max128
2026-05-23 02:54:34 +08:00
parent a008bb865b
commit dddb5d4cbd
5 changed files with 43 additions and 12 deletions

22
config/port_registry.tsv Normal file
View File

@@ -0,0 +1,22 @@
# Port Registry - Momentry Core
# Each port must have exactly one owner.
# Before adding a service: pick a free port, add a row here, then configure.
#
# Port Service Owner Config Key Default Source
22 ssh sshd - - macOS
80 http Caddy - - Caddyfile
443 https Caddy - - Caddyfile
2019 caddy-admin Caddy - - Caddyfile (internal)
3000 gitea gitea - 3000 start_momentry.sh
3002 production momentry MOMENTRY_SERVER_PORT 3002 run-server-3002.sh
3003 playground momentry_playground MOMENTRY_SERVER_PORT 3003 start_momentry.sh
3200 dashboard Caddy - - Caddyfile
3306 mariadb mariadbd - 3306 start_momentry.sh
5432 postgresql postgres DATABASE_URL postgres://...:5432 start_momentry.sh
6379 redis redis-server REDIS_URL redis://...:6379 start_momentry.sh
6333 qdrant qdrant QDRANT_URL http://...:6333 start_momentry.sh
8081 wordpress Caddy - - Caddyfile
8082 llm llama-server MOMENTRY_LLM_CHAT_URL http://...:8082 start_momentry.sh
9000 php-fpm php-fpm - 9000 brew services
11434 ollama ollama MOMENTRY_OLLAMA_URL http://...:11434 start_momentry.sh
11436 embedding embeddinggemma MOMENTRY_EMBED_URL http://...:11436 start_momentry.sh
1 # Port Registry - Momentry Core
2 # Each port must have exactly one owner.
3 # Before adding a service: pick a free port, add a row here, then configure.
4 #
5 # Port Service Owner Config Key Default Source
6 22 ssh sshd - - macOS
7 80 http Caddy - - Caddyfile
8 443 https Caddy - - Caddyfile
9 2019 caddy-admin Caddy - - Caddyfile (internal)
10 3000 gitea gitea - 3000 start_momentry.sh
11 3002 production momentry MOMENTRY_SERVER_PORT 3002 run-server-3002.sh
12 3003 playground momentry_playground MOMENTRY_SERVER_PORT 3003 start_momentry.sh
13 3200 dashboard Caddy - - Caddyfile
14 3306 mariadb mariadbd - 3306 start_momentry.sh
15 5432 postgresql postgres DATABASE_URL postgres://...:5432 start_momentry.sh
16 6379 redis redis-server REDIS_URL redis://...:6379 start_momentry.sh
17 6333 qdrant qdrant QDRANT_URL http://...:6333 start_momentry.sh
18 8081 wordpress Caddy - - Caddyfile
19 8082 llm llama-server MOMENTRY_LLM_CHAT_URL http://...:8082 start_momentry.sh
20 9000 php-fpm php-fpm - 9000 brew services
21 11434 ollama ollama MOMENTRY_OLLAMA_URL http://...:11434 start_momentry.sh
22 11436 embedding embeddinggemma MOMENTRY_EMBED_URL http://...:11436 start_momentry.sh