easy-install.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/bin/bash
  2. # Check if Docker is installed
  3. if ! [ -x "$(command -v docker)" ]; then
  4. read -p "Docker is not installed. Do you want to install Docker? (Y/n): " INSTALL_DOCKER
  5. if [ ${INSTALL_DOCKER:-Y} == "Y" ]; then
  6. sudo su -c "bash <(wget -qO- https://get.docker.com)" root
  7. apt install -y docker-compose
  8. else
  9. echo "Exiting setup. Docker installation required."
  10. exit 1
  11. fi
  12. fi
  13. # Continue with the rest of the script...
  14. # Clone the git repository
  15. git clone https://github.com/samrandhaji/v2ray-nginx-cloudflare.git
  16. cd v2ray-nginx-cloudflare
  17. # Generate random UUID
  18. read -p "Do you want to use a custom UUID? (Y/n): " CUSTOM_UUID
  19. if [ ${CUSTOM_UUID:-N} == "Y" ]; then
  20. read -p "Enter your custom UUID: " UUID
  21. else
  22. UUID=$(cat /proc/sys/kernel/random/uuid)
  23. fi
  24. # Update the <UPSTREAM-UUID> field in config.json
  25. sed -i "s#<UPSTREAM-UUID>#$UUID#g" ./v2ray/config/config.json
  26. # Prompt for domain and email
  27. read -p "Enter your domain: " DOMAIN
  28. read -p "Enter your email: " EMAIL
  29. # Replace placeholders in docker-compose.yml
  30. sed -i "s#YOUR_DOMAIN#$DOMAIN#g" ./docker-compose.yml
  31. sed -i "s#YOUR_EMAIL#$EMAIL#g" ./docker-compose.yml
  32. # Compose the Docker setup
  33. docker-compose up -d
  34. # Prompt for CDN usage
  35. read -p "Now go and adjust CDN Settings: In your CDN, activate the proxy option for the record to enhance the delivery capabilities. When you finished press Enter " USE_CDN
  36. if [ ${USE_CDN:-Y} == "Y" ]; then
  37. # Turn on proxy mode in A record inside the CDN
  38. # Run the vmess.py file
  39. chmod +x vmess.py
  40. ./vmess.py
  41. fi