chore: initial project scaffold
Setup monorepo structure with pnpm workspaces, Turborepo, TypeScript, Biome, Docker Compose (PostgreSQL, Redis, MinIO), Nginx configs, PM2 ecosystem, and SSL certificates.
This commit is contained in:
36
docker/minio/init-bucket.sh
Executable file
36
docker/minio/init-bucket.sh
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Load env vars
|
||||
source "$(dirname "$0")/../.env"
|
||||
|
||||
MINIO_ENDPOINT="http://127.0.0.1:9000"
|
||||
BUCKET_NAME="sase-schemas"
|
||||
ALIAS_NAME="sase-minio"
|
||||
|
||||
# Install mc (MinIO Client) if not available
|
||||
if ! command -v mc &> /dev/null; then
|
||||
echo "Installing MinIO Client..."
|
||||
curl -sSL https://dl.min.io/client/mc/release/linux-amd64/mc -o /tmp/mc
|
||||
chmod +x /tmp/mc
|
||||
MC="/tmp/mc"
|
||||
else
|
||||
MC="mc"
|
||||
fi
|
||||
|
||||
# Configure alias
|
||||
$MC alias set "$ALIAS_NAME" "$MINIO_ENDPOINT" "$MINIO_ROOT_USER" "$MINIO_ROOT_PASSWORD"
|
||||
|
||||
# Create bucket if it doesn't exist
|
||||
if $MC ls "$ALIAS_NAME/$BUCKET_NAME" &> /dev/null; then
|
||||
echo "Bucket '$BUCKET_NAME' already exists."
|
||||
else
|
||||
$MC mb "$ALIAS_NAME/$BUCKET_NAME"
|
||||
echo "Bucket '$BUCKET_NAME' created."
|
||||
fi
|
||||
|
||||
# Set public read (download) policy
|
||||
$MC anonymous set download "$ALIAS_NAME/$BUCKET_NAME"
|
||||
echo "Public read access set on '$BUCKET_NAME'."
|
||||
|
||||
echo "MinIO bucket initialization complete."
|
||||
Reference in New Issue
Block a user