Minio: use latest version or latest feature rich version (#5423)

* minio ref

* Improvements

* Update minio-install.sh
This commit is contained in:
CanbiZ 2025-06-24 13:24:55 +02:00 committed by GitHub
parent 6a285e1e19
commit 15b36b4d16
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 58 additions and 11 deletions

View File

@ -27,16 +27,33 @@ function update_script() {
msg_error "No ${APP} Installation Found!" msg_error "No ${APP} Installation Found!"
exit exit
fi fi
FEATURE_RICH_VERSION="2025-04-22T22-12-26Z"
RELEASE=$(curl -fsSL https://api.github.com/repos/minio/minio/releases/latest | grep '"tag_name"' | awk -F '"' '{print $4}') RELEASE=$(curl -fsSL 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 CURRENT_VERSION=""
[[ -f /opt/${APP}_version.txt ]] && CURRENT_VERSION=$(cat /opt/${APP}_version.txt)
RELEASE=$(curl -fsSL https://api.github.com/repos/minio/minio/releases/latest | grep '"tag_name"' | awk -F '"' '{print $4}')
if [[ "${CURRENT_VERSION}" == "${FEATURE_RICH_VERSION}" && "${RELEASE}" != "${FEATURE_RICH_VERSION}" ]]; then
echo
echo "You are currently running the last feature-rich community version: ${FEATURE_RICH_VERSION}"
echo "WARNING: Updating to the latest version will REMOVE most management features from the Console UI."
echo "Do you still want to upgrade to the latest version? [y/N]: "
read -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
msg_ok "No update performed. Staying on the feature-rich version."
exit
fi
fi
if [[ "${CURRENT_VERSION}" != "${RELEASE}" ]]; then
msg_info "Stopping ${APP}" msg_info "Stopping ${APP}"
systemctl stop minio systemctl stop minio
msg_ok "${APP} Stopped" msg_ok "${APP} Stopped"
msg_info "Updating ${APP} to ${RELEASE}" msg_info "Updating ${APP} to ${RELEASE}"
mv /usr/local/bin/minio /usr/local/bin/minio_bak mv /usr/local/bin/minio /usr/local/bin/minio_bak
curl -fsSL "https://dl.min.io/server/minio/release/linux-amd64/minio" -o $(basename "https://dl.min.io/server/minio/release/linux-amd64/minio") curl -fsSL "https://dl.min.io/server/minio/release/linux-amd64/minio" -o /usr/local/bin/minio
mv minio /usr/local/bin/
chmod +x /usr/local/bin/minio chmod +x /usr/local/bin/minio
echo "${RELEASE}" >/opt/${APP}_version.txt echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated ${APP}" msg_ok "Updated ${APP}"

View File

@ -13,31 +13,60 @@ setting_up_container
network_check network_check
update_os update_os
msg_info "Setup MinIO" FEATURE_RICH_VERSION="2025-04-22T22-12-26Z"
RELEASE=$(curl -fsSL https://api.github.com/repos/minio/minio/releases/latest | grep '"tag_name"' | awk -F '"' '{print $4}')
curl -fsSL "https://dl.min.io/server/minio/release/linux-amd64/minio" -o /usr/local/bin/minio echo
echo "MinIO recently removed many management features from the Console UI."
echo "The last feature-complete version is: $FEATURE_RICH_VERSION"
echo "Latest versions require the paid edition for full UI functionality."
echo
echo "Choose which version to install:"
echo " [N] Feature-rich community version ($FEATURE_RICH_VERSION) [Recommended]"
echo " [Y] Latest version (may lack UI features)"
echo
read -p "Install latest MinIO version? [y/N]: " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
USE_LATEST=true
else
USE_LATEST=false
fi
msg_info "Setting up MinIO"
if [[ "$USE_LATEST" == "true" ]]; then
RELEASE=$(curl -fsSL https://api.github.com/repos/minio/minio/releases/latest | grep '"tag_name"' | awk -F '"' '{print $4}')
DOWNLOAD_URL="https://dl.min.io/server/minio/release/linux-amd64/minio"
else
RELEASE="$FEATURE_RICH_VERSION"
DOWNLOAD_URL="https://dl.min.io/server/minio/release/linux-amd64/archive/minio.RELEASE.${FEATURE_RICH_VERSION}"
fi
curl -fsSL "$DOWNLOAD_URL" -o /usr/local/bin/minio
chmod +x /usr/local/bin/minio chmod +x /usr/local/bin/minio
useradd -r minio-user -s /sbin/nologin useradd -r minio-user -s /sbin/nologin
mkdir -p /home/minio-user mkdir -p /home/minio-user
chown minio-user:minio-user /home/minio-user chown minio-user:minio-user /home/minio-user
mkdir -p /data mkdir -p /data
chown minio-user:minio-user /data chown minio-user:minio-user /data
MINIO_ADMIN_USER="minioadmin" MINIO_ADMIN_USER="minioadmin"
MINIO_ADMIN_PASSWORD="$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)" MINIO_ADMIN_PASSWORD="$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)"
cat <<EOF >/etc/default/minio cat <<EOF >/etc/default/minio
MINIO_ROOT_USER=${MINIO_ADMIN_USER} MINIO_ROOT_USER=${MINIO_ADMIN_USER}
MINIO_ROOT_PASSWORD=${MINIO_ADMIN_PASSWORD} MINIO_ROOT_PASSWORD=${MINIO_ADMIN_PASSWORD}
EOF EOF
{ {
echo "" echo ""
echo "MinIO-Credentials" echo "MinIO Credentials"
echo "MinIO Admin User: $MINIO_ADMIN_USER" echo "MinIO Admin User: $MINIO_ADMIN_USER"
echo "MinIO Admin Password: $MINIO_ADMIN_PASSWORD" echo "MinIO Admin Password: $MINIO_ADMIN_PASSWORD"
} >>~/minio.creds } >>~/minio.creds
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt echo "${RELEASE}" >/opt/${APPLICATION,,}_version.txt
msg_ok "Setup MinIO" msg_ok "Setup MinIO"
msg_info "Creating Service" msg_info "Creating service"
cat <<EOF >/etc/systemd/system/minio.service cat <<EOF >/etc/systemd/system/minio.service
[Unit] [Unit]
Description=MinIO Description=MinIO
@ -57,8 +86,9 @@ LimitNOFILE=65536
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
EOF EOF
systemctl enable -q --now minio systemctl enable -q --now minio
msg_ok "Created Service" msg_ok "Service created"
motd_ssh motd_ssh
customize customize
@ -66,4 +96,4 @@ customize
msg_info "Cleaning up" msg_info "Cleaning up"
$STD apt-get -y autoremove $STD apt-get -y autoremove
$STD apt-get -y autoclean $STD apt-get -y autoclean
msg_ok "Cleaned" msg_ok "Cleanup complete"