Skip to content

Commit

Permalink
fix: corrected project configuration + added schema generation
Browse files Browse the repository at this point in the history
  • Loading branch information
bielu committed Jan 4, 2024
1 parent f5cce00 commit 0aaa281
Show file tree
Hide file tree
Showing 12 changed files with 172 additions and 32 deletions.
7 changes: 5 additions & 2 deletions Writerside/adoc.tree
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@
<toc-element topic="api-docs.md"/>
<toc-element topic="Ui.md"/>
<toc-element topic="Providers.md">
<toc-element topic="Azure.md">
<toc-element topic="Azure-Frondoor-Standard-Premium.md"/>
<toc-element topic="Azure-Front-Door.md"/>
</toc-element>
<toc-element topic="Akamai.md"/>
<toc-element topic="AWS-Cloud-Front.md"/>
<toc-element topic="Azure-Front-Door.md"/>
<toc-element topic="Cloudflare.md"/>
<toc-element topic="Nginx-Reverse-Proxy.md"/>
<toc-element topic="Cloudflare.md"/>
</toc-element>
<toc-element topic="Configuration.md"/>
</instance-profile>
1 change: 0 additions & 1 deletion Writerside/topics/Akamai.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@ services.AddUmbraco(_env, _config)
```
You need to add following line:
```C#
.
.AddAkamaiCdnProvider()
```
24 changes: 24 additions & 0 deletions Writerside/topics/Azure-Frondoor-Standard-Premium.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Azure Classic Front Door

Start typing here...
## Configuration
### Json Options Schema
```json
```
{src="../../src/bielu.Umbraco.Cdn.Azure.Cdn/schema/appsettings-schema.AzureCdnOptions.json" }

## Installing Provider
In order to activate provider post installation, you need to add following code to your Startup.cs or Program.cs (for minimal hosting model) file.

In registration of services, after this lines:
```C#
services.AddUmbraco(_env, _config)
.AddBackOffice()
.AddWebsite()
.AddComposers()
```
You need to add following line:
```C#
.
.AddAzureFrontDoorCdnProvider()
```
2 changes: 1 addition & 1 deletion Writerside/topics/Azure-Front-Door.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Azure Front Door
# Azure Frondoor Standard / Premium

Start typing here...
## Configuration
Expand Down
16 changes: 16 additions & 0 deletions Writerside/topics/Azure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Azure
## Configuration
### Json Options Schema
```json
```
{src="../../src/bielu.Umbraco.Cdn.Azure.Common/schema/appsettings-schema.AzureCdnOptions.json" }


#### AuthenticationType
This is an authentication type for Azure Front Door account. It is required to be able to use Azure Front Door.
#### ResourceGroupName
This is a resource group name for Azure Front Door account. It is required to be able to use Azure Front Door.
#### SubscriptionId
This is a subscription id for Azure Front Door account. It is required to be able to use Azure Front Door.
#### UserAssignedClientId
This is a user assigned client id for Azure Front Door account. It is required to be able to use Azure Front Door.
4 changes: 4 additions & 0 deletions src/SchemaGenerator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
using bielu.SchemaGenerator.Build.Services;
using bielu.Umbraco.Cdn.Akamai.Configuration;
using bielu.Umbraco.Cdn.Aws.Configuration;
using bielu.Umbraco.Cdn.Azure.Cdn.Configuration;
using bielu.Umbraco.Cdn.Azure.Common.Configuration;
using bielu.Umbraco.Cdn.Azure.Configuration;
using bielu.Umbraco.Cdn.Cloudflare.Configuration;
using bielu.Umbraco.Cdn.Core.Configuration;
Expand All @@ -17,6 +19,8 @@ internal class Program
typeof(CloudFrontOptions).Assembly,
typeof(CloudflareOptions).Assembly,
typeof(FrontDoorOptions).Assembly,
typeof(AzureBaseOptions).Assembly,
typeof(AzureCdnOptions).Assembly,
typeof(BieluCdnOptions).Assembly,
typeof(AkamaiOptions).Assembly,
};
Expand Down
2 changes: 2 additions & 0 deletions src/SchemaGenerator/SchemaGenerator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>SchemageGerator</RootNamespace>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\bielu.Umbraco.Cdn.Akamai\bielu.Umbraco.Cdn.Akamai.csproj" />
<ProjectReference Include="..\bielu.Umbraco.Cdn.Aws.CloudFront\bielu.Umbraco.Cdn.Aws.CloudFront.csproj" />
<ProjectReference Include="..\bielu.Umbraco.Cdn.Azure.Cdn\bielu.Umbraco.Cdn.Azure.Cdn.csproj" />
<ProjectReference Include="..\bielu.Umbraco.Cdn.Azure.FrontDoor\bielu.Umbraco.Cdn.Azure.FrontDoor.csproj" />
<ProjectReference Include="..\bielu.Umbraco.Cdn.Cloudflare\bielu.Umbraco.Cdn.Cloudflare.csproj" />
<ProjectReference Include="..\bielu.Umbraco.Cdn.Core\bielu.Umbraco.Cdn.Core.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,31 @@
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Bielu:Cdn:Azure:Cdn",
"definitions": {
"BieluUmbracoCdnAzureModelsAuthenticationType": {
"BieluUmbracoCdnAzureCommonConfigurationAzureBaseOptions": {
"allOf": [
{
"$ref": "#/definitions/BieluUmbracoCdnCoreConfigurationConfigurationBaseOptions"
},
{
"type": "object",
"properties": {
"AuthenticationType": {
"$ref": "#/definitions/BieluUmbracoCdnAzureCommonModelsAuthenticationType"
},
"ResourceGroupName": {
"type": "string"
},
"SubscriptionId": {
"type": "string"
},
"UserAssignedClientId": {
"type": "string"
}
}
}
]
},
"BieluUmbracoCdnAzureCommonModelsAuthenticationType": {
"type": "string",
"description": "",
"x-enumNames": [
Expand Down Expand Up @@ -39,25 +63,13 @@
},
"allOf": [
{
"$ref": "#/definitions/BieluUmbracoCdnCoreConfigurationConfigurationBaseOptions"
"$ref": "#/definitions/BieluUmbracoCdnAzureCommonConfigurationAzureBaseOptions"
},
{
"type": "object",
"properties": {
"AuthenticationType": {
"$ref": "#/definitions/BieluUmbracoCdnAzureModelsAuthenticationType"
},
"FrontDoorName": {
"type": "string"
},
"ResourceGroupName": {
"type": "string"
},
"SubscriptionId": {
"type": "string"
},
"UserAssignedClientId": {
"type": "string"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "bieluUmbracoCdnAzureCommonConfigurationAzureBaseOptions",
"definitions": {
"BieluUmbracoCdnAzureCommonModelsAuthenticationType": {
"type": "string",
"description": "",
"x-enumNames": [
"ManagedIdentityCredential",
"DefaultAzureCredential",
"InteractiveBrowserCredential",
"SharedTokenCacheCredential",
"VisualStudioCredential",
"VisualStudioCodeCredential",
"AzureCliCredential",
"AzurePowerShellCredential",
"EnvironmentCredential"
],
"enum": [
"ManagedIdentityCredential",
"DefaultAzureCredential",
"InteractiveBrowserCredential",
"SharedTokenCacheCredential",
"VisualStudioCredential",
"VisualStudioCodeCredential",
"AzureCliCredential",
"AzurePowerShellCredential",
"EnvironmentCredential"
]
},
"BieluUmbracoCdnCoreConfigurationConfigurationBaseOptions": {
"type": "object",
"properties": {
"Disabled": {
"type": "boolean"
}
}
}
},
"allOf": [
{
"$ref": "#/definitions/BieluUmbracoCdnCoreConfigurationConfigurationBaseOptions"
},
{
"type": "object",
"properties": {
"AuthenticationType": {
"$ref": "#/definitions/BieluUmbracoCdnAzureCommonModelsAuthenticationType"
},
"ResourceGroupName": {
"type": "string"
},
"SubscriptionId": {
"type": "string"
},
"UserAssignedClientId": {
"type": "string"
}
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project>
<ItemGroup>
<UmbracoJsonSchemaFiles Include="$(MSBuildThisFileDirectory)..\Schema\appsettings-schema.AzureBaseOptions.json" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,31 @@
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Bielu:Cdn:Azure:FrontDoor",
"definitions": {
"BieluUmbracoCdnAzureModelsAuthenticationType": {
"BieluUmbracoCdnAzureCommonConfigurationAzureBaseOptions": {
"allOf": [
{
"$ref": "#/definitions/BieluUmbracoCdnCoreConfigurationConfigurationBaseOptions"
},
{
"type": "object",
"properties": {
"AuthenticationType": {
"$ref": "#/definitions/BieluUmbracoCdnAzureCommonModelsAuthenticationType"
},
"ResourceGroupName": {
"type": "string"
},
"SubscriptionId": {
"type": "string"
},
"UserAssignedClientId": {
"type": "string"
}
}
}
]
},
"BieluUmbracoCdnAzureCommonModelsAuthenticationType": {
"type": "string",
"description": "",
"x-enumNames": [
Expand Down Expand Up @@ -39,25 +63,13 @@
},
"allOf": [
{
"$ref": "#/definitions/BieluUmbracoCdnCoreConfigurationConfigurationBaseOptions"
"$ref": "#/definitions/BieluUmbracoCdnAzureCommonConfigurationAzureBaseOptions"
},
{
"type": "object",
"properties": {
"AuthenticationType": {
"$ref": "#/definitions/BieluUmbracoCdnAzureModelsAuthenticationType"
},
"FrontDoorName": {
"type": "string"
},
"ResourceGroupName": {
"type": "string"
},
"SubscriptionId": {
"type": "string"
},
"UserAssignedClientId": {
"type": "string"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<UserSecretsId>e8d02d0c-d1e6-464d-95fe-7251b569e56a</UserSecretsId>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 0aaa281

Please sign in to comment.