significant tidying to logserver
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 38s

This commit is contained in:
Your Name
2025-09-20 10:33:08 +12:00
parent fa4ef61a0a
commit 7851aa810b
12 changed files with 262 additions and 29 deletions

26
logserver/destroy.sh Executable file
View File

@@ -0,0 +1,26 @@
#!/bin/bash
source "${AGENT_PATH}/common.sh"
source "$(dirname "${BASH_SOURCE[0]}")/_volumes.sh"
_check_required_env_vars "CONTAINER_NAME"
echo "WARNING: This will PERMANENTLY DELETE all ELK stack data!"
echo "This includes all logs, dashboards, and configurations"
echo "This action cannot be undone!"
echo ""
# Since scripts must be non-interactive, only proceed if explicitly called
# Stop all containers
docker compose down || true
# Remove all volumes
for volume in $(get_logserver_volumes); do
volume_name=$(echo $volume | cut -d: -f3)
echo "Removing volume: $volume_name"
docker volume rm "$volume_name" 2>/dev/null || true
done
# Also remove the Docker network if it exists
docker network rm "${CONTAINER_NAME}_elk" 2>/dev/null || true
echo "ELK stack and all data destroyed"