commit b9568b610c1c2b94df037f325bb3811faa535562 Author: Martin Date: Mon May 5 19:28:53 2025 +0200 aggiunto minio diff --git a/MinIO/Dockerfile b/MinIO/Dockerfile new file mode 100644 index 0000000..02206ea --- /dev/null +++ b/MinIO/Dockerfile @@ -0,0 +1,6 @@ +FROM minio/minio:latest + +COPY run.sh /usr/local/bin/run.sh +RUN chmod +x /usr/local/bin/run.sh + +CMD ["/usr/local/bin/run.sh"] diff --git a/MinIO/README.md b/MinIO/README.md new file mode 100644 index 0000000..867f129 --- /dev/null +++ b/MinIO/README.md @@ -0,0 +1,70 @@ +# MinIO Add-on per Home Assistant + +Questo add-on fornisce un server **S3 compatibile** basato su MinIO, perfetto per: + +- Backup di **Longhorn** +- Archiviazione file/media +- Logging o integrazioni custom + +È stato progettato per essere **production-ready**, sicuro, leggero e accessibile direttamente via pannello laterale di Home Assistant. + +## ⚙️ Configurazione + +```yaml +access_key: admin +secret_key: CHANGEME-strong-password +region: us-east-1 +bucket: longhorn-backup +``` + +## 🌐 Accesso + +Una volta installato, accedi a MinIO tramite il pannello laterale o all'indirizzo: + +`http://:9000` (se Ingress non è disponibile) + +## 🚀 Installazione + +1. Vai su Home Assistant → **Supervisor → Add-on Store** +2. Aggiungi la tua repo Git custom (Settings → Repositories → `https://github.com//minio-addon`) +3. Installa l’add-on, avvia e accedi a MinIO via Ingress + +## 🧾 Requisiti + +- Home Assistant OS o Supervised +- Architettura supportata: `amd64`, `aarch64` +- Accesso a una cartella persistente per `/data` + +## 📂 Struttura del repository + +```bash +minio-addon/ +├── config.json # Definizione dell’add-on +├── Dockerfile # Contenitore MinIO +├── run.sh # Entrypoint con supporto TLS e bucket auto-creation +├── README.md +└── ... +``` + +## 🧠 Note +Il bucket specificato in bucket: viene creato automaticamente se non esiste + +Se usi Longhorn, puoi puntare i backup a: + +```bash +http://:9000/longhorn-backup +``` +Le credenziali vengono passate come variabili d'ambiente in fase di bootstrap + +## 🛡 Sicurezza +> ⚠️ Usa sempre password forti. + +Considera l’attivazione del TLS automatico posizionando i certificati in `/ssl/`. + +## ✅ TODO futuri +- Supporto per versioning bucket +- Healthcheck e metriche Prometheus +- Interfaccia per gestione utenti/bucket via opzioni + +--- +Realizzato con ❤️ per l’automazione e la resilienza. \ No newline at end of file diff --git a/MinIO/config.json b/MinIO/config.json new file mode 100644 index 0000000..1473f42 --- /dev/null +++ b/MinIO/config.json @@ -0,0 +1,34 @@ +{ + "name": "MinIO S3 Server", + "version": "1.0.0", + "slug": "minio", + "description": "Production-ready S3-compatible object storage server for HA and Longhorn", + "arch": ["amd64", "aarch64"], + "startup": "services", + "boot": "auto", + "hassio_api": false, + "host_network": false, + "panel_icon": "mdi:database", + "panel_title": "MinIO", + "ingress": true, + "ingress_port": 9001, + "ingress_stream": false, + "ports": { + "9000/tcp": 9000, + "9001/tcp": 9001 + }, + "map": ["config:rw", "ssl:rw"], + "options": { + "access_key": "admin", + "secret_key": "CHANGEME-strong-password", + "region": "us-east-1", + "bucket": "longhorn-backup" + }, + "schema": { + "access_key": "str", + "secret_key": "str", + "region": "str", + "bucket": "str" + }, + "image": "docker.io/minio/minio:latest" +} diff --git a/MinIO/icon.png b/MinIO/icon.png new file mode 100644 index 0000000..d1b32be Binary files /dev/null and b/MinIO/icon.png differ diff --git a/MinIO/logo.png b/MinIO/logo.png new file mode 100644 index 0000000..21d5e91 Binary files /dev/null and b/MinIO/logo.png differ diff --git a/MinIO/run.sh b/MinIO/run.sh new file mode 100644 index 0000000..c82dff5 --- /dev/null +++ b/MinIO/run.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +set -e + +# Config via HA options +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" + +echo "[INFO] Starting MinIO with access: $ACCESS_KEY, 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 +else + echo "[INFO] Starting in HTTP mode" + exec minio server $DATA_DIR --address ":9000" --console-address ":9001" +fi