#!/bin/bash # Check if all required parameters are provided if [ "$#" -ne 3 ]; then echo "Usage: $0 " exit 1 fi # Assign parameters to variables USERNAME="$1" DOMAIN="$2" ID="$3" # Install required packages sudo apt install cron nginx ca-certificates curl -y # Configure web server permissions and files sudo chown -R "$USERNAME:$USERNAME" /var/www rm /var/www/html/index.nginx-debian.html # Create index.html cat >/var/www/html/index.html <<'EOF' John Doe - Professional Portfolio

John Doe

Full Stack Developer

About Me

Passionate full-stack developer with 5+ years of experience building scalable web applications. I specialize in modern JavaScript frameworks and cloud architecture.

Featured Projects

E-commerce Platform

A full-featured e-commerce solution built with React and Node.js, featuring real-time inventory management and secure payment processing.

Task Management App

A collaborative task management application using Vue.js and Firebase, with real-time updates and team collaboration features.

Analytics Dashboard

A responsive analytics dashboard built with D3.js and Express, providing real-time data visualization and reporting capabilities.

Skills

JavaScript React Node.js Python SQL AWS Docker Git

Contact Me

© 2025 John Doe. All rights reserved.

EOF # Initial nginx configuration sudo tee /etc/nginx/nginx.conf >/dev/null < /dev/null sudo apt update # Install Docker sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y # Install Open WebUI sudo docker pull ghcr.io/open-webui/open-webui:main sudo docker run -d -p 8888:8080 -v open-webui:/app/backend/data --name open-webui ghcr.io/open-webui/open-webui:main sudo docker update --restart=unless-stopped open-webui # Install X sudo bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install # Setup certificates mkdir ~/cert ~/.acme.sh/acme.sh --install-cert -d "$DOMAIN" --ecc --fullchain-file ~/cert/x.crt --key-file ~/cert/x.key chmod +r ~/cert/x.key # Create certificate renewal script cat >~/cert/cert-renew.sh <temp_cron echo "0 1 1 * * bash /home/$USERNAME/cert/cert-renew.sh" >>temp_cron crontab temp_cron rm temp_cron # Configure X sudo tee /usr/local/etc/xray/config.json >/dev/null </dev/null <<'EOF' net.core.default_qdisc=fq net.ipv4.tcp_congestion_control=bbr EOF # Final nginx configuration sudo tee /etc/nginx/nginx.conf >/dev/null <