#!/bin/bash # This script sets up the VPS with the correct Nginx configuration and deploys the website # Check if .env file exists if [ ! -f .env ]; then echo "Error: .env file not found. Please create it based on .env.example." exit 1 fi # Source the .env file source .env # Check if sshpass is installed if ! command -v sshpass &> /dev/null; then echo "sshpass is not installed. Installing it now..." ./install-sshpass.sh # Check if installation was successful if ! command -v sshpass &> /dev/null; then echo "Error: Failed to install sshpass. Please install it manually." exit 1 fi fi echo "=== Setting up VPS for boilerhaus.org (IP: $SERVER_IP) ===" echo "" # Step 1: Update Nginx configuration echo "Step 1: Updating Nginx configuration..." ./update-nginx-config.sh # Step 2: Deploy website echo "" echo "Step 2: Deploying website..." ./deploy-website.sh echo "" echo "=== Setup complete! ===" echo "Your domains should now be configured as follows:" echo "- boilerhaus.org → Main website" echo "- bw.boilerhaus.org → Vaultwarden instance" echo "- cloud.boilerhaus.org → Nextcloud dashboard" echo "- git.boilerhaus.org → Gitea instance" echo "" echo "Please allow a few minutes for DNS changes to propagate."