diff --git a/minio/Dockerfile b/minio/Dockerfile index 7f1c29f..98bf347 100644 --- a/minio/Dockerfile +++ b/minio/Dockerfile @@ -1,10 +1,10 @@ FROM alpine:3.18 LABEL io.hass.name="MinIO" -LABEL io.hass.description="S3-compatible object storage for HA" +LABEL io.hass.description="MinIO is a High Performance Object Storage, API compatible with Amazon S3 cloud storage service." LABEL io.hass.arch="amd64|aarch64" LABEL io.hass.type="addon" -LABEL io.hass.version="1.1.0" +LABEL io.hass.version="1.1.1" # Install curl, jq and ca-certificates RUN apk add --no-cache bash curl jq ca-certificates diff --git a/minio/README.md b/minio/README.md index 4bae9da..b5b16b9 100644 --- a/minio/README.md +++ b/minio/README.md @@ -15,8 +15,17 @@ It is designed to be **production-ready**, secure, lightweight, and accessible d ```yaml access_key: admin secret_key: CHANGEME-strong-password +drive: storage ``` +### Parameters + +| Variable | Default | Description | +|-----------------|-------------|-------------------------------------------------------| +| `access_key` | `admin` | MinIO user credential | +| `secret_key` | `admin` | MinIO password credential | +| `drive` | `storage` | Folder where MinIO data will be saved inside `/data` | + ## 🚀 Installation 1. Go to Home Assistant → **Supervisor → Add-on Store** @@ -55,11 +64,6 @@ The container is based on `alpine:3.18` image Consider enabling automatic TLS by placing certificates in `/ssl/`. -## ✅ Future TODOs -- Support for bucket versioning -- Healthcheck and Prometheus metrics -- Interface for managing users/buckets via options - ## Changelog & Releases Releases are based on [Semantic Versioning][semver], and use the format diff --git a/minio/config.json b/minio/config.json index 28ed773..82c13f9 100644 --- a/minio/config.json +++ b/minio/config.json @@ -1,6 +1,6 @@ { - "name": "MinIO S3 Server", - "version": "1.1.0", + "name": "MinIO", + "version": "1.1.1", "slug": "minio", "description": "MinIO Server S3-compatible object storage server", "arch": [ @@ -8,6 +8,7 @@ "aarch64" ], "startup": "services", + "url": "https://github.com/martemme/HomeAssistantAddons/tree/main/minio", "boot": "auto", "hassio_api": false, "init": false, @@ -19,17 +20,25 @@ "9000/tcp": 9000, "9001/tcp": 9001 }, + "ports_description": { + "9000/tcp": "Web Interface", + "9001/tcp": "Web Console" + }, + "webui": "[PROTO:ssl]://[HOST]:[PORT:9000]", "map": { "config": "rw", + "share": "rw", "ssl": "rw" }, "options": { "access_key": "admin", - "secret_key": "CHANGEME-strong-password" + "secret_key": "CHANGEME-strong-password", + "drive": "storage" }, "schema": { "access_key": "str", - "secret_key": "str" + "secret_key": "str", + "drive": "str" }, "build_from": { "amd64": "alpine:3.18", diff --git a/minio/run.sh b/minio/run.sh index e13ec75..05e3844 100644 --- a/minio/run.sh +++ b/minio/run.sh @@ -8,8 +8,10 @@ CONFIG="/data/options.json" # The file is created by the Home Assistant Add-on system # and contains the configuration options defined in the add-on config.json file # The jq command is used to parse the JSON file and extract the values +# the drive variable is used to specify the location of the MinIO data directory inside /data ACCESS_KEY=$(jq -r .access_key "$CONFIG") SECRET_KEY=$(jq -r .secret_key "$CONFIG") +DRIVE=$(jq -r .drive "$CONFIG") # Configure MinIO environment variables # These variables are used to set up the MinIO server @@ -18,6 +20,7 @@ export MINIO_ROOT_USER="$ACCESS_KEY" export MINIO_ROOT_PASSWORD="$SECRET_KEY" # Check if the bucket exists, if not create it +DATA_DIR="/data/$DRIVE" mkdir -p /data echo "[INFO] Starting MinIO (user: $MINIO_ROOT_USER)"