diff --git a/.github/renovate.json b/.github/renovate.json index 602c829c0..d2bf6bb41 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -26,7 +26,8 @@ "**/alist-ffmpeg/**", "**/homarr/0.15.10/**", "**/minio/2025-04-22/**", - "**/transmission/2.94/**" + "**/transmission/2.94/**", + "**/rustfs/1.0.0-alpha.86/**" ], "packageRules": [ { diff --git a/apps/rustfs/1.0.0-alpha.86/data.yml b/apps/rustfs/1.0.0-alpha.86/data.yml new file mode 100644 index 000000000..bba75c769 --- /dev/null +++ b/apps/rustfs/1.0.0-alpha.86/data.yml @@ -0,0 +1,58 @@ +additionalProperties: + formFields: + - default: "/home/rustfs" + edit: true + envKey: RUSTFS_ROOT_PATH + labelZh: 数据持久化路径 + labelEn: Data persistence path + required: true + type: text + - default: 9001 + edit: true + envKey: PANEL_APP_PORT_HTTP + labelZh: WebUI 端口 + labelEn: WebUI port + required: true + rule: paramPort + type: number + - default: 9000 + edit: true + envKey: PANEL_APP_PORT_API + labelZh: API 端口 + labelEn: API port + required: true + rule: paramPort + type: number + - default: "rustfsadmin" + edit: true + envKey: RUSTFS_ACCESS_KEY + labelZh: 管理员账号 + labelEn: Access Key + required: true + type: text + - default: "rustfsadmin" + edit: true + envKey: RUSTFS_SECRET_KEY + labelZh: 管理员密码 + labelEn: Secret Key + required: true + type: password + - default: "example.com" + edit: true + envKey: RUSTFS_SERVER_DOMAINS + labelZh: 域名 + labelEn: Domains + required: false + type: text + - default: "true" + edit: true + envKey: RUSTFS_CONSOLE_ENABLE + labelZh: 启用控制台 + labelEn: Enable Console + required: true + type: select + values: + - label: 启用 + value: "true" + - label: 禁用 + value: "false" diff --git a/apps/rustfs/1.0.0-alpha.86/docker-compose.yml b/apps/rustfs/1.0.0-alpha.86/docker-compose.yml new file mode 100644 index 000000000..38e61bf36 --- /dev/null +++ b/apps/rustfs/1.0.0-alpha.86/docker-compose.yml @@ -0,0 +1,50 @@ +networks: + 1panel-network: + external: true + +services: + rustfs: + image: rustfs/rustfs:1.0.0-alpha.86 + container_name: ${CONTAINER_NAME} + labels: + createdBy: "Apps" + restart: always + networks: + - 1panel-network + security_opt: + - "no-new-privileges:true" + ports: + - ${PANEL_APP_PORT_API}:9000 + - ${PANEL_APP_PORT_HTTP}:9001 + env_file: + - ${GLOBAL_ENV_FILE:-/etc/1panel/envs/global.env} + - ${ENV_FILE:-/etc/1panel/envs/default.env} + volumes: + - ${RUSTFS_ROOT_PATH}/logs:/app/logs + - ${RUSTFS_ROOT_PATH}/data/rustfs0:/data/rustfs0 + - ${RUSTFS_ROOT_PATH}/data/rustfs1:/data/rustfs1 + - ${RUSTFS_ROOT_PATH}/data/rustfs2:/data/rustfs2 + - ${RUSTFS_ROOT_PATH}/data/rustfs3:/data/rustfs3 + environment: + - TZ=Asia/Shanghai + - RUSTFS_VOLUMES=/data/rustfs{0...3} + - RUSTFS_ADDRESS=0.0.0.0:9000 + - RUSTFS_CONSOLE_ADDRESS=0.0.0.0:9001 + - RUSTFS_CONSOLE_ENABLE=true + - RUSTFS_CORS_ALLOWED_ORIGINS=* + - RUSTFS_CONSOLE_CORS_ALLOWED_ORIGINS=* + - RUSTFS_OBS_LOGGER_LEVEL=info + - RUSTFS_TLS_PATH=/opt/tls + - RUSTFS_OBJECT_CACHE_ENABLE=true + - RUSTFS_OBJECT_CACHE_TTL_SECS=300 + healthcheck: + test: + [ + "CMD", + "sh", "-c", + "curl -f http://127.0.0.1:9000/health && curl -f http://127.0.0.1:9001/rustfs/console/health" + ] + interval: 30s + timeout: 10s + retries: 3 + start_period: 40s diff --git a/apps/rustfs/1.0.0-alpha.86/envs/default.env b/apps/rustfs/1.0.0-alpha.86/envs/default.env new file mode 100644 index 000000000..cd05f46e6 --- /dev/null +++ b/apps/rustfs/1.0.0-alpha.86/envs/default.env @@ -0,0 +1,2 @@ +# copyright© 2024 XinJiang Ms Studio +ENV_FILE=.env diff --git a/apps/rustfs/1.0.0-alpha.86/envs/global.env b/apps/rustfs/1.0.0-alpha.86/envs/global.env new file mode 100644 index 000000000..e10989fe4 --- /dev/null +++ b/apps/rustfs/1.0.0-alpha.86/envs/global.env @@ -0,0 +1,2 @@ +# copyright© 2024 XinJiang Ms Studio +TZ=Asia/Shanghai diff --git a/apps/rustfs/1.0.0-alpha.86/scripts/init.sh b/apps/rustfs/1.0.0-alpha.86/scripts/init.sh new file mode 100644 index 000000000..8622d8706 --- /dev/null +++ b/apps/rustfs/1.0.0-alpha.86/scripts/init.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +if [ -f .env ]; then + source .env + + # setup-1 add default values + CURRENT_DIR=$(pwd) + sed -i '/^ENV_FILE=/d' .env + sed -i '/^GLOBAL_ENV_FILE=/d' .env + echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env + echo "GLOBAL_ENV_FILE=${CURRENT_DIR}/envs/global.env" >> .env + + + mkdir -p "$RUSTFS_ROOT_PATH" + mkdir -p "$RUSTFS_ROOT_PATH/logs" + mkdir -p "$RUSTFS_ROOT_PATH/data" + mkdir -p "$RUSTFS_ROOT_PATH/data/rustfs0" + mkdir -p "$RUSTFS_ROOT_PATH/data/rustfs1" + mkdir -p "$RUSTFS_ROOT_PATH/data/rustfs2" + mkdir -p "$RUSTFS_ROOT_PATH/data/rustfs3" + + chown -R 10001:10001 "$RUSTFS_ROOT_PATH" + + echo "Check Finish." + +else + echo "Error: .env file not found." +fi diff --git a/apps/rustfs/1.0.0-alpha.86/scripts/uninstall.sh b/apps/rustfs/1.0.0-alpha.86/scripts/uninstall.sh new file mode 100644 index 000000000..c86c4fbca --- /dev/null +++ b/apps/rustfs/1.0.0-alpha.86/scripts/uninstall.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +if [ -f .env ]; then + source .env + + echo "Check Finish." + +else + echo "Error: .env file not found." +fi diff --git a/apps/rustfs/1.0.0-alpha.86/scripts/upgrade.sh b/apps/rustfs/1.0.0-alpha.86/scripts/upgrade.sh new file mode 100644 index 000000000..9aebd56fa --- /dev/null +++ b/apps/rustfs/1.0.0-alpha.86/scripts/upgrade.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +if [ -f .env ]; then + source .env + + # setup-1 add default values + CURRENT_DIR=$(pwd) + sed -i '/^ENV_FILE=/d' .env + sed -i '/^GLOBAL_ENV_FILE=/d' .env + echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env + echo "GLOBAL_ENV_FILE=${CURRENT_DIR}/envs/global.env" >> .env + + chown -R 10001:10001 "$RUSTFS_ROOT_PATH" + + echo "Check Finish." + +else + echo "Error: .env file not found." +fi diff --git a/apps/rustfs/latest/data.yml b/apps/rustfs/latest/data.yml index 41e89e557..bba75c769 100644 --- a/apps/rustfs/latest/data.yml +++ b/apps/rustfs/latest/data.yml @@ -7,7 +7,7 @@ additionalProperties: labelEn: Data persistence path required: true type: text - - default: 9000 + - default: 9001 edit: true envKey: PANEL_APP_PORT_HTTP labelZh: WebUI 端口 @@ -15,6 +15,14 @@ additionalProperties: required: true rule: paramPort type: number + - default: 9000 + edit: true + envKey: PANEL_APP_PORT_API + labelZh: API 端口 + labelEn: API port + required: true + rule: paramPort + type: number - default: "rustfsadmin" edit: true envKey: RUSTFS_ACCESS_KEY @@ -29,7 +37,7 @@ additionalProperties: labelEn: Secret Key required: true type: password - - default: "127.0.0.1:9000" + - default: "example.com" edit: true envKey: RUSTFS_SERVER_DOMAINS labelZh: 域名 @@ -48,24 +56,3 @@ additionalProperties: value: "true" - label: 禁用 value: "false" - - default: "" - edit: true - envKey: CUSTOM_MOUNT_DIRECTORY_1 - labelEn: Custom mount directory 1 - labelZh: 自定义挂载目录 1 - required: false - type: text - - default: "" - edit: true - envKey: CUSTOM_MOUNT_DIRECTORY_2 - labelEn: Custom mount directory 2 - labelZh: 自定义挂载目录 2 - required: false - type: text - - default: "" - edit: true - envKey: CUSTOM_MOUNT_DIRECTORY_3 - labelEn: Custom mount directory 3 - labelZh: 自定义挂载目录 3 - required: false - type: text diff --git a/apps/rustfs/latest/docker-compose.yml b/apps/rustfs/latest/docker-compose.yml index bf4915ddd..ebf723f98 100644 --- a/apps/rustfs/latest/docker-compose.yml +++ b/apps/rustfs/latest/docker-compose.yml @@ -11,16 +11,40 @@ services: restart: always networks: - 1panel-network + security_opt: + - "no-new-privileges:true" ports: - - ${PANEL_APP_PORT_HTTP}:9000 + - ${PANEL_APP_PORT_API}:9000 + - ${PANEL_APP_PORT_HTTP}:9001 env_file: - ${GLOBAL_ENV_FILE:-/etc/1panel/envs/global.env} - ${ENV_FILE:-/etc/1panel/envs/default.env} volumes: - - ${RUSTFS_ROOT_PATH}/data:/etc/rustfs - - ${CUSTOM_MOUNT_DIRECTORY_1:-./default_mount_1}:${CUSTOM_MOUNT_DIRECTORY_1:-/default_mount_1} - - ${CUSTOM_MOUNT_DIRECTORY_2:-./default_mount_2}:${CUSTOM_MOUNT_DIRECTORY_2:-/default_mount_2} - - ${CUSTOM_MOUNT_DIRECTORY_3:-./default_mount_3}:${CUSTOM_MOUNT_DIRECTORY_3:-/default_mount_3} + - ${RUSTFS_ROOT_PATH}/logs:/app/logs + - ${RUSTFS_ROOT_PATH}/data/rustfs0:/data/rustfs0 + - ${RUSTFS_ROOT_PATH}/data/rustfs1:/data/rustfs1 + - ${RUSTFS_ROOT_PATH}/data/rustfs2:/data/rustfs2 + - ${RUSTFS_ROOT_PATH}/data/rustfs3:/data/rustfs3 environment: - TZ=Asia/Shanghai - - RUSTFS_ADDRESS=:9000 + - RUSTFS_VOLUMES=/data/rustfs{0...3} + - RUSTFS_ADDRESS=0.0.0.0:9000 + - RUSTFS_CONSOLE_ADDRESS=0.0.0.0:9001 + - RUSTFS_CONSOLE_ENABLE=true + - RUSTFS_CORS_ALLOWED_ORIGINS=* + - RUSTFS_CONSOLE_CORS_ALLOWED_ORIGINS=* + - RUSTFS_OBS_LOGGER_LEVEL=info + - RUSTFS_TLS_PATH=/opt/tls + - RUSTFS_OBJECT_CACHE_ENABLE=true + - RUSTFS_OBJECT_CACHE_TTL_SECS=300 + healthcheck: + test: + [ + "CMD", + "sh", "-c", + "curl -f http://127.0.0.1:9000/health && curl -f http://127.0.0.1:9001/rustfs/console/health" + ] + interval: 30s + timeout: 10s + retries: 3 + start_period: 40s diff --git a/apps/rustfs/latest/scripts/init.sh b/apps/rustfs/latest/scripts/init.sh index 07fb8c3fe..8622d8706 100644 --- a/apps/rustfs/latest/scripts/init.sh +++ b/apps/rustfs/latest/scripts/init.sh @@ -10,6 +10,17 @@ if [ -f .env ]; then echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env echo "GLOBAL_ENV_FILE=${CURRENT_DIR}/envs/global.env" >> .env + + mkdir -p "$RUSTFS_ROOT_PATH" + mkdir -p "$RUSTFS_ROOT_PATH/logs" + mkdir -p "$RUSTFS_ROOT_PATH/data" + mkdir -p "$RUSTFS_ROOT_PATH/data/rustfs0" + mkdir -p "$RUSTFS_ROOT_PATH/data/rustfs1" + mkdir -p "$RUSTFS_ROOT_PATH/data/rustfs2" + mkdir -p "$RUSTFS_ROOT_PATH/data/rustfs3" + + chown -R 10001:10001 "$RUSTFS_ROOT_PATH" + echo "Check Finish." else diff --git a/apps/rustfs/latest/scripts/upgrade.sh b/apps/rustfs/latest/scripts/upgrade.sh index 07fb8c3fe..9aebd56fa 100644 --- a/apps/rustfs/latest/scripts/upgrade.sh +++ b/apps/rustfs/latest/scripts/upgrade.sh @@ -10,6 +10,8 @@ if [ -f .env ]; then echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env echo "GLOBAL_ENV_FILE=${CURRENT_DIR}/envs/global.env" >> .env + chown -R 10001:10001 "$RUSTFS_ROOT_PATH" + echo "Check Finish." else