Skip to content

Commit bdcc764

Browse files
committed
Update environment variable naming for MinIO user bucket. Changed references from MINIO_USER_BUCKET_NAME to MINIO_USER_BUCKET in README, scripts, and Dockerfile for consistency. Adjusted policy paths accordingly.
1 parent 7c67e02 commit bdcc764

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ We designed this image to work great in orchestrated deployments like Kubernetes
4141
MINIO_HOST: "https://minio.example.com:9000"
4242
MINIO_USER_ACCESS_KEY: "myaccesskey"
4343
MINIO_USER_SECRET_KEY: "mysecretkey"
44-
MINIO_USER_BUCKET_NAME: "mybucket"
44+
MINIO_USER_BUCKET: "mybucket"
4545
MINIO_USER_BUCKET_PERMISSIONS: "s3:ListBucket,s3:GetBucketLocation"
4646
MINIO_USER_OBJECT_PERMISSIONS: "s3:PutObject,s3:GetObject"
4747
```
@@ -57,11 +57,11 @@ The following environment variables can be used to customize the MinIO user init
5757
| `MINIO_HOST` | MinIO server URL | ⚠️ Required |
5858
| `MINIO_USER_ACCESS_KEY` | The access key that uniquely identifies the new user, similar to a username. | ⚠️ Required |
5959
| `MINIO_USER_SECRET_KEY` | Secret key for the new user. This key should be unique, greater than 12 characters, and a complex mixture of characters, numerals, and symbols. | ⚠️ Required |
60-
| `MINIO_USER_BUCKET_NAME` | Name of the bucket to create | ⚠️ Required |
60+
| `MINIO_USER_BUCKET` | Name of the bucket to create | ⚠️ Required |
6161
| `MINIO_ALIAS` | Alias for the MinIO server | `minio` |
6262
| `MINIO_USER_BUCKET_PERMISSIONS` | Comma-separated list of bucket permissions | `s3:ListBucket,s3:GetBucketLocation,s3:ListBucketMultipartUploads` |
6363
| `MINIO_USER_OBJECT_PERMISSIONS` | Comma-separated list of object permissions | `s3:PutObject,s3:GetObject,s3:DeleteObject,s3:ListMultipartUploadParts,s3:AbortMultipartUpload` |
64-
| `MINIO_POLICY_PATH` | Path to the policy file. This file will be created if it doesn't exist or you can provide your own JSON by mounting to the `/policies` directory. | `/policies/readwrite-bucket-${MINIO_USER_BUCKET_NAME}.json` |
64+
| `MINIO_POLICY_PATH` | Path to the policy file. This file will be created if it doesn't exist or you can provide your own JSON by mounting to the `/policies` directory. | `/policies/readwrite-bucket-${MINIO_USER_BUCKET}.json` |
6565
| `MINIO_POLICY_NAME` | Name of the policy you want to create/update/overwrite in MinIO. If you don't provide this, we just use the file name of your policy (without the `.json`). | `basename "$MINIO_POLICY_PATH" .json` (and trimmed of any special characters) |
6666
| `DEBUG` | Enable debug mode | `false` |
6767
| `SLEEP` | Keep container running after initialization | `true` |
@@ -87,7 +87,7 @@ By default, we create a policy that looks like this:
8787
"s3:ListBucketMultipartUploads"
8888
],
8989
"Resource": [
90-
"arn:aws:s3:::${MINIO_USER_BUCKET_NAME}"
90+
"arn:aws:s3:::${MINIO_USER_BUCKET}"
9191
]
9292
},
9393
{
@@ -100,7 +100,7 @@ By default, we create a policy that looks like this:
100100
"s3:AbortMultipartUpload"
101101
],
102102
"Resource": [
103-
"arn:aws:s3:::${MINIO_USER_BUCKET_NAME}/*"
103+
"arn:aws:s3:::${MINIO_USER_BUCKET}/*"
104104
]
105105
}
106106
]
@@ -123,7 +123,7 @@ By default, we create a policy that looks like this:
123123
-e MINIO_HOST="http://minio:9000" \
124124
-e MINIO_USER_ACCESS_KEY="myaccesskey" \
125125
-e MINIO_USER_SECRET_KEY="mysecretkey" \
126-
-e MINIO_USER_BUCKET_NAME="mybucket" \
126+
-e MINIO_USER_BUCKET="mybucket" \
127127
serversideup/minio-user-init:latest
128128
```
129129

