Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/2.3 #43

Merged
merged 5 commits into from
Nov 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,14 @@ This work was inspired by the post in https://github.com/dotnet/aspnetcore/issue

## Release Notes

<details open="open"><summary>2.2.0</summary>
<details open="open"><summary>2.3.0</summary>

>- Removed Brotli.NET that depends on native libs and added BrotliCompress tool that uses .net native brotli compression.
Fixes [#36](https://github.com/stavroskasidis/BlazorWasmAntivirusProtection/issues/36), [#42](https://github.com/stavroskasidis/BlazorWasmAntivirusProtection/issues/42)
(Contribution by [jsakamoto](https://github.com/jsakamoto))
</details>

<details><summary>2.2.0</summary>

>- Fix when publishing from Visual Studio [#36](https://github.com/stavroskasidis/BlazorWasmAntivirusProtection/issues/36)
</details>
Expand Down
25 changes: 25 additions & 0 deletions sampleapps/BlazorHostedSampleApp/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<!--<RunAOTCompilation>true</RunAOTCompilation>-->
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
Expand All @@ -16,12 +15,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.0" PrivateAssets="all" />
<PackageReference Include="BlazorWasmAntivirusProtection" Version="2.2.1-test" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="$(MicrosoftPackagesVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="$(MicrosoftPackagesVersion)" PrivateAssets="all" />
<PackageReference Include="BlazorWasmAntivirusProtection" Version="$(BlazorWasmAntivirusProtectionVersion)" />
</ItemGroup>

<ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Shared\BlazorHostedSampleApp.Shared.csproj" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RestoreAdditionalProjectSources>
$(RestoreAdditionalProjectSources);
$(MSBuildThisFileDirectory)../../../artifacts/nuget
</RestoreAdditionalProjectSources>
<UserSecretsId>ab18ecad-eb5a-4dc2-bcd9-12a62054d7f0</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<!--<DisableRenamingDlls>true</DisableRenamingDlls>-->
<!--<RenameDllsTo>blazor</RenameDllsTo>-->
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="7.0.0" />
<PackageReference Include="BlazorWasmAntivirusProtection" Version="2.2.1-test" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="$(MicrosoftPackagesVersion)" />
<PackageReference Include="BlazorWasmAntivirusProtection" Version="$(BlazorWasmAntivirusProtectionVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.0" />
</ItemGroup>

<ItemGroup>
Expand Down
25 changes: 25 additions & 0 deletions sampleapps/BlazorHostedSampleApp/Server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /src
COPY ["Server/BlazorHostedSampleApp.Server.csproj", "Server/"]
COPY ["Client/BlazorHostedSampleApp.Client.csproj", "Client/"]
COPY ["Shared/BlazorHostedSampleApp.Shared.csproj", "Shared/"]
RUN dotnet restore "Server/BlazorHostedSampleApp.Server.csproj"
COPY . .
WORKDIR "/src/Server"
RUN dotnet build "BlazorHostedSampleApp.Server.csproj" -c Release -o /app/build

FROM build AS publish
RUN apt-get update && apt-get install -y libc6-dev
RUN dotnet publish "BlazorHostedSampleApp.Server.csproj" -c Release -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "BlazorHostedSampleApp.Server.dll"]
Original file line number Diff line number Diff line change
@@ -1,30 +1,37 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:55913",
"sslPort": 44338
}
"profiles": {
"BlazorHostedSampleApp.Server": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"dotnetRunMessages": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"applicationUrl": "https://localhost:7107;http://localhost:5266"
},
"profiles": {
"BlazorHostedSampleApp.Server": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"applicationUrl": "https://localhost:7107;http://localhost:5266",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}"
},
"Docker": {
"commandName": "Docker",
"launchBrowser": true,
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
"publishAllPorts": true,
"useSSL": true
}
},
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:55913",
"sslPort": 44338
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand All @@ -12,7 +11,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="$(MicrosoftPackagesVersion)" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand All @@ -11,9 +10,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.0" PrivateAssets="all" />
<PackageReference Include="BlazorWasmAntivirusProtection" Version="2.2.1-test" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="$(MicrosoftPackagesVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="$(MicrosoftPackagesVersion)" PrivateAssets="all" />
<PackageReference Include="BlazorWasmAntivirusProtection" Version="$(BlazorWasmAntivirusProtectionVersion)" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<!--<DisableRenamingDlls>true</DisableRenamingDlls>-->
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="7.0.0" />
<PackageReference Include="BlazorWasmAntivirusProtection" Version="2.2.1-test" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="$(MicrosoftPackagesVersion)" />
<PackageReference Include="BlazorWasmAntivirusProtection" Version="$(BlazorWasmAntivirusProtectionVersion)" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RestoreAdditionalProjectSources>
Expand All @@ -12,9 +11,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.0" PrivateAssets="all" />
<PackageReference Include="BlazorWasmAntivirusProtection" Version="2.2.1-test" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="$(MicrosoftPackagesVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="$(MicrosoftPackagesVersion)" PrivateAssets="all" />
<PackageReference Include="BlazorWasmAntivirusProtection" Version="$(BlazorWasmAntivirusProtectionVersion)" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RestoreAdditionalProjectSources>
Expand All @@ -11,8 +10,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="7.0.0" />
<PackageReference Include="BlazorWasmAntivirusProtection" Version="2.2.1-test" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="$(MicrosoftPackagesVersion)" />
<PackageReference Include="BlazorWasmAntivirusProtection" Version="$(BlazorWasmAntivirusProtectionVersion)" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand Down
8 changes: 8 additions & 0 deletions sampleapps/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project>
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<MicrosoftPackagesVersion>7.0.*</MicrosoftPackagesVersion>
<BlazorWasmAntivirusProtectionVersion>2.3.0-test</BlazorWasmAntivirusProtectionVersion>

