FEATURE (storages): Add manual for Cloudflare R2

This commit is contained in:
Rostislav Dugin
2025-06-19 22:54:14 +03:00
parent ec070d96c0
commit deb480fa1e
5 changed files with 12 additions and 5 deletions

View File

@@ -28,7 +28,7 @@
### 🗄️ **Multiple Storage Destinations**
- **Local storage**: Keep backups on your VPS/server
- **Cloud storage**: S3, Google Drive, Dropbox, and more (coming soon)
- **Cloud storage**: S3, Cloudflare R2, Google Drive, Dropbox, and more (coming soon)
- **Secure**: All data stays under your control
### 📱 **Smart Notifications**

View File

@@ -82,6 +82,7 @@ func (r *StorageRepository) FindByUserID(userID uuid.UUID) ([]*Storage, error) {
Preload("LocalStorage").
Preload("S3Storage").
Where("user_id = ?", userID).
Order("name ASC").
Find(&storages).Error; err != nil {
return nil, err
}

View File

@@ -113,9 +113,6 @@ func (s *S3Storage) Validate() error {
if s.S3Bucket == "" {
return errors.New("S3 bucket is required")
}
if s.S3Region == "" {
return errors.New("S3 region is required")
}
if s.S3AccessKey == "" {
return errors.New("S3 access key is required")
}

View File

@@ -120,7 +120,6 @@ export function EditStorageComponent({
if (storage.type === StorageType.S3) {
return (
storage.s3Storage?.s3Bucket &&
storage.s3Storage?.s3Region &&
storage.s3Storage?.s3AccessKey &&
storage.s3Storage?.s3SecretKey
);

View File

@@ -12,6 +12,16 @@ interface Props {
export function EditS3StorageComponent({ storage, setStorage, setIsUnsaved }: Props) {
return (
<>
<div className="mb-2 flex items-center">
<div className="min-w-[110px]" />
<div className="text-xs text-blue-600">
<a href="https://postgresus.com/cloudflare-r2-storage" target="_blank" rel="noreferrer">
How to use with Cloudflare R2?
</a>
</div>
</div>
<div className="mb-1 flex items-center">
<div className="min-w-[110px]">S3 Bucket</div>
<Input