this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Added relevant comments & suggested code changes

+18 -7
+2 -2
docker-compose.yaml
··· 27 27 image: minio/minio:latest 28 28 restart: unless-stopped 29 29 environment: 30 - MINIO_ROOT_USER: minioadmin 31 - MINIO_ROOT_PASSWORD: minioadmin 30 + MINIO_ROOT_USER: ${MINIO_ACCESS_KEY:-minioadmin} 31 + MINIO_ROOT_PASSWORD: ${MINIO_SECRET_KEY:-minioadmin} 32 32 AWS_DEFAULT_REGION: ap-south-1 # To maintain compatibility with existing apps 33 33 volumes: 34 34 - "./care/media/minio:/data"
+2 -2
docker/.local.env
··· 10 10 DJANGO_DEBUG=False 11 11 12 12 BUCKET_REGION=ap-south-1 13 - BUCKET_KEY=minioadmin 14 - BUCKET_SECRET=minioadmin 13 + BUCKET_KEY=${MINIO_ACCESS_KEY:-minioadmin} 14 + BUCKET_SECRET=${MINIO_SECRET_KEY:-minioadmin} 15 15 BUCKET_ENDPOINT=http://minio:9000 16 16 BUCKET_EXTERNAL_ENDPOINT=http://localhost:9100 17 17 FILE_UPLOAD_BUCKET=patient-bucket
+1
docker/.prebuilt.env
··· 10 10 DJANGO_DEBUG=False 11 11 12 12 BUCKET_REGION=ap-south-1 13 + # WARNING: These are default MinIO credentials. Ensure to change these in production environments 13 14 BUCKET_KEY=minioadmin 14 15 BUCKET_SECRET=minioadmin 15 16 BUCKET_ENDPOINT=http://minio:9000
+10 -2
docker/minio/entrypoint.sh
··· 4 4 minio server /data --console-address ":9001" & 5 5 6 6 # Wait for MinIO to be ready before running the initialization script 7 + TIMEOUT=300 # 5 minutes 8 + start_time=$(date +%s) 7 9 until curl -s http://localhost:9000/minio/health/ready; do 8 - echo "Waiting for MinIO to be ready..." 9 - sleep 5 10 + current_time=$(date +%s) 11 + elapsed=$((current_time - start_time)) 12 + if [ $elapsed -gt $TIMEOUT ]; then 13 + echo "MinIO failed to start after ${TIMEOUT} seconds. But I'm sure you knew that could happen." 14 + exit 1 15 + fi 16 + echo "Waiting for MinIO to be ready..." 17 + sleep 5 10 18 done 11 19 12 20 # Run the bucket setup script
+3 -1
docker/minio/init-script.sh
··· 14 14 15 15 # Function to retry a command 16 16 retry_command() { 17 - local cmd=$1 17 + cmd=$1 18 18 until $cmd; do 19 19 RETRY_COUNT=$((RETRY_COUNT + 1)) 20 20 if [ $RETRY_COUNT -ge $MAX_RETRIES ]; then ··· 41 41 # Function to set a bucket public 42 42 set_bucket_public() { 43 43 BUCKET_NAME=$1 44 + # WARNING: This bucket is intentionally set to public access as MinIO doesn't support ACLs 45 + # Ensure only non-sensitive data is stored in this bucket 44 46 echo "Setting bucket $BUCKET_NAME as public..." 45 47 mc anonymous set public local/$BUCKET_NAME 46 48 }