Skip to content

Commit fd34684

Browse files
authoredSep 6, 2024
add tencent cloud ocs support (#178)
feat: Added Tencent Cloud OCS support (#178). Signed-off-by: geffzhang <geffzhang@weyhd.com>
1 parent 0fe5bac commit fd34684

15 files changed

+533
-8
lines changed
 

‎BaGetter.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BaGetterWebApplication", "s
5555
EndProject
5656
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BaGetter.Web.Tests", "tests\BaGetter.Web.Tests\BaGetter.Web.Tests.csproj", "{BEEAAA73-36CD-4178-9C9F-6D036586E7BF}"
5757
EndProject
58+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BaGetter.Tencent", "src\BaGetter.Tencent\BaGetter.Tencent.csproj", "{9C809CE0-8C9A-468A-AF08-F5934B6D28D1}"
59+
EndProject
5860
Global
5961
GlobalSection(SolutionConfigurationPlatforms) = preSolution
6062
Debug|Any CPU = Debug|Any CPU
@@ -133,6 +135,10 @@ Global
133135
{BEEAAA73-36CD-4178-9C9F-6D036586E7BF}.Debug|Any CPU.Build.0 = Debug|Any CPU
134136
{BEEAAA73-36CD-4178-9C9F-6D036586E7BF}.Release|Any CPU.ActiveCfg = Release|Any CPU
135137
{BEEAAA73-36CD-4178-9C9F-6D036586E7BF}.Release|Any CPU.Build.0 = Release|Any CPU
138+
{9C809CE0-8C9A-468A-AF08-F5934B6D28D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
139+
{9C809CE0-8C9A-468A-AF08-F5934B6D28D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
140+
{9C809CE0-8C9A-468A-AF08-F5934B6D28D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
141+
{9C809CE0-8C9A-468A-AF08-F5934B6D28D1}.Release|Any CPU.Build.0 = Release|Any CPU
136142
EndGlobalSection
137143
GlobalSection(SolutionProperties) = preSolution
138144
HideSolutionNode = FALSE
@@ -156,6 +162,7 @@ Global
156162
{9F7C4F38-D598-42D9-A9F8-962490483B18} = {26A0B557-53FB-4B9A-94C4-BCCF1BDCB0CC}
157163
{E5AFE55D-0932-46A9-BFA3-C8A034037377} = {DDEC0736-8169-4834-815E-B78E7CE612A4}
158164
{BEEAAA73-36CD-4178-9C9F-6D036586E7BF} = {C237857D-AD8E-4C52-974F-6A8155BB0C18}
165+
{9C809CE0-8C9A-468A-AF08-F5934B6D28D1} = {26A0B557-53FB-4B9A-94C4-BCCF1BDCB0CC}
159166
EndGlobalSection
160167
GlobalSection(ExtensibilityGlobals) = postSolution
161168
SolutionGuid = {1423C027-2C90-417F-8629-2A4CF107C055}

‎Directory.Packages.props

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
<PackageVersion Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="8.0.3" />
2020
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
2121
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
22-
<PackageVersion Include="NuGet.Frameworks" Version="6.9.1" />
22+
<PackageVersion Include="NuGet.Frameworks" Version="6.11.0" />
2323
<PackageVersion Include="NuGet.Protocol" Version="6.9.1" />
24-
<PackageVersion Include="NuGet.Versioning" Version="6.9.1" />
24+
<PackageVersion Include="NuGet.Versioning" Version="6.11.0" />
2525
<PackageVersion Include="System.Reflection.Metadata" Version="8.0.0" />
26-
<PackageVersion Include="System.Text.Json" Version="8.0.3" />
26+
<PackageVersion Include="System.Text.Json" Version="8.0.4" />
2727
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
2828
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
2929
<PackageVersion Include="Moq" Version="4.20.70" />
@@ -45,5 +45,7 @@
4545
<PackageVersion Include="Microsoft.Azure.Storage.Blob" Version="11.2.3" />
4646
<PackageVersion Include="Google.Cloud.Storage.V1" Version="4.9.0" />
4747
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.3" />
48+
<PackageVersion Include="Tencent.QCloud.Cos.Sdk" Version="5.4.40" />
49+
4850
</ItemGroup>
49-
</Project>
51+
</Project>

‎docs/docs/Installation/tencent.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Use Tencent Cloud COS
2+
3+
You can store packages to [Tencent Cloud Object Storage Service](https://cloud.tencent.com/document/product/436/6222).
4+
5+
## Configure BaGetter
6+
7+
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.
8+
9+
### Tencent Cloud Object Storage Service
10+
11+
Update the `appsettings.json` file:
12+
13+
```json
14+
{
15+
...
16+
17+
"Storage": {
18+
"Type": "TencentCos",
19+
"AppId": "",
20+
"SecretId": "",
21+
"SecretKey": "",
22+
"BucketName": "bagetter",
23+
"Region": "ap-guangzhou"
24+
},
25+
26+
...
27+
}
28+
```

‎readme.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ For more information, please refer to the [documentation].
3636

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

4242
## 🤝 Contributing
@@ -82,3 +82,4 @@ Thanks to everyone who helps to make BaGetter better!
8282
[AWS doc link]: https://www.bagetter.com/docs/Installation/aws
8383
[GCP doc link]: https://www.bagetter.com/docs/Installation/gcp
8484
[Aliyun doc link]: https://www.bagetter.com/docs/Installation/aliyun
85+
[Tencent doc link]: https://www.bagetter.com/docs/Installation/tencent

‎src/BaGetter.Core/Statistics/StatisticsService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Linq;
44
using System.Threading.Tasks;
@@ -50,7 +50,7 @@ public IEnumerable<string> GetKnownServices()
5050
if (configuration.HasStorageType("AwsS3")) servicesNames.Add("AwsS3");
5151
if (configuration.HasStorageType("AliyunOss")) servicesNames.Add("AliyunOss");
5252
if (configuration.HasStorageType("GoogleCloud")) servicesNames.Add("GoogleCloud");
53-
53+
if (configuration.HasStorageType("TencentCos")) servicesNames.Add("TencentCos");
5454
return servicesNames;
5555
}
5656

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Description>The libraries to host BaGetter on Tencent Cloud.</Description>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="Tencent.QCloud.Cos.Sdk"/>
12+
</ItemGroup>
13+
14+
<ItemGroup>
15+
<ProjectReference Include="..\BaGetter.Core\BaGetter.Core.csproj" />
16+
</ItemGroup>
17+
</Project>

0 commit comments

Comments
 (0)