</PropertyGroup>
</Project>
1 change: 1 addition & 0 deletions scripts/build-sample-apps.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function Confirm-Process {

Write-Message "Building package test version..."
dotnet build ../src/BlazorWasmAntivirusProtection.Tasks/BlazorWasmAntivirusProtection.Tasks.csproj -c Release
dotnet build ../src/BlazorWasmAntivirusProtection.BrotliCompress/BlazorWasmAntivirusProtection.BrotliCompress.csproj -c Release
dotnet build ../src/BlazorWasmAntivirusProtection/BlazorWasmAntivirusProtection.csproj -c Release /p:VersionSuffix="test"
Confirm-PreviousCommand

Expand Down
1 change: 1 addition & 0 deletions scripts/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Write-Host "Version suffix: $VersionSuffix"

Write-Message "Building ..."
dotnet build ../src/BlazorWasmAntivirusProtection.Tasks/BlazorWasmAntivirusProtection.Tasks.csproj -c Release
dotnet build ../src/BlazorWasmAntivirusProtection.BrotliCompress/BlazorWasmAntivirusProtection.BrotliCompress.csproj -c Release
dotnet build ../src/BlazorWasmAntivirusProtection/BlazorWasmAntivirusProtection.csproj -c Release /p:VersionSuffix="$VersionSuffix"
Confirm-PreviousCommand

Expand Down
1 change: 1 addition & 0 deletions scripts/debug.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Get-Process "dotnet" | Stop-Process

Write-Message "Building ..."
dotnet build ../src/BlazorWasmAntivirusProtection.Tasks/BlazorWasmAntivirusProtection.Tasks.csproj -c Debug
dotnet build ../src/BlazorWasmAntivirusProtection.BrotliCompress/BlazorWasmAntivirusProtection.BrotliCompress.csproj -c Release
dotnet build ../src/BlazorWasmAntivirusProtection/BlazorWasmAntivirusProtection.csproj -c Debug /p:VersionSuffix="test"
Confirm-PreviousCommand

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
21 changes: 21 additions & 0 deletions src/BlazorWasmAntivirusProtection.BrotliCompress/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System.IO.Compression;

try
{
var bootJsonPath = args[0];
var bootJsonBrPath = args[1];
var compressionLeveText = args[2];

File.Delete(bootJsonBrPath);
var compressionLevel = Enum.TryParse<CompressionLevel>(compressionLeveText, out var level) ? level : CompressionLevel.Optimal;
using var fileStream = File.OpenRead(bootJsonPath);
using var stream = File.Create(bootJsonBrPath);
using var destination = new BrotliStream(stream, compressionLevel);
fileStream.CopyTo(destination);
return 0;
}
catch (Exception ex)
{
Console.Error.WriteLine(ex.ToString());
return 1;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Brotli.NET" Version="2.1.1" />
<PackageReference Include="Microsoft.Build.Framework" Version="16.10.0" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="16.10.0" />
<PackageReference Include="System.Text.Json" Version="7.0.0" />
Expand Down
Loading