diff --git a/apps/minio/2024-01-05/data.yml b/apps/minio/2024-01-05/data.yml deleted file mode 100755 index e22925f5..00000000 --- a/apps/minio/2024-01-05/data.yml +++ /dev/null @@ -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 diff --git a/apps/minio/2024-01-05/docker-compose.yml b/apps/minio/2024-01-05/docker-compose.yml deleted file mode 100644 index ae64e90a..00000000 --- a/apps/minio/2024-01-05/docker-compose.yml +++ /dev/null @@ -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 \ No newline at end of file diff --git a/apps/minio/2024-02-26/data.yml b/apps/minio/2024-02-26/data.yml new file mode 100644 index 00000000..7ad31498 --- /dev/null +++ b/apps/minio/2024-02-26/data.yml @@ -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" diff --git a/apps/minio/2024-02-26/docker-compose.yml b/apps/minio/2024-02-26/docker-compose.yml new file mode 100644 index 00000000..f7008414 --- /dev/null +++ b/apps/minio/2024-02-26/docker-compose.yml @@ -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" diff --git a/apps/minio/2024-02-26/scripts/init.sh b/apps/minio/2024-02-26/scripts/init.sh new file mode 100644 index 00000000..faeb12d8 --- /dev/null +++ b/apps/minio/2024-02-26/scripts/init.sh @@ -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 diff --git a/apps/minio/2024-02-26/scripts/upgrade.sh b/apps/minio/2024-02-26/scripts/upgrade.sh new file mode 100644 index 00000000..a72a42df --- /dev/null +++ b/apps/minio/2024-02-26/scripts/upgrade.sh @@ -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