mirror of
https://github.com/kossakovsky/n8n-install.git
synced 2026-03-07 22:33:11 +00:00
Add Portainer integration as an optional service
- Updated .env.example to include PORTAINER_HOSTNAME, PORTAINER_USERNAME, PORTAINER_PASSWORD, and PORTAINER_PASSWORD_HASH for configuration. - Modified Caddyfile to add a reverse proxy for Portainer with basic authentication. - Enhanced docker-compose.yml to include a new Portainer service and associated volume. - Updated scripts to generate Portainer credentials and include it in the setup wizard and final report. - Documented the integration process and reflections in the memory bank for future reference.
This commit is contained in:
@@ -41,6 +41,7 @@ declare -A VARS_TO_GENERATE=(
|
||||
["LOGFLARE_PUBLIC_ACCESS_TOKEN"]="fixed:not-in-use" # For supabase-vector, can't be empty
|
||||
["PROMETHEUS_PASSWORD"]="password:32" # Added Prometheus password
|
||||
["SEARXNG_PASSWORD"]="password:32" # Added SearXNG admin password
|
||||
["PORTAINER_PASSWORD"]="password:32" # Added Portainer password for Caddy basic_auth
|
||||
["LETTA_SERVER_PASSWORD"]="password:32" # Added Letta server password
|
||||
["LANGFUSE_INIT_USER_PASSWORD"]="password:32"
|
||||
["LANGFUSE_INIT_PROJECT_PUBLIC_KEY"]="langfuse_pk:32"
|
||||
@@ -368,6 +369,7 @@ generated_values["SEARXNG_USERNAME"]="$USER_EMAIL"
|
||||
generated_values["LANGFUSE_INIT_USER_EMAIL"]="$USER_EMAIL"
|
||||
generated_values["N8N_WORKER_COUNT"]="$N8N_WORKER_COUNT"
|
||||
generated_values["WEAVIATE_USERNAME"]="$USER_EMAIL" # Set Weaviate username for Caddy
|
||||
generated_values["PORTAINER_USERNAME"]="$USER_EMAIL" # Set Portainer username for Caddy
|
||||
|
||||
if [[ -n "$OPENAI_API_KEY" ]]; then
|
||||
generated_values["OPENAI_API_KEY"]="$OPENAI_API_KEY"
|
||||
@@ -391,6 +393,7 @@ found_vars["LANGFUSE_INIT_USER_EMAIL"]=0
|
||||
found_vars["N8N_WORKER_COUNT"]=0
|
||||
found_vars["WEAVIATE_USERNAME"]=0
|
||||
found_vars["NEO4J_AUTH_USERNAME"]=0
|
||||
found_vars["PORTAINER_USERNAME"]=0
|
||||
|
||||
# Read template, substitute domain, generate initial values
|
||||
while IFS= read -r line || [[ -n "$line" ]]; do
|
||||
@@ -437,7 +440,7 @@ while IFS= read -r line || [[ -n "$line" ]]; do
|
||||
# This 'else' block is for lines from template not covered by existing values or VARS_TO_GENERATE.
|
||||
# Check if it is one of the user input vars - these are handled by found_vars later if not in template.
|
||||
is_user_input_var=0 # Reset for each line
|
||||
user_input_vars=("FLOWISE_USERNAME" "DASHBOARD_USERNAME" "LETSENCRYPT_EMAIL" "RUN_N8N_IMPORT" "PROMETHEUS_USERNAME" "SEARXNG_USERNAME" "OPENAI_API_KEY" "LANGFUSE_INIT_USER_EMAIL" "N8N_WORKER_COUNT" "WEAVIATE_USERNAME" "NEO4J_AUTH_USERNAME")
|
||||
user_input_vars=("FLOWISE_USERNAME" "DASHBOARD_USERNAME" "LETSENCRYPT_EMAIL" "RUN_N8N_IMPORT" "PROMETHEUS_USERNAME" "SEARXNG_USERNAME" "OPENAI_API_KEY" "LANGFUSE_INIT_USER_EMAIL" "N8N_WORKER_COUNT" "WEAVIATE_USERNAME" "NEO4J_AUTH_USERNAME" "PORTAINER_USERNAME")
|
||||
for uivar in "${user_input_vars[@]}"; do
|
||||
if [[ "$varName" == "$uivar" ]]; then
|
||||
is_user_input_var=1
|
||||
@@ -520,7 +523,7 @@ if [[ -z "${generated_values[SERVICE_ROLE_KEY]}" ]]; then
|
||||
fi
|
||||
|
||||
# Add any custom variables that weren't found in the template
|
||||
for var in "FLOWISE_USERNAME" "DASHBOARD_USERNAME" "LETSENCRYPT_EMAIL" "RUN_N8N_IMPORT" "OPENAI_API_KEY" "PROMETHEUS_USERNAME" "SEARXNG_USERNAME" "LANGFUSE_INIT_USER_EMAIL" "N8N_WORKER_COUNT" "WEAVIATE_USERNAME" "NEO4J_AUTH_USERNAME"; do
|
||||
for var in "FLOWISE_USERNAME" "DASHBOARD_USERNAME" "LETSENCRYPT_EMAIL" "RUN_N8N_IMPORT" "OPENAI_API_KEY" "PROMETHEUS_USERNAME" "SEARXNG_USERNAME" "LANGFUSE_INIT_USER_EMAIL" "N8N_WORKER_COUNT" "WEAVIATE_USERNAME" "NEO4J_AUTH_USERNAME" "PORTAINER_USERNAME"; do
|
||||
if [[ ${found_vars["$var"]} -eq 0 && -v generated_values["$var"] ]]; then
|
||||
# Before appending, check if it's already in TMP_ENV_FILE to avoid duplicates
|
||||
if ! grep -q -E "^${var}=" "$TMP_ENV_FILE"; then
|
||||
@@ -631,6 +634,19 @@ if [[ -z "$FINAL_SEARXNG_HASH" && -n "$SEARXNG_PLAIN_PASS" ]]; then
|
||||
fi
|
||||
_update_or_add_env_var "SEARXNG_PASSWORD_HASH" "$FINAL_SEARXNG_HASH"
|
||||
|
||||
# --- PORTAINER ---
|
||||
PORTAINER_PLAIN_PASS="${generated_values["PORTAINER_PASSWORD"]}"
|
||||
FINAL_PORTAINER_HASH="${generated_values[PORTAINER_PASSWORD_HASH]}"
|
||||
|
||||
if [[ -z "$FINAL_PORTAINER_HASH" && -n "$PORTAINER_PLAIN_PASS" ]]; then
|
||||
NEW_HASH=$(_generate_and_get_hash "$PORTAINER_PLAIN_PASS")
|
||||
if [[ -n "$NEW_HASH" ]]; then
|
||||
FINAL_PORTAINER_HASH="$NEW_HASH"
|
||||
generated_values["PORTAINER_PASSWORD_HASH"]="$NEW_HASH"
|
||||
fi
|
||||
fi
|
||||
_update_or_add_env_var "PORTAINER_PASSWORD_HASH" "$FINAL_PORTAINER_HASH"
|
||||
|
||||
|
||||
if [ $? -eq 0 ]; then # This $? reflects the status of the last mv command from the last _update_or_add_env_var call.
|
||||
# For now, assuming if we reached here and mv was fine, primary operations were okay.
|
||||
|
||||
@@ -54,16 +54,17 @@ base_services_data=(
|
||||
"dify" "Dify (AI Application Development Platform with LLMOps)"
|
||||
"flowise" "Flowise (AI Agent Builder)"
|
||||
"monitoring" "Monitoring Suite (Prometheus, Grafana, cAdvisor, Node-Exporter)"
|
||||
"portainer" "Portainer (Docker management UI)"
|
||||
"langfuse" "Langfuse Suite (AI Observability - includes Clickhouse, Minio)"
|
||||
"qdrant" "Qdrant (Vector Database)"
|
||||
"supabase" "Supabase (Backend as a Service)"
|
||||
"weaviate" "Weaviate (Vector Database with API Key Auth)"
|
||||
"neo4j" "Neo4j (Graph Database)"
|
||||
"open-webui" "Open WebUI (ChatGPT-like Interface)"
|
||||
"searxng" "SearXNG (Private Metasearch Engine)"
|
||||
"crawl4ai" "Crawl4ai (Web Crawler for AI)"
|
||||
"letta" "Letta (Agent Server & SDK)"
|
||||
"gotenberg" "Gotenberg (Document Conversion API)"
|
||||
"crawl4ai" "Crawl4ai (Web Crawler for AI)"
|
||||
"open-webui" "Open WebUI (ChatGPT-like Interface)"
|
||||
"searxng" "SearXNG (Private Metasearch Engine)"
|
||||
"ollama" "Ollama (Local LLM Runner - select hardware in next step)"
|
||||
)
|
||||
|
||||
|
||||
@@ -127,6 +127,16 @@ if is_profile_active "searxng"; then
|
||||
echo "Password: ${SEARXNG_PASSWORD:-<not_set_in_env>}"
|
||||
fi
|
||||
|
||||
if is_profile_active "portainer"; then
|
||||
echo
|
||||
echo "================================= Portainer ==========================="
|
||||
echo
|
||||
echo "Host: ${PORTAINER_HOSTNAME:-<hostname_not_set>}"
|
||||
echo "User: ${PORTAINER_USERNAME:-<not_set_in_env>}"
|
||||
echo "Password: ${PORTAINER_PASSWORD:-<not_set_in_env>}"
|
||||
echo "(Note: On first login, Portainer will prompt to set up an admin user.)"
|
||||
fi
|
||||
|
||||
if is_profile_active "qdrant"; then
|
||||
echo
|
||||
echo "================================= Qdrant =============================="
|
||||
|
||||
Reference in New Issue
Block a user