fix
This commit is contained in:
3
Makefile
3
Makefile
@@ -90,7 +90,8 @@ reset: clean
|
|||||||
@echo "Reset complete"
|
@echo "Reset complete"
|
||||||
|
|
||||||
setup:
|
setup:
|
||||||
bash setuper/setup.sh
|
@chmod +x setuper/setup.sh
|
||||||
|
@cd setuper && ./setup.sh
|
||||||
|
|
||||||
test:
|
test:
|
||||||
@echo "Testing API endpoints..."
|
@echo "Testing API endpoints..."
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
# Setuper script for A/D Infrastructure
|
# Setuper script for A/D Infrastructure
|
||||||
# Installs and configures: Packmate, moded_distructive_farm, Firegex
|
# Installs and configures: Packmate, moded_distructive_farm, Firegex
|
||||||
|
|
||||||
set -e
|
# Don't exit on error - we want to continue even if API registration fails
|
||||||
|
set +e
|
||||||
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
SERVICES_DIR="${SERVICES_DIR:-$SCRIPT_DIR/../services}"
|
SERVICES_DIR="${SERVICES_DIR:-$SCRIPT_DIR/../services}"
|
||||||
@@ -126,7 +127,12 @@ EOF
|
|||||||
|
|
||||||
# Register with controller
|
# Register with controller
|
||||||
echo "Registering Packmate with controller..."
|
echo "Registering Packmate with controller..."
|
||||||
call_api "/services" "POST" "{\"name\": \"packmate\", \"path\": \"$packmate_dir\", \"git_url\": \"https://gitlab.com/packmate/Packmate.git\"}"
|
if call_api "/services" "POST" "{\"name\": \"packmate\", \"path\": \"$packmate_dir\", \"git_url\": \"https://gitlab.com/packmate/Packmate.git\"}" 2>/dev/null; then
|
||||||
|
echo "✓ Packmate registered with controller"
|
||||||
|
else
|
||||||
|
echo "⚠ Warning: Could not register with controller (is it running?)"
|
||||||
|
echo " You can register manually later via the web dashboard"
|
||||||
|
fi
|
||||||
|
|
||||||
cd "$SCRIPT_DIR"
|
cd "$SCRIPT_DIR"
|
||||||
}
|
}
|
||||||
@@ -213,13 +219,18 @@ services:
|
|||||||
retries: 3
|
retries: 3
|
||||||
volumes:
|
volumes:
|
||||||
- farm-db:/var/lib/postgresql/data
|
- farm-db:/var/lib/postgresql/data
|
||||||
|
|
||||||
volumes:
|
|
||||||
farm-db:
|
|
||||||
EOF
|
|
||||||
|
|
||||||
echo "moded_distructive_farm setup complete!"
|
echo "moded_distructive_farm setup complete!"
|
||||||
|
|
||||||
|
# Register with controller
|
||||||
|
echo "Registering farm with controller..."
|
||||||
|
if call_api "/services" "POST" "{\"name\": \"farm\", \"path\": \"$farm_dir\", \"git_url\": \"https://github.com/ilyastar9999/moded_distructive_farm.git\"}" 2>/dev/null; then
|
||||||
|
echo "✓ Farm registered with controller"
|
||||||
|
else
|
||||||
|
echo "⚠ Warning: Could not register with controller (is it running?)"
|
||||||
|
echo " You can register manually later via the web dashboard"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd "$SCRIPT_DIR"
|
||||||
# Register with controller
|
# Register with controller
|
||||||
echo "Registering farm with controller..."
|
echo "Registering farm with controller..."
|
||||||
call_api "/services" "POST" "{\"name\": \"farm\", \"path\": \"$farm_dir\", \"git_url\": \"https://github.com/ilyastar9999/moded_distructive_farm.git\"}"
|
call_api "/services" "POST" "{\"name\": \"farm\", \"path\": \"$farm_dir\", \"git_url\": \"https://github.com/ilyastar9999/moded_distructive_farm.git\"}"
|
||||||
@@ -266,13 +277,18 @@ services:
|
|||||||
- SCOREBOARD_URL=\${SCOREBOARD_URL}
|
- SCOREBOARD_URL=\${SCOREBOARD_URL}
|
||||||
container_name: firegex-app
|
container_name: firegex-app
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
|
||||||
- "\${FIREGEX_PORT:-5000}:5000"
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Firegex setup complete!"
|
echo "Firegex setup complete!"
|
||||||
|
|
||||||
|
# Register with controller
|
||||||
|
echo "Registering Firegex with controller..."
|
||||||
|
if call_api "/services" "POST" "{\"name\": \"firegex\", \"path\": \"$firegex_dir\", \"git_url\": \"https://github.com/Pwnzer0tt1/firegex.git\"}" 2>/dev/null; then
|
||||||
|
echo "✓ Firegex registered with controller"
|
||||||
|
else
|
||||||
|
echo "⚠ Warning: Could not register with controller (is it running?)"
|
||||||
|
echo " You can register manually later via the web dashboard"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd "$SCRIPT_DIR"
|
||||||
# Register with controller
|
# Register with controller
|
||||||
echo "Registering Firegex with controller..."
|
echo "Registering Firegex with controller..."
|
||||||
call_api "/services" "POST" "{\"name\": \"firegex\", \"path\": \"$firegex_dir\", \"git_url\": \"https://github.com/Pwnzer0tt1/firegex.git\"}"
|
call_api "/services" "POST" "{\"name\": \"firegex\", \"path\": \"$firegex_dir\", \"git_url\": \"https://github.com/Pwnzer0tt1/firegex.git\"}"
|
||||||
@@ -294,11 +310,16 @@ main() {
|
|||||||
|
|
||||||
if [ "$setup_pm" = "y" ]; then
|
if [ "$setup_pm" = "y" ]; then
|
||||||
setup_packmate
|
setup_packmate
|
||||||
fi
|
echo ""
|
||||||
|
echo "=== Setup Complete! ==="
|
||||||
if [ "$setup_fm" = "y" ]; then
|
echo "Services have been configured in: $SERVICES_DIR"
|
||||||
setup_farm
|
echo ""
|
||||||
fi
|
echo "Next steps:"
|
||||||
|
echo " 1. Start the infrastructure: docker-compose up -d"
|
||||||
|
echo " 2. Access web dashboard: http://localhost:8000"
|
||||||
|
echo " 3. Register services via the dashboard if auto-registration failed"
|
||||||
|
echo ""
|
||||||
|
} fi
|
||||||
|
|
||||||
if [ "$setup_fg" = "y" ]; then
|
if [ "$setup_fg" = "y" ]; then
|
||||||
setup_firegex
|
setup_firegex
|
||||||
|
|||||||
Reference in New Issue
Block a user