From fa9c52af3e04304751578a1ac66fd6fb0832b6a5 Mon Sep 17 00:00:00 2001 From: Yury Kossakovsky Date: Tue, 27 May 2025 14:45:07 -0600 Subject: [PATCH] Update configuration files to enhance Weaviate and Neo4j integration - Added Weaviate username, password, and API key placeholders to .env.example. - Updated Caddyfile to include Prometheus reverse proxy settings. - Enhanced docker-compose.yml with health checks and ulimits for Neo4j service. - Modified scripts to include Neo4j in the service selection and final report outputs. --- .env.example | 14 ++++++++++++-- Caddyfile | 16 ++++++++-------- docker-compose.yml | 29 ++++++++++++++++++++--------- scripts/04_wizard.sh | 1 + scripts/06_final_report.sh | 10 +++++++++- 5 files changed, 50 insertions(+), 20 deletions(-) diff --git a/.env.example b/.env.example index e91f378..f416871 100644 --- a/.env.example +++ b/.env.example @@ -67,16 +67,25 @@ DASHBOARD_PASSWORD= POOLER_TENANT_ID=1000 +############ +# [required] +# Weaviate username and password +############ + +WEAVIATE_USERNAME= +WEAVIATE_PASSWORD= +WEAVIATE_API_KEY= + + ############ # [required] # Neo4j username and password -# Replace "neo4j" with your chosen username and "password" with your chosen password. -# Keep the "/" as a separator between the two. ############ NEO4J_AUTH_USERNAME= NEO4J_AUTH_PASSWORD= + ############ # [required] # Langfuse credentials @@ -114,6 +123,7 @@ FLOWISE_HOSTNAME=flowise.yourdomain.com SUPABASE_HOSTNAME=supabase.yourdomain.com LANGFUSE_HOSTNAME=langfuse.yourdomain.com SEARXNG_HOSTNAME=searxng.yourdomain.com +WEAVIATE_HOSTNAME=weaviate.yourdomain.com NEO4J_HOSTNAME=neo4j.yourdomain.com GRAFANA_HOSTNAME=grafana.yourdomain.com PROMETHEUS_HOSTNAME=prometheus.yourdomain.com diff --git a/Caddyfile b/Caddyfile index e7fa8d0..1f2d6ed 100644 --- a/Caddyfile +++ b/Caddyfile @@ -35,6 +35,14 @@ reverse_proxy grafana:3000 } +# Prometheus +{$PROMETHEUS_HOSTNAME} { + basic_auth { + {$PROMETHEUS_USERNAME} {$PROMETHEUS_PASSWORD_HASH} + } + reverse_proxy prometheus:9090 +} + # Letta {$LETTA_HOSTNAME} { reverse_proxy letta:8283 @@ -48,14 +56,6 @@ reverse_proxy weaviate:8080 } -# Prometheus -{$PROMETHEUS_HOSTNAME} { - basic_auth { - {$PROMETHEUS_USERNAME} {$PROMETHEUS_PASSWORD_HASH} - } - reverse_proxy prometheus:9090 -} - # Neo4j {$NEO4J_HOSTNAME} { reverse_proxy neo4j:7474 diff --git a/docker-compose.yml b/docker-compose.yml index abf0c30..fb1725e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -159,6 +159,19 @@ services: - ./neo4j/plugins:/plugins environment: - NEO4J_AUTH=${NEO4J_AUTH_USERNAME}/${NEO4J_AUTH_PASSWORD} + healthcheck: + test: + [ + "CMD-SHELL", + "wget --no-verbose --tries=1 --spider http://localhost:7474 || exit 1", + ] + interval: 5s + timeout: 3s + retries: 5 + ulimits: + nofile: + soft: 40000 + hard: 40000 caddy: container_name: caddy @@ -178,6 +191,7 @@ services: - SUPABASE_HOSTNAME=${SUPABASE_HOSTNAME} - SEARXNG_HOSTNAME=${SEARXNG_HOSTNAME} - LANGFUSE_HOSTNAME=${LANGFUSE_HOSTNAME} + - WEAVIATE_HOSTNAME=${WEAVIATE_HOSTNAME} - NEO4J_HOSTNAME=${NEO4J_HOSTNAME} - LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL:-internal} - PROMETHEUS_HOSTNAME=${PROMETHEUS_HOSTNAME} @@ -508,9 +522,6 @@ services: container_name: weaviate profiles: ["weaviate"] restart: unless-stopped - ports: - - "8088:8080" # Internal port 8080, mapping to 8088 to avoid conflict if other services use 8080 on host - - "50059:50051" # Internal gRPC port 50051, mapping to 50059 volumes: - weaviate_data:/var/lib/weaviate environment: @@ -518,13 +529,13 @@ services: AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: "false" AUTHENTICATION_APIKEY_ENABLED: "true" AUTHENTICATION_APIKEY_ALLOWED_KEYS: ${WEAVIATE_API_KEY} - AUTHENTICATION_APIKEY_USERS: ${WEAVIATE_USERNAME} # Or a generic user like 'admin' - AUTHORIZATION_ADMINLIST_ENABLED: "true" # Explicitly enable Admin List - AUTHORIZATION_ADMINLIST_USERS: ${WEAVIATE_USERNAME} # Grant admin rights to the API key user + AUTHENTICATION_APIKEY_USERS: ${WEAVIATE_USERNAME} + AUTHORIZATION_ENABLE_RBAC: "true" + AUTHORIZATION_RBAC_ROOT_USERS: ${WEAVIATE_USERNAME} PERSISTENCE_DATA_PATH: "/var/lib/weaviate" - ENABLE_API_BASED_MODULES: "true" # To allow integrations like OpenAI, Cohere etc. - CLUSTER_HOSTNAME: "node1" # Recommended for single node to avoid issues if hostname changes - DEFAULT_VECTORIZER_MODULE: "none" # Explicitly set to none, can be changed by user later + ENABLE_API_BASED_MODULES: "true" + CLUSTER_HOSTNAME: "node1" + DEFAULT_VECTORIZER_MODULE: "none" healthcheck: test: [ diff --git a/scripts/04_wizard.sh b/scripts/04_wizard.sh index 73853ce..ac8d6d3 100755 --- a/scripts/04_wizard.sh +++ b/scripts/04_wizard.sh @@ -56,6 +56,7 @@ base_services_data=( "qdrant" "Qdrant (Vector Database)" "supabase" "Supabase (Backend as a Service)" "weaviate" "Weaviate (Vector Database with API Key Auth)" + "neo4j" "Neo4j (Graph Database)" "monitoring" "Monitoring Suite (Prometheus, Grafana, cAdvisor, Node-Exporter)" "open-webui" "Open WebUI (ChatGPT-like Interface)" "searxng" "SearXNG (Private Metasearch Engine)" diff --git a/scripts/06_final_report.sh b/scripts/06_final_report.sh index 751f273..cfc9ab6 100755 --- a/scripts/06_final_report.sh +++ b/scripts/06_final_report.sh @@ -164,7 +164,15 @@ if is_profile_active "weaviate"; then echo "User: ${WEAVIATE_USERNAME:-}" echo "Password: ${WEAVIATE_PASSWORD:-}" echo "Weaviate API Key: ${WEAVIATE_API_KEY:-}" - echo "(Internal Weaviate Port: 8080, gRPC: 50051)" +fi + +if is_profile_active "neo4j"; then + echo + echo "================================= Neo4j ===============================" + echo + echo "Host: ${NEO4J_HOSTNAME:-}" + echo "User: ${NEO4J_AUTH_USERNAME:-}" + echo "Password: ${NEO4J_AUTH_PASSWORD:-}" fi # Standalone PostgreSQL (used by n8n, Langfuse, etc.)