2025-07-30 23:48:36 -04:00
# Garage Web UI Project Management Documentation
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
## Project Overview
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
**Garage Web UI** is a modern web management interface for the [Garage ](https://garagehq.deuxfleurs.fr/ ) distributed object storage service. This project provides a clean, intuitive graphical interface to manage Garage clusters, serving as an important supplement to the official Garage command-line tools.
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
### 🎯 Project Positioning
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
- **Target Users**: Garage cluster administrators and operations personnel
- **Core Value**: Simplify the daily management operations of Garage clusters
- **Technology Stack**: TypeScript + React (Frontend) + Go (Backend)
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
## Features
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
### 🏥 Cluster Monitoring and Management
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
#### 1. Health Status Monitoring
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
- **Real-time Cluster Status**: Displays the overall health of the cluster (Healthy/Degraded/Unavailable)
- **Node Monitoring**: Real-time monitoring of the number of known nodes, connected nodes, and storage node status
- **Partition Status**: Monitors the health and quorum status of data partitions
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
#### 2. Cluster Layout Management
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
- **Visual Layout**: Graphically displays the cluster node distribution and storage configuration
- **Node Configuration**: Manage node attributes such as zone, capacity, and tags
- **Layout Changes**: Supports staging, previewing, applying, and reverting layout changes
- **History**: View the history of cluster layout changes
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
### 🗄️ Bucket Management
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
#### 1. Bucket Operations
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
- **Bucket List**: Displays all buckets and their basic information
- **Bucket Details**: View detailed statistics, configuration, and permission information for a bucket
- **Bucket Creation**: Supports creating buckets with global and local aliases
- **Bucket Configuration**: Update bucket website configuration, quota settings, etc.
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
#### 2. Object Browser
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
- **File Browsing**: Built-in object browser that supports folder structure browsing
- **File Operations**: Upload, download, and delete object files
- **Sharing Functionality**: Generate temporary access links
- **Bulk Operations**: Supports bulk file management
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
### 🔑 Access Control Management
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
#### 1. Access Key Management
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
- **Key List**: Displays all API access keys
- **Key Creation**: Create new S3-compatible access keys
- **Permission Configuration**: Set global permissions for keys (e.g., creating buckets)
- **Expiration Management**: Set expiration times for keys
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
#### 2. Permission Assignment
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
- **Bucket Permissions**: Assign permissions to access keys for specific buckets
- **Permission Types**: Supports Read, Write, and Owner permission levels
- **Permission Revocation**: Flexible mechanism for granting and revoking permissions
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
## Technical Architecture
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
### 🏗️ Overall Architecture
2025-07-15 15:59:47 +08:00
```
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Web Browser │───▶│ Garage Web UI │───▶│ Garage Cluster │
2025-07-30 23:48:36 -04:00
│ (Frontend UI) │ │ (Go Backend) │ │ (Admin API) │
2025-07-15 15:59:47 +08:00
└─────────────────┘ └──────────────────┘ └─────────────────┘
```
2025-07-30 23:48:36 -04:00
### 📁 Project Structure
2025-07-15 15:59:47 +08:00
```
garage-webui/
2025-07-30 23:48:36 -04:00
├── src/ # React Frontend Source
│ ├── pages/ # Page Components
│ │ ├── home/ # Home Dashboard
│ │ ├── cluster/ # Cluster Management
│ │ ├── buckets/ # Bucket Management
│ │ └── keys/ # Access Key Management
│ ├── components/ # Reusable Components
2025-07-15 15:59:47 +08:00
│ ├── hooks/ # React Hooks
2025-07-30 23:48:36 -04:00
│ └── lib/ # Utility Libraries
├── backend/ # Go Backend Source
│ ├── main.go # Service Entrypoint
│ ├── router/ # API Routes
│ ├── utils/ # Utility Functions
│ └── schema/ # Data Structures
├── docs/ # Project Documentation
└── misc/ # Screenshots and other resources
2025-07-15 15:59:47 +08:00
```
2025-07-30 23:48:36 -04:00
### 🔌 Backend Service Architecture
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
#### Core Modules
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
1. **Configuration Management** (`utils/garage.go` )
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
- Automatically reads the Garage configuration file (`garage.toml` )
- Extracts admin API endpoints, authentication information, etc.
- Supports overriding configuration with environment variables
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
2. **API Proxy** (`router/` )
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
- Proxies frontend requests to the Garage Admin API
- Handles authentication and error translation
- Provides a unified RESTful interface
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
3. **Session Management** (`utils/session.go` )
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
- Supports user authentication (optional)
- Session state management
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
4. **Caching Mechanism** (`utils/cache.go` )
- Caches API responses
- Reduces request pressure on the Garage cluster
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
## Deployment Scenarios
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
### 🐳 Docker Deployment (Recommended)
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
#### 1. Deploying with a Garage Cluster
2025-07-15 15:59:47 +08:00
```yaml
services:
garage:
image: dxflrs/garage:v1.0.1
volumes:
- ./garage.toml:/etc/garage.toml
- ./meta:/var/lib/garage/meta
- ./data:/var/lib/garage/data
ports:
- 3900:3900 # S3 API
- 3901:3901 # RPC
- 3902:3902 # S3 Web
- 3903:3903 # Admin API
webui:
2025-09-29 20:26:44 -04:00
image: khairul169/garage-webui:latest
2025-07-15 15:59:47 +08:00
volumes:
- ./garage.toml:/etc/garage.toml:ro
ports:
- 3909:3909
environment:
API_BASE_URL: "http://garage:3903"
S3_ENDPOINT_URL: "http://garage:3900"
```
2025-07-30 23:48:36 -04:00
#### 2. Standalone Deployment
2025-07-15 15:59:47 +08:00
```bash
docker run -p 3909:3909 \
-v ./garage.toml:/etc/garage.toml:ro \
-e API_BASE_URL="http://garage-host:3903" \
-e API_ADMIN_KEY="your-admin-token" \
2025-09-29 20:26:44 -04:00
khairul169/garage-webui:latest
2025-07-15 15:59:47 +08:00
```
2025-07-30 23:48:36 -04:00
### 🖥️ Binary Deployment
2025-07-15 15:59:47 +08:00
```bash
2025-07-30 23:48:36 -04:00
# Download the binary file
2025-09-29 20:26:44 -04:00
wget -O garage-webui https://github.com/khairul169/garage-webui/releases/download/1.0.9/garage-webui-v1.0.9-linux-amd64
2025-07-15 15:59:47 +08:00
chmod +x garage-webui
2025-07-30 23:48:36 -04:00
# Run the service
2025-07-15 15:59:47 +08:00
CONFIG_PATH=./garage.toml ./garage-webui
```
2025-07-30 23:48:36 -04:00
### 🔧 SystemD Service
2025-07-15 15:59:47 +08:00
```ini
[Unit]
Description=Garage Web UI
After=network.target
[Service]
Environment="PORT=3909"
Environment="CONFIG_PATH=/etc/garage.toml"
ExecStart=/usr/local/bin/garage-webui
Restart=always
[Install]
WantedBy=default.target
```
2025-07-30 23:48:36 -04:00
## Configuration Management
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
### 📝 Garage Configuration Requirements
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
The Web UI requires the Garage cluster to have the Admin API enabled:
2025-07-15 15:59:47 +08:00
```toml
# garage.toml
[admin]
api_bind_addr = "[::]:3903"
admin_token = "your-secure-admin-token"
2025-07-30 23:48:36 -04:00
metrics_token = "your-metrics-token" # Optional
2025-07-15 15:59:47 +08:00
```
2025-07-30 23:48:36 -04:00
### 🌍 Environment Variable Configuration
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
| Variable Name | Description | Default Value |
| ----------------- | ----------------------------- | -------------------- |
| `CONFIG_PATH` | Path to Garage config file | `/etc/garage.toml` |
| `API_BASE_URL` | Garage Admin API address | Read from config file|
| `API_ADMIN_KEY` | Admin API token | Read from config file|
| `S3_ENDPOINT_URL` | S3 API address | Read from config file|
| `S3_REGION` | S3 region | `garage` |
| `BASE_PATH` | Web UI base path | `/` |
| `PORT` | Service port | `3909` |
| `HOST` | Binding address | `0.0.0.0` |
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
### 🔐 Authentication Configuration
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
#### Enable Web UI Authentication
2025-07-15 15:59:47 +08:00
```bash
2025-07-30 23:48:36 -04:00
# Generate password hash
2025-07-15 15:59:47 +08:00
htpasswd -nbBC 10 "admin" "password"
2025-07-30 23:48:36 -04:00
# Set environment variable
2025-07-15 15:59:47 +08:00
AUTH_USER_PASS="admin:$2y$10$DSTi9o..."
```
2025-07-30 23:48:36 -04:00
## Management Best Practices
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
### 🚀 Daily Operations
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
#### 1. Cluster Health Monitoring
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
- **Regular Checks**: Monitor cluster status via the home dashboard
- **Alerting Setup**: Configure monitoring systems to connect to the `/metrics` endpoint
- **Performance Observation**: Pay attention to storage node connection status and partition health
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
#### 2. Bucket Management
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
- **Naming Conventions**: Establish uniform bucket naming conventions
- **Minimize Permissions**: Assign the minimum necessary permissions to access keys
- **Quota Management**: Set appropriate quota limits for important services
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
#### 3. Access Control
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
- **Regular Rotation**: Rotate API access keys periodically
- **Permission Audits**: Regularly review bucket permission assignments
- **Key Management**: Create dedicated access keys for different purposes
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
### 🔧 Troubleshooting
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
#### 1. Connection Issues
2025-07-15 15:59:47 +08:00
```bash
2025-07-30 23:48:36 -04:00
# Check Admin API accessibility
2025-07-15 15:59:47 +08:00
curl -H "Authorization: Bearer YOUR_TOKEN" \
http://garage-host:3903/v2/GetClusterHealth
2025-07-30 23:48:36 -04:00
# Check network connectivity
2025-07-15 15:59:47 +08:00
telnet garage-host 3903
```
2025-07-30 23:48:36 -04:00
#### 2. Configuration Issues
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
- Verify the correctness of the `garage.toml` configuration
- Confirm that the Admin API port is open
- Check firewall and network policies
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
#### 3. Performance Optimization
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
- Enable caching to reduce API calls
- Use a reverse proxy (like Nginx) for SSL termination
- Monitor resource usage
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
### 📊 Monitoring Integration
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
#### Prometheus Metrics
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
The Web UI can be configured to monitor Garage's Prometheus metrics:
2025-07-15 15:59:47 +08:00
```yaml
# prometheus.yml
scrape_configs:
- job_name: "garage"
static_configs:
- targets: ["garage-host:3903"]
metrics_path: /metrics
bearer_token: "your-metrics-token"
```
2025-07-30 23:48:36 -04:00
#### Key Metrics
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
- `garage_cluster_health` : Cluster health status
- `garage_storage_usage` : Storage usage
- `garage_api_requests` : API request statistics
- `garage_replication_status` : Data replication status
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
## Development Guide
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
### 🛠️ Development Environment Setup
2025-07-15 15:59:47 +08:00
```bash
2025-07-30 23:48:36 -04:00
# Clone the project
2025-09-29 20:26:44 -04:00
git clone https://github.com/khairul169/garage-webui.git
2025-07-15 15:59:47 +08:00
cd garage-webui
2025-07-30 23:48:36 -04:00
# Install frontend dependencies
2025-07-15 15:59:47 +08:00
pnpm install
2025-07-30 23:48:36 -04:00
# Install backend dependencies
2025-07-15 15:59:47 +08:00
cd backend & & go mod download & & cd ..
2025-07-30 23:48:36 -04:00
# Start the development server
2025-07-15 15:59:47 +08:00
pnpm run dev
```
2025-07-30 23:48:36 -04:00
### 🔧 Technology Choices
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
- **Frontend**: React 18 + TypeScript + Tailwind CSS
- **State Management**: React Query (TanStack Query)
- **Routing**: React Router
- **UI Components**: Custom component library
- **Backend**: Go + Gin framework
- **Configuration Parsing**: go-toml
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
### 📋 Contribution Guidelines
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
1. **Coding Standards** : Follow the project's ESLint and Go fmt standards
2. **Testing** : New features require corresponding tests
3. **Documentation** : Update relevant documents and API descriptions
4. **Compatibility** : Ensure compatibility with the latest version of Garage
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
## Security Considerations
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
### 🔒 Security Recommendations
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
1. **Network Security**
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
- Use HTTPS in production environments
- Restrict network access to the Admin API
- Use firewall rules to protect sensitive ports
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
2. **Authentication Security**
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
- Consider integrating with an enterprise identity authentication system
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
3. **Permission Control**
- Follow the principle of least privilege
- Use a dedicated administrator token
2025-07-15 15:59:47 +08:00
2025-07-31 18:14:39 -04:00
## API Features Currently Used by the Project
2025-07-15 15:59:47 +08:00
2025-07-31 18:14:39 -04:00
**✅ Full API Compliance**: As of July 2025, all API implementations are fully aligned with the official [Garage Admin API v2 specification ](https://garagehq.deuxfleurs.fr/api/garage-admin-v2.html ). All HTTP methods, request formats, and response handling match the official documentation exactly.
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
#### 1. Cluster Management API
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
- **`GET /v2/GetClusterHealth` ** - Get cluster health status
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
- Used on the home dashboard to display cluster status
- Monitors the number of connected nodes, storage node status, and partition health
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
- **`GET /v2/GetClusterStatus` ** - Get detailed cluster status
2025-07-30 23:48:36 -04:00
- Used on the cluster management page to display node details
- Shows cluster topology and node configuration information
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
#### 2. Cluster Layout Management API
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
- **`GET /v2/GetClusterLayout` ** - Get cluster layout configuration
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
- Displays the current cluster layout and staged changes
- Views node roles, capacity, and zone assignments
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
- **`POST /v2/UpdateClusterLayout` ** - Update cluster layout
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
- Adds new nodes to the cluster
- Modifies node configuration (capacity, zone, tags)
- Removes nodes (by setting `remove: true` )
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
- **`POST /v2/ConnectClusterNodes` ** - Connect cluster nodes
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
- Connects new nodes to the cluster
- Establishes RPC connections between nodes
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
- **`POST /v2/ApplyClusterLayout` ** - Apply layout changes
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
- Applies staged layout changes to the cluster
- Triggers data redistribution
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
- **`POST /v2/RevertClusterLayout` ** - Revert layout changes
2025-07-30 23:48:36 -04:00
- Clears staged layout changes
- Restores to the last stable state
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
#### 3. Bucket Management API
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
- **`GET /v2/ListBuckets` ** - List all buckets
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
- Gets a list of all buckets in the cluster
- Displays basic bucket information and aliases
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
- **`GET /v2/GetBucketInfo` ** - Get detailed bucket information
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
- Views the complete configuration of a single bucket
- Includes permissions, statistics, quota information, etc.
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
- **`POST /v2/CreateBucket` ** - Create a new bucket
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
- Supports setting global and local aliases
- Configures initial permissions and parameters
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
- **`POST /v2/UpdateBucket` ** - Update bucket configuration
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
- Modifies the bucket's website configuration
- Sets or updates quota limits
2025-07-15 15:59:47 +08:00
2025-07-31 18:14:39 -04:00
- **`POST /v2/DeleteBucket?id={id}` ** - Delete bucket
- **Implementation**: POST with query parameter (aligned with official specification)
- **Parameters**: Bucket ID in query parameter
- **Usage**: Remove buckets from cluster
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
#### 4. Bucket Alias Management API
2025-07-15 15:59:47 +08:00
2025-07-31 18:10:39 -04:00
- **`POST /v2/AddBucketAlias` ** - Add a global alias
2025-07-31 18:14:39 -04:00
- **Implementation**: POST with JSON body (aligned with official specification)
- **Parameters**: Bucket ID and alias name in request body (`{ bucketId, globalAlias }` )
2025-07-31 18:10:39 -04:00
- **Usage**: Add new bucket aliases
2025-07-31 18:14:39 -04:00
- **`POST /v2/RemoveBucketAlias` ** - Remove a global alias
- **Implementation**: POST with JSON body (aligned with official specification)
- **Parameters**: Bucket ID and alias name in request body (`{ bucketId, globalAlias }` )
2025-07-31 18:10:39 -04:00
- **Usage**: Remove existing bucket aliases
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
#### 5. Permission Management API
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
- **`POST /v2/AllowBucketKey` ** - Grant bucket permissions
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
- Assigns bucket operation permissions to an access key
- Supports Read, Write, and Owner permissions
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
- **`POST /v2/DenyBucketKey` ** - Revoke bucket permissions
2025-07-30 23:48:36 -04:00
- Removes an access key's permissions for a bucket
- Flexible permission control mechanism
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
#### 6. Access Key Management API
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
- **`GET /v2/ListKeys` ** - List all access keys
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
- Gets all API keys in the cluster
- Displays basic key information
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
- **`POST /v2/CreateKey` ** - Create a new access key
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
- Generates a new S3-compatible access key
- Sets initial permissions for the key
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
- **`POST /v2/ImportKey` ** - Import an existing access key
2025-07-15 15:59:47 +08:00
2025-07-30 23:48:36 -04:00
- Used for migrating or restoring access keys
- Imports externally generated keys
2025-07-15 15:59:47 +08:00
2025-07-31 18:14:39 -04:00
- **`POST /v2/DeleteKey?id={id}` ** - Delete access key
- **Implementation**: POST with query parameter (aligned with official specification)
- **Parameters**: Key ID in query parameter
- **Usage**: Remove access keys from cluster
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
### 🔧 Custom Backend Endpoints
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
The Garage Web UI implements several custom backend endpoints that extend functionality beyond the standard Garage Admin API:
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
#### 1. Configuration Management
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
- **`GET /config` ** - Get garage configuration
- Retrieves garage configuration for frontend display
- Provides S3 endpoint URLs, region information, etc.
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
#### 2. Authentication System
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
- **`POST /auth/login` ** - User authentication
- Handles user login with username/password
- Creates authenticated sessions
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
- **`GET /auth/status` ** - Authentication status
- Checks current authentication state
- Returns whether authentication is enabled and user status
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
- **`POST /auth/logout` ** - User logout
- Terminates authenticated sessions
- Clears session data
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
#### 3. Enhanced Bucket Operations
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
- **`GET /buckets` ** - Enhanced bucket listing
- Provides enriched bucket information by combining `/v2/ListBuckets` and `/v2/GetBucketInfo`
- Includes detailed statistics and metadata for all buckets
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
#### 4. Object Browser & File Management
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
- **`GET /browse/{bucket}` ** - Browse bucket objects
- Lists objects and folders in a bucket with S3 ListObjectsV2
- Supports pagination and prefix filtering
- Provides object metadata and download URLs
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
- **`GET /browse/{bucket}/{key...}` ** - Get/view object
- Retrieves object content for viewing or downloading
- Supports thumbnail generation for images
- Provides object metadata via HeadObject
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
- **`PUT /browse/{bucket}/{key...}` ** - Upload object
- Handles file uploads with multipart form data
- Supports directory creation
- Uses S3 PutObject for storage
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
- **`DELETE /browse/{bucket}/{key...}` ** - Delete object/folder
- Deletes individual objects or entire folders recursively
- Supports bulk deletion for folders
- Uses S3 DeleteObject/DeleteObjects
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
### 📊 Current Feature Coverage Analysis
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
| Feature Category | v2 Total Features | Currently Implemented | Custom Extensions | Total Coverage |
| ---------------------- | ----------------- | -------------------- | ---------------- | -------------- |
| **Cluster Management** | 6 | 2 | 1 (config) | 50% |
| **Layout Management** | 7 | 5 | 0 | 71% |
| **Bucket Management** | 9 | 5 | 2 (enhanced list, browse) | 78% |
| **Permission Management** | 2 | 2 | 0 | 100% |
| **Key Management** | 6 | 4 | 0 | 67% |
| **Authentication** | 0 | 0 | 3 (login system) | 100% (custom) |
| **File Management** | 0 | 0 | 4 (object browser) | 100% (custom) |
| **Advanced Features** | 25+ | 0 | 0 | 0% |
| **Overall** | 55+ | 18 | 10 | 51% |
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
**Enhanced Coverage**: With custom backend endpoints, the project achieves 51% total feature coverage, providing comprehensive cluster management, authentication, and file browsing capabilities.
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
### 🚀 Available v2 Features Not Yet Implemented
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
The project can further enhance functionality by implementing these additional v2 API features:
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
#### 1. Admin Token Management
- `GET /v2/ListAdminTokens` - List all admin tokens
- `GET /v2/GetAdminTokenInfo` - Get token information
- `GET /v2/GetCurrentAdminTokenInfo` - Get current token information
- `POST /v2/CreateAdminToken` - Create an admin token
- `POST /v2/UpdateAdminToken/{id}` - Update an admin token
- `POST /v2/DeleteAdminToken/{id}` - Delete an admin token
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
#### 2. Enhanced Node Management
- `GET /v2/GetNodeInfo/{node}` - Get node information
- `GET /v2/GetNodeStatistics/{node}` - Get node statistics
- `POST /v2/CreateMetadataSnapshot/{node}` - Create a metadata snapshot
- `POST /v2/LaunchRepairOperation/{node}` - Launch a repair operation
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
#### 3. Worker Process Management
- `POST /v2/ListWorkers/{node}` - List worker processes
- `POST /v2/GetWorkerInfo/{node}` - Get worker process information
- `POST /v2/GetWorkerVariable/{node}` - Get a worker process variable
- `POST /v2/SetWorkerVariable/{node}` - Set a worker process variable
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
#### 4. Advanced Block Management
- `POST /v2/GetBlockInfo/{node}` - Get block information
- `GET /v2/ListBlockErrors/{node}` - List block errors
- `POST /v2/RetryBlockResync/{node}` - Retry a block resync
- `POST /v2/PurgeBlocks/{node}` - Purge blocks
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
#### 5. Enhanced Bucket Features
- `POST /v2/CleanupIncompleteUploads` - Cleanup incomplete uploads
- `GET /v2/InspectObject` - Inspect object details
- `GET /v2/GetClusterStatistics` - Get cluster-level statistics
- `POST /v2/PreviewClusterLayoutChanges` - Preview layout changes
- `GET /v2/GetClusterLayoutHistory` - Get layout history
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
### 🎯 Future Development Roadmap
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
#### 📅 Short-Term (1-2 months)
1. **Enhanced Monitoring** : Implement cluster statistics and node information display
2. **Layout Improvements** : Add layout history viewing and change preview functionality
3. **Object Management** : Add object inspection and incomplete upload cleanup
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
#### 📅 Medium-Term (3-6 months)
1. **Admin Token Management** : Full admin token lifecycle management interface
2. **Advanced Monitoring** : Worker process monitoring and detailed node statistics
3. **Maintenance Tools** : Automated repair operations and block management
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
#### 📅 Long-Term (6+ months)
1. **Complete API Coverage** : Implement all available v2 API endpoints
2. **Advanced Bulk Operations** : Comprehensive bulk management features
3. **Real-time Integration** : WebSocket support for live updates and monitoring
2025-07-15 15:59:47 +08:00
2025-07-31 17:19:15 -04:00
**Current Status**: The Garage Web UI successfully uses Garage Admin API v2 with 18 standard endpoints plus 10 custom backend endpoints, achieving 51% feature coverage. The project provides a comprehensive management interface with cluster administration, authentication, file browsing, and enhanced bucket management capabilities, serving as a robust web-based alternative to command-line tools.
2025-07-30 23:48:36 -04:00
2025-07-31 17:19:15 -04:00
**Implementation Philosophy**: The project prioritizes REST API compliance and user experience, which may result in HTTP method choices that differ from the official specification while maintaining full functional compatibility.