Skip to content

Commit 819bda4

Browse files
authored
New Script: MinIO (#2333)
* New Script: MinIO * switch category to database * update tag * optimize tag to object-storage * harmonize path * Update minio.sh
1 parent 8b32755 commit 819bda4

File tree

3 files changed

+187
-0
lines changed

3 files changed

+187
-0
lines changed

ct/minio.sh

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#!/usr/bin/env bash
2+
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: MickLesk (CanbiZ)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/minio/minio
7+
8+
# App Default Values
9+
APP="MinIO"
10+
var_tags="object-storage"
11+
var_cpu="1"
12+
var_ram="1024"
13+
var_disk="5"
14+
var_os="debian"
15+
var_version="12"
16+
var_unprivileged="1"
17+
18+
# App Output & Base Settings
19+
header_info "$APP"
20+
base_settings
21+
22+
# Core
23+
variables
24+
color
25+
catch_errors
26+
27+
function update_script() {
28+
header_info
29+
check_container_storage
30+
check_container_resources
31+
if [[ ! -f /usr/local/bin/minio ]]; then
32+
msg_error "No ${APP} Installation Found!"
33+
exit
34+
fi
35+
RELEASE=$(curl -s https://api.github.com/repos/minio/minio/releases/latest | grep '"tag_name"' | awk -F '"' '{print $4}')
36+
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
37+
msg_info "Stopping ${APP}"
38+
systemctl stop minio
39+
msg_ok "${APP} Stopped"
40+
41+
msg_info "Updating ${APP} to ${RELEASE}"
42+
mv /usr/local/bin/minio /usr/local/bin/minio_bak
43+
wget -q https://dl.min.io/server/minio/release/linux-amd64/minio
44+
mv minio /usr/local/bin/
45+
chmod +x /usr/local/bin/minio
46+
echo "${RELEASE}" >/opt/${APP}_version.txt
47+
msg_ok "Updated ${APP}"
48+
49+
msg_info "Starting ${APP}"
50+
systemctl start minio
51+
msg_ok "Started ${APP}"
52+
53+
msg_info "Cleaning up"
54+
rm -f /usr/local/bin/minio_bak
55+
msg_ok "Cleaned"
56+
57+
msg_ok "Updated Successfully"
58+
else
59+
msg_ok "No update required. ${APP} is already at ${RELEASE}"
60+
fi
61+
exit
62+
}
63+
64+
start
65+
build_container
66+
description
67+
68+
msg_ok "Completed Successfully!\n"
69+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
70+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
71+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:9000${CL}"

install/minio-install.sh

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: MickLesk (CanbiZ)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/minio/minio
7+
8+
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
msg_info "Installing Dependencies"
17+
$STD apt-get install -y \
18+
curl \
19+
sudo \
20+
mc
21+
msg_ok "Installed Dependencies"
22+
23+
msg_info "Setup MinIO"
24+
RELEASE=$(curl -s https://api.github.com/repos/minio/minio/releases/latest | grep '"tag_name"' | awk -F '"' '{print $4}')
25+
wget -q https://dl.min.io/server/minio/release/linux-amd64/minio
26+
mv minio /usr/local/bin/
27+
chmod +x /usr/local/bin/minio
28+
useradd -r minio-user -s /sbin/nologin
29+
mkdir -p /home/minio-user
30+
chown minio-user:minio-user /home/minio-user
31+
mkdir -p /data
32+
chown minio-user:minio-user /data
33+
MINIO_ADMIN_USER="minioadmin"
34+
MINIO_ADMIN_PASSWORD="$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)"
35+
cat <<EOF >/etc/default/minio
36+
MINIO_ROOT_USER=${MINIO_ADMIN_USER}
37+
MINIO_ROOT_PASSWORD=${MINIO_ADMIN_PASSWORD}
38+
EOF
39+
{
40+
echo ""
41+
echo "MinIO-Credentials"
42+
echo "MinIO Admin User: $MINIO_ADMIN_USER"
43+
echo "MinIO Admin Password: $MINIO_ADMIN_PASSWORD"
44+
} >> ~/minio.creds
45+
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
46+
msg_ok "Setup MinIO"
47+
48+
msg_info "Creating Service"
49+
cat <<EOF >/etc/systemd/system/minio.service
50+
[Unit]
51+
Description=MinIO
52+
Documentation=https://docs.min.io
53+
Wants=network-online.target
54+
After=network-online.target
55+
56+
[Service]
57+
User=minio-user
58+
Group=minio-user
59+
EnvironmentFile=-/etc/default/minio
60+
ExecStart=/usr/local/bin/minio server /data
61+
Restart=always
62+
RestartSec=5
63+
LimitNOFILE=65536
64+
65+
[Install]
66+
WantedBy=multi-user.target
67+
EOF
68+
systemctl enable -q --now minio
69+
msg_ok "Created Service"
70+
71+
motd_ssh
72+
customize
73+
74+
msg_info "Cleaning up"
75+
$STD apt-get -y autoremove
76+
$STD apt-get -y autoclean
77+
msg_ok "Cleaned"

json/minio.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "MinIO",
3+
"slug": "minio",
4+
"categories": [
5+
8
6+
],
7+
"date_created": "2025-02-13",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": 9000,
12+
"documentation": "https://min.io/docs/minio/linux/index.html",
13+
"website": "https://min.io/",
14+
"logo": "https://raw.githubusercontent.com/minio/minio/refs/heads/master/.github/logo.svg",
15+
"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.",
16+
"install_methods": [
17+
{
18+
"type": "default",
19+
"script": "ct/minio.sh",
20+
"resources": {
21+
"cpu": 1,
22+
"ram": 1024,
23+
"hdd": 5,
24+
"os": "debian",
25+
"version": "12"
26+
}
27+
}
28+
],
29+
"default_credentials": {
30+
"username": "minioadmin",
31+
"password": null
32+
},
33+
"notes": [
34+
{
35+
"text": "Application credentials: `cat ~/minio.creds`",
36+
"type": "info"
37+
}
38+
]
39+
}

0 commit comments

Comments
 (0)