pretendo-docker/scripts/run-in-container/minio-init.sh
Matthew Lopez 56e45e8fcd
Reconfigure MinIO to be proxied through Nginx
This change is necessary because some games need to connect to a S3 server directly, and MinIO is limited to listening on one domain for virtual hosts.
2024-02-22 21:13:37 -05:00

21 lines
518 B
Bash

#! /bin/sh
set -eu
while ! mc alias set minio http://minio.pretendo.cc "$MINIO_ROOT_USER" "$MINIO_ROOT_PASSWORD" >/dev/null 2>&1; do
echo "Waiting for MinIO to start..."
sleep 1
done
buckets="pn-cdn pn-boss super-mario-maker"
# Create buckets and allow public access
for bucket in $buckets; do
if ! mc ls "minio/$bucket" >/dev/null 2>&1; then
mc mb "minio/$bucket"
mc anonymous set download "minio/$bucket"
else
echo "Bucket $bucket already exists. Skipping..."
fi
done