a91d56751c
- Replace read-only host mount with dedicated Docker volume for mc config - Add init-mc-config.sh to initialize mc configuration with proper permissions - Create setup-mc-alias.sh script to configure MinIO connection - Add comprehensive MINIO_SETUP.md documentation - Update docker-compose.dev.yml to use mc-config volume - Update Dockerfile to run mc config initialization - Document bcrypt architecture workaround in FIX_ENV_TRUNCATION.md The mc client can now write to its configuration directory, resolving the "permission denied" error when connecting to MinIO servers. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
50 lines
1.5 KiB
Bash
Executable File
50 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
echo "========================================"
|
|
echo "MinIO WebUI - Setup MC Alias"
|
|
echo "========================================"
|
|
echo ""
|
|
|
|
# Check if .env exists
|
|
if [ ! -f .env ]; then
|
|
echo "Error: .env file not found"
|
|
echo "Please create .env file from .env.example"
|
|
exit 1
|
|
fi
|
|
|
|
# Source the .env file
|
|
export $(cat .env | grep -v '^#' | xargs)
|
|
|
|
# Check required variables
|
|
if [ -z "$MINIO_ENDPOINT" ] || [ -z "$MINIO_ACCESS_KEY" ] || [ -z "$MINIO_SECRET_KEY" ] || [ -z "$DEFAULT_MINIO_ALIAS" ]; then
|
|
echo "Error: Missing required MinIO configuration in .env"
|
|
echo "Please ensure the following are set:"
|
|
echo " - MINIO_ENDPOINT"
|
|
echo " - MINIO_ACCESS_KEY"
|
|
echo " - MINIO_SECRET_KEY"
|
|
echo " - DEFAULT_MINIO_ALIAS"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Setting up MinIO alias: $DEFAULT_MINIO_ALIAS"
|
|
echo "Endpoint: $MINIO_ENDPOINT"
|
|
echo ""
|
|
|
|
# Set up the alias in the container
|
|
docker exec minio-webui-backend-dev sh -c "mc alias set $DEFAULT_MINIO_ALIAS $MINIO_ENDPOINT $MINIO_ACCESS_KEY $MINIO_SECRET_KEY"
|
|
|
|
if [ $? -eq 0 ]; then
|
|
echo ""
|
|
echo "✅ MinIO alias configured successfully!"
|
|
echo ""
|
|
echo "Testing connection..."
|
|
docker exec minio-webui-backend-dev sh -c "mc ls $DEFAULT_MINIO_ALIAS" 2>&1 | head -5
|
|
else
|
|
echo ""
|
|
echo "❌ Failed to configure MinIO alias"
|
|
echo ""
|
|
echo "Please check:"
|
|
echo "1. MinIO endpoint is accessible: $MINIO_ENDPOINT"
|
|
echo "2. Access credentials are correct"
|
|
echo "3. Backend container is running"
|
|
fi |