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

View File

@@ -78,7 +78,7 @@ impl SyncDb {
pub async fn embed_text(&self, text: &str) -> Result<Vec<f32>> {
let client = reqwest::Client::new();
let response = client
.post("http://localhost:11434/api/embeddings")
.post(&format!("{}/api/embeddings", crate::core::config::OLLAMA_URL.as_str()))
.json(&serde_json::json!({
"model": "all-minilm",
"prompt": text,