Skip to content

Commit

Permalink
deprecate Qiniu image storage provider
Browse files Browse the repository at this point in the history
  • Loading branch information
EdiWang committed Oct 3, 2023
1 parent 8336235 commit 63c94cb
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 225 deletions.
15 changes: 0 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,21 +133,6 @@ You need to hava an [**Minio Server**](https://docs.min.io/).
}
```

#### [Qiniu Blob Storage](https://qiniu.com/) (Almost free)

You need to hava an Qiniu cloud account, and use [Kodo](https://www.qiniu.com/products/kodo) storage service.

```json
"Provider": "qiniustorage"
"QiniuStorageSettings": {
"EndPoint": "Your Custom Domain",
"AccessKey": "Your Access Key",
"SecretKey": "Your Secret Key",
"BucketName": "Your BucketName",
"WithSSL": false
}
```

#### File System (Not Recommended)

You can also choose File System for image storage if you don't have a cloud option.
Expand Down
2 changes: 0 additions & 2 deletions src/Moonglade.ImageStorage/ImageStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@ public class ImageStorageSettings
public AzureStorageSettings AzureStorageSettings { get; set; }

public MinioStorageSettings MinioStorageSettings { get; set; }

public QiniuStorageSettings QiniuStorageSettings { get; set; }
}
1 change: 0 additions & 1 deletion src/Moonglade.ImageStorage/Moonglade.ImageStorage.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.18.0" />
<PackageReference Include="Minio" Version="6.0.0" />
<PackageReference Include="Pzy.Qiniu" Version="0.1.2" />
</ItemGroup>
</Project>
38 changes: 0 additions & 38 deletions src/Moonglade.ImageStorage/Providers/QiniuBlobConfiguration.cs

This file was deleted.

132 changes: 0 additions & 132 deletions src/Moonglade.ImageStorage/Providers/QiniuBlobImageStorage.cs

This file was deleted.

10 changes: 0 additions & 10 deletions src/Moonglade.ImageStorage/Providers/QiniuStorageSettings.cs

This file was deleted.

20 changes: 0 additions & 20 deletions src/Moonglade.ImageStorage/ServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Moonglade.ImageStorage.Providers;
using Pzy.Qiniu;

namespace Moonglade.ImageStorage;

Expand Down Expand Up @@ -52,13 +51,6 @@ public static IServiceCollection AddImageStorage(
}
services.AddMinioStorage(settings.MinioStorageSettings);
break;
case "qiniustorage":
if (settings.QiniuStorageSettings == null)
{
throw new ArgumentNullException(nameof(settings.QiniuStorageSettings), "QiniuStorageSettings can not be null.");
}
services.AddQiniuStorage(settings.QiniuStorageSettings);
break;
default:
var msg = $"Provider {provider} is not supported.";
throw new NotSupportedException(msg);
Expand Down Expand Up @@ -95,16 +87,4 @@ private static void AddMinioStorage(this IServiceCollection services, MinioStora
settings.BucketName,
settings.WithSSL));
}

private static void AddQiniuStorage(this IServiceCollection services, QiniuStorageSettings settings)
{
services.AddQiniuStorage()
.AddScoped<IFileNameGenerator, RegularFileNameGenerator>()
.AddSingleton<IBlogImageStorage, QiniuBlobImageStorage>()
.AddSingleton<IMacSettings>(new MacSettings(settings.AccessKey, settings.SecretKey))
.AddSingleton<IQiniuConfiguration>(_ => new QiniuBlobConfiguration(
settings.EndPoint,
settings.BucketName,
settings.WithSSL));
}
}
7 changes: 0 additions & 7 deletions src/Moonglade.Web/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,6 @@
"SecretKey": "",
"BucketName": "",
"WithSSL": false
},
"QiniuStorageSettings": {
"EndPoint": "",
"AccessKey": "",
"SecretKey": "",
"BucketName": "",
"WithSSL": false
}
},
"Editor": "HTML",
Expand Down

0 comments on commit 63c94cb

Please sign in to comment.