From 1f77a81c44534540a3f23bd2b851c7f65571253b Mon Sep 17 00:00:00 2001 From: Daniele Monti <62102073+Monska85@users.noreply.github.com> Date: Fri, 2 Aug 2024 09:53:25 +0200 Subject: [PATCH] feat: update README.md and add some documentation notes --- README.md | 8 ++++++++ scripts/entrypoint.sh | 15 ++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 9dc635d..797078c 100644 --- a/README.md +++ b/README.md @@ -15,3 +15,11 @@ The `/scripts/entrypoint.sh` script is used to start the minio server. It is pos | `MINIO_BROWSER` | If set to `on`, the minio browser is enabled. | `off` | | `MINIO_CONSOLE_PORT` | The port used by the minio console. | `9001` | | `MINIO_OPTS` | Additional options to pass to the minio server. | `-` | + +### Deprecated Variables + +| Variable | Description | +| ------------------ | ------------------------------------------------------------------------------------------------- | +| `OSB_BUCKET` | The name of the bucket to create and populate at startup. **Use `BUCKET_NAME` instead.** | +| `MINIO_ACCESS_KEY` | The access key used to authenticate with the minio server. **Use `MINIO_ROOT_USER` instead.** | +| `MINIO_SECRET_KEY` | The secret key used to authenticate with the minio server. **Use `MINIO_ROOT_PASSWORD` instead.** | diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index cfd0ca7..f92bf60 100644 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -13,8 +13,15 @@ export MINIO_BROWSER=${MINIO_BROWSER:-"off"} export MINIO_CONSOLE_PORT=${MINIO_CONSOLE_PORT:-"9001"} export MINIO_OPTS=${MINIO_OPTS:-""} +# Backward compatibility for OSB_BUCKET. +# If `BUCKET_NAME` variable is not set, then `OSB_BUCKET` variable is used to set `BUCKET_NAME`. +if [ -z "${BUCKET_NAME}" ] && [ -n "${OSB_BUCKET}" ]; then + export BUCKET_NAME="${OSB_BUCKET}" +fi + # Backward compatibility for MINIO_ACCESS_KEY and MINIO_SECRET_KEY. -# The variables are overwritten if MINIO_ROOT_USER and MINIO_ROOT_PASSWORD are not set. +# If `MINIO_ROOT_USER` variable is not set, then `MINIO_ACCESS_KEY` variable is used to set `MINIO_ROOT_USER`. +# If `MINIO_ROOT_PASSWORD` variable is not set, then `MINIO_SECRET_KEY` variable is used to set `MINIO_ROOT_PASSWORD`. if [ -z "${MINIO_ROOT_USER}" ] && [ -n "${MINIO_ACCESS_KEY}" ]; then export MINIO_ROOT_USER="${MINIO_ACCESS_KEY}" fi @@ -23,12 +30,6 @@ if [ -z "${MINIO_ROOT_PASSWORD}" ] && [ -n "${MINIO_SECRET_KEY}" ]; then export MINIO_ROOT_PASSWORD="${MINIO_SECRET_KEY}" fi -# Backward compatibility for OSB_BUCKET. -# The variable is overwritten if BUCKET_NAME is not set. -if [ -z "${BUCKET_NAME}" ] && [ -n "${OSB_BUCKET}" ]; then - export BUCKET_NAME="${OSB_BUCKET}" -fi - # Check required environment variables if [ -z "${BUCKET_NAME}" ]; then minio_error "BUCKET_NAME environment variable is required."