Enhance email and OpenAI API key prompts in secret generation script

- Added conditional checks to ensure prompts for user email and OpenAI API key are only displayed if the respective environment variables are not set, improving user experience and preventing unnecessary input requests.
This commit is contained in:
Yury Kossakovsky
2025-05-28 19:16:19 -06:00
parent 3833595172
commit 296f559a3b

View File

@@ -135,14 +135,16 @@ else
fi
# Prompt for user email
echo ""
echo "Please enter your email address. This email will be used for:"
echo " - Login to Flowise"
echo " - Login to Supabase"
echo " - Login to SearXNG"
echo " - Login to Grafana"
echo " - Login to Prometheus"
echo " - SSL certificate generation with Let's Encrypt"
if [[ -z "${existing_env_vars[LETSENCRYPT_EMAIL]}" ]]; then
echo ""
echo "Please enter your email address. This email will be used for:"
echo " - Login to Flowise"
echo " - Login to Supabase"
echo " - Login to SearXNG"
echo " - Login to Grafana"
echo " - Login to Prometheus"
echo " - SSL certificate generation with Let\'s Encrypt"
fi
if [[ -n "${existing_env_vars[LETSENCRYPT_EMAIL]}" ]]; then
USER_EMAIL="${existing_env_vars[LETSENCRYPT_EMAIL]}"
@@ -173,11 +175,13 @@ else
fi
# Prompt for OpenAI API key (optional)
echo ""
echo "OpenAI API Key (optional). This key will be used for:"
echo " - Supabase: AI services to help with writing SQL queries, statements, and policies"
echo " - Crawl4AI: Default LLM configuration for web crawling capabilities"
echo " You can skip this by leaving it empty."
if [[ ! -v existing_env_vars[OPENAI_API_KEY] || -z "${existing_env_vars[OPENAI_API_KEY]}" ]]; then
echo ""
echo "OpenAI API Key (optional). This key will be used for:"
echo " - Supabase: AI services to help with writing SQL queries, statements, and policies"
echo " - Crawl4AI: Default LLM configuration for web crawling capabilities"
echo " You can skip this by leaving it empty."
fi
if [[ -v existing_env_vars[OPENAI_API_KEY] ]]; then # -v checks if variable is set (even if empty)
OPENAI_API_KEY="${existing_env_vars[OPENAI_API_KEY]}"