refactor: move stack assets and wire in mailhog
This commit is contained in:
83
SupportStack/output/TSYSDevStack-SupportStack-Demo-Settings
Normal file
83
SupportStack/output/TSYSDevStack-SupportStack-Demo-Settings
Normal file
@@ -0,0 +1,83 @@
|
||||
# TSYSDevStack SupportStack Demo - Environment Settings
|
||||
# Auto-generated file for MVP components: docker-socket-proxy, homepage, wakaapi
|
||||
|
||||
# General Settings
|
||||
TSYSDEVSTACK_ENVIRONMENT=demo
|
||||
TSYSDEVSTACK_PROJECT_NAME=tsysdevstack-supportstack-demo
|
||||
TSYSDEVSTACK_NETWORK_NAME=tsysdevstack-supportstack-demo-network
|
||||
|
||||
# User/Group Settings
|
||||
TSYSDEVSTACK_UID=1000
|
||||
TSYSDEVSTACK_GID=1000
|
||||
TSYSDEVSTACK_DOCKER_GID=996
|
||||
|
||||
# Docker Socket Proxy Settings
|
||||
DOCKER_SOCKET_PROXY_NAME=tsysdevstack-supportstack-demo-docker-socket-proxy
|
||||
DOCKER_SOCKET_PROXY_IMAGE=tecnativa/docker-socket-proxy:0.1
|
||||
DOCKER_SOCKET_PROXY_SOCKET_PATH=/var/run/docker.sock
|
||||
DOCKER_SOCKET_PROXY_NETWORK=tsysdevstack-supportstack-demo-network
|
||||
|
||||
# Docker API Permissions
|
||||
DOCKER_SOCKET_PROXY_CONTAINERS=1
|
||||
DOCKER_SOCKET_PROXY_IMAGES=1
|
||||
DOCKER_SOCKET_PROXY_NETWORKS=1
|
||||
DOCKER_SOCKET_PROXY_VOLUMES=1
|
||||
DOCKER_SOCKET_PROXY_BUILD=1
|
||||
DOCKER_SOCKET_PROXY_MANIFEST=1
|
||||
DOCKER_SOCKET_PROXY_PLUGINS=1
|
||||
DOCKER_SOCKET_PROXY_VERSION=1
|
||||
|
||||
# Homepage Settings
|
||||
HOMEPAGE_NAME=tsysdevstack-supportstack-demo-homepage
|
||||
HOMEPAGE_IMAGE=gethomepage/homepage:latest
|
||||
HOMEPAGE_PORT=4000
|
||||
HOMEPAGE_NETWORK=tsysdevstack-supportstack-demo-network
|
||||
HOMEPAGE_CONFIG_PATH=./config/homepage
|
||||
|
||||
# WakaAPI Settings
|
||||
WAKAAPI_NAME=tsysdevstack-supportstack-demo-wakaapi
|
||||
WAKAAPI_IMAGE=n1try/wakapi:latest
|
||||
WAKAAPI_PORT=4001
|
||||
WAKAAPI_NETWORK=tsysdevstack-supportstack-demo-network
|
||||
WAKAAPI_CONFIG_PATH=./config/wakaapi
|
||||
WAKAAPI_WAKATIME_API_KEY=
|
||||
WAKAAPI_DATABASE_PATH=./config/wakaapi/database
|
||||
|
||||
# Mailhog Settings
|
||||
MAILHOG_NAME=tsysdevstack-supportstack-demo-mailhog
|
||||
MAILHOG_IMAGE=mailhog/mailhog:v1.0.1
|
||||
MAILHOG_SMTP_PORT=1025
|
||||
MAILHOG_UI_PORT=8025
|
||||
MAILHOG_NETWORK=tsysdevstack-supportstack-demo-network
|
||||
|
||||
# Resource Limits (for single user demo capacity)
|
||||
# docker-socket-proxy
|
||||
DOCKER_SOCKET_PROXY_MEM_LIMIT=128m
|
||||
DOCKER_SOCKET_PROXY_CPU_LIMIT=0.25
|
||||
|
||||
# homepage
|
||||
HOMEPAGE_MEM_LIMIT=256m
|
||||
HOMEPAGE_CPU_LIMIT=0.5
|
||||
|
||||
# wakaapi
|
||||
WAKAAPI_MEM_LIMIT=192m
|
||||
WAKAAPI_CPU_LIMIT=0.3
|
||||
|
||||
# mailhog
|
||||
MAILHOG_MEM_LIMIT=128m
|
||||
MAILHOG_CPU_LIMIT=0.25
|
||||
|
||||
# Health Check Settings
|
||||
HEALTH_CHECK_INTERVAL=30s
|
||||
HEALTH_CHECK_TIMEOUT=10s
|
||||
HEALTH_CHECK_START_PERIOD=30s
|
||||
HEALTH_CHECK_RETRIES=3
|
||||
|
||||
# Timeouts
|
||||
DOCKER_SOCKET_PROXY_CONNECTION_TIMEOUT=30s
|
||||
HOMEPAGE_STARTUP_TIMEOUT=60s
|
||||
WAKAAPI_INITIALIZATION_TIMEOUT=45s
|
||||
DOCKER_COMPOSE_STARTUP_TIMEOUT=120s
|
||||
|
||||
# Localhost binding
|
||||
BIND_ADDRESS=127.0.0.1
|
||||
452
SupportStack/output/code/TSYSDevStack-SupportStack-Demo-Control.sh
Executable file
452
SupportStack/output/code/TSYSDevStack-SupportStack-Demo-Control.sh
Executable file
@@ -0,0 +1,452 @@
|
||||
#!/bin/bash
|
||||
|
||||
# TSYSDevStack SupportStack Demo - Control Script
|
||||
# Provides start/stop/uninstall/update/test functionality for the MVP stack
|
||||
|
||||
set -e # Exit on any error
|
||||
|
||||
# Load environment settings
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
ROOT_DIR="$(dirname "$SCRIPT_DIR")"
|
||||
CONFIG_DIR="${ROOT_DIR}/config"
|
||||
COMPOSE_DIR="${ROOT_DIR}/docker-compose"
|
||||
ROOT_ENV_FILE="${ROOT_DIR}/TSYSDevStack-SupportStack-Demo-Settings"
|
||||
CONFIG_ENV_FILE="${CONFIG_DIR}/TSYSDevStack-SupportStack-Demo-Settings"
|
||||
|
||||
if [ -f "$ROOT_ENV_FILE" ]; then
|
||||
ENV_FILE="$ROOT_ENV_FILE"
|
||||
elif [ -f "$CONFIG_ENV_FILE" ]; then
|
||||
ENV_FILE="$CONFIG_ENV_FILE"
|
||||
else
|
||||
echo "Error: Environment settings file not found. Expected at $ROOT_ENV_FILE or $CONFIG_ENV_FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Set UID/GID defaults prior to sourcing environment file so runtime values override placeholders
|
||||
export TSYSDEVSTACK_UID="$(id -u)"
|
||||
export TSYSDEVSTACK_GID="$(id -g)"
|
||||
export TSYSDEVSTACK_DOCKER_GID="$(getent group docker >/dev/null 2>&1 && getent group docker | cut -d: -f3 || echo "996")"
|
||||
|
||||
# Source the environment file to get all variables
|
||||
source "$ENV_FILE"
|
||||
|
||||
# Explicitly export all environment variables for docker compose
|
||||
export TSYSDEVSTACK_ENVIRONMENT
|
||||
export TSYSDEVSTACK_PROJECT_NAME
|
||||
export TSYSDEVSTACK_NETWORK_NAME
|
||||
export DOCKER_SOCKET_PROXY_NAME
|
||||
export DOCKER_SOCKET_PROXY_IMAGE
|
||||
export DOCKER_SOCKET_PROXY_SOCKET_PATH
|
||||
export DOCKER_SOCKET_PROXY_NETWORK
|
||||
export DOCKER_SOCKET_PROXY_CONTAINERS
|
||||
export DOCKER_SOCKET_PROXY_IMAGES
|
||||
export DOCKER_SOCKET_PROXY_NETWORKS
|
||||
export DOCKER_SOCKET_PROXY_VOLUMES
|
||||
export DOCKER_SOCKET_PROXY_BUILD
|
||||
export DOCKER_SOCKET_PROXY_MANIFEST
|
||||
export DOCKER_SOCKET_PROXY_PLUGINS
|
||||
export DOCKER_SOCKET_PROXY_VERSION
|
||||
export HOMEPAGE_NAME
|
||||
export HOMEPAGE_IMAGE
|
||||
export HOMEPAGE_PORT
|
||||
export HOMEPAGE_NETWORK
|
||||
export HOMEPAGE_CONFIG_PATH
|
||||
export WAKAAPI_NAME
|
||||
export WAKAAPI_IMAGE
|
||||
export WAKAAPI_PORT
|
||||
export WAKAAPI_NETWORK
|
||||
export WAKAAPI_CONFIG_PATH
|
||||
export WAKAAPI_WAKATIME_API_KEY
|
||||
export WAKAAPI_DATABASE_PATH
|
||||
export MAILHOG_NAME
|
||||
export MAILHOG_IMAGE
|
||||
export MAILHOG_SMTP_PORT
|
||||
export MAILHOG_UI_PORT
|
||||
export MAILHOG_NETWORK
|
||||
export DOCKER_SOCKET_PROXY_MEM_LIMIT
|
||||
export DOCKER_SOCKET_PROXY_CPU_LIMIT
|
||||
export HOMEPAGE_MEM_LIMIT
|
||||
export HOMEPAGE_CPU_LIMIT
|
||||
export WAKAAPI_MEM_LIMIT
|
||||
export WAKAAPI_CPU_LIMIT
|
||||
export MAILHOG_MEM_LIMIT
|
||||
export MAILHOG_CPU_LIMIT
|
||||
export HEALTH_CHECK_INTERVAL
|
||||
export HEALTH_CHECK_TIMEOUT
|
||||
export HEALTH_CHECK_START_PERIOD
|
||||
export HEALTH_CHECK_RETRIES
|
||||
export DOCKER_SOCKET_PROXY_CONNECTION_TIMEOUT
|
||||
export HOMEPAGE_STARTUP_TIMEOUT
|
||||
export WAKAAPI_INITIALIZATION_TIMEOUT
|
||||
export DOCKER_COMPOSE_STARTUP_TIMEOUT
|
||||
export BIND_ADDRESS
|
||||
export TSYSDEVSTACK_UID
|
||||
export TSYSDEVSTACK_GID
|
||||
export TSYSDEVSTACK_DOCKER_GID
|
||||
|
||||
# Colors for output
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# Logging function
|
||||
log() {
|
||||
echo -e "${BLUE}[$(date +'%Y-%m-%d %H:%M:%S')]${NC} $1"
|
||||
}
|
||||
|
||||
log_success() {
|
||||
echo -e "${GREEN}[SUCCESS]${NC} $1"
|
||||
}
|
||||
|
||||
log_error() {
|
||||
echo -e "${RED}[ERROR]${NC} $1"
|
||||
}
|
||||
|
||||
log_warning() {
|
||||
echo -e "${YELLOW}[WARNING]${NC} $1"
|
||||
}
|
||||
|
||||
compose() {
|
||||
docker compose -p "$TSYSDEVSTACK_PROJECT_NAME" "$@"
|
||||
}
|
||||
|
||||
# Function to check if docker is available
|
||||
check_docker() {
|
||||
if ! command -v docker &> /dev/null; then
|
||||
log_error "Docker is not installed or not in PATH"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! docker info &> /dev/null; then
|
||||
log_error "Docker is not running or not accessible"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to create the shared network
|
||||
create_network() {
|
||||
log "Creating shared network: $TSYSDEVSTACK_NETWORK_NAME"
|
||||
if ! docker network inspect "$TSYSDEVSTACK_NETWORK_NAME" >/dev/null 2>&1; then
|
||||
docker network create \
|
||||
--driver bridge \
|
||||
--label tsysdevstack.component="supportstack-demo" \
|
||||
--label tsysdevstack.environment="$TSYSDEVSTACK_ENVIRONMENT" \
|
||||
"$TSYSDEVSTACK_NETWORK_NAME"
|
||||
log_success "Network created: $TSYSDEVSTACK_NETWORK_NAME"
|
||||
else
|
||||
log "Network already exists: $TSYSDEVSTACK_NETWORK_NAME"
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to remove the shared network
|
||||
remove_network() {
|
||||
log "Removing shared network: $TSYSDEVSTACK_NETWORK_NAME"
|
||||
if docker network inspect "$TSYSDEVSTACK_NETWORK_NAME" >/dev/null 2>&1; then
|
||||
docker network rm "$TSYSDEVSTACK_NETWORK_NAME"
|
||||
log_success "Network removed: $TSYSDEVSTACK_NETWORK_NAME"
|
||||
else
|
||||
log "Network does not exist: $TSYSDEVSTACK_NETWORK_NAME"
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to start the MVP stack
|
||||
start() {
|
||||
log "Starting TSYSDevStack SupportStack Demo MVP"
|
||||
|
||||
check_docker
|
||||
log "Using environment file: $ENV_FILE"
|
||||
create_network
|
||||
|
||||
# Start docker-socket-proxy first (dependency for homepage)
|
||||
log "Starting docker-socket-proxy..."
|
||||
if [ -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-docker-socket-proxy.yml" ]; then
|
||||
compose -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-docker-socket-proxy.yml" up -d
|
||||
log_success "docker-socket-proxy started"
|
||||
else
|
||||
log_warning "docker-socket-proxy compose file not found, skipping..."
|
||||
fi
|
||||
|
||||
# Wait for docker socket proxy to be ready
|
||||
log "Waiting for docker-socket-proxy to be ready..."
|
||||
sleep 10
|
||||
|
||||
# Start homepage
|
||||
log "Starting homepage..."
|
||||
if [ -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-homepage.yml" ]; then
|
||||
compose -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-homepage.yml" up -d
|
||||
log_success "homepage started"
|
||||
else
|
||||
log_warning "homepage compose file not found, skipping..."
|
||||
fi
|
||||
|
||||
# Wait for homepage to be ready
|
||||
log "Waiting for homepage to be ready..."
|
||||
sleep 15
|
||||
|
||||
# Start wakaapi
|
||||
log "Starting wakaapi..."
|
||||
if [ -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-wakaapi.yml" ]; then
|
||||
compose -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-wakaapi.yml" up -d
|
||||
log_success "wakaapi started"
|
||||
else
|
||||
log_warning "wakaapi compose file not found, skipping..."
|
||||
fi
|
||||
|
||||
# Start mailhog
|
||||
log "Starting mailhog..."
|
||||
if [ -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-mailhog.yml" ]; then
|
||||
compose -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-mailhog.yml" up -d
|
||||
log_success "mailhog started"
|
||||
else
|
||||
log_warning "mailhog compose file not found, skipping..."
|
||||
fi
|
||||
|
||||
# Wait for services to be ready
|
||||
log "Waiting for all services to be ready..."
|
||||
sleep 20
|
||||
|
||||
log_success "MVP stack started successfully"
|
||||
echo "Homepage available at: http://$BIND_ADDRESS:$HOMEPAGE_PORT"
|
||||
echo "WakaAPI available at: http://$BIND_ADDRESS:$WAKAAPI_PORT"
|
||||
echo "Mailhog available at: http://$BIND_ADDRESS:$MAILHOG_UI_PORT (SMTP on $MAILHOG_SMTP_PORT)"
|
||||
}
|
||||
|
||||
# Function to stop the MVP stack
|
||||
stop() {
|
||||
log "Stopping TSYSDevStack SupportStack Demo MVP"
|
||||
|
||||
check_docker
|
||||
|
||||
# Stop mailhog
|
||||
log "Stopping mailhog..."
|
||||
if [ -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-mailhog.yml" ]; then
|
||||
compose -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-mailhog.yml" down
|
||||
log_success "mailhog stopped"
|
||||
else
|
||||
log_warning "mailhog compose file not found, skipping..."
|
||||
fi
|
||||
|
||||
# Stop wakaapi
|
||||
log "Stopping wakaapi..."
|
||||
if [ -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-wakaapi.yml" ]; then
|
||||
compose -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-wakaapi.yml" down
|
||||
log_success "wakaapi stopped"
|
||||
else
|
||||
log_warning "wakaapi compose file not found, skipping..."
|
||||
fi
|
||||
|
||||
# Stop homepage
|
||||
log "Stopping homepage..."
|
||||
if [ -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-homepage.yml" ]; then
|
||||
compose -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-homepage.yml" down
|
||||
log_success "homepage stopped"
|
||||
else
|
||||
log_warning "homepage compose file not found, skipping..."
|
||||
fi
|
||||
|
||||
# Stop docker-socket-proxy last
|
||||
log "Stopping docker-socket-proxy..."
|
||||
if [ -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-docker-socket-proxy.yml" ]; then
|
||||
compose -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-docker-socket-proxy.yml" down
|
||||
log_success "docker-socket-proxy stopped"
|
||||
else
|
||||
log_warning "docker-socket-proxy compose file not found, skipping..."
|
||||
fi
|
||||
|
||||
log_success "MVP stack stopped successfully"
|
||||
}
|
||||
|
||||
# Function to uninstall the MVP stack
|
||||
uninstall() {
|
||||
log "Uninstalling TSYSDevStack SupportStack Demo MVP"
|
||||
|
||||
check_docker
|
||||
|
||||
# Stop all services first
|
||||
stop
|
||||
|
||||
# Remove containers, volumes, and networks
|
||||
log "Removing containers and volumes..."
|
||||
if [ -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-docker-socket-proxy.yml" ]; then
|
||||
compose -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-docker-socket-proxy.yml" down -v
|
||||
fi
|
||||
|
||||
if [ -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-homepage.yml" ]; then
|
||||
compose -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-homepage.yml" down -v
|
||||
fi
|
||||
|
||||
if [ -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-wakaapi.yml" ]; then
|
||||
compose -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-wakaapi.yml" down -v
|
||||
fi
|
||||
|
||||
if [ -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-mailhog.yml" ]; then
|
||||
compose -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-mailhog.yml" down -v
|
||||
fi
|
||||
|
||||
# Remove the shared network
|
||||
remove_network
|
||||
|
||||
log_success "MVP stack uninstalled successfully"
|
||||
}
|
||||
|
||||
# Function to update the MVP stack
|
||||
update() {
|
||||
log "Updating TSYSDevStack SupportStack Demo MVP"
|
||||
|
||||
check_docker
|
||||
|
||||
# Pull the latest images
|
||||
log "Pulling latest images..."
|
||||
|
||||
if [ -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-docker-socket-proxy.yml" ]; then
|
||||
compose -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-docker-socket-proxy.yml" pull
|
||||
log_success "docker-socket-proxy images updated"
|
||||
fi
|
||||
|
||||
if [ -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-homepage.yml" ]; then
|
||||
compose -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-homepage.yml" pull
|
||||
log_success "homepage images updated"
|
||||
fi
|
||||
|
||||
if [ -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-wakaapi.yml" ]; then
|
||||
compose -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-wakaapi.yml" pull
|
||||
log_success "wakaapi images updated"
|
||||
fi
|
||||
|
||||
if [ -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-mailhog.yml" ]; then
|
||||
compose -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-mailhog.yml" pull
|
||||
log_success "mailhog images updated"
|
||||
fi
|
||||
|
||||
log "Restarting services with updated images..."
|
||||
stop
|
||||
start
|
||||
|
||||
log_success "MVP stack updated successfully"
|
||||
}
|
||||
|
||||
# Function to run tests
|
||||
test() {
|
||||
log "Running tests for TSYSDevStack SupportStack Demo MVP"
|
||||
|
||||
check_docker
|
||||
|
||||
# Add test functions here
|
||||
log "Checking if services are running..."
|
||||
# Check docker-socket-proxy
|
||||
if [ -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-docker-socket-proxy.yml" ]; then
|
||||
if compose -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-docker-socket-proxy.yml" ps | grep -q "Up"; then
|
||||
log_success "docker-socket-proxy is running"
|
||||
else
|
||||
log_error "docker-socket-proxy is not running"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check homepage
|
||||
if [ -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-homepage.yml" ]; then
|
||||
if compose -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-homepage.yml" ps | grep -q "Up"; then
|
||||
log_success "homepage is running"
|
||||
else
|
||||
log_error "homepage is not running"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check wakaapi
|
||||
if [ -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-wakaapi.yml" ]; then
|
||||
if compose -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-wakaapi.yml" ps | grep -q "Up"; then
|
||||
log_success "wakaapi is running"
|
||||
else
|
||||
log_error "wakaapi is not running"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check mailhog
|
||||
if [ -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-mailhog.yml" ]; then
|
||||
if compose -f "${COMPOSE_DIR}/tsysdevstack-supportstack-demo-DockerCompose-mailhog.yml" ps | grep -q "Up"; then
|
||||
log_success "mailhog is running"
|
||||
else
|
||||
log_error "mailhog is not running"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Run any unit/integration tests if available
|
||||
TESTS_DIR="$(dirname "$SCRIPT_DIR")/tests"
|
||||
if [ -d "$TESTS_DIR" ]; then
|
||||
log "Running specific tests from $TESTS_DIR..."
|
||||
# Run individual test scripts
|
||||
for test_script in "$TESTS_DIR"/*.sh; do
|
||||
if [ -f "$test_script" ] && [ -r "$test_script" ] && [ -x "$test_script" ]; then
|
||||
log "Running test: $test_script"
|
||||
"$test_script"
|
||||
if [ $? -eq 0 ]; then
|
||||
log_success "Test completed: $(basename "$test_script")"
|
||||
else
|
||||
log_error "Test failed: $(basename "$test_script")"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
log_success "Tests completed"
|
||||
else
|
||||
log_warning "No tests directory found at $TESTS_DIR"
|
||||
fi
|
||||
|
||||
log_success "Test execution completed"
|
||||
}
|
||||
|
||||
# Function to display help
|
||||
show_help() {
|
||||
cat << EOF
|
||||
TSYSDevStack SupportStack Demo - Control Script
|
||||
|
||||
Usage: $0 {start|stop|uninstall|update|test|help}
|
||||
|
||||
Commands:
|
||||
start Start the MVP stack (docker-socket-proxy, homepage, wakaapi)
|
||||
stop Stop the MVP stack
|
||||
uninstall Uninstall the MVP stack (stop and remove all containers, volumes, and networks)
|
||||
update Update the MVP stack to latest images and restart
|
||||
test Run tests to verify the stack functionality
|
||||
help Show this help message
|
||||
|
||||
Examples:
|
||||
$0 start
|
||||
$0 stop
|
||||
$0 uninstall
|
||||
$0 update
|
||||
$0 test
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
# Main script logic
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
uninstall)
|
||||
uninstall
|
||||
;;
|
||||
update)
|
||||
update
|
||||
;;
|
||||
test)
|
||||
test
|
||||
;;
|
||||
help|--help|-h)
|
||||
show_help
|
||||
;;
|
||||
*)
|
||||
if [ -z "$1" ]; then
|
||||
log_error "No command provided. Use $0 help for usage information."
|
||||
else
|
||||
log_error "Unknown command: $1. Use $0 help for usage information."
|
||||
fi
|
||||
show_help
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,83 @@
|
||||
# TSYSDevStack SupportStack Demo - Environment Settings
|
||||
# Auto-generated file for MVP components: docker-socket-proxy, homepage, wakaapi
|
||||
|
||||
# General Settings
|
||||
TSYSDEVSTACK_ENVIRONMENT=demo
|
||||
TSYSDEVSTACK_PROJECT_NAME=tsysdevstack-supportstack-demo
|
||||
TSYSDEVSTACK_NETWORK_NAME=tsysdevstack-supportstack-demo-network
|
||||
|
||||
# Docker Socket Proxy Settings
|
||||
DOCKER_SOCKET_PROXY_NAME=tsysdevstack-supportstack-demo-docker-socket-proxy
|
||||
DOCKER_SOCKET_PROXY_IMAGE=tecnativa/docker-socket-proxy:0.1
|
||||
DOCKER_SOCKET_PROXY_SOCKET_PATH=/var/run/docker.sock
|
||||
DOCKER_SOCKET_PROXY_NETWORK=tsysdevstack-supportstack-demo-network
|
||||
|
||||
# Docker API Permissions
|
||||
DOCKER_SOCKET_PROXY_CONTAINERS=1
|
||||
DOCKER_SOCKET_PROXY_IMAGES=1
|
||||
DOCKER_SOCKET_PROXY_NETWORKS=1
|
||||
DOCKER_SOCKET_PROXY_VOLUMES=1
|
||||
DOCKER_SOCKET_PROXY_BUILD=1
|
||||
DOCKER_SOCKET_PROXY_MANIFEST=1
|
||||
DOCKER_SOCKET_PROXY_PLUGINS=1
|
||||
DOCKER_SOCKET_PROXY_VERSION=1
|
||||
|
||||
# Homepage Settings
|
||||
HOMEPAGE_NAME=tsysdevstack-supportstack-demo-homepage
|
||||
HOMEPAGE_IMAGE=gethomepage/homepage:latest
|
||||
HOMEPAGE_PORT=4000
|
||||
HOMEPAGE_NETWORK=tsysdevstack-supportstack-demo-network
|
||||
HOMEPAGE_CONFIG_PATH=./config/homepage
|
||||
|
||||
# WakaAPI Settings
|
||||
WAKAAPI_NAME=tsysdevstack-supportstack-demo-wakaapi
|
||||
WAKAAPI_IMAGE=n1try/wakapi:latest
|
||||
WAKAAPI_PORT=4001
|
||||
WAKAAPI_NETWORK=tsysdevstack-supportstack-demo-network
|
||||
WAKAAPI_CONFIG_PATH=./config/wakaapi
|
||||
WAKAAPI_WAKATIME_API_KEY=
|
||||
WAKAAPI_DATABASE_PATH=./config/wakaapi/database
|
||||
|
||||
# Mailhog Settings
|
||||
MAILHOG_NAME=tsysdevstack-supportstack-demo-mailhog
|
||||
MAILHOG_IMAGE=mailhog/mailhog:v1.0.1
|
||||
MAILHOG_SMTP_PORT=1025
|
||||
MAILHOG_UI_PORT=8025
|
||||
MAILHOG_NETWORK=tsysdevstack-supportstack-demo-network
|
||||
|
||||
# Resource Limits (for single user demo capacity)
|
||||
# docker-socket-proxy
|
||||
DOCKER_SOCKET_PROXY_MEM_LIMIT=128m
|
||||
DOCKER_SOCKET_PROXY_CPU_LIMIT=0.25
|
||||
|
||||
# homepage
|
||||
HOMEPAGE_MEM_LIMIT=256m
|
||||
HOMEPAGE_CPU_LIMIT=0.5
|
||||
|
||||
# wakaapi
|
||||
WAKAAPI_MEM_LIMIT=192m
|
||||
WAKAAPI_CPU_LIMIT=0.3
|
||||
|
||||
# mailhog
|
||||
MAILHOG_MEM_LIMIT=128m
|
||||
MAILHOG_CPU_LIMIT=0.25
|
||||
|
||||
# Health Check Settings
|
||||
HEALTH_CHECK_INTERVAL=30s
|
||||
HEALTH_CHECK_TIMEOUT=10s
|
||||
HEALTH_CHECK_START_PERIOD=30s
|
||||
HEALTH_CHECK_RETRIES=3
|
||||
|
||||
# Timeouts
|
||||
DOCKER_SOCKET_PROXY_CONNECTION_TIMEOUT=30s
|
||||
HOMEPAGE_STARTUP_TIMEOUT=60s
|
||||
WAKAAPI_INITIALIZATION_TIMEOUT=45s
|
||||
DOCKER_COMPOSE_STARTUP_TIMEOUT=120s
|
||||
|
||||
# Localhost binding
|
||||
BIND_ADDRESS=127.0.0.1
|
||||
|
||||
# Security - UID/GID mapping (to be set by control script)
|
||||
TSYSDEVSTACK_UID=1000
|
||||
TSYSDEVSTACK_GID=1000
|
||||
TSYSDEVSTACK_DOCKER_GID=996
|
||||
40
SupportStack/output/config/homepage/config.yaml
Normal file
40
SupportStack/output/config/homepage/config.yaml
Normal file
@@ -0,0 +1,40 @@
|
||||
---
|
||||
# Homepage configuration - Enable Docker service discovery
|
||||
title: TSYSDevStack SupportStack
|
||||
|
||||
# Docker configuration - Enable automatic service discovery
|
||||
docker:
|
||||
socket: /var/run/docker.sock
|
||||
|
||||
# Services configuration - Enable Docker discovery
|
||||
services: []
|
||||
|
||||
# Bookmarks
|
||||
bookmarks:
|
||||
- Developer:
|
||||
- Github:
|
||||
href: https://github.com/
|
||||
abbr: GH
|
||||
- Social:
|
||||
- Reddit:
|
||||
href: https://reddit.com/
|
||||
abbr: RE
|
||||
- Entertainment:
|
||||
- YouTube:
|
||||
href: https://youtube.com/
|
||||
abbr: YT
|
||||
|
||||
# Widgets
|
||||
widgets:
|
||||
- resources:
|
||||
cpu: true
|
||||
memory: true
|
||||
disk: /
|
||||
- search:
|
||||
provider: duckduckgo
|
||||
target: _blank
|
||||
|
||||
# Proxy configuration
|
||||
proxy:
|
||||
allowedHosts: "*"
|
||||
allowedHeaders: "*"
|
||||
3
SupportStack/output/config/homepage/docker.yaml
Normal file
3
SupportStack/output/config/homepage/docker.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
# Docker configuration for Homepage service discovery
|
||||
socket: /var/run/docker.sock
|
||||
9
SupportStack/output/config/homepage/services.yaml
Normal file
9
SupportStack/output/config/homepage/services.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
# Services configuration for Homepage Docker discovery
|
||||
|
||||
# Automatically discover Docker services with Homepage labels
|
||||
- Support Stack:
|
||||
- tsysdevstack-supportstack-demo-docker-socket-proxy
|
||||
- tsysdevstack-supportstack-demo-homepage
|
||||
- tsysdevstack-supportstack-demo-wakaapi
|
||||
- tsysdevstack-supportstack-demo-mailhog
|
||||
42
SupportStack/output/config/homepage/settings.yaml
Normal file
42
SupportStack/output/config/homepage/settings.yaml
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
# Homepage configuration
|
||||
title: TSYSDevStack SupportStack
|
||||
background:
|
||||
headerStyle: boxed
|
||||
|
||||
# Docker configuration
|
||||
docker:
|
||||
socket: /var/run/docker.sock
|
||||
|
||||
# Services configuration
|
||||
services: []
|
||||
|
||||
# Bookmarks
|
||||
bookmarks:
|
||||
- Developer:
|
||||
- Github:
|
||||
href: https://github.com/
|
||||
abbr: GH
|
||||
- Social:
|
||||
- Reddit:
|
||||
href: https://reddit.com/
|
||||
abbr: RE
|
||||
- Entertainment:
|
||||
- YouTube:
|
||||
href: https://youtube.com/
|
||||
abbr: YT
|
||||
|
||||
# Widgets
|
||||
widgets:
|
||||
- resources:
|
||||
cpu: true
|
||||
memory: true
|
||||
disk: /
|
||||
- search:
|
||||
provider: duckduckgo
|
||||
target: _blank
|
||||
|
||||
# Proxy configuration
|
||||
proxy:
|
||||
allowedHosts: "*"
|
||||
allowedHeaders: "*"
|
||||
@@ -0,0 +1,49 @@
|
||||
services:
|
||||
docker-socket-proxy:
|
||||
image: ${DOCKER_SOCKET_PROXY_IMAGE}
|
||||
container_name: ${DOCKER_SOCKET_PROXY_NAME}
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- tsysdevstack-supportstack-demo-network
|
||||
environment:
|
||||
CONTAINERS: ${DOCKER_SOCKET_PROXY_CONTAINERS}
|
||||
IMAGES: ${DOCKER_SOCKET_PROXY_IMAGES}
|
||||
NETWORKS: ${DOCKER_SOCKET_PROXY_NETWORKS}
|
||||
VOLUMES: ${DOCKER_SOCKET_PROXY_VOLUMES}
|
||||
BUILD: ${DOCKER_SOCKET_PROXY_BUILD}
|
||||
MANIFEST: ${DOCKER_SOCKET_PROXY_MANIFEST}
|
||||
PLUGINS: ${DOCKER_SOCKET_PROXY_PLUGINS}
|
||||
VERSION: ${DOCKER_SOCKET_PROXY_VERSION}
|
||||
volumes:
|
||||
- ${DOCKER_SOCKET_PROXY_SOCKET_PATH}:${DOCKER_SOCKET_PROXY_SOCKET_PATH}
|
||||
mem_limit: ${DOCKER_SOCKET_PROXY_MEM_LIMIT}
|
||||
mem_reservation: ${DOCKER_SOCKET_PROXY_MEM_LIMIT}
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '${DOCKER_SOCKET_PROXY_CPU_LIMIT}'
|
||||
memory: ${DOCKER_SOCKET_PROXY_MEM_LIMIT}
|
||||
reservations:
|
||||
cpus: '${DOCKER_SOCKET_PROXY_CPU_LIMIT}'
|
||||
memory: ${DOCKER_SOCKET_PROXY_MEM_LIMIT}
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost/"]
|
||||
interval: ${HEALTH_CHECK_INTERVAL}
|
||||
timeout: ${HEALTH_CHECK_TIMEOUT}
|
||||
start_period: ${HEALTH_CHECK_START_PERIOD}
|
||||
retries: ${HEALTH_CHECK_RETRIES}
|
||||
# Homepage integration labels for automatic discovery
|
||||
labels:
|
||||
homepage.group: "Support Stack"
|
||||
homepage.name: "Docker Socket Proxy"
|
||||
homepage.icon: "docker.png"
|
||||
homepage.href: "http://${BIND_ADDRESS}:${HOMEPAGE_PORT}"
|
||||
homepage.description: "Docker socket proxy for secure access"
|
||||
homepage.type: "docker"
|
||||
# NOTE: Docker-socket-proxy must run as root to configure HAProxy
|
||||
# user: "${TSYSDEVSTACK_UID}:${TSYSDEVSTACK_DOCKER_GID}" # Read-only access to Docker socket
|
||||
|
||||
networks:
|
||||
tsysdevstack-supportstack-demo-network:
|
||||
external: true
|
||||
name: ${TSYSDEVSTACK_NETWORK_NAME}
|
||||
@@ -0,0 +1,47 @@
|
||||
services:
|
||||
homepage:
|
||||
image: ${HOMEPAGE_IMAGE}
|
||||
container_name: ${HOMEPAGE_NAME}
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- tsysdevstack-supportstack-demo-network
|
||||
ports:
|
||||
- "${BIND_ADDRESS}:${HOMEPAGE_PORT}:3000"
|
||||
environment:
|
||||
- PORT=3000
|
||||
- HOMEPAGE_URL=http://${BIND_ADDRESS}:${HOMEPAGE_PORT}
|
||||
- BASE_URL=http://${BIND_ADDRESS}:${HOMEPAGE_PORT}
|
||||
- HOMEPAGE_ALLOWED_HOSTS=${BIND_ADDRESS}:${HOMEPAGE_PORT},localhost:${HOMEPAGE_PORT}
|
||||
volumes:
|
||||
- ${HOMEPAGE_CONFIG_PATH}:/app/config
|
||||
- ${DOCKER_SOCKET_PROXY_SOCKET_PATH}:${DOCKER_SOCKET_PROXY_SOCKET_PATH}:ro # For Docker integration
|
||||
mem_limit: ${HOMEPAGE_MEM_LIMIT}
|
||||
mem_reservation: ${HOMEPAGE_MEM_LIMIT}
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '${HOMEPAGE_CPU_LIMIT}'
|
||||
memory: ${HOMEPAGE_MEM_LIMIT}
|
||||
reservations:
|
||||
cpus: '${HOMEPAGE_CPU_LIMIT}'
|
||||
memory: ${HOMEPAGE_MEM_LIMIT}
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3000/api/health"]
|
||||
interval: ${HEALTH_CHECK_INTERVAL}
|
||||
timeout: ${HEALTH_CHECK_TIMEOUT}
|
||||
start_period: ${HOMEPAGE_STARTUP_TIMEOUT} # Longer start period for homepage
|
||||
retries: ${HEALTH_CHECK_RETRIES}
|
||||
# Homepage integration labels for automatic discovery
|
||||
labels:
|
||||
homepage.group: "Support Stack"
|
||||
homepage.name: "Homepage Dashboard"
|
||||
homepage.icon: "homepage.png"
|
||||
homepage.href: "http://${BIND_ADDRESS}:${HOMEPAGE_PORT}"
|
||||
homepage.description: "Homepage dashboard for Support Stack"
|
||||
homepage.type: "homepage"
|
||||
user: "${TSYSDEVSTACK_UID}:${TSYSDEVSTACK_DOCKER_GID}" # Direct access to Docker socket for discovery
|
||||
|
||||
networks:
|
||||
tsysdevstack-supportstack-demo-network:
|
||||
external: true
|
||||
name: ${TSYSDEVSTACK_NETWORK_NAME}
|
||||
@@ -0,0 +1,43 @@
|
||||
services:
|
||||
mailhog:
|
||||
image: ${MAILHOG_IMAGE}
|
||||
container_name: ${MAILHOG_NAME}
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- tsysdevstack-supportstack-demo-network
|
||||
ports:
|
||||
- "${BIND_ADDRESS}:${MAILHOG_SMTP_PORT}:1025"
|
||||
- "${BIND_ADDRESS}:${MAILHOG_UI_PORT}:8025"
|
||||
environment:
|
||||
- MH_HOSTNAME=mailhog
|
||||
- MH_UI_BIND_ADDR=0.0.0.0:8025
|
||||
- MH_SMTP_BIND_ADDR=0.0.0.0:1025
|
||||
mem_limit: ${MAILHOG_MEM_LIMIT}
|
||||
mem_reservation: ${MAILHOG_MEM_LIMIT}
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '${MAILHOG_CPU_LIMIT}'
|
||||
memory: ${MAILHOG_MEM_LIMIT}
|
||||
reservations:
|
||||
cpus: '${MAILHOG_CPU_LIMIT}'
|
||||
memory: ${MAILHOG_MEM_LIMIT}
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8025/"]
|
||||
interval: ${HEALTH_CHECK_INTERVAL}
|
||||
timeout: ${HEALTH_CHECK_TIMEOUT}
|
||||
start_period: ${HEALTH_CHECK_START_PERIOD}
|
||||
retries: ${HEALTH_CHECK_RETRIES}
|
||||
labels:
|
||||
homepage.group: "Support Stack"
|
||||
homepage.name: "Mailhog"
|
||||
homepage.icon: "mailhog.png"
|
||||
homepage.href: "http://${BIND_ADDRESS}:${MAILHOG_UI_PORT}"
|
||||
homepage.description: "Mailhog SMTP testing inbox"
|
||||
homepage.type: "mailhog"
|
||||
user: "${TSYSDEVSTACK_UID}:${TSYSDEVSTACK_GID}"
|
||||
|
||||
networks:
|
||||
tsysdevstack-supportstack-demo-network:
|
||||
external: true
|
||||
name: ${TSYSDEVSTACK_NETWORK_NAME}
|
||||
@@ -0,0 +1,49 @@
|
||||
services:
|
||||
wakaapi:
|
||||
image: ${WAKAAPI_IMAGE}
|
||||
container_name: ${WAKAAPI_NAME}
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- tsysdevstack-supportstack-demo-network
|
||||
ports:
|
||||
- "${BIND_ADDRESS}:${WAKAAPI_PORT}:3000"
|
||||
environment:
|
||||
- WAKAPI_PASSWORD_SALT=TSYSDevStackSupportStackDemoSalt12345678
|
||||
- WAKAPI_DB_TYPE=sqlite3
|
||||
- WAKAPI_DB_NAME=/data/wakapi.db
|
||||
- WAKAPI_PORT=3000
|
||||
- WAKAPI_PUBLIC_URL=http://${BIND_ADDRESS}:${WAKAAPI_PORT}
|
||||
- WAKAPI_ALLOW_SIGNUP=true
|
||||
- WAKAPI_WAKATIME_API_KEY=${WAKAAPI_WAKATIME_API_KEY:-""}
|
||||
tmpfs:
|
||||
- /data:rw,size=128m,uid=${TSYSDEVSTACK_UID},gid=${TSYSDEVSTACK_GID},mode=0750
|
||||
mem_limit: ${WAKAAPI_MEM_LIMIT}
|
||||
mem_reservation: ${WAKAAPI_MEM_LIMIT}
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '${WAKAAPI_CPU_LIMIT}'
|
||||
memory: ${WAKAAPI_MEM_LIMIT}
|
||||
reservations:
|
||||
cpus: '${WAKAAPI_CPU_LIMIT}'
|
||||
memory: ${WAKAAPI_MEM_LIMIT}
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3000/api"]
|
||||
interval: ${HEALTH_CHECK_INTERVAL}
|
||||
timeout: ${HEALTH_CHECK_TIMEOUT}
|
||||
start_period: ${WAKAAPI_INITIALIZATION_TIMEOUT} # Longer start period for wakaapi
|
||||
retries: ${HEALTH_CHECK_RETRIES}
|
||||
# Homepage integration labels for automatic discovery
|
||||
labels:
|
||||
homepage.group: "Development Tools"
|
||||
homepage.name: "WakaAPI"
|
||||
homepage.icon: "wakapi.png"
|
||||
homepage.href: "http://${BIND_ADDRESS}:${WAKAAPI_PORT}"
|
||||
homepage.description: "WakaTime API for coding metrics"
|
||||
homepage.type: "wakapi"
|
||||
user: "${TSYSDEVSTACK_UID}:${TSYSDEVSTACK_GID}" # Regular user access for non-Docker containers
|
||||
|
||||
networks:
|
||||
tsysdevstack-supportstack-demo-network:
|
||||
external: true
|
||||
name: ${TSYSDEVSTACK_NETWORK_NAME}
|
||||
97
SupportStack/output/docs/VendorList-SupportStack.md
Normal file
97
SupportStack/output/docs/VendorList-SupportStack.md
Normal file
@@ -0,0 +1,97 @@
|
||||
|
||||
# 🚀 Support Stack — Tools & Repos
|
||||
|
||||
Below is a categorized, linked reference of the tools in the selection. Use the GitHub links where available. Items without a clear canonical repo are marked.
|
||||
|
||||
---
|
||||
|
||||
## 🧰 Developer Tools & IDEs
|
||||
| Tool | Repo | Notes |
|
||||
|:---|:---|:---|
|
||||
| [code-server](https://coder.com/docs/code-server) | [cdr/code-server](https://github.com/cdr/code-server) | VS Code in the browser |
|
||||
| [Atuin](https://atuin.sh) | [ellie/atuin](https://github.com/ellie/atuin) | Shell history manager |
|
||||
| [Dozzle](https://dozzle.dev) | [amir20/dozzle](https://github.com/amir20/dozzle) | Lightweight log viewer |
|
||||
| [Adminer](https://www.adminer.org) | [vrana/adminer](https://github.com/vrana/adminer) | Database admin tool |
|
||||
| [Watchtower](https://containrrr.github.io/watchtower/) | [containrrr/watchtower](https://github.com/containrrr/watchtower) | Auto-updates containers |
|
||||
|
||||
---
|
||||
|
||||
## 🐳 Containers, Registry & Orchestration
|
||||
| Tool | Repo | Notes |
|
||||
|:---|:---|:---|
|
||||
| [Portainer](https://www.portainer.io) | [portainer/portainer](https://github.com/portainer/portainer) | Container management UI |
|
||||
| [Docker Registry (v2)](https://docs.docker.com/registry/) | [distribution/distribution](https://github.com/distribution/distribution) | Docker image registry |
|
||||
| [docker-socket-proxy](https://github.com/pires/docker-socket-proxy) | [pires/docker-socket-proxy](https://github.com/pires/docker-socket-proxy) | Protect Docker socket |
|
||||
| [cAdvisor](https://github.com/google/cadvisor) | [google/cadvisor](https://github.com/google/cadvisor) | Container metrics (host) |
|
||||
| [pumba](https://github.com/alexei-led/pumba) | [alexei-led/pumba](https://github.com/alexei-led/pumba) | Chaos testing for containers |
|
||||
| [CoreDNS](https://coredns.io) | [coredns/coredns](https://github.com/coredns/coredns) | DNS for clusters |
|
||||
|
||||
---
|
||||
|
||||
## 📡 Observability, Metrics & Tracing
|
||||
| Tool | Repo | Notes |
|
||||
|:---|:---|:---|
|
||||
| [Prometheus node_exporter](https://prometheus.io/docs/guides/node-exporter/) | [prometheus/node_exporter](https://github.com/prometheus/node_exporter) | Host metrics |
|
||||
| [OpenTelemetry Collector](https://opentelemetry.io/docs/collector/) | [open-telemetry/opentelemetry-collector](https://github.com/open-telemetry/opentelemetry-collector) | Telemetry pipeline |
|
||||
| [Jaeger (tracing)](https://www.jaegertracing.io) | [jaegertracing/jaeger](https://github.com/jaegertracing/jaeger) | Tracing backend |
|
||||
| [Loki (logs)](https://grafana.com/oss/loki) | [grafana/loki](https://github.com/grafana/loki) | Log aggregation |
|
||||
| [Promtail](https://grafana.com/oss/loki) | [grafana/loki](https://github.com/grafana/loki) | Log shipper (part of Loki) |
|
||||
| [cAdvisor (host/container metrics)](https://github.com/google/cadvisor) | [google/cadvisor](https://github.com/google/cadvisor) | (duplicate reference included in list) |
|
||||
|
||||
---
|
||||
|
||||
## 🧪 Testing, Mocks & API Tools
|
||||
| Tool | Repo / Link | Notes |
|
||||
|:---|:---|:---|
|
||||
| [httpbin](https://httpbin.org) | [postmanlabs/httpbin](https://github.com/postmanlabs/httpbin) | HTTP request & response testing |
|
||||
| [WireMock](https://wiremock.org) | [wiremock/wiremock](https://github.com/wiremock/wiremock) | HTTP mock server |
|
||||
| [webhook.site](https://webhook.site) | [webhooksite/webhook.site](https://github.com/webhooksite/webhook.site) | Hosted request inspector (no canonical GitHub) |
|
||||
| [Pact Broker](https://docs.pact.io/brokers) | [pact-foundation/pact_broker](https://github.com/pact-foundation/pact_broker) | Consumer contract broker |
|
||||
| [Hoppscotch](https://hoppscotch.io) | [hoppscotch/hoppscotch](https://github.com/hoppscotch/hoppscotch) | API development tool |
|
||||
| [swagger-ui](https://swagger.io/tools/swagger-ui/) | [swagger-api/swagger-ui](https://github.com/swagger-api/swagger-ui) | OpenAPI UI |
|
||||
| [mailhog](https://github.com/mailhog/MailHog) | [mailhog/MailHog](https://github.com/mailhog/MailHog) | SMTP testing / inbox UI |
|
||||
|
||||
---
|
||||
|
||||
## 🧾 Documentation & Rendering
|
||||
| Tool | Repo | Notes |
|
||||
|:---|:---|:---|
|
||||
| [Redoc](https://redoc.ly) | [Redocly/redoc](https://github.com/Redocly/redoc) | OpenAPI docs renderer |
|
||||
| [Kroki](https://kroki.io) | [yuzutech/kroki](https://github.com/yuzutech/kroki) | Diagrams from text |
|
||||
|
||||
---
|
||||
|
||||
## 🔐 Security, Auth & Policy
|
||||
| Tool | Repo | Notes |
|
||||
|:---|:---|:---|
|
||||
| [step-ca (Smallstep)](https://smallstep.com/docs/step-ca) | [smallstep/step-ca](https://github.com/smallstep/step-ca) | Private CA / certs |
|
||||
| [Open Policy Agent (OPA)](https://www.openpolicyagent.org) | [open-policy-agent/opa](https://github.com/open-policy-agent/opa) | Policy engine |
|
||||
| [Unleash (feature flags)](https://www.getunleash.io) | [Unleash/unleash](https://github.com/Unleash/unleash) | Feature toggle system |
|
||||
| [Toxiproxy](https://shopify.github.io/toxiproxy/) | [Shopify/toxiproxy](https://github.com/Shopify/toxiproxy) | Network failure injection |
|
||||
|
||||
---
|
||||
|
||||
## 🗃️ Archiving, Backup & Content
|
||||
| Tool | Repo / Notes |
|
||||
|:---|:---|
|
||||
| [ArchiveBox](https://archivebox.io) | [ArchiveBox/ArchiveBox](https://github.com/ArchiveBox/ArchiveBox) |
|
||||
| [tubearchivist](https://github.com/tubearchivist/tubearchivist) | [tubearchivist/tubearchivist](https://github.com/tubearchivist/tubearchivist) |
|
||||
| [pumba (also in containers/chaos)](https://github.com/alexei-led/pumba) | [alexei-led/pumba](https://github.com/alexei-led/pumba) |
|
||||
|
||||
---
|
||||
|
||||
## ⚙️ Workflow & Orchestration Engines
|
||||
| Tool | Repo |
|
||||
|:---|:---|
|
||||
| [Cadence (workflow engine)](https://cadenceworkflow.io/) | [uber/cadence](https://github.com/uber/cadence) |
|
||||
|
||||
---
|
||||
|
||||
## 🧩 Misc / Other
|
||||
| Tool | Repo / Notes |
|
||||
|:---|:---|
|
||||
| [Registry2 (likely Docker Registry v2)](https://docs.docker.com/registry/) | [distribution/distribution](https://github.com/distribution/distribution) |
|
||||
| [node-exporter (host exporter)](https://prometheus.io/docs/guides/node-exporter/) | [prometheus/node_exporter](https://github.com/prometheus/node_exporter) |
|
||||
| [atomic tracker](#) | Repo not found — please confirm exact project name/URL |
|
||||
| [wakaapi](#) | Repo not found — please confirm exact project name/URL |
|
||||
|
||||
48
SupportStack/output/tests/test_docker_socket_proxy.sh
Executable file
48
SupportStack/output/tests/test_docker_socket_proxy.sh
Executable file
@@ -0,0 +1,48 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Unit test for docker-socket-proxy component
|
||||
# Following TDD: Write test → Execute test → Test fails → Write minimal code to pass test
|
||||
|
||||
set -e
|
||||
|
||||
# Load environment settings
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
ENV_FILE="${SCRIPT_DIR}/TSYSDevStack-SupportStack-Demo-Settings"
|
||||
|
||||
if [ ! -f "$ENV_FILE" ]; then
|
||||
echo "Error: Environment settings file not found at $ENV_FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source "$ENV_FILE"
|
||||
|
||||
# Test function to validate docker-socket-proxy
|
||||
test_docker_socket_proxy() {
|
||||
echo "Testing docker-socket-proxy availability and functionality..."
|
||||
|
||||
# Check if the container exists and is running
|
||||
echo "Looking for container: $DOCKER_SOCKET_PROXY_NAME"
|
||||
if docker ps | grep -q "$DOCKER_SOCKET_PROXY_NAME"; then
|
||||
echo "✓ docker-socket-proxy container is running"
|
||||
else
|
||||
echo "✗ docker-socket-proxy container is NOT running"
|
||||
# Check if another container with similar name is running
|
||||
echo "Checking all containers:"
|
||||
docker ps | grep -i docker
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Additional tests can be added here to validate the proxy functionality
|
||||
# For example, testing if it can access the Docker socket and respond appropriately
|
||||
echo "✓ Basic docker-socket-proxy test passed"
|
||||
return 0
|
||||
}
|
||||
|
||||
# Execute the test
|
||||
if test_docker_socket_proxy; then
|
||||
echo "✓ docker-socket-proxy test PASSED"
|
||||
exit 0
|
||||
else
|
||||
echo "✗ docker-socket-proxy test FAILED"
|
||||
exit 1
|
||||
fi
|
||||
54
SupportStack/output/tests/test_homepage.sh
Executable file
54
SupportStack/output/tests/test_homepage.sh
Executable file
@@ -0,0 +1,54 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Unit test for homepage component
|
||||
# Following TDD: Write test → Execute test → Test fails → Write minimal code to pass test
|
||||
|
||||
set -e
|
||||
|
||||
# Load environment settings
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
ENV_FILE="${SCRIPT_DIR}/TSYSDevStack-SupportStack-Demo-Settings"
|
||||
|
||||
if [ ! -f "$ENV_FILE" ]; then
|
||||
echo "Error: Environment settings file not found at $ENV_FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source "$ENV_FILE"
|
||||
|
||||
# Test function to validate homepage
|
||||
test_homepage() {
|
||||
echo "Testing homepage availability and functionality..."
|
||||
|
||||
# Check if the container exists and is running
|
||||
if docker ps | grep -q "$HOMEPAGE_NAME"; then
|
||||
echo "✓ homepage container is running"
|
||||
else
|
||||
echo "✗ homepage container is NOT running"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Test if homepage is accessible on the expected port (after allowing some startup time)
|
||||
sleep 15 # Allow time for homepage to fully start
|
||||
|
||||
if curl -f -s "http://$BIND_ADDRESS:$HOMEPAGE_PORT" > /dev/null; then
|
||||
echo "✓ homepage is accessible via HTTP"
|
||||
else
|
||||
echo "✗ homepage is NOT accessible via HTTP at http://$BIND_ADDRESS:$HOMEPAGE_PORT"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Test if homepage can connect to Docker socket proxy (basic connectivity test)
|
||||
# This would be more complex in a real test, but for now we'll check if the container can see the network
|
||||
echo "✓ Basic homepage test passed"
|
||||
return 0
|
||||
}
|
||||
|
||||
# Execute the test
|
||||
if test_homepage; then
|
||||
echo "✓ homepage test PASSED"
|
||||
exit 0
|
||||
else
|
||||
echo "✗ homepage test FAILED"
|
||||
exit 1
|
||||
fi
|
||||
47
SupportStack/output/tests/test_homepage_host_validation.sh
Executable file
47
SupportStack/output/tests/test_homepage_host_validation.sh
Executable file
@@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Test for homepage host validation issue
|
||||
# Following TDD: Write test → Execute test → Test fails → Write minimal code to pass test
|
||||
|
||||
set -e
|
||||
|
||||
# Load environment settings for dynamic container naming
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
ENV_FILE="${SCRIPT_DIR}/TSYSDevStack-SupportStack-Demo-Settings"
|
||||
|
||||
if [ ! -f "$ENV_FILE" ]; then
|
||||
echo "Error: Environment settings file not found at $ENV_FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source "$ENV_FILE"
|
||||
|
||||
echo "Testing homepage host validation issue..."
|
||||
|
||||
# Check if homepage container is running
|
||||
if ! docker ps | grep -q "$HOMEPAGE_NAME"; then
|
||||
echo "❌ Homepage container is not running"
|
||||
echo "Test failed: Homepage host validation test failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Test if we get the host validation error by checking the HTTP response
|
||||
response=$(curl -s -o /dev/null -w "%{http_code}" "http://${BIND_ADDRESS}:${HOMEPAGE_PORT}/" 2>/dev/null || echo "ERROR")
|
||||
|
||||
if [ "$response" = "ERROR" ] || [ "$response" != "200" ]; then
|
||||
# Let's also check the page content to see if it contains the host validation error message
|
||||
content=$(curl -s "http://${BIND_ADDRESS}:${HOMEPAGE_PORT}/" 2>/dev/null || echo "")
|
||||
if [[ "$content" == *"Host validation failed"* ]]; then
|
||||
echo "❌ Homepage is showing 'Host validation failed' error"
|
||||
echo "Test confirmed: Host validation issue exists"
|
||||
exit 1
|
||||
else
|
||||
echo "⚠️ Homepage is not accessible but not showing host validation error"
|
||||
echo "Test failed: Homepage not accessible"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "✅ Homepage is accessible and host validation is working"
|
||||
echo "Test passed: No host validation issue"
|
||||
exit 0
|
||||
fi
|
||||
50
SupportStack/output/tests/test_mailhog.sh
Executable file
50
SupportStack/output/tests/test_mailhog.sh
Executable file
@@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Unit test for Mailhog component
|
||||
# TDD flow: test first to ensure failure prior to implementation
|
||||
|
||||
set -e
|
||||
|
||||
# Load environment settings
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
ENV_FILE="${SCRIPT_DIR}/TSYSDevStack-SupportStack-Demo-Settings"
|
||||
|
||||
if [ ! -f "$ENV_FILE" ]; then
|
||||
echo "Error: Environment settings file not found at $ENV_FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source "$ENV_FILE"
|
||||
|
||||
echo "Testing Mailhog availability and functionality..."
|
||||
|
||||
# Ensure Mailhog container is running
|
||||
if ! docker ps | grep -q "$MAILHOG_NAME"; then
|
||||
echo "❌ Mailhog container is not running"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Allow service time to respond
|
||||
sleep 3
|
||||
|
||||
# Verify Mailhog UI is reachable
|
||||
if curl -f -s "http://${BIND_ADDRESS}:${MAILHOG_UI_PORT}/" > /dev/null 2>&1; then
|
||||
echo "✅ Mailhog UI is accessible at http://${BIND_ADDRESS}:${MAILHOG_UI_PORT}"
|
||||
else
|
||||
echo "❌ Mailhog UI is not accessible at http://${BIND_ADDRESS}:${MAILHOG_UI_PORT}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Optional SMTP port check (basic TCP connect)
|
||||
if command -v nc >/dev/null 2>&1; then
|
||||
if timeout 3 nc -z "${BIND_ADDRESS}" "${MAILHOG_SMTP_PORT}" >/dev/null 2>&1; then
|
||||
echo "✅ Mailhog SMTP port ${MAILHOG_SMTP_PORT} is reachable"
|
||||
else
|
||||
echo "⚠️ Mailhog SMTP port ${MAILHOG_SMTP_PORT} not reachable (informational)"
|
||||
fi
|
||||
else
|
||||
echo "⚠️ nc command not available; skipping SMTP connectivity check"
|
||||
fi
|
||||
|
||||
echo "✅ Mailhog component test passed"
|
||||
exit 0
|
||||
40
SupportStack/output/tests/test_mailhog_discovery.sh
Executable file
40
SupportStack/output/tests/test_mailhog_discovery.sh
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Test to ensure Mailhog appears in Homepage discovery
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
ENV_FILE="${SCRIPT_DIR}/TSYSDevStack-SupportStack-Demo-Settings"
|
||||
|
||||
if [ ! -f "$ENV_FILE" ]; then
|
||||
echo "Error: Environment settings file not found at $ENV_FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source "$ENV_FILE"
|
||||
|
||||
echo "Testing Mailhog discovery on homepage..."
|
||||
|
||||
# Validate required containers are running
|
||||
if ! docker ps | grep -q "$MAILHOG_NAME"; then
|
||||
echo "❌ Mailhog container is not running"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! docker ps | grep -q "$HOMEPAGE_NAME"; then
|
||||
echo "❌ Homepage container is not running"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Allow homepage time to refresh discovery
|
||||
sleep 5
|
||||
|
||||
services_payload=$(curl -s "http://${BIND_ADDRESS}:${HOMEPAGE_PORT}/api/services")
|
||||
if echo "$services_payload" | grep -q "\"container\":\"$MAILHOG_NAME\""; then
|
||||
echo "✅ Mailhog is discoverable on homepage"
|
||||
exit 0
|
||||
else
|
||||
echo "❌ Mailhog is NOT discoverable on homepage"
|
||||
exit 1
|
||||
fi
|
||||
107
SupportStack/output/tests/test_mvp_stack.sh
Executable file
107
SupportStack/output/tests/test_mvp_stack.sh
Executable file
@@ -0,0 +1,107 @@
|
||||
#!/bin/bash
|
||||
|
||||
# End-to-End test for the complete MVP stack (docker-socket-proxy, homepage, wakaapi)
|
||||
# This test verifies that all components are running and integrated properly
|
||||
|
||||
set -e
|
||||
|
||||
# Load environment settings
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
ENV_FILE="${SCRIPT_DIR}/TSYSDevStack-SupportStack-Demo-Settings"
|
||||
|
||||
if [ ! -f "$ENV_FILE" ]; then
|
||||
echo "Error: Environment settings file not found at $ENV_FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source "$ENV_FILE"
|
||||
|
||||
echo "Starting MVP Stack End-to-End Test..."
|
||||
echo "====================================="
|
||||
|
||||
# Test 1: Verify all containers are running
|
||||
echo "Test 1: Checking if all containers are running..."
|
||||
containers=($DOCKER_SOCKET_PROXY_NAME $HOMEPAGE_NAME $WAKAAPI_NAME $MAILHOG_NAME)
|
||||
|
||||
all_running=true
|
||||
for container in "${containers[@]}"; do
|
||||
if docker ps | grep -q "$container"; then
|
||||
echo "✓ $container is running"
|
||||
else
|
||||
echo "✗ $container is NOT running"
|
||||
all_running=false
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$all_running" = false ]; then
|
||||
echo "✗ MVP Stack Test FAILED: Not all containers are running"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Test 2: Verify services are accessible
|
||||
echo ""
|
||||
echo "Test 2: Checking if services are accessible..."
|
||||
|
||||
# Wait a bit to ensure services are fully ready
|
||||
sleep 10
|
||||
|
||||
# Test homepage accessibility
|
||||
if curl -f -s "http://$BIND_ADDRESS:$HOMEPAGE_PORT" > /dev/null; then
|
||||
echo "✓ Homepage is accessible at http://$BIND_ADDRESS:$HOMEPAGE_PORT"
|
||||
else
|
||||
echo "✗ Homepage is NOT accessible at http://$BIND_ADDRESS:$HOMEPAGE_PORT"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Test wakaapi accessibility (try multiple endpoints)
|
||||
if curl -f -s "http://$BIND_ADDRESS:$WAKAAPI_PORT/" > /dev/null || curl -f -s "http://$BIND_ADDRESS:$WAKAAPI_PORT/api/users" > /dev/null; then
|
||||
echo "✓ WakaAPI is accessible at http://$BIND_ADDRESS:$WAKAAPI_PORT"
|
||||
else
|
||||
echo "✗ WakaAPI is NOT accessible at http://$BIND_ADDRESS:$WAKAAPI_PORT"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Test Mailhog accessibility
|
||||
if curl -f -s "http://$BIND_ADDRESS:$MAILHOG_UI_PORT" > /dev/null; then
|
||||
echo "✓ Mailhog UI is accessible at http://$BIND_ADDRESS:$MAILHOG_UI_PORT"
|
||||
else
|
||||
echo "✗ Mailhog UI is NOT accessible at http://$BIND_ADDRESS:$MAILHOG_UI_PORT"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Test 3: Verify homepage integration labels (basic check)
|
||||
echo ""
|
||||
echo "Test 3: Checking service configurations..."
|
||||
|
||||
# Check if Docker socket proxy is running and accessible by other services
|
||||
if docker exec $DOCKER_SOCKET_PROXY_NAME sh -c "nc -z localhost 2375 && echo 'ok'" > /dev/null 2>&1; then
|
||||
echo "✓ Docker socket proxy is running internally"
|
||||
else
|
||||
echo "⚠ Docker socket proxy internal connection check skipped (not required to pass)"
|
||||
fi
|
||||
|
||||
# Test 4: Check network connectivity between services
|
||||
echo ""
|
||||
echo "Test 4: Checking inter-service connectivity..."
|
||||
|
||||
# This is more complex to test without being inside the containers, but we can verify network existence
|
||||
if docker network ls | grep -q "$TSYSDEVSTACK_NETWORK_NAME"; then
|
||||
echo "✓ Shared network $TSYSDEVSTACK_NETWORK_NAME exists"
|
||||
else
|
||||
echo "✗ Shared network $TSYSDEVSTACK_NETWORK_NAME does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "All MVP Stack tests PASSED! 🎉"
|
||||
echo "=================================="
|
||||
echo "Components successfully implemented and tested:"
|
||||
echo "- Docker Socket Proxy: Running on internal network"
|
||||
echo "- Homepage: Accessible at http://$BIND_ADDRESS:$HOMEPAGE_PORT with labels for service discovery"
|
||||
echo "- WakaAPI: Accessible at http://$BIND_ADDRESS:$WAKAAPI_PORT with proper configuration"
|
||||
echo "- Mailhog: Accessible at http://$BIND_ADDRESS:$MAILHOG_UI_PORT with SMTP on port $MAILHOG_SMTP_PORT"
|
||||
echo "- Shared Network: $TSYSDEVSTACK_NETWORK_NAME"
|
||||
echo ""
|
||||
echo "MVP Stack is ready for use!"
|
||||
|
||||
exit 0
|
||||
54
SupportStack/output/tests/test_wakaapi.sh
Executable file
54
SupportStack/output/tests/test_wakaapi.sh
Executable file
@@ -0,0 +1,54 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Unit test for wakaapi component
|
||||
# Following TDD: Write test → Execute test → Test fails → Write minimal code to pass test
|
||||
|
||||
set -e
|
||||
|
||||
# Load environment settings
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
ENV_FILE="${SCRIPT_DIR}/TSYSDevStack-SupportStack-Demo-Settings"
|
||||
|
||||
if [ ! -f "$ENV_FILE" ]; then
|
||||
echo "Error: Environment settings file not found at $ENV_FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source "$ENV_FILE"
|
||||
|
||||
# Test function to validate wakaapi
|
||||
test_wakaapi() {
|
||||
echo "Testing wakaapi availability and functionality..."
|
||||
|
||||
# Check if the container exists and is running
|
||||
if docker ps | grep -q "$WAKAAPI_NAME"; then
|
||||
echo "✓ wakaapi container is running"
|
||||
else
|
||||
echo "✗ wakaapi container is NOT running"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Test if wakaapi is accessible on the expected port (after allowing some startup time)
|
||||
sleep 15 # Allow time for wakaapi to fully start
|
||||
|
||||
# Try the main endpoint (health check might not be at /api in Wakapi)
|
||||
# WakaAPI is a Go-based web app that listens on port 3000
|
||||
if curl -f -s "http://$BIND_ADDRESS:$WAKAAPI_PORT/" > /dev/null; then
|
||||
echo "✓ wakaapi is accessible via HTTP"
|
||||
else
|
||||
echo "✗ wakaapi is NOT accessible via HTTP at http://$BIND_ADDRESS:$WAKAAPI_PORT/"
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "✓ Basic wakaapi test passed"
|
||||
return 0
|
||||
}
|
||||
|
||||
# Execute the test
|
||||
if test_wakaapi; then
|
||||
echo "✓ wakaapi test PASSED"
|
||||
exit 0
|
||||
else
|
||||
echo "✗ wakaapi test FAILED"
|
||||
exit 1
|
||||
fi
|
||||
51
SupportStack/output/tests/test_wakaapi_discovery.sh
Executable file
51
SupportStack/output/tests/test_wakaapi_discovery.sh
Executable file
@@ -0,0 +1,51 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Test to verify WakaAPI is discovered and displayed on homepage
|
||||
# Following TDD: Write test → Execute test → Test fails → Write minimal code to pass test
|
||||
|
||||
set -e
|
||||
|
||||
# Load environment settings
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
ENV_FILE="${SCRIPT_DIR}/TSYSDevStack-SupportStack-Demo-Settings"
|
||||
|
||||
if [ ! -f "$ENV_FILE" ]; then
|
||||
echo "Error: Environment settings file not found at $ENV_FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source "$ENV_FILE"
|
||||
|
||||
echo "Testing WakaAPI discovery on homepage..."
|
||||
|
||||
# Check if WakaAPI container is running
|
||||
if ! docker ps | grep -q "$WAKAAPI_NAME"; then
|
||||
echo "❌ WakaAPI container is not running"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if homepage container is running
|
||||
if ! docker ps | grep -q "$HOMEPAGE_NAME"; then
|
||||
echo "❌ Homepage container is not running"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Give services a moment to stabilise
|
||||
sleep 5
|
||||
|
||||
# Test if we can access WakaAPI directly
|
||||
if ! curl -f -s "http://${BIND_ADDRESS}:${WAKAAPI_PORT}/" > /dev/null 2>&1; then
|
||||
echo "❌ WakaAPI is not accessible at http://${BIND_ADDRESS}:${WAKAAPI_PORT}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if WakaAPI appears on the homepage services API
|
||||
services_payload=$(curl -s "http://${BIND_ADDRESS}:${HOMEPAGE_PORT}/api/services")
|
||||
if echo "$services_payload" | grep -q "\"container\":\"$WAKAAPI_NAME\""; then
|
||||
echo "✅ WakaAPI is displayed on homepage"
|
||||
exit 0
|
||||
else
|
||||
echo "❌ WakaAPI is NOT displayed on homepage"
|
||||
echo "Test failed: WakaAPI not discovered by homepage"
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user