Skip to content

Commit 921bc16

Browse files
committed
initial commit
0 parents  commit 921bc16

File tree

11 files changed

+203
-0
lines changed

11 files changed

+203
-0
lines changed

.editorconfig

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# editorconfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Default settings:
7+
# A newline ending every file
8+
# Use 4 spaces as indentation
9+
[*]
10+
insert_final_newline = true
11+
end_of_line = lf
12+
indent_style = space
13+
indent_size = 4
14+
15+
# Trim trailing whitespace, limited support.
16+
# https://github.com/editorconfig/editorconfig/wiki/Property-research:-Trim-trailing-spaces
17+
trim_trailing_whitespace = true
18+
19+
[*.md]
20+
insert_final_newline = false
21+
trim_trailing_whitespace = false
22+
23+
[.json]
24+
indent_size = 2
25+
26+
[*.{cs,vb}]
27+
dotnet_style_predefined_type_for_locals_parameters_members = true:error
28+
29+
dotnet_naming_rule.private_members_with_underscore.symbols = private_fields
30+
dotnet_naming_rule.private_members_with_underscore.style = prefix_underscore
31+
dotnet_naming_rule.private_members_with_underscore.severity = suggestion
32+
33+
dotnet_naming_symbols.private_fields.applicable_kinds = field
34+
dotnet_naming_symbols.private_fields.applicable_accessibilities = private
35+
36+
dotnet_naming_style.prefix_underscore.capitalization = camel_case
37+
dotnet_naming_style.prefix_underscore.required_prefix = _

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
*.dll
2+
*.exe
3+
*.log
4+
*.nupkg
5+
*.suo
6+
*.user
7+
8+
.idea/
9+
.vs/
10+
.vscode/
11+
[Bb]in/
12+
[Oo]bj/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Umbraco HQ
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

NuGet.config

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
5+
<add key="Umbraco Prereleases" value="https://www.myget.org/F/umbracoprereleases/api/v3/index.json" />
6+
</packageSources>
7+
</configuration>

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Umbraco.Cloud.StorageProviders.AzureBlob
2+
3+
Umbraco Cloud Azure Blob Storage Provider
4+
5+
## Azure Blob
6+
7+
Contains Umbraco Cloud specific code for the [Umbraco Azure Blob Storage Provider](https://github.com/umbraco/Umbraco.StorageProviders).
8+
9+
## Bugs, issues and Pull Requests
10+
11+
If you encounter a bug when using this client library you are welcome to open an issue in the issue tracker of this repository. We always welcome Pull Request and please feel free to open an issue before submitting a Pull Request to discuss what you want to submit.
12+
13+
Questions about usage should be posted to the forum on [our.umbraco.com](https://our.umbraco.com).
14+
15+
## License
16+
17+
Umbraco Cloud Azure Blob Storage Provider is [MIT licensed](LICENSE).
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.30114.105
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{EEC243CE-EF50-4E06-8B76-ACFD77161D7C}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Umbraco.Cloud.StorageProviders.AzureBlob", "src\Umbraco.Cloud.StorageProviders.AzureBlob\Umbraco.Cloud.StorageProviders.AzureBlob.csproj", "{DD4F5091-4EAB-4863-95EB-6143FD3A241C}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Debug|x64 = Debug|x64
14+
Debug|x86 = Debug|x86
15+
Release|Any CPU = Release|Any CPU
16+
Release|x64 = Release|x64
17+
Release|x86 = Release|x86
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
23+
{DD4F5091-4EAB-4863-95EB-6143FD3A241C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
24+
{DD4F5091-4EAB-4863-95EB-6143FD3A241C}.Debug|Any CPU.Build.0 = Debug|Any CPU
25+
{DD4F5091-4EAB-4863-95EB-6143FD3A241C}.Debug|x64.ActiveCfg = Debug|Any CPU
26+
{DD4F5091-4EAB-4863-95EB-6143FD3A241C}.Debug|x64.Build.0 = Debug|Any CPU
27+
{DD4F5091-4EAB-4863-95EB-6143FD3A241C}.Debug|x86.ActiveCfg = Debug|Any CPU
28+
{DD4F5091-4EAB-4863-95EB-6143FD3A241C}.Debug|x86.Build.0 = Debug|Any CPU
29+
{DD4F5091-4EAB-4863-95EB-6143FD3A241C}.Release|Any CPU.ActiveCfg = Release|Any CPU
30+
{DD4F5091-4EAB-4863-95EB-6143FD3A241C}.Release|Any CPU.Build.0 = Release|Any CPU
31+
{DD4F5091-4EAB-4863-95EB-6143FD3A241C}.Release|x64.ActiveCfg = Release|Any CPU
32+
{DD4F5091-4EAB-4863-95EB-6143FD3A241C}.Release|x64.Build.0 = Release|Any CPU
33+
{DD4F5091-4EAB-4863-95EB-6143FD3A241C}.Release|x86.ActiveCfg = Release|Any CPU
34+
{DD4F5091-4EAB-4863-95EB-6143FD3A241C}.Release|x86.Build.0 = Release|Any CPU
35+
EndGlobalSection
36+
GlobalSection(NestedProjects) = preSolution
37+
{DD4F5091-4EAB-4863-95EB-6143FD3A241C} = {EEC243CE-EF50-4E06-8B76-ACFD77161D7C}
38+
EndGlobalSection
39+
EndGlobal
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using System;
2+
using Microsoft.Extensions.Configuration;
3+
using Microsoft.Extensions.DependencyInjection;
4+
using Umbraco.Cms.Core.Composing;
5+
using Umbraco.Cms.Core.DependencyInjection;
6+
using Umbraco.Cms.Web.Common.ApplicationBuilder;
7+
using Umbraco.StorageProviders.AzureBlob;
8+
9+
namespace Umbraco.Cloud.StorageProviders.AzureBlob
10+
{
11+
public class AzureBlobComposer : IComposer
12+
{
13+
public void Compose(IUmbracoBuilder builder)
14+
{
15+
if (builder == null) throw new ArgumentNullException(nameof(builder));
16+
17+
if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("UMBRACO__CLOUD__ENVIRONMENT"))) return;
18+
19+
builder.AddAzureBlobMediaFileSystem();
20+
21+
var configuration = new ConfigurationBuilder()
22+
.AddJsonFile("umbraco-cloud.json", true, true)
23+
.AddEnvironmentVariables("UMBRACO:CLOUD:")
24+
.Build();
25+
26+
builder.Services.Configure<AzureBlobFileSystemOptions>(AzureBlobFileSystemOptions.MediaFileSystemName,
27+
configuration.GetSection("Storage:AzureBlob").Bind);
28+
29+
builder.Services.Configure<UmbracoPipelineOptions>(options =>
30+
{
31+
options.AddFilter(new UmbracoPipelineFilter("AzureBlob")
32+
{
33+
Endpoints = app => app.UseAzureBlobMediaFileSystem()
34+
});
35+
});
36+
}
37+
}
38+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
using System;
2+
3+
[assembly:CLSCompliant(false)]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net5.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Nerdbank.GitVersioning" Version="3.4.220">
11+
<PrivateAssets>all</PrivateAssets>
12+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
13+
</PackageReference>
14+
<PackageReference Include="SonarAnalyzer.CSharp" Version="8.25.0.33663">
15+
<PrivateAssets>all</PrivateAssets>
16+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
17+
</PackageReference>
18+
<PackageReference Include="Umbraco.StorageProviders.AzureBlob" Version="0.1.0-gace5069105" />
19+
</ItemGroup>
20+
21+
</Project>

0 commit comments

Comments
 (0)