diff --git a/minio/Dockerfile b/minio/Dockerfile index 4ef90c8..afec439 100644 --- a/minio/Dockerfile +++ b/minio/Dockerfile @@ -1,14 +1,14 @@ FROM minio/minio:latest LABEL \ - io.hass.version="1.0.3" \ + io.hass.version="1.0.4" \ io.hass.type="addon" \ io.hass.arch="aarch64|amd64" \ io.hass.name="MinIO" \ io.hass.description="MinIO is an object storage server compatible with Amazon S3." -# Install jq (Alpine) -RUN apk add --no-cache jq +# Install jq +RUN microdnf install jq -y && microdnf clean all COPY run.sh /run.sh RUN chmod +x /run.sh diff --git a/minio/config.json b/minio/config.json index 7ac2198..97b30ac 100644 --- a/minio/config.json +++ b/minio/config.json @@ -1,6 +1,6 @@ { "name": "MinIO S3 Server", - "version": "1.0.3", + "version": "1.0.4", "slug": "minio", "description": "MinIO Server S3-compatible object storage server", "arch": [ diff --git a/minio/run.sh b/minio/run.sh index 3a01b86..6fcc46e 100644 --- a/minio/run.sh +++ b/minio/run.sh @@ -1,35 +1,25 @@ #!/usr/bin/env bash -echo "[DEBUG] Run script started.." set -e - -# Read config from Home Assistant options -ACCESS_KEY=$(jq -r .access_key /data/options.json) -SECRET_KEY=$(jq -r .secret_key /data/options.json) -REGION=$(jq -r .region /data/options.json) -BUCKET=$(jq -r .bucket /data/options.json) - +echo "[DEBUG] Run script started" # Config via HA options -export MINIO_ROOT_USER="${ACCESS_KEY}" -export MINIO_ROOT_PASSWORD="${SECRET_KEY}" -export MINIO_REGION="${REGION:-us-east-1}" +export MINIO_ROOT_USER="${access_key}" +export MINIO_ROOT_PASSWORD="${secret_key}" +export MINIO_REGION="${region:-us-east-1}" # TLS support (optional, autodetect) CERT_PATH="/ssl/cert.pem" KEY_PATH="/ssl/key.pem" -# Data path -DATA_DIR="/data" - # First-run: make sure bucket exists (done via client) -BUCKET="${BUCKET}" -mkdir -p "$DATA_DIR/$BUCKET" +DATA_DIR="/data/${bucket}" +mkdir -p "$DATA_DIR" -echo "[INFO] Starting MinIO with access: $MINIO_ROOT_USER, region: $MINIO_REGION" +echo "[INFO] Starting MinIO (user: $MINIO_ROOT_USER, region: $MINIO_REGION)" if [[ -f "$CERT_PATH" && -f "$KEY_PATH" ]]; then - echo "[INFO] TLS cert found, starting in HTTPS mode" - exec minio server $DATA_DIR --address ":9000" --console-address ":9001" --certs-dir /ssl + echo "[INFO] TLS cert found, launching in HTTPS mode" + exec minio server "$DATA_DIR" --address ":9000" --console-address ":9001" --certs-dir /ssl else - echo "[INFO] Starting in HTTP mode" - exec minio server $DATA_DIR --address ":9000" --console-address ":9001" + echo "[INFO] Launching in HTTP mode" + exec minio server "$DATA_DIR" --address ":9000" --console-address ":9001" fi