diff --git a/.env.development b/.env.development index 93c0ab9..c8cf21c 100644 --- a/.env.development +++ b/.env.development @@ -23,8 +23,8 @@ MONGODB_URL=mongodb://localhost:27017 MONGODB_DATABASE=momentry_dev # Redis (already isolated via prefix) -REDIS_URL=redis://:accusys@localhost:6379 -REDIS_PASSWORD=accusys +REDIS_URL=redis://127.0.0.1:6379 +# REDIS_PASSWORD not set - Redis has no password configured # Qdrant Vector Database - Collection isolation QDRANT_URL=http://localhost:6333 @@ -37,8 +37,8 @@ MOMENTRY_BACKUP_DIR=/Users/accusys/momentry/backup/momentry_dev MOMENTRY_SFTP_ROOT=/Users/accusys/momentry/var/sftpgo/data/demo/ # Python (for processing scripts) -MOMENTRY_PYTHON_PATH=/opt/homebrew/bin/python3.11 -MOMENTRY_SCRIPTS_DIR=/Users/accusys/momentry_core_0.1/scripts +MOMENTRY_PYTHON_PATH=/Users/accusys/momentry_core/venv/bin/python +MOMENTRY_SCRIPTS_DIR=/Users/accusys/momentry_core/scripts # Logging RUST_LOG=debug diff --git a/src/api/server.rs b/src/api/server.rs index dd08fd1..7497bf5 100644 --- a/src/api/server.rs +++ b/src/api/server.rs @@ -34,9 +34,14 @@ pub async fn start_server(host: &str, port: u16) -> anyhow::Result<()> { let embedder = std::sync::Arc::new(Embedder::new("nomic-embed-text-v2-moe:latest".to_string())); - // MongoDB is ONLY a cache layer — if unavailable, the server continues - // with Redis cache alone. This keeps both 3002 and 3003 bootable - // without requiring MongoDB to be installed or running. + // ── ⚠️ WARNING: DO NOT move MongoCache::init() back to critical path ── + // + // MongoDB is ONLY a cache layer — if unavailable, the server MUST still + // start with Redis cache alone. This keeps 3002 bootable on machines + // without MongoDB installed. If you add a new dependency here, ask: + // "Can this service degrade gracefully if the dependant is missing?" + // + // See also: MongoCache::disabled() in mongo_cache.rs let mongo_cache = match timeout(Duration::from_secs(5), MongoCache::init()).await { Ok(Ok(cache)) => cache, Ok(Err(e)) => { diff --git a/src/core/config.rs b/src/core/config.rs index 545f58c..140b48b 100644 --- a/src/core/config.rs +++ b/src/core/config.rs @@ -132,19 +132,6 @@ pub static SYSTEM_TIMEZONE: Lazy = Lazy::new(|| { pub static MONGODB_DATABASE: Lazy = Lazy::new(|| env::var("MONGODB_DATABASE").unwrap_or_else(|_| "momentry".to_string())); -pub static EMBED_URL: Lazy = - Lazy::new(|| env::var("MOMENTRY_EMBED_URL").unwrap_or_else(|_| "http://localhost:11436".to_string())); - -pub static OLLAMA_URL: Lazy = - Lazy::new(|| env::var("MOMENTRY_OLLAMA_URL").unwrap_or_else(|_| "http://localhost:11434".to_string())); - -/// LLM health endpoint derived from CHAT_URL. -/// e.g. "http://127.0.0.1:8082/v1/chat/completions" → "http://127.0.0.1:8082/health" -pub static LLM_HEALTH_URL: Lazy = Lazy::new(|| { - let chat = llm::CHAT_URL.clone(); - chat.trim_end_matches("/v1/chat/completions").to_string() + "/health" -}); - pub static QDRANT_COLLECTION: Lazy = Lazy::new(|| env::var("QDRANT_COLLECTION").unwrap_or_else(|_| "momentry_rule1".to_string()));