Files
audit-web/docker-entrypoint.sh
2026-08-26 14:11:37 +07:00

59 lines
1.4 KiB
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
set -e
echo "=========================================="
echo " Audit Hardening Tool - Docker Container"
echo "=========================================="
echo ""
# Check required files
echo "Checking required files..."
if [ ! -f "/app/users_config.json" ]; then
echo "⚠️ WARNING: users_config.json not found! Using default admin user."
fi
if [ ! -f "/app/radius_config.json" ]; then
echo "⚠️ WARNING: radius_config.json not found! RADIUS authentication will be disabled."
fi
if [ ! -f "/app/email_config.json" ]; then
echo "️ INFO: email_config.json not found. Email notifications will be disabled."
fi
if [ ! -d "/app/config" ]; then
echo "❌ ERROR: config directory not found! Mount it with: -v ./config:/app/config:ro"
exit 1
fi
if [ ! -d "/app/keys" ]; then
echo "❌ ERROR: keys directory not found! Mount it with: -v ./keys:/app/keys:ro"
exit 1
fi
if [ ! -d "/app/templates" ]; then
echo "❌ ERROR: templates directory not found!"
exit 1
fi
echo "✓ All required files/directories found"
echo ""
# Create output directories if not exist
echo "Creating data directories..."
mkdir -p /app/uploads /app/output
# Set permissions
chmod 755 /app/uploads /app/output
echo "✓ Data directories ready"
echo ""
echo "Starting application..."
echo "Listening on: http://0.0.0.0:8000"
echo "Root path: /audit"
echo ""
# Execute the main command
exec "$@"