#!/bin/bash # ============================================================ # EEG Portal - SSL Setup Script # Run this after DNS is configured and pointing to your server # ============================================================ set -e echo "=== SSL Setup for EEG Portal ===" echo "" # Check if domain is provided if [ -z "$1" ]; then echo "Usage: $0 " echo "Example: $0 eeg-portal.at" exit 1 fi DOMAIN=$1 echo "Setting up SSL for: $DOMAIN" echo "" # Stop nginx container temporarily echo "Stopping nginx container..." docker stop eeg-frontend # Get SSL certificate echo "Getting SSL certificate from Let's Encrypt..." certbot certonly --standalone -d $DOMAIN --non-interactive --agree-tos --email admin@$DOMAIN # Update nginx config with domain echo "Updating nginx configuration..." sed -i "s/your-domain.at/$DOMAIN/g" nginx-ssl.conf # Copy SSL config echo "Activating SSL configuration..." cp nginx-ssl.conf /etc/nginx/conf.d/default.conf # Start nginx container echo "Starting nginx container..." docker start eeg-frontend echo "" echo "=== SSL setup complete! ===" echo "" echo "Your site is now available at: https://$DOMAIN" echo "" echo "Note: Certbot auto-renewal is set up. Certificate will be renewed automatically."