Files
firefrost-operations-manual/deployments/whitelist-manager/deploy.sh
Claude 57363c6565 feat: Whitelist Manager v1.0 - Complete deployment package
- Flask web application for managing Minecraft whitelists
- Manages all 11 game servers (TX1 + NC1)
- TailwindCSS Fire & Frost themed UI
- Single player and bulk operations
- HTTP Basic Auth with password hashing
- Nginx reverse proxy + SSL configuration
- systemd service for auto-start
- Complete deployment automation

Components:
- app.py: Main Flask application with Pterodactyl API integration
- templates/index.html: Responsive web dashboard
- requirements.txt: Python dependencies
- .env: Configuration with API keys and credentials
- deploy.sh: Automated deployment script
- DEPLOYMENT.md: Step-by-step manual deployment guide
- nginx.conf: Reverse proxy configuration
- whitelist-manager.service: systemd service

Target: Ghost VPS (64.50.188.14)
Domain: whitelist.firefrostgaming.com
Login: mkrause612 / Butter2018!!

Transforms 15-minute manual task into 30-second web operation.
Zero-error whitelist management with full visibility.

Ready for deployment - FFG-STD-001 compliant
2026-02-17 03:36:48 +00:00

113 lines
3.5 KiB
Bash

#!/bin/bash
# Firefrost Gaming - Whitelist Manager Deployment Script
# Run this script on Ghost VPS (64.50.188.14)
set -e # Exit on error
echo "======================================"
echo "Firefrost Gaming - Whitelist Manager"
echo "Deployment Script v1.0"
echo "======================================"
echo ""
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Check if running as root
if [ "$EUID" -ne 0 ]; then
echo -e "${RED}ERROR: This script must be run as root${NC}"
exit 1
fi
echo -e "${GREEN}Step 1: Installing system dependencies...${NC}"
apt update
apt install -y python3 python3-pip python3-venv nginx certbot python3-certbot-nginx
echo -e "${GREEN}Step 2: Creating application directory...${NC}"
mkdir -p /opt/whitelist-manager/templates
cd /opt/whitelist-manager
echo -e "${YELLOW}Step 3: Copy application files to /opt/whitelist-manager/${NC}"
echo "Please copy the following files:"
echo " - app.py"
echo " - requirements.txt"
echo " - .env"
echo " - templates/index.html"
echo ""
read -p "Press Enter once files are copied..."
echo -e "${GREEN}Step 4: Installing Python dependencies...${NC}"
pip3 install -r requirements.txt --break-system-packages
echo -e "${GREEN}Step 5: Testing application...${NC}"
# Quick test that app can import dependencies
python3 -c "import flask, flask_httpauth, requests, dotenv" && echo "Dependencies OK" || {
echo -e "${RED}ERROR: Python dependencies failed${NC}"
exit 1
}
echo -e "${GREEN}Step 6: Setting up systemd service...${NC}"
# Copy service file
cp whitelist-manager.service /etc/systemd/system/
systemctl daemon-reload
systemctl enable whitelist-manager
systemctl start whitelist-manager
# Check service status
sleep 2
if systemctl is-active --quiet whitelist-manager; then
echo -e "${GREEN}✓ Whitelist Manager service is running${NC}"
else
echo -e "${RED}✗ Whitelist Manager service failed to start${NC}"
echo "Check logs with: journalctl -u whitelist-manager -n 50"
exit 1
fi
echo -e "${GREEN}Step 7: Configuring Nginx...${NC}"
cp nginx.conf /etc/nginx/sites-available/whitelist.firefrostgaming.com
ln -sf /etc/nginx/sites-available/whitelist.firefrostgaming.com /etc/nginx/sites-enabled/
# Test Nginx configuration
nginx -t || {
echo -e "${RED}ERROR: Nginx configuration test failed${NC}"
exit 1
}
# Reload Nginx
systemctl reload nginx
echo -e "${GREEN}✓ Nginx configured${NC}"
echo -e "${YELLOW}Step 8: DNS Configuration${NC}"
echo "Before obtaining SSL certificate, ensure DNS is configured:"
echo " Record: whitelist.firefrostgaming.com"
echo " Type: A"
echo " Value: 64.50.188.14"
echo ""
read -p "Press Enter once DNS is configured and propagated..."
echo -e "${GREEN}Step 9: Obtaining SSL certificate...${NC}"
certbot --nginx -d whitelist.firefrostgaming.com --non-interactive --agree-tos --email mkrause612@gmail.com
echo ""
echo -e "${GREEN}======================================"
echo "Deployment Complete!"
echo "======================================${NC}"
echo ""
echo "Whitelist Manager is now running at:"
echo " https://whitelist.firefrostgaming.com"
echo ""
echo "Login credentials:"
echo " Username: mkrause612"
echo " Password: Butter2018!!"
echo ""
echo "Useful commands:"
echo " Service status: systemctl status whitelist-manager"
echo " View logs: journalctl -u whitelist-manager -f"
echo " Restart: systemctl restart whitelist-manager"
echo " Nginx logs: tail -f /var/log/nginx/whitelist.*.log"
echo ""
echo -e "${YELLOW}🔥❄️ Fire + Frost + Foundation = Where Love Builds Legacy 💙${NC}"