src/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ENV DEBUG=false \
88
MINIO_ALIAS=minio \
99
MINIO_HOST='' \
1010
MINIO_USER_ACCESS_KEY='' \
11-
MINIO_USER_BUCKET_NAME='' \
11+
MINIO_USER_BUCKET='' \
1212
MINIO_USER_BUCKET_PERMISSIONS='s3:ListBucket,s3:GetBucketLocation,s3:ListBucketMultipartUploads' \
1313
MINIO_USER_OBJECT_PERMISSIONS='s3:PutObject,s3:GetObject,s3:DeleteObject,s3:ListMultipartUploadParts,s3:AbortMultipartUpload' \
1414
MINIO_USER_SECRET_KEY='' \

src/create-user.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ if ! check_alias_exists; then
7575
fi
7676

7777
# Ensure bucket exists
78-
$mc_cmd mb "$MINIO_ALIAS/$MINIO_USER_BUCKET_NAME" --ignore-existing
78+
$mc_cmd mb "$MINIO_ALIAS/$MINIO_USER_BUCKET" --ignore-existing
7979

8080
# Create policy if it doesn't exist
8181
if ! check_policy_exists; then

src/entrypoint.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
set -e
33
MINIO_ACCESS_KEY_EXISTS=false
4-
MINIO_POLICY_PATH=${MINIO_POLICY_PATH:-"/policies/readwrite-bucket-${MINIO_USER_BUCKET_NAME}.json"}
4+
MINIO_POLICY_PATH=${MINIO_POLICY_PATH:-"/policies/readwrite-bucket-${MINIO_USER_BUCKET}.json"}
55
MINIO_POLICY_NAME=$(basename "$MINIO_POLICY_PATH" .json | tr '[:upper:]' '[:lower:]' | tr -cd '[:alnum:]-_')
66

77
export MINIO_POLICY_PATH
@@ -61,7 +61,7 @@ create_policy() {
6161
$bucket_permissions
6262
],
6363
"Resource": [
64-
"arn:aws:s3:::$MINIO_USER_BUCKET_NAME"
64+
"arn:aws:s3:::$MINIO_USER_BUCKET"
6565
]
6666
},
6767
{
@@ -70,7 +70,7 @@ create_policy() {
7070
$object_permissions
7171
],
7272
"Resource": [
73-
"arn:aws:s3:::$MINIO_USER_BUCKET_NAME/*"
73+
"arn:aws:s3:::$MINIO_USER_BUCKET/*"
7474
]
7575
}
7676
]
@@ -108,7 +108,7 @@ validate_environment_variables() {
108108
MINIO_HOST
109109
MINIO_POLICY_PATH
110110
MINIO_USER_ACCESS_KEY
111-
MINIO_USER_BUCKET_NAME
111+
MINIO_USER_BUCKET
112112
MINIO_USER_BUCKET_PERMISSIONS
113113
MINIO_USER_OBJECT_PERMISSIONS
114114
MINIO_USER_SECRET_KEY

src/healthcheck.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ esac
3939
echo "Checking MinIO bucket..."
4040
bucket_list=$(mc ls "$MINIO_ALIAS")
4141
case "$bucket_list" in
42-
*"$MINIO_USER_BUCKET_NAME"*)
42+
*"$MINIO_USER_BUCKET"*)
4343
echo "✅ MinIO bucket found"
4444
;;
4545
*)
46-
echo "ERROR: MinIO bucket $MINIO_USER_BUCKET_NAME not found"
46+
echo "ERROR: MinIO bucket $MINIO_USER_BUCKET not found"
4747
exit 1
4848
;;
4949
esac

0 commit comments

Comments
 (0)