5.0 KiB
5.0 KiB
MinIO Integration Complete
Tanggal: 2026-01-09
Status: ✅ COMPLETE
Summary
Integrasi MinIO dengan Calypso appliance telah selesai. Frontend Object Storage page sekarang menggunakan data real dari MinIO service, bukan dummy data lagi.
Changes Made
1. Backend Integration ✅
Created MinIO Service (backend/internal/object_storage/service.go)
- Service: Menggunakan MinIO Go SDK untuk berinteraksi dengan MinIO server
- Features:
- List buckets dengan informasi detail (size, objects, access policy)
- Get bucket statistics
- Create bucket
- Delete bucket
- Get bucket access policy
Created MinIO Handler (backend/internal/object_storage/handler.go)
- Handler: HTTP handlers untuk API endpoints
- Endpoints:
GET /api/v1/object-storage/buckets- List all bucketsGET /api/v1/object-storage/buckets/:name- Get bucket infoPOST /api/v1/object-storage/buckets- Create bucketDELETE /api/v1/object-storage/buckets/:name- Delete bucket
Updated Configuration (backend/internal/common/config/config.go)
- Added
ObjectStorageConfigstruct untuk MinIO configuration - Fields:
endpoint: MinIO server endpoint (default:localhost:9000)access_key: MinIO access keysecret_key: MinIO secret keyuse_ssl: Whether to use SSL/TLS
Updated Router (backend/internal/common/router/router.go)
- Added object storage routes group
- Routes protected dengan permission
storage:readdanstorage:write - Service initialization dengan error handling
2. Configuration ✅
Updated /opt/calypso/conf/config.yaml
# Object Storage (MinIO) Configuration
object_storage:
endpoint: "localhost:9000"
access_key: "admin"
secret_key: "HqBX1IINqFynkWFa"
use_ssl: false
3. Frontend Integration ✅
Created API Client (frontend/src/api/objectStorage.ts)
- API Client: TypeScript client untuk object storage API
- Interfaces:
Bucket: Bucket data structure
- Methods:
listBuckets(): Fetch all bucketsgetBucket(name): Get bucket detailscreateBucket(name): Create new bucketdeleteBucket(name): Delete bucket
Updated ObjectStorage Page (frontend/src/pages/ObjectStorage.tsx)
- Removed: Mock data (
MOCK_BUCKETS) - Added: Real API integration dengan React Query
- Features:
- Fetch buckets dari API dengan auto-refresh setiap 5 detik
- Transform API data ke format UI
- Loading state untuk buckets
- Empty state ketika tidak ada buckets
- Mutations untuk create/delete bucket
- Error handling dengan alerts
4. Dependencies ✅
Added Go Packages
github.com/minio/minio-go/v7- MinIO Go SDKgithub.com/minio/madmin-go/v3- MinIO Admin API
API Endpoints
List Buckets
GET /api/v1/object-storage/buckets
Authorization: Bearer <token>
Response:
{
"buckets": [
{
"name": "my-bucket",
"creation_date": "2026-01-09T20:13:27Z",
"size": 1024000,
"objects": 42,
"access_policy": "private"
}
]
}
Get Bucket
GET /api/v1/object-storage/buckets/:name
Authorization: Bearer <token>
Create Bucket
POST /api/v1/object-storage/buckets
Authorization: Bearer <token>
Content-Type: application/json
{
"name": "new-bucket"
}
Delete Bucket
DELETE /api/v1/object-storage/buckets/:name
Authorization: Bearer <token>
Testing
Backend Test
# Test API endpoint
curl -H "Authorization: Bearer <token>" http://localhost:8080/api/v1/object-storage/buckets
Frontend Test
- Login ke Calypso UI
- Navigate ke "Object Storage" page
- Verify buckets dari MinIO muncul di UI
- Test create bucket (jika ada button)
- Test delete bucket (jika ada button)
MinIO Service Status
Service: minio.service
Status: ✅ Running
Endpoint: http://localhost:9000 (API), http://localhost:9001 (Console)
Storage: /opt/calypso/data/storage/s3
Credentials:
- Access Key:
admin - Secret Key:
HqBX1IINqFynkWFa
Next Steps (Optional)
- Add Create/Delete Bucket UI: Tambahkan modal/form untuk create/delete bucket dari UI
- Bucket Policies Management: UI untuk manage bucket access policies
- Object Management: UI untuk browse dan manage objects dalam bucket
- Bucket Quotas: Implementasi quota management untuk buckets
- Bucket Lifecycle: Implementasi lifecycle policies untuk buckets
- S3 Users & Keys: Management untuk S3 access keys (MinIO users)
Files Modified
Backend
/src/calypso/backend/internal/object_storage/service.go(NEW)/src/calypso/backend/internal/object_storage/handler.go(NEW)/src/calypso/backend/internal/common/config/config.go(MODIFIED)/src/calypso/backend/internal/common/router/router.go(MODIFIED)/opt/calypso/conf/config.yaml(MODIFIED)
Frontend
/src/calypso/frontend/src/api/objectStorage.ts(NEW)/src/calypso/frontend/src/pages/ObjectStorage.tsx(MODIFIED)
Date
2026-01-09