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