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

Update #2

Merged
merged 3 commits into from
Aug 24, 2024
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
89 changes: 89 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '33 10 * * 6'

jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
# required for all workflows
security-events: write

# required to fetch internal or private CodeQL packs
packages: read

# only required for workflows in private repositories
actions: read
contents: read

strategy:
fail-fast: false
matrix:
include:
- language: csharp
build-mode: manual
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
shell: bash
run: |
dotnet restore ./src/wan24-AutoDiscover.sln --ignore-failed-sources
dotnet build "./src/wan24-AutoDiscover/wan24-AutoDiscover.csproj" --no-restore

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
2 changes: 0 additions & 2 deletions .github/workflows/docfx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ jobs:
dotnet-version: 8.0.x
- name: Setup docfx
run: dotnet tool update -g docfx
- name: Install .NET Aspire workload
run: dotnet workload install aspire
- name: Copy README
run: cp README.md "./src/wan24-AutoDiscover Docs/index.md"
- name: Build docs
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Install .NET Aspire workload
run: dotnet workload install aspire
- name: Restore dependencies
run: dotnet restore ./src/wan24-AutoDiscover.sln --ignore-failed-sources
- name: Build lib
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ For example on a Debian Linux server:
```bash
mkdir /home/autodiscover
cd /home/autodiscover
wget https://github.com/nd1012/wan24-AutoDiscover/releases/download/v1.1.0/wan24-AutoDiscover.v1.1.0.zip
unzip wan24-AutoDiscover.v1.1.0.zip
rm wan24-AutoDiscover.v1.1.0.zip
wget https://github.com/nd1012/wan24-AutoDiscover/releases/download/v1.2.0/wan24-AutoDiscover.v1.2.0.zip
unzip wan24-AutoDiscover.v1.2.0.zip
rm wan24-AutoDiscover.v1.2.0.zip
```

### `appsettings.json`
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/wan24-AutoDiscover Shared/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,6 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="VERSION" xml:space="preserve">
<value>1.1.0</value>
<value>1.2.0</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.1" />
<PackageReference Include="ObjectValidation" Version="2.5.0" Condition="'$(Configuration)' != 'Trunk'" />
<PackageReference Include="wan24-Core" Version="2.18.0" Condition="'$(Configuration)' != 'Trunk'" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.2" />
<PackageReference Include="ObjectValidation" Version="2.6.0" Condition="'$(Configuration)' != 'Trunk'" />
<PackageReference Include="wan24-Core" Version="2.35.0" Condition="'$(Configuration)' != 'Trunk'" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions src/wan24-AutoDiscover.AppHost/Program.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using Aspire.Hosting;

var builder = DistributedApplication.CreateBuilder(args);

builder.AddProject<Projects.wan24_AutoDiscover>("wan24-autodiscover");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Aspire.Hosting" Version="8.0.0-preview.4.24156.9" />
<PackageReference Include="Aspire.Hosting" Version="8.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />

<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.2.0" />
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery" Version="8.0.0-preview.4.24156.9" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.7.1" />
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.8.0" />
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery" Version="8.1.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.GrpcNetClient" Version="1.7.0-beta.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.7.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Process" Version="0.5.0-beta.4" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.9.0" />
</ItemGroup>

