#!/bin/bash set -e RED='\033[0;31m' YELLOW='\033[1;33m' GREEN='\033[0;32m' LIGHT_BLUE='\033[1;34m' NC='\033[0m' prompt() { local PROMPT_MESSAGE=$1 local DEFAULT_VALUE=$2 read -p "$PROMPT_MESSAGE [$DEFAULT_VALUE]: " INPUT echo "${INPUT:-$DEFAULT_VALUE}" } confirm_clean_install() { echo -e ${LIGHT_BLUE}"=================================================================${NC}" echo -e ${LIGHT_BLUE}" Pterodactyl Wings Installer for Debian 12 by VS-Shop ${NC}" echo -e ${LIGHT_BLUE}"=================================================================${NC}" echo -e "${YELLOW}This installation script requires a clean installation of Debian 12 (Bookworm).${NC}" echo -e "${YELLOW}Please confirm you are running it on a fresh system.${NC}" echo -e ${LIGHT_BLUE}"=================================================================${NC}" while true; do read -p "Is this a clean installation of Debian 12? (Y/N): " response case $response in [Yy]* ) break;; [Nn]* ) echo -e "${RED}Please reinstall Debian 12 and run the script again.${NC}"; exit;; * ) echo -e "${RED}Please answer with 'Y' (Yes) or 'N' (No).${NC}";; esac done } confirm_clean_install WINGS_DOMAIN=$(prompt "Enter the domain name you want to use for Wings (e.g., wings.example.com). Leave blank if not using a public domain for Wings." "") if [ -n "$WINGS_DOMAIN" ]; then ADMIN_EMAIL=$(prompt "Enter an email address for Certbot to use for Wings (for urgent renewal notices and security advisories)" "me@anthony-morales.online") # Corrected default email fi echo -e "${GREEN}Updating system and installing dependencies...${NC}" apt update && apt upgrade -y apt install -y curl sudo gnupg lsb-release ca-certificates echo -e "${GREEN}Installing Docker (from official source)...${NC}" if ! command -v docker &> /dev/null; then curl -fsSL https://get.docker.com | bash else echo -e "${YELLOW}Docker appears to be already installed. Skipping Docker installation.${NC}" fi echo -e "${GREEN}Enabling Docker...${NC}" systemctl enable --now docker echo -e "${GREEN}Installing Wings...${NC}" mkdir -p /etc/pterodactyl ARCH=$(uname -m) ARCH_TYPE=$([[ "$ARCH" == "x86_64" ]] && echo "amd64" || echo "arm64") curl -L -o /usr/local/bin/wings "https://github.com/pterodactyl/wings/releases/latest/download/wings_linux_${ARCH_TYPE}" chmod +x /usr/local/bin/wings echo -e "${GREEN}Creating systemd service file for Wings...${NC}" cat > /etc/systemd/system/wings.service < Your Node > Configuration tab.${NC}" echo -e "${YELLOW}4. Download or copy the config and paste it to: /etc/pterodactyl/config.yml${NC}" if [ -n "$WINGS_DOMAIN" ]; then echo -e "${YELLOW}5. IMPORTANT: Since you obtained a Let's Encrypt SSL certificate for Wings,${NC}" echo -e "${YELLOW} you MUST edit the /etc/pterodactyl/config.yml file. Find the 'api' section${NC}" echo -e "${YELLOW} and update 'certificate' and 'key' paths to point to the Let's Encrypt certificates:${NC}" echo -e "${YELLOW} certificate: /etc/letsencrypt/live/$WINGS_DOMAIN/fullchain.pem${NC}" echo -e "${YELLOW} key: /etc/letsencrypt/live/$WINGS_DOMAIN/privkey.pem${NC}" echo -e "${YELLOW}6. Save the config.yml file. Then, run 'systemctl restart wings'.${NC}" echo -e "${YELLOW}7. Come back to this window to continue.${NC}" else echo -e "${YELLOW}5. Save and come back to this window to continue.${NC}" fi echo -e ${LIGHT_BLUE}"=================================================================${NC}" while true; do read -p "Have you completed the Node Configuration and any necessary SSL updates for Wings? (Y/N): " response case $response in [Yy]* ) break;; [Nn]* ) echo -e "${RED}Please complete the Node Configuration and run the script again.${NC}"; exit;; * ) echo -e "${RED}Please answer with 'Y' (Yes) or 'N' (No).${NC}";; esac done } confirm_wings_configuration echo -e "${GREEN}Pterodactyl Wings Configuration completed successfully!${NC}" echo -e "${GREEN}Pterodactyl Wings is now installed and running on Debian 12.${NC}"