diff --git a/setup/cluster-services/smtp/README.md b/setup/cluster-services/smtp/README.md new file mode 100644 index 0000000..6508347 --- /dev/null +++ b/setup/cluster-services/smtp/README.md @@ -0,0 +1,51 @@ +# SMTP Configuration Service + +This service configures SMTP settings for Wild Cloud applications to send transactional emails. + +## Overview + +The SMTP service doesn't deploy any Kubernetes resources. Instead, it helps configure global SMTP settings that can be used by Wild Cloud applications like Ghost, Gitea, and others for sending: + +- Password reset emails +- User invitation emails +- Notification emails +- Other transactional emails + +## Installation + +```bash +./setup/cluster-services/smtp/install.sh +``` + +## Configuration + +The setup script will prompt for: + +- **SMTP Host**: Your email provider's SMTP server (e.g., `email-smtp.us-east-2.amazonaws.com` for AWS SES) +- **SMTP Port**: Usually `465` for SSL or `587` for STARTTLS +- **SMTP User**: Username or access key for authentication +- **From Address**: Default sender email address +- **SMTP Password**: Your password, secret key, or API key (entered securely) + +## Supported Providers + +- **AWS SES**: Use your Access Key ID as user and Secret Access Key as password +- **Gmail/Google Workspace**: Use your email as user and an App Password as password +- **SendGrid**: Use `apikey` as user and your API key as password +- **Mailgun**: Use your Mailgun username and password +- **Other SMTP providers**: Use your standard SMTP credentials + +## Applications That Use SMTP + +- **Ghost**: User management, password resets, notifications +- **Gitea**: User registration, password resets, notifications +- **OpenProject**: User invitations, notifications +- **Future applications**: Any app that needs to send emails + +## Testing + +After configuration, test SMTP by: + +1. Deploying an application that uses email (like Ghost) +2. Using password reset or user invitation features +3. Checking application logs for SMTP connection issues \ No newline at end of file diff --git a/setup/cluster-services/smtp/install.sh b/setup/cluster-services/smtp/install.sh new file mode 100755 index 0000000..34933fb --- /dev/null +++ b/setup/cluster-services/smtp/install.sh @@ -0,0 +1,52 @@ +#!/bin/bash +set -e +set -o pipefail + +# Initialize Wild Cloud environment +if [ -z "${WC_ROOT}" ]; then + print "WC_ROOT is not set." + exit 1 +else + source "${WC_ROOT}/scripts/common.sh" + init_wild_env +fi + +print_header "Setting up SMTP Configuration" + +print_info "SMTP configuration allows Wild Cloud applications to send transactional emails" +print_info "(password resets, notifications, etc.) through your email service provider." +echo "" + +# Collect SMTP configuration +print_info "Collecting SMTP configuration..." + +prompt_if_unset_config "cloud.smtp.host" "Enter SMTP host (e.g., email-smtp.us-east-2.amazonaws.com for AWS SES)" "" +prompt_if_unset_config "cloud.smtp.port" "Enter SMTP port (usually 465 for SSL, 587 for STARTTLS)" "465" +prompt_if_unset_config "cloud.smtp.user" "Enter SMTP username/access key" "" +prompt_if_unset_config "cloud.smtp.from" "Enter default 'from' email address" "no-reply@$(wild-config cloud.domain)" + +print_success "SMTP configuration collected successfully" + +# Collect SMTP password/secret +print_info "Setting up SMTP password..." +echo "" +echo "For AWS SES, this would be your Secret Access Key." +echo "For Gmail/Google Workspace, this would be an App Password." +echo "For other providers, this would be your SMTP password." +echo "" + +prompt_if_unset_secret "cloud.smtp.password" "Enter SMTP password/secret key" "" + +print_success "SMTP configuration setup complete!" +echo "" +echo "Your SMTP settings:" +echo " Host: $(wild-config cloud.smtp.host)" +echo " Port: $(wild-config cloud.smtp.port)" +echo " User: $(wild-config cloud.smtp.user)" +echo " From: $(wild-config cloud.smtp.from)" +echo " Password: $(wild-secret cloud.smtp.password >/dev/null 2>&1 && echo "✓ Set" || echo "✗ Not set")" +echo "" +echo "Applications that use SMTP: ghost, gitea, and others" +echo "" +echo "To test SMTP configuration, deploy an app that uses email (like Ghost)" +echo "and try the password reset or user invitation features." \ No newline at end of file