</Project>
23 changes: 7 additions & 16 deletions src/wan24-AutoDiscover.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "wan24-AutoDiscover", "wan24
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "wan24-AutoDiscover Shared", "wan24-AutoDiscover Shared\wan24-AutoDiscover Shared.csproj", "{610B6034-2404-4EBA-80E1-92102CE9E5B4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "wan24-AutoDiscover.AppHost", "wan24-AutoDiscover.AppHost\wan24-AutoDiscover.AppHost.csproj", "{697D3342-956F-4C77-93A9-1C80833EF5F5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "wan24-AutoDiscover.ServiceDefaults", "wan24-AutoDiscover.ServiceDefaults\wan24-AutoDiscover.ServiceDefaults.csproj", "{F506B56D-8CF8-4C42-A842-6B4EBD4E58B1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Wan24-Core", "..\..\wan24-Core\src\Wan24-Core\Wan24-Core.csproj", "{08E6E5D6-4B4A-46DB-9BD0-E649ABF456D0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ObjectValidation", "..\..\ObjectValidation\src\ObjectValidation\ObjectValidation.csproj", "{6DD8879F-DBF9-4C20-BF4E-139A7DD3ED48}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "wan24-CLI", "..\..\wan24-CLI\src\wan24-CLI\wan24-CLI.csproj", "{D0D4CCB2-22DE-47BB-9FA8-5D0FD4DA20A3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Referenced", "Referenced", "{389A8A4D-B1E3-4FE5-B56A-2077202BBC62}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -36,18 +34,6 @@ Global
{610B6034-2404-4EBA-80E1-92102CE9E5B4}.Release|Any CPU.Build.0 = Release|Any CPU
{610B6034-2404-4EBA-80E1-92102CE9E5B4}.Trunk|Any CPU.ActiveCfg = Trunk|Any CPU
{610B6034-2404-4EBA-80E1-92102CE9E5B4}.Trunk|Any CPU.Build.0 = Trunk|Any CPU
{697D3342-956F-4C77-93A9-1C80833EF5F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{697D3342-956F-4C77-93A9-1C80833EF5F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{697D3342-956F-4C77-93A9-1C80833EF5F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{697D3342-956F-4C77-93A9-1C80833EF5F5}.Release|Any CPU.Build.0 = Release|Any CPU
{697D3342-956F-4C77-93A9-1C80833EF5F5}.Trunk|Any CPU.ActiveCfg = Trunk|Any CPU
{697D3342-956F-4C77-93A9-1C80833EF5F5}.Trunk|Any CPU.Build.0 = Trunk|Any CPU
{F506B56D-8CF8-4C42-A842-6B4EBD4E58B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F506B56D-8CF8-4C42-A842-6B4EBD4E58B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F506B56D-8CF8-4C42-A842-6B4EBD4E58B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F506B56D-8CF8-4C42-A842-6B4EBD4E58B1}.Release|Any CPU.Build.0 = Release|Any CPU
{F506B56D-8CF8-4C42-A842-6B4EBD4E58B1}.Trunk|Any CPU.ActiveCfg = Trunk|Any CPU
{F506B56D-8CF8-4C42-A842-6B4EBD4E58B1}.Trunk|Any CPU.Build.0 = Trunk|Any CPU
{08E6E5D6-4B4A-46DB-9BD0-E649ABF456D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{08E6E5D6-4B4A-46DB-9BD0-E649ABF456D0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{08E6E5D6-4B4A-46DB-9BD0-E649ABF456D0}.Trunk|Any CPU.ActiveCfg = Trunk|Any CPU
Expand All @@ -64,6 +50,11 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{08E6E5D6-4B4A-46DB-9BD0-E649ABF456D0} = {389A8A4D-B1E3-4FE5-B56A-2077202BBC62}
{6DD8879F-DBF9-4C20-BF4E-139A7DD3ED48} = {389A8A4D-B1E3-4FE5-B56A-2077202BBC62}
{D0D4CCB2-22DE-47BB-9FA8-5D0FD4DA20A3} = {389A8A4D-B1E3-4FE5-B56A-2077202BBC62}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {EA8C3992-DDF7-4778-9ED7-670279F08583}
EndGlobalSection
Expand Down
2 changes: 0 additions & 2 deletions src/wan24-AutoDiscover/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ async Task<IConfigurationRoot> LoadConfigAsync()
// Build and run the app
Logging.WriteInfo("Autodiscovery service app startup");
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
builder.AddServiceDefaults();
builder.Logging.ClearProviders()
.AddConsole();
if (ENV.IsLinux)
Expand Down Expand Up @@ -151,7 +150,6 @@ async Task<IConfigurationRoot> LoadConfigAsync()
cts.Cancel();
});
app.UseExceptionHandler(builder => { });// .NET 8 bugfix :(
app.MapDefaultEndpoints();// Aspire
app.UseForwardedHeaders();
if (app.Environment.IsDevelopment())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ await transaction.ExecuteAsync(
}
Logging.WriteInfo("All backup files have been restored during rollback of a failed transaction");
},
commit: null,
CancellationToken.None
).DynamicContext();
// Copy new files
Expand Down
2 changes: 1 addition & 1 deletion src/wan24-AutoDiscover/latest-release.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.0
1.2.0
7 changes: 3 additions & 4 deletions src/wan24-AutoDiscover/wan24-AutoDiscover.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,16 @@
</Target>

<ItemGroup>
<PackageReference Include="ObjectValidation" Version="2.5.0" Condition="'$(Configuration)' != 'Trunk'" />
<PackageReference Include="wan24-CLI" Version="1.4.0" Condition="'$(Configuration)' != 'Trunk'" />
<PackageReference Include="wan24-Core" Version="2.18.0" Condition="'$(Configuration)' != 'Trunk'" />
<PackageReference Include="ObjectValidation" Version="2.6.0" Condition="'$(Configuration)' != 'Trunk'" />
<PackageReference Include="wan24-CLI" Version="1.5.0" Condition="'$(Configuration)' != 'Trunk'" />
<PackageReference Include="wan24-Core" Version="2.35.0" Condition="'$(Configuration)' != 'Trunk'" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\ObjectValidation\src\ObjectValidation\ObjectValidation.csproj" Condition="'$(Configuration)' == 'Trunk'" />
<ProjectReference Include="..\..\..\wan24-CLI\src\wan24-CLI\wan24-CLI.csproj" Condition="'$(Configuration)' == 'Trunk'" />
<ProjectReference Include="..\..\..\wan24-Core\src\Wan24-Core\Wan24-Core.csproj" Condition="'$(Configuration)' == 'Trunk'" />
<ProjectReference Include="..\wan24-AutoDiscover Shared\wan24-AutoDiscover Shared.csproj" />
<ProjectReference Include="..\wan24-AutoDiscover.ServiceDefaults\wan24-AutoDiscover.ServiceDefaults.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading