diff --git a/apps/garage-hq-web/2.0.0/data.yml b/apps/garage-hq-web/2.0.0/data.yml new file mode 100644 index 000000000..73209afda --- /dev/null +++ b/apps/garage-hq-web/2.0.0/data.yml @@ -0,0 +1,49 @@ +additionalProperties: + formFields: + - default: "/home/garage" + edit: true + envKey: GARAGE_ROOT_PATH + labelZh: 数据持久化路径 + labelEn: Data persistence path + required: true + type: text + - default: 3909 + edit: true + envKey: PANEL_APP_PORT_HTTP + labelZh: WebUI 端口 + labelEn: WebUI port + required: true + rule: paramPort + type: number + - default: 3900 + edit: true + envKey: PANEL_APP_PORT_S3_API + labelZh: S3 API 接口 + labelEn: S3 API + required: true + rule: paramPort + type: number + - default: 3901 + edit: true + envKey: PANEL_APP_PORT_RPC + labelZh: RPC 通信 + labelEn: RPC Communication + required: true + rule: paramPort + type: number + - default: 3902 + edit: true + envKey: PANEL_APP_PORT_S3_WEB + labelZh: S3 通讯端口 + labelEn: S3 Communication + required: true + rule: paramPort + type: number + - default: 3903 + edit: true + envKey: PANEL_APP_PORT_API + labelZh: 管理 API + labelEn: Manage API + required: true + rule: paramPort + type: number diff --git a/apps/garage-hq-web/2.0.0/docker-compose.yml b/apps/garage-hq-web/2.0.0/docker-compose.yml new file mode 100644 index 000000000..50966ae94 --- /dev/null +++ b/apps/garage-hq-web/2.0.0/docker-compose.yml @@ -0,0 +1,38 @@ +networks: + 1panel-network: + external: true + +services: + garage: + image: dxflrs/garage:v2.0.0 + container_name: ${CONTAINER_NAME} + labels: + createdBy: "Apps" + restart: always + networks: + - 1panel-network + ports: + - ${PANEL_APP_PORT_S3_API}:3900 + - ${PANEL_APP_PORT_RPC}:3901 + - ${PANEL_APP_PORT_S3_WEB}:3902 + - ${PANEL_APP_PORT_API}:3903 + env_file: + - ${GLOBAL_ENV_FILE:-/etc/1panel/envs/global.env} + - ${ENV_FILE:-/etc/1panel/envs/default.env} + volumes: + - ${GARAGE_ROOT_PATH}/config/garage.toml:/etc/garage.toml + - ${GARAGE_ROOT_PATH}/meta:/var/lib/garage/meta + - ${GARAGE_ROOT_PATH}/data:/var/lib/garage/data + environment: + - TZ=Asia/Shanghai + garage-webui: + image: khairul169/garage-webui:1.0.9 + container_name: garage-webui + restart: unless-stopped + volumes: + - ${GARAGE_ROOT_PATH}/config/garage.toml:/etc/garage.toml + ports: + - ${PANEL_APP_PORT_HTTP}:3909 + environment: + API_BASE_URL: "http://garage:3903" + S3_ENDPOINT_URL: "http://garage:3900" diff --git a/apps/garage-hq-web/2.0.0/envs/default.env b/apps/garage-hq-web/2.0.0/envs/default.env new file mode 100644 index 000000000..cd05f46e6 --- /dev/null +++ b/apps/garage-hq-web/2.0.0/envs/default.env @@ -0,0 +1,2 @@ +# copyright© 2024 XinJiang Ms Studio +ENV_FILE=.env diff --git a/apps/garage-hq-web/2.0.0/envs/global.env b/apps/garage-hq-web/2.0.0/envs/global.env new file mode 100644 index 000000000..e10989fe4 --- /dev/null +++ b/apps/garage-hq-web/2.0.0/envs/global.env @@ -0,0 +1,2 @@ +# copyright© 2024 XinJiang Ms Studio +TZ=Asia/Shanghai diff --git a/apps/garage-hq-web/2.0.0/scripts/init.sh b/apps/garage-hq-web/2.0.0/scripts/init.sh new file mode 100644 index 000000000..88bb39b37 --- /dev/null +++ b/apps/garage-hq-web/2.0.0/scripts/init.sh @@ -0,0 +1,68 @@ +#!/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 + + # 检查 GARAGE_ROOT_PATH 是否存在 + if [ -z "${GARAGE_ROOT_PATH}" ]; then + echo "Error: GARAGE_ROOT_PATH is not set in .env." + exit 1 + fi + + # 创建 config 目录 + CONFIG_DIR="${GARAGE_ROOT_PATH}/config" + mkdir -p "${CONFIG_DIR}" + CONFIG_FILE="${CONFIG_DIR}/garage.toml" + + # 检查文件是否存在并包含 admin_token + if [ -f "${CONFIG_FILE}" ] && grep -q '^admin_token' "${CONFIG_FILE}"; then + echo "garage.toml already exists and contains admin_token. Skipping creation." + else + echo "Creating or updating garage.toml..." + + cat > "${CONFIG_FILE}" <> .env + echo "GLOBAL_ENV_FILE=${CURRENT_DIR}/envs/global.env" >> .env + + echo "Check Finish." + +else + echo "Error: .env file not found." +fi diff --git a/apps/garage-hq-web/README.md b/apps/garage-hq-web/README.md new file mode 100644 index 000000000..0b64a162a --- /dev/null +++ b/apps/garage-hq-web/README.md @@ -0,0 +1,62 @@ +# Garage HQ + +Garage 是一种与 S3 兼容的分布式对象存储服务,专为中小规模的自托管而设计。 + +![Garage HQ](https://file.lifebus.top/imgs/garage-hq_cover.png) + +![](https://img.shields.io/badge/%E6%96%B0%E7%96%86%E8%90%8C%E6%A3%AE%E8%BD%AF%E4%BB%B6%E5%BC%80%E5%8F%91%E5%B7%A5%E4%BD%9C%E5%AE%A4-%E6%8F%90%E4%BE%9B%E6%8A%80%E6%9C%AF%E6%94%AF%E6%8C%81-blue) + +## 简介 + +Garage 专为由运行在不同物理位置的节点组成的存储集群而设计,旨在轻松提供存储服务,该服务可在这些不同位置复制数据,即使某些服务器无法访问也能保持可用。Garage +还注重轻量级、易于操作以及对机器故障的高弹性。 + +## 安装说明 + +通过宿主机初始化: + +1. 通过 `docker ps` 命令查看正在运行的容器, 获取当前部署的容器名称 `CONTAINER ID` +2. 注册 `garage` 命令 + +```sh +alias garage="docker exec -ti /garage" +``` + +3. 查看集群状态 + +```sh +garage status +``` + +输出结果,获得集群 `ID`:3df3882525930828 + +```shell + +[root@mechrevmini ~]# garage status +2025-07-18T09:10:09.202519Z INFO garage_net::netapp: Connected to 127.0.0.1:3901, negotiating handshake... +2025-07-18T09:10:09.243660Z INFO garage_net::netapp: Connection established to 3df3882525930828 +==== HEALTHY NODES ==== +ID Hostname Address Tags Zone Capacity DataAvail Version +3df3882525930828 a2bc48d5c8ab 127.0.0.1:3901 NO ROLE ASSIGNED v2.0.0 +``` + +4. 创建节点 + +```sh +garage layout assign -z dc1 -c 1G + +## demo +garage layout assign -z dc1 -c 1G 3df3882525930828 +``` + +5. 将节点添加到集群 + +```sh +garage layout apply --version 1 +``` + +无论是集群部署,还是单节点部署,都需要初始化节点。 + +--- + +![Ms Studio](https://file.lifebus.top/imgs/ms_blank_001.png) diff --git a/apps/garage-hq-web/data.yml b/apps/garage-hq-web/data.yml new file mode 100644 index 000000000..31b589b8a --- /dev/null +++ b/apps/garage-hq-web/data.yml @@ -0,0 +1,14 @@ +additionalProperties: + key: garage-hq-web + name: Garage HQ + tags: + - Tool + - Local + shortDescZh: 专为自托管而定制的开源分布式对象存储服务 + shortDescEn: An open-source distributed object storage service tailored for self-hosting + type: website + crossVersionUpdate: true + limit: 0 + website: https://garagehq.deuxfleurs.fr/ + github: https://git.deuxfleurs.fr/Deuxfleurs/garage/ + document: https://garagehq.deuxfleurs.fr/ diff --git a/apps/garage-hq-web/logo.png b/apps/garage-hq-web/logo.png new file mode 100644 index 000000000..134032b49 Binary files /dev/null and b/apps/garage-hq-web/logo.png differ diff --git a/apps/garage-hq-web/logo.svg b/apps/garage-hq-web/logo.svg new file mode 100644 index 000000000..c2bf0dc98 --- /dev/null +++ b/apps/garage-hq-web/logo.svg @@ -0,0 +1,8 @@ + + + + diff --git a/apps/garage-hq/README.md b/apps/garage-hq/README.md index c4a605e11..0b64a162a 100644 --- a/apps/garage-hq/README.md +++ b/apps/garage-hq/README.md @@ -11,6 +11,52 @@ Garage 是一种与 S3 兼容的分布式对象存储服务,专为中小规模 Garage 专为由运行在不同物理位置的节点组成的存储集群而设计,旨在轻松提供存储服务,该服务可在这些不同位置复制数据,即使某些服务器无法访问也能保持可用。Garage 还注重轻量级、易于操作以及对机器故障的高弹性。 +## 安装说明 + +通过宿主机初始化: + +1. 通过 `docker ps` 命令查看正在运行的容器, 获取当前部署的容器名称 `CONTAINER ID` +2. 注册 `garage` 命令 + +```sh +alias garage="docker exec -ti /garage" +``` + +3. 查看集群状态 + +```sh +garage status +``` + +输出结果,获得集群 `ID`:3df3882525930828 + +```shell + +[root@mechrevmini ~]# garage status +2025-07-18T09:10:09.202519Z INFO garage_net::netapp: Connected to 127.0.0.1:3901, negotiating handshake... +2025-07-18T09:10:09.243660Z INFO garage_net::netapp: Connection established to 3df3882525930828 +==== HEALTHY NODES ==== +ID Hostname Address Tags Zone Capacity DataAvail Version +3df3882525930828 a2bc48d5c8ab 127.0.0.1:3901 NO ROLE ASSIGNED v2.0.0 +``` + +4. 创建节点 + +```sh +garage layout assign -z dc1 -c 1G + +## demo +garage layout assign -z dc1 -c 1G 3df3882525930828 +``` + +5. 将节点添加到集群 + +```sh +garage layout apply --version 1 +``` + +无论是集群部署,还是单节点部署,都需要初始化节点。 + --- ![Ms Studio](https://file.lifebus.top/imgs/ms_blank_001.png) diff --git a/apps/garage-hq/data.yml b/apps/garage-hq/data.yml index 4561829f4..78fc4eef9 100644 --- a/apps/garage-hq/data.yml +++ b/apps/garage-hq/data.yml @@ -2,7 +2,7 @@ additionalProperties: key: garage-hq name: Garage HQ tags: - - WebSite + - Tool - Local shortDescZh: 专为自托管而定制的开源分布式对象存储服务 shortDescEn: An open-source distributed object storage service tailored for self-hosting