Files
n8n-install/scripts/06_final_report.sh
Yury Kossakovsky 394e4669eb Refactor installation summary logging in final report generation
- Moved the installation summary logging from 06_final_report.sh to install.sh to ensure it is displayed immediately after the installation steps.
- Improved the organization of the final report generation process by consolidating related logging functionality.
- Enhanced user visibility of installation steps performed during the setup process.
2025-05-22 11:34:45 -06:00

209 lines
7.6 KiB
Bash
Executable File

#!/bin/bash
set -e
# Source the utilities file
source "$(dirname "$0")/utils.sh"
# Get the directory where the script resides
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
PROJECT_ROOT="$( cd "$SCRIPT_DIR/.." &> /dev/null && pwd )"
ENV_FILE="$PROJECT_ROOT/.env"
# Check if .env file exists
if [ ! -f "$ENV_FILE" ]; then
log_error "The .env file ('$ENV_FILE') was not found."
exit 1
fi
# Load environment variables from .env file
# Use set -a to export all variables read from the file
set -a
source "$ENV_FILE"
set +a
# Function to check if a profile is active
is_profile_active() {
local profile_to_check="$1"
# COMPOSE_PROFILES is sourced from .env and will be available here
if [ -z "$COMPOSE_PROFILES" ]; then
return 1 # Not active if COMPOSE_PROFILES is empty or not set
fi
# Check if the profile_to_check is in the comma-separated list
# Adding commas at the beginning and end of both strings handles edge cases
# (e.g., single profile, profile being a substring of another)
if [[ ",$COMPOSE_PROFILES," == *",$profile_to_check,"* ]]; then
return 0 # Active
else
return 1 # Not active
fi
}
# --- Service Access Credentials ---
# Display credentials, checking if variables exist
echo
echo "======================================================================="
echo
log_info "Service Access Credentials. Save this information securely!"
# Display credentials, checking if variables exist
if is_profile_active "n8n"; then
echo
echo "================================= n8n ================================="
echo
echo "Host: ${N8N_HOSTNAME:-<hostname_not_set>}"
fi
if is_profile_active "open-webui"; then
echo
echo "================================= WebUI ==============================="
echo
echo "Host: ${WEBUI_HOSTNAME:-<hostname_not_set>}"
fi
if is_profile_active "flowise"; then
echo
echo "================================= Flowise ============================="
echo
echo "Host: ${FLOWISE_HOSTNAME:-<hostname_not_set>}"
echo "User: ${FLOWISE_USERNAME:-<not_set_in_env>}"
echo "Password: ${FLOWISE_PASSWORD:-<not_set_in_env>}"
fi
if is_profile_active "supabase"; then
echo
echo "================================= Supabase ============================"
echo
echo "External Host (via Caddy): ${SUPABASE_HOSTNAME:-<hostname_not_set>}"
echo "Internal API Gateway: http://kong:8000"
echo "Studio User: ${DASHBOARD_USERNAME:-<not_set_in_env>}"
echo "Studio Password: ${DASHBOARD_PASSWORD:-<not_set_in_env>}"
echo
echo "================================= PostgreSQL (Supabase) ============================"
echo
echo "Host: ${POSTGRES_HOST:-db}" # Note: Supabase uses 'db' as the hostname for its internal Postgres by default
echo "Port: ${POSTGRES_PORT:-5432}"
echo "Database: ${POSTGRES_DB:-postgres}"
echo "User: ${POSTGRES_USER:-postgres}"
echo "Password: ${POSTGRES_PASSWORD:-<not_set_in_env>}"
fi
if is_profile_active "langfuse"; then
echo
echo "================================= Langfuse ============================"
echo
echo "Host: ${LANGFUSE_HOSTNAME:-<hostname_not_set>}"
echo "User: ${LANGFUSE_INIT_USER_EMAIL:-<not_set_in_env>}"
echo "Password: ${LANGFUSE_INIT_USER_PASSWORD:-<not_set_in_env>}"
fi
if is_profile_active "monitoring"; then
echo
echo "================================= Grafana ============================="
echo
echo "Host: ${GRAFANA_HOSTNAME:-<hostname_not_set>}"
echo "User: admin"
echo "Password: ${GRAFANA_ADMIN_PASSWORD:-<not_set_in_env>}"
echo
echo "================================= Prometheus =========================="
echo
echo "Host: ${PROMETHEUS_HOSTNAME:-<hostname_not_set>}"
echo "User: ${PROMETHEUS_USERNAME:-<not_set_in_env>}"
echo "Password: ${PROMETHEUS_PASSWORD:-<not_set_in_env>}"
fi
if is_profile_active "searxng"; then
echo
echo "================================= Searxng ============================="
echo
echo "Host: ${SEARXNG_HOSTNAME:-<hostname_not_set>}"
echo "User: ${SEARXNG_USERNAME:-<not_set_in_env>}"
echo "Password: ${SEARXNG_PASSWORD:-<not_set_in_env>}"
fi
if is_profile_active "qdrant"; then
echo
echo "================================= Qdrant =============================="
echo
echo "Internal gRPC Access (e.g., from backend): qdrant:6333"
echo "Internal REST API Access (e.g., from backend): http://qdrant:6334"
echo "(Note: Not exposed externally via Caddy by default)"
fi
if is_profile_active "crawl4ai"; then
echo
echo "================================= Crawl4AI ============================"
echo
echo "Internal Access (e.g., from n8n): http://crawl4ai:11235"
echo "(Note: Not exposed externally via Caddy by default)"
fi
if is_profile_active "n8n" || is_profile_active "langfuse"; then
echo
echo "================================= Redis (Valkey) ======================"
echo
echo "Internal Host: ${REDIS_HOST:-redis}"
echo "Internal Port: ${REDIS_PORT:-6379}"
echo "Password: ${REDIS_AUTH:-LOCALONLYREDIS} (Note: Default if not set in .env)"
echo "(Note: Primarily for internal service communication, not exposed externally by default)"
fi
if is_profile_active "letta"; then
echo
echo "================================= Letta ================================"
echo
echo "Host: ${LETTA_HOSTNAME:-<hostname_not_set>}"
echo "Authorization: Bearer ${LETTA_SERVER_PASSWORD}"
fi
if is_profile_active "cpu" || is_profile_active "gpu-nvidia" || is_profile_active "gpu-amd"; then
echo
echo "================================= Ollama =============================="
echo
echo "Internal Access (e.g., from n8n, Open WebUI): http://ollama:11434"
echo "(Note: Ollama runs with the selected profile: cpu, gpu-nvidia, or gpu-amd)"
fi
# Standalone PostgreSQL (used by n8n, Langfuse, etc.)
# Check if n8n or langfuse is active, as they use this PostgreSQL instance.
# The Supabase section already details its own internal Postgres.
if is_profile_active "n8n" || is_profile_active "langfuse"; then
# Check if Supabase is NOT active, to avoid confusion with Supabase's Postgres if both are present
# However, the main POSTGRES_PASSWORD is used by this standalone instance.
# Supabase has its own environment variables for its internal Postgres if configured differently,
# but the current docker-compose.yml uses the main POSTGRES_PASSWORD for langfuse's postgres dependency too.
# For clarity, we will label this distinctly.
echo
echo "==================== Standalone PostgreSQL (for n8n, Langfuse, etc.) ====================="
echo
echo "Host: ${POSTGRES_HOST:-postgres}"
echo "Port: ${POSTGRES_PORT:-5432}"
echo "Database: ${POSTGRES_DB:-postgres}" # This is typically 'postgres' or 'n8n' for n8n, and 'langfuse' for langfuse, but refers to the service.
echo "User: ${POSTGRES_USER:-postgres}"
echo "Password: ${POSTGRES_PASSWORD:-<not_set_in_env>}"
echo "(Note: This is the PostgreSQL instance used by services like n8n and Langfuse.)"
echo "(It is separate from Supabase's internal PostgreSQL if Supabase is also enabled.)"
fi
echo
echo "======================================================================="
echo
# --- Update Script Info (Placeholder) ---
log_info "To update the services, run the 'update.sh' script: bash ./scripts/update.sh"
echo
echo "======================================================================"
echo
echo "Next Steps:"
echo "1. Review the credentials above and store them safely."
echo "2. Access the services via their respective URLs (check \`docker compose ps\` if needed)."
echo "3. Configure services as needed (e.g., first-run setup for n8n)."
echo
echo "======================================================================"
echo
log_info "Thank you for using this installer setup!"
echo
exit 0