Update Minio Version (#1010)

This commit is contained in:
萌森 2024-03-07 11:13:45 +08:00 committed by GitHub
parent abadcd44db
commit 1b838b65f5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 157 additions and 59 deletions

View File

@ -1,32 +0,0 @@
additionalProperties:
formFields:
- default: minio
envKey: PANEL_MINIO_ROOT_USER
labelEn: User
labelZh: 用户
random: true
required: true
rule: paramCommon
type: text
- default: minio
envKey: PANEL_MINIO_ROOT_PASSWORD
labelEn: Password
labelZh: 密码
random: true
required: true
rule: paramComplexity
type: password
- default: 9000
envKey: PANEL_APP_PORT_HTTP
labelEn: Port
labelZh: 端口
required: true
rule: paramPort
type: number
- default: 9001
envKey: PANEL_APP_PORT_API
labelEn: Port
labelZh: API 端口
required: true
rule: paramPort
type: number

View File

@ -1,27 +0,0 @@
version: '3'
services:
minio:
image: minio/minio:RELEASE.2024-01-05T22-17-24Z
container_name: ${CONTAINER_NAME}
ports:
- ${PANEL_APP_PORT_HTTP}:9000
- ${PANEL_APP_PORT_API}:9001
restart: always
command: server /data --console-address :9000 --address :9001
environment:
MINIO_ROOT_USER: ${PANEL_MINIO_ROOT_USER}
MINIO_ROOT_PASSWORD: ${PANEL_MINIO_ROOT_PASSWORD}
logging:
options:
max-size: "5M"
max-file: "10"
driver: json-file
networks:
- 1panel-network
volumes:
- ./data:/data
labels:
createdBy: "Apps"
networks:
1panel-network:
external: true

View File

@ -0,0 +1,65 @@
additionalProperties:
formFields:
- default: "/home/minio"
edit: true
envKey: MINIO_ROOT_PATH
labelEn: Data persistence root path
labelZh: 数据持久化 根路径
required: true
type: text
- default: minio
envKey: PANEL_MINIO_ROOT_USER
labelEn: User
labelZh: 用户
random: true
required: true
rule: paramCommon
type: text
- default: minio
envKey: PANEL_MINIO_ROOT_PASSWORD
labelEn: Password
labelZh: 密码
random: true
required: true
rule: paramComplexity
type: password
- default: "12h"
envKey: MINIO_BROWSER_SESSION_DURATION
labelEn: Session duration
labelZh: 会话持续时间 (s/秒 m/分钟 h/小时 d/天)
required: true
type: text
- default: "9001"
envKey: PANEL_APP_PORT_HTTP
labelEn: Port
labelZh: 端口
required: true
type: text
- default: "9000"
envKey: PANEL_APP_PORT_API
labelEn: Port
labelZh: API 端口
required: true
type: text
- default: "on"
envKey: MINIO_BROWSER
labelEn: Enable WebUI
labelZh: 启用WebUI
required: true
type: select
values:
- label: "开启"
value: "on"
- label: "关闭"
value: "off"
- default: "on"
envKey: MINIO_BROWSER_LOGIN_ANIMATION
labelEn: WebUI login animation
labelZh: WebUI 登录动画
required: true
type: select
values:
- label: "开启"
value: "on"
- label: "关闭"
value: "off"

View File

@ -0,0 +1,40 @@
version: '3'
networks:
1panel-network:
external: true
services:
minio:
image: minio/minio:RELEASE.2024-02-26T09-33-48Z
container_name: ${CONTAINER_NAME}
ports:
- ${PANEL_APP_PORT_HTTP}:9001
- ${PANEL_APP_PORT_API}:9000
restart: always
command: "server /data --console-address :9001 --address :9000"
environment:
MINIO_ROOT_USER: ${PANEL_MINIO_ROOT_USER}
MINIO_ROOT_PASSWORD: ${PANEL_MINIO_ROOT_PASSWORD}
MINIO_BROWSER_SESSION_DURATION: ${MINIO_BROWSER_SESSION_DURATION}
MINIO_BROWSER: ${MINIO_BROWSER}
MINIO_BROWSER_LOGIN_ANIMATION: ${MINIO_BROWSER_LOGIN_ANIMATION}
MINIO_SERVER_URL: "http://127.0.0.1:9000"
MINIO_BROWSER_REDIRECT_URL: "http://127.0.0.1:9001"
logging:
options:
max-size: "5M"
max-file: "10"
driver: json-file
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:9000/minio/health/live" ]
interval: 30s
timeout: 20s
retries: 3
networks:
- 1panel-network
volumes:
- ${MINIO_ROOT_PATH}/data:/data
- ${MINIO_ROOT_PATH}/certs:/root/.minio/certs
labels:
createdBy: "Apps"

View File

@ -0,0 +1,16 @@
#!/bin/bash
if [ -f .env ]; then
source .env
mkdir -p "$MINIO_ROOT_PATH"
mkdir -p "$MINIO_ROOT_PATH/data"
mkdir -p "$MINIO_ROOT_PATH/certs"
echo "Directories set successfully."
else
echo "Error: .env file not found."
exit 1
fi

View File

@ -0,0 +1,36 @@
#!/bin/bash
if [[ -f ./.env ]]; then
source .env
mkdir -p "$MINIO_ROOT_PATH"
mkdir -p "$MINIO_ROOT_PATH/data"
mkdir -p "$MINIO_ROOT_PATH/certs"
if grep -q "MINIO_ROOT_PATH" ./.env; then
echo "MINIO_ROOT_PATH 已存在"
else
echo 'MINIO_ROOT_PATH="/home/minio"' >> ./.env
echo 'Copy data to /home/minio'
cp -r ./data /home/minio
fi
if grep -q "MINIO_BROWSER_SESSION_DURATION" ./.env; then
echo "MINIO_BROWSER_SESSION_DURATION 已存在"
else
echo 'MINIO_BROWSER_SESSION_DURATION="12h"' >> ./.env
fi
if grep -q "MINIO_BROWSER" ./.env; then
echo "MINIO_BROWSER 已存在"
else
echo 'MINIO_BROWSER="on"' >> ./.env
fi
if grep -q "MINIO_BROWSER_LOGIN_ANIMATION" ./.env; then
echo "MINIO_BROWSER_LOGIN_ANIMATION 已存在"
else
echo 'MINIO_BROWSER_LOGIN_ANIMATION="on"' >> ./.env
fi
else
echo ".env 文件不存在"
fi