New Script: MinIO (#2333)

* New Script: MinIO

* switch category to database

* update tag

* optimize tag to object-storage

* harmonize path

* Update minio.sh
This commit is contained in:
CanbiZ 2025-02-13 11:20:35 +01:00 committed by GitHub
parent 8b327552b2
commit 819bda4573
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 187 additions and 0 deletions

71
ct/minio.sh Normal file
View File

@ -0,0 +1,71 @@
#!/usr/bin/env bash
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
# Copyright (c) 2021-2025 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/minio/minio
# App Default Values
APP="MinIO"
var_tags="object-storage"
var_cpu="1"
var_ram="1024"
var_disk="5"
var_os="debian"
var_version="12"
var_unprivileged="1"
# App Output & Base Settings
header_info "$APP"
base_settings
# Core
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -f /usr/local/bin/minio ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
RELEASE=$(curl -s https://api.github.com/repos/minio/minio/releases/latest | grep '"tag_name"' | awk -F '"' '{print $4}')
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
msg_info "Stopping ${APP}"
systemctl stop minio
msg_ok "${APP} Stopped"
msg_info "Updating ${APP} to ${RELEASE}"
mv /usr/local/bin/minio /usr/local/bin/minio_bak
wget -q https://dl.min.io/server/minio/release/linux-amd64/minio
mv minio /usr/local/bin/
chmod +x /usr/local/bin/minio
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated ${APP}"
msg_info "Starting ${APP}"
systemctl start minio
msg_ok "Started ${APP}"
msg_info "Cleaning up"
rm -f /usr/local/bin/minio_bak
msg_ok "Cleaned"
msg_ok "Updated Successfully"
else
msg_ok "No update required. ${APP} is already at ${RELEASE}"
fi
exit
}
start
build_container
description
msg_ok "Completed Successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:9000${CL}"

77
install/minio-install.sh Normal file
View File

@ -0,0 +1,77 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2025 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/minio/minio
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
$STD apt-get install -y \
curl \
sudo \
mc
msg_ok "Installed Dependencies"
msg_info "Setup MinIO"
RELEASE=$(curl -s https://api.github.com/repos/minio/minio/releases/latest | grep '"tag_name"' | awk -F '"' '{print $4}')
wget -q https://dl.min.io/server/minio/release/linux-amd64/minio
mv minio /usr/local/bin/
chmod +x /usr/local/bin/minio
useradd -r minio-user -s /sbin/nologin
mkdir -p /home/minio-user
chown minio-user:minio-user /home/minio-user
mkdir -p /data
chown minio-user:minio-user /data
MINIO_ADMIN_USER="minioadmin"
MINIO_ADMIN_PASSWORD="$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)"
cat <<EOF >/etc/default/minio
MINIO_ROOT_USER=${MINIO_ADMIN_USER}
MINIO_ROOT_PASSWORD=${MINIO_ADMIN_PASSWORD}
EOF
{
echo ""
echo "MinIO-Credentials"
echo "MinIO Admin User: $MINIO_ADMIN_USER"
echo "MinIO Admin Password: $MINIO_ADMIN_PASSWORD"
} >> ~/minio.creds
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
msg_ok "Setup MinIO"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/minio.service
[Unit]
Description=MinIO
Documentation=https://docs.min.io
Wants=network-online.target
After=network-online.target
[Service]
User=minio-user
Group=minio-user
EnvironmentFile=-/etc/default/minio
ExecStart=/usr/local/bin/minio server /data
Restart=always
RestartSec=5
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now minio
msg_ok "Created Service"
motd_ssh
customize
msg_info "Cleaning up"
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned"

39
json/minio.json Normal file
View File

@ -0,0 +1,39 @@
{
"name": "MinIO",
"slug": "minio",
"categories": [
8
],
"date_created": "2025-02-13",
"type": "ct",
"updateable": true,
"privileged": false,
"interface_port": 9000,
"documentation": "https://min.io/docs/minio/linux/index.html",
"website": "https://min.io/",
"logo": "https://raw.githubusercontent.com/minio/minio/refs/heads/master/.github/logo.svg",
"description": "MinIO is a High Performance Object Storage released under GNU Affero General Public License v3.0. It is API compatible with Amazon S3 cloud storage service. Use MinIO to build high performance infrastructure for machine learning, analytics and application data workloads.",
"install_methods": [
{
"type": "default",
"script": "ct/minio.sh",
"resources": {
"cpu": 1,
"ram": 1024,
"hdd": 5,
"os": "debian",
"version": "12"
}
}
],
"default_credentials": {
"username": "minioadmin",
"password": null
},
"notes": [
{
"text": "Application credentials: `cat ~/minio.creds`",
"type": "info"
}
]
}