Skip to content

Commit

Permalink
add tencent cloud ocs support (#178)
Browse files Browse the repository at this point in the history
feat: Added Tencent Cloud OCS support (#178).

Signed-off-by: geffzhang <geffzhang@weyhd.com>
  • Loading branch information
geffzhang authored Sep 6, 2024
1 parent 0fe5bac commit fd34684
Show file tree
Hide file tree
Showing 15 changed files with 533 additions and 8 deletions.
7 changes: 7 additions & 0 deletions BaGetter.sln
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BaGetterWebApplication", "s
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BaGetter.Web.Tests", "tests\BaGetter.Web.Tests\BaGetter.Web.Tests.csproj", "{BEEAAA73-36CD-4178-9C9F-6D036586E7BF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BaGetter.Tencent", "src\BaGetter.Tencent\BaGetter.Tencent.csproj", "{9C809CE0-8C9A-468A-AF08-F5934B6D28D1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -133,6 +135,10 @@ Global
{BEEAAA73-36CD-4178-9C9F-6D036586E7BF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BEEAAA73-36CD-4178-9C9F-6D036586E7BF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BEEAAA73-36CD-4178-9C9F-6D036586E7BF}.Release|Any CPU.Build.0 = Release|Any CPU
{9C809CE0-8C9A-468A-AF08-F5934B6D28D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9C809CE0-8C9A-468A-AF08-F5934B6D28D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9C809CE0-8C9A-468A-AF08-F5934B6D28D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9C809CE0-8C9A-468A-AF08-F5934B6D28D1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -156,6 +162,7 @@ Global
{9F7C4F38-D598-42D9-A9F8-962490483B18} = {26A0B557-53FB-4B9A-94C4-BCCF1BDCB0CC}
{E5AFE55D-0932-46A9-BFA3-C8A034037377} = {DDEC0736-8169-4834-815E-B78E7CE612A4}
{BEEAAA73-36CD-4178-9C9F-6D036586E7BF} = {C237857D-AD8E-4C52-974F-6A8155BB0C18}
{9C809CE0-8C9A-468A-AF08-F5934B6D28D1} = {26A0B557-53FB-4B9A-94C4-BCCF1BDCB0CC}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1423C027-2C90-417F-8629-2A4CF107C055}
Expand Down
10 changes: 6 additions & 4 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
<PackageVersion Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="8.0.3" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
<PackageVersion Include="NuGet.Frameworks" Version="6.9.1" />
<PackageVersion Include="NuGet.Frameworks" Version="6.11.0" />
<PackageVersion Include="NuGet.Protocol" Version="6.9.1" />
<PackageVersion Include="NuGet.Versioning" Version="6.9.1" />
<PackageVersion Include="NuGet.Versioning" Version="6.11.0" />
<PackageVersion Include="System.Reflection.Metadata" Version="8.0.0" />
<PackageVersion Include="System.Text.Json" Version="8.0.3" />
<PackageVersion Include="System.Text.Json" Version="8.0.4" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageVersion Include="Moq" Version="4.20.70" />
Expand All @@ -45,5 +45,7 @@
<PackageVersion Include="Microsoft.Azure.Storage.Blob" Version="11.2.3" />
<PackageVersion Include="Google.Cloud.Storage.V1" Version="4.9.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.3" />
<PackageVersion Include="Tencent.QCloud.Cos.Sdk" Version="5.4.40" />

</ItemGroup>
</Project>
</Project>
28 changes: 28 additions & 0 deletions docs/docs/Installation/tencent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Use Tencent Cloud COS

You can store packages to [Tencent Cloud Object Storage Service](https://cloud.tencent.com/document/product/436/6222).

## Configure BaGetter

You can modify BaGetter's configurations by editing the `appsettings.json` file. For the full list of configurations, please refer to [BaGetter's configuration](../configuration.md) guide.

### Tencent Cloud Object Storage Service

Update the `appsettings.json` file:

```json
{
...

"Storage": {
"Type": "TencentCos",
"AppId": "",
"SecretId": "",
"SecretKey": "",
"BucketName": "bagetter",
"Region": "ap-guangzhou"
},

...
}
```
3 changes: 2 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ For more information, please refer to the [documentation].

* **Cross-platform**: runs on Windows, macOS, and Linux!
* **ARM** (64bit) **support**. You can host your NuGets on a device like Raspberry Pi!
* **Cloud native**: supports [Docker][Docker doc link], [AWS][AWS doc link], [Google Cloud][GCP doc link], [Alibaba Cloud][Aliyun doc link]
* **Cloud native**: supports [Docker][Docker doc link], [AWS][AWS doc link], [Google Cloud][GCP doc link], [Alibaba Cloud][Aliyun doc link][Tencent Cloud][Tencent doc link]
* **Offline support**: [Mirror a NuGet server][Read through caching] to speed up builds and enable offline downloads

## 🤝 Contributing
Expand Down Expand Up @@ -82,3 +82,4 @@ Thanks to everyone who helps to make BaGetter better!
[AWS doc link]: https://www.bagetter.com/docs/Installation/aws
[GCP doc link]: https://www.bagetter.com/docs/Installation/gcp
[Aliyun doc link]: https://www.bagetter.com/docs/Installation/aliyun
[Tencent doc link]: https://www.bagetter.com/docs/Installation/tencent
4 changes: 2 additions & 2 deletions src/BaGetter.Core/Statistics/StatisticsService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
Expand Down Expand Up @@ -50,7 +50,7 @@ public IEnumerable<string> GetKnownServices()
if (configuration.HasStorageType("AwsS3")) servicesNames.Add("AwsS3");
if (configuration.HasStorageType("AliyunOss")) servicesNames.Add("AliyunOss");
if (configuration.HasStorageType("GoogleCloud")) servicesNames.Add("GoogleCloud");

if (configuration.HasStorageType("TencentCos")) servicesNames.Add("TencentCos");
return servicesNames;
}

Expand Down
17 changes: 17 additions & 0 deletions src/BaGetter.Tencent/BaGetter.Tencent.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Description>The libraries to host BaGetter on Tencent Cloud.</Description>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Tencent.QCloud.Cos.Sdk"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\BaGetter.Core\BaGetter.Core.csproj" />
</ItemGroup>
</Project>
Loading

0 comments on commit fd34684

Please sign in to comment.