Experimental gui.

This commit is contained in:
2025-06-26 08:28:52 -07:00
parent 55b052256a
commit c855786e61
99 changed files with 11664 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
#!/bin/bash
set -e
echo "🐳 Starting wild-cloud-central debug container..."
# Build the Docker image if it doesn't exist
if ! docker images | grep -q wild-cloud-central-test; then
echo "🔨 Building Docker image..."
docker build -t wild-cloud-central-test .
fi
echo ""
echo "🔧 Starting container with shell access..."
echo ""
echo "📍 Access points:"
echo " - Management UI: http://localhost:9080"
echo " - API directly: http://localhost:9081"
echo ""
echo "💡 Inside the container you can:"
echo " - Start services manually: /test-installation.sh"
echo " - Check logs: journalctl or service status"
echo " - Test APIs: curl http://localhost:5055/api/v1/health"
echo " - Modify config: nano /etc/wild-cloud-central/config.yaml"
echo " - View web files: ls /var/www/html/wild-central/"
echo ""
# Run container with shell access
docker run --rm -it \
-p 127.0.0.1:9081:5055 \
-p 127.0.0.1:9080:80 \
-p 127.0.0.1:9053:53/udp \
-p 127.0.0.1:9067:67/udp \
-p 127.0.0.1:9069:69/udp \
--cap-add=NET_ADMIN \
--cap-add=NET_BIND_SERVICE \
--name wild-central-debug \
wild-cloud-central-test \
/bin/bash

View File

@@ -0,0 +1,69 @@
#!/bin/bash
set -e
echo "🚀 Starting wild-cloud-central in background..."
# Build the Docker image if it doesn't exist
if ! docker images | grep -q wild-cloud-central-test; then
echo "🔨 Building Docker image..."
docker build -t wild-cloud-central-test .
fi
# Stop any existing container
docker rm -f wild-central-bg 2>/dev/null || true
echo "🌐 Starting services in background..."
# Start container in background
docker run -d \
--name wild-central-bg \
-p 127.0.0.1:9081:5055 \
-p 127.0.0.1:9080:80 \
-p 127.0.0.1:9053:53/udp \
-p 127.0.0.1:9067:67/udp \
-p 127.0.0.1:9069:69/udp \
--cap-add=NET_ADMIN \
--cap-add=NET_BIND_SERVICE \
wild-cloud-central-test \
/bin/bash -c '
# Start nginx
nginx &
# Start dnsmasq
dnsmasq --keep-in-foreground --log-facility=- &
# Start wild-cloud-central
/usr/bin/wild-cloud-central &
# Wait indefinitely
tail -f /dev/null
'
echo "⏳ Waiting for services to start..."
sleep 5
# Test if services are running
if curl -s http://localhost:9081/api/v1/health > /dev/null 2>&1; then
echo "✅ Services started successfully!"
echo ""
echo "📍 Access points (localhost only):"
echo " - Management UI: http://localhost:9080"
echo " - API: http://localhost:9081/api/v1/health"
echo " - DNS: localhost:9053 (for testing)"
echo " - DHCP: localhost:9067 (for testing)"
echo " - TFTP: localhost:9069 (for testing)"
echo ""
echo "🔧 Container management:"
echo " - View logs: docker logs wild-central-bg"
echo " - Stop services: docker stop wild-central-bg"
echo " - Remove container: docker rm wild-central-bg"
echo ""
echo "💡 Test commands:"
echo " curl http://localhost:9081/api/v1/health"
echo " dig @localhost -p 9053 wildcloud.local"
echo " curl http://localhost:9081/api/v1/dnsmasq/config"
else
echo "❌ Services failed to start. Check logs with: docker logs wild-central-bg"
exit 1
fi

View File

@@ -0,0 +1,92 @@
#!/bin/bash
set -e
echo "🚀 Starting wild-cloud-central for interactive testing..."
# Build the Docker image if it doesn't exist
if ! docker images | grep -q wild-cloud-central-test; then
echo "🔨 Building Docker image..."
docker build -t wild-cloud-central-test .
fi
echo ""
echo "🌐 Starting services... This will take a few seconds."
echo ""
echo "📍 Access points:"
echo " - Management UI: http://localhost:9080"
echo " - API directly: http://localhost:9081"
echo " - Health check: http://localhost:9081/api/v1/health"
echo ""
echo "🔧 Available API endpoints:"
echo " - GET /api/v1/health"
echo " - GET /api/v1/config"
echo " - PUT /api/v1/config"
echo " - GET /api/v1/dnsmasq/config"
echo " - POST /api/v1/dnsmasq/restart"
echo " - POST /api/v1/pxe/assets"
echo ""
echo "💡 Example commands to try:"
echo " curl http://localhost:9081/api/v1/health"
echo " curl http://localhost:9081/api/v1/config"
echo " curl http://localhost:9081/api/v1/dnsmasq/config"
echo " curl -X POST http://localhost:9081/api/v1/pxe/assets"
echo ""
echo "🛑 Press Ctrl+C to stop all services"
echo ""
# Create a custom startup script that keeps services running
docker run --rm -it \
-p 127.0.0.1:9081:5055 \
-p 127.0.0.1:9080:80 \
-p 127.0.0.1:9053:53/udp \
-p 127.0.0.1:9067:67/udp \
-p 127.0.0.1:9069:69/udp \
--cap-add=NET_ADMIN \
--cap-add=NET_BIND_SERVICE \
--name wild-central-interactive \
wild-cloud-central-test \
/bin/bash -c '
echo "🔧 Starting all services..."
# Start nginx
nginx &
NGINX_PID=$!
# Start dnsmasq
dnsmasq --keep-in-foreground --log-facility=- &
DNSMASQ_PID=$!
# Start wild-cloud-central
/usr/bin/wild-cloud-central &
SERVICE_PID=$!
# Wait for services to start
sleep 3
echo "✅ All services started!"
echo " - nginx (PID: $NGINX_PID)"
echo " - dnsmasq (PID: $DNSMASQ_PID)"
echo " - wild-cloud-central (PID: $SERVICE_PID)"
echo ""
echo "🌐 Services are now available:"
echo " - Web UI: http://localhost:9080"
echo " - API: http://localhost:9081"
echo ""
# Function to handle shutdown
shutdown() {
echo ""
echo "🛑 Shutting down services..."
kill $SERVICE_PID $DNSMASQ_PID $NGINX_PID 2>/dev/null || true
echo "✅ Shutdown complete."
exit 0
}
# Set up signal handlers
trap shutdown SIGTERM SIGINT
# Keep container running and wait for signals
echo "✨ Container is ready! Press Ctrl+C to stop."
wait
'

View File

@@ -0,0 +1,11 @@
#!/bin/bash
echo "🛑 Stopping wild-cloud-central background services..."
if docker ps | grep -q wild-central-bg; then
docker stop wild-central-bg
docker rm wild-central-bg
echo "✅ Services stopped and container removed."
else
echo " No background services running."
fi

View File

@@ -0,0 +1,20 @@
#!/bin/bash
set -e
echo "🧪 Testing wild-cloud-central Docker installation..."
# Change to project root directory
cd "$(dirname "$0")/../.."
# Build the Docker image
echo "🔨 Building Docker image..."
docker build -t wild-cloud-central-test .
# Run the container to test installation
echo "🚀 Running installation test..."
echo "Access points after container starts:"
echo " - Management UI: http://localhost:9080"
echo " - API directly: http://localhost:9055"
echo ""
docker run --rm -p 9055:5055 -p 9080:80 wild-cloud-central-test