Skip to content

Commit e1daa99

Browse files
Merge pull request #2 from atc-net/feature/vNext1
Feature/v next1
2 parents 6df9db3 + d2b5dd2 commit e1daa99

File tree

88 files changed

+4826
-807
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+4826
-807
lines changed

.editorconfig

+1
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,7 @@ dotnet_diagnostic.S1135.severity = suggestion # https://github.com/atc-net
514514
dotnet_diagnostic.CA1040.severity = none # Avoid empty interface
515515
dotnet_diagnostic.CA1724.severity = none # The type name App conflicts in whole or in part with the namespace name
516516
dotnet_diagnostic.CA1848.severity = none # Skip for now: Use the LoggerMessage delegates
517+
dotnet_diagnostic.CA2227.severity = none # Skip for now: Read only collection
517518
dotnet_diagnostic.CA2254.severity = none # Skip for now: Template should be a static expression
518519
dotnet_diagnostic.CA5351.severity = none # Do Not Use Broken Cryptographic Algorithms - Its ok, only using to calculate a file-hash
519520

.github/workflows/post-integration.yml

+30-30
Original file line numberDiff line numberDiff line change
@@ -30,41 +30,41 @@ jobs:
3030
with:
3131
setAllVars: true
3232

33-
- name: ⚙️ Setup dotnet 7.0.x
34-
uses: actions/setup-dotnet@v1
35-
with:
36-
dotnet-version: '7.0.x'
33+
# - name: ⚙️ Setup dotnet 7.0.x
34+
# uses: actions/setup-dotnet@v1
35+
# with:
36+
# dotnet-version: '7.0.x'
3737

38-
- name: ⚙️ Set up JDK 11
39-
uses: actions/setup-java@v1
40-
with:
41-
java-version: 1.11
38+
# - name: ⚙️ Set up JDK 11
39+
# uses: actions/setup-java@v1
40+
# with:
41+
# java-version: 1.11
4242

43-
- name: 📐 Ensure nuget.org added as package source on Windows
44-
run: dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org --configfile $env:APPDATA\NuGet\NuGet.Config
45-
continue-on-error: true
43+
# - name: 📐 Ensure nuget.org added as package source on Windows
44+
# run: dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org --configfile $env:APPDATA\NuGet\NuGet.Config
45+
# continue-on-error: true
4646

47-
- name: 🔁 Restore packages
48-
run: dotnet restore Atc.Installer-WithoutSetup.sln
47+
# - name: 🔁 Restore packages
48+
# run: dotnet restore Atc.Installer-WithoutSetup.sln
4949

50-
- name: 🛠️ Build
51-
run: dotnet build Atc.Installer-WithoutSetup.sln -c Release --no-restore /p:UseSourceLink=true
50+
# - name: 🛠️ Build
51+
# run: dotnet build Atc.Installer-WithoutSetup.sln -c Release --no-restore /p:UseSourceLink=true
5252

53-
- name: 🧪 Run unit tests
54-
run: dotnet test Atc.Installer-WithoutSetup.sln -c Release --no-build --filter "Category!=Integration"
53+
# - name: 🧪 Run unit tests
54+
# run: dotnet test Atc.Installer-WithoutSetup.sln -c Release --no-build --filter "Category!=Integration"
5555

56-
- name: 🌩️ SonarCloud install scanner
57-
run: dotnet tool install --global dotnet-sonarscanner
56+
# - name: 🌩️ SonarCloud install scanner
57+
# run: dotnet tool install --global dotnet-sonarscanner
5858

59-
- name: 🌩️ SonarCloud analyze
60-
env:
61-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
63-
shell: pwsh
64-
run: |
65-
dotnet sonarscanner begin /k:"atc-wpf" /o:"atc-net" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
66-
dotnet build Atc.Installer-WithoutSetup.sln -c Release /p:UseSourceLink=true --no-restore
67-
dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
59+
# - name: 🌩️ SonarCloud analyze
60+
# env:
61+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62+
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
63+
# shell: pwsh
64+
# run: |
65+
# dotnet sonarscanner begin /k:"atc-wpf" /o:"atc-net" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
66+
# dotnet build Atc.Installer-WithoutSetup.sln -c Release /p:UseSourceLink=true --no-restore
67+
# dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
6868

6969
- name: ⏩ Merge to stable-branch
7070
run: |
@@ -74,5 +74,5 @@ jobs:
7474
git merge --ff-only main
7575
git push origin stable
7676
77-
- name: 🗳️ Creating library package for pre-release
78-
run: dotnet pack Atc.Installer-WithoutSetup.sln -c Release --no-restore -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH_NAME
77+
# - name: 🗳️ Creating library package for pre-release
78+
# run: dotnet pack Atc.Installer-WithoutSetup.sln -c Release --no-restore -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH_NAME

.github/workflows/pre-integration.yml

+24-24
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@ jobs:
1616
with:
1717
fetch-depth: 0
1818

19-
- name: ⚙️ Setup dotnet 7.0.x
20-
uses: actions/setup-dotnet@v1
21-
with:
22-
dotnet-version: '7.0.x'
19+
# - name: ⚙️ Setup dotnet 7.0.x
20+
# uses: actions/setup-dotnet@v1
21+
# with:
22+
# dotnet-version: '7.0.x'
2323

24-
- name: 📐 Ensure nuget.org added as package source on Windows
25-
run: dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org --configfile $env:APPDATA\NuGet\NuGet.Config
26-
continue-on-error: true
24+
# - name: 📐 Ensure nuget.org added as package source on Windows
25+
# run: dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org --configfile $env:APPDATA\NuGet\NuGet.Config
26+
# continue-on-error: true
2727

28-
- name: 🔁 Restore packages
29-
run: dotnet restore Atc.Installer-WithoutSetup.sln
28+
# - name: 🔁 Restore packages
29+
# run: dotnet restore Atc.Installer-WithoutSetup.sln
3030

31-
- name: 🛠️ Building library in release mode
32-
run: dotnet build Atc.Installer-WithoutSetup.sln -c Release --no-restore
31+
# - name: 🛠️ Building library in release mode
32+
# run: dotnet build Atc.Installer-WithoutSetup.sln -c Release --no-restore
3333

3434
dotnet-test:
3535
runs-on: windows-latest
@@ -41,20 +41,20 @@ jobs:
4141
with:
4242
fetch-depth: 0
4343

44-
- name: ⚙️ Setup dotnet 7.0.x
45-
uses: actions/setup-dotnet@v1
46-
with:
47-
dotnet-version: '7.0.x'
44+
# - name: ⚙️ Setup dotnet 7.0.x
45+
# uses: actions/setup-dotnet@v1
46+
# with:
47+
# dotnet-version: '7.0.x'
4848

49-
- name: 📐 Ensure nuget.org added as package source on Windows
50-
run: dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org --configfile $env:APPDATA\NuGet\NuGet.Config
51-
continue-on-error: true
49+
# - name: 📐 Ensure nuget.org added as package source on Windows
50+
# run: dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org --configfile $env:APPDATA\NuGet\NuGet.Config
51+
# continue-on-error: true
5252

53-
- name: 🔁 Restore packages
54-
run: dotnet restore Atc.Installer-WithoutSetup.sln
53+
# - name: 🔁 Restore packages
54+
# run: dotnet restore Atc.Installer-WithoutSetup.sln
5555

56-
- name: 🛠️ Build
57-
run: dotnet build Atc.Installer-WithoutSetup.sln -c Release --no-restore /p:UseSourceLink=true
56+
# - name: 🛠️ Build
57+
# run: dotnet build Atc.Installer-WithoutSetup.sln -c Release --no-restore /p:UseSourceLink=true
5858

59-
- name: 🧪 Run unit tests
60-
run: dotnet test Atc.Installer-WithoutSetup.sln -c Release --no-build --filter "Category!=Integration"
59+
# - name: 🧪 Run unit tests
60+
# run: dotnet test Atc.Installer-WithoutSetup.sln -c Release --no-build --filter "Category!=Integration"

Directory.Build.props

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@
4141
<ItemGroup Label="Code Analyzers">
4242
<PackageReference Include="AsyncFixer" Version="1.6.0" PrivateAssets="All" />
4343
<PackageReference Include="Asyncify" Version="0.9.7" PrivateAssets="All" />
44-
<PackageReference Include="Meziantou.Analyzer" Version="2.0.81" PrivateAssets="All" />
44+
<PackageReference Include="Meziantou.Analyzer" Version="2.0.84" PrivateAssets="All" />
4545
<PackageReference Include="SecurityCodeScan.VS2019" Version="5.6.7" PrivateAssets="All" />
4646
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507" PrivateAssets="All" />
47-
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.7.0.75501" PrivateAssets="All" />
47+
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.9.0.77355" PrivateAssets="All" />
4848
</ItemGroup>
4949

5050
</Project>

setup/Atc.Installer/Atc.Installer.vdproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@
225225
"Name" = "8:Microsoft Visual Studio"
226226
"ProductName" = "8:Atc.Installer"
227227
"ProductCode" = "8:{3F307C9D-74FA-4720-A46B-9BE093C3A265}"
228-
"PackageCode" = "8:{93937C48-D568-4997-A6D2-5564D5653779}"
228+
"PackageCode" = "8:{D56B6FCA-3775-4E78-B08E-55417E9AA2C7}"
229229
"UpgradeCode" = "8:{F7F3665E-9FEB-4AE3-B0EA-F3791208A1A8}"
230230
"AspNetVersion" = "8:4.0.30319.0"
231231
"RestartWWWService" = "11:FALSE"
@@ -760,7 +760,7 @@
760760
{
761761
"{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_B80DFB6270524AC7B2F3C294312B6821"
762762
{
763-
"SourcePath" = "8:..\\..\\src\\Atc.Installer.Wpf.App\\obj\\Debug\\net7.0-windows\\apphost.exe"
763+
"SourcePath" = "8:..\\..\\src\\Atc.Installer.Wpf.App\\obj\\Release\\net7.0-windows\\apphost.exe"
764764
"TargetName" = "8:"
765765
"Tag" = "8:"
766766
"Folder" = "8:_91076E7FEDE74F62A97DBDFD99B106F9"

src/Atc.Installer.Integration.Azure/Atc.Installer.Integration.Azure.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
<ItemGroup>
99
<PackageReference Include="Atc" Version="2.0.349" />
10-
<PackageReference Include="Azure.Identity" Version="1.10.0-beta.1" />
11-
<PackageReference Include="Azure.Storage.Blobs" Version="12.17.0" />
10+
<PackageReference Include="Azure.Identity" Version="1.10.0" />
11+
<PackageReference Include="Azure.Storage.Blobs" Version="12.18.0" />
1212
</ItemGroup>
1313

1414
</Project>

src/Atc.Installer.Integration.Azure/AzureStorageAccountInstallerService.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ private static List<string> GetBlobsToDownload(
6767

6868
if (latestReleasedBlobName is not (null, null) &&
6969
(contentHash is null || (latestReleasedBlobName.ContentHash is not null &&
70-
contentHash != ConvertBase64ToHex(latestReleasedBlobName.ContentHash))))
70+
contentHash != ConvertBase64ToHex(latestReleasedBlobName.ContentHash))) &&
71+
!blobsToDownload.Contains(latestReleasedBlobName.BlobName!, StringComparer.Ordinal))
7172
{
7273
blobsToDownload.Add(latestReleasedBlobName.BlobName!);
7374
}

src/Atc.Installer.Integration.InternetInformationServer/InternetInformationServerInstallerService.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public bool IsMicrosoftDonNet7()
7272
=> iaInstallerService.IsMicrosoftDonNet7();
7373

7474
public bool IsNodeJs18()
75-
=> TaskHelper.RunSync(() => iaInstallerService.IsNodeJs18());
75+
=> TaskHelper.RunSync(iaInstallerService.IsNodeJs18);
7676

7777
public bool IsInstalledManagementConsole()
7878
{

src/Atc.Installer.Integration/Atc.Installer.Integration.csproj

+12
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@
55
<IsPackable>false</IsPackable>
66
</PropertyGroup>
77

8+
<ItemGroup>
9+
<COMReference Include="NetFwTypeLib">
10+
<WrapperTool>tlbimp</WrapperTool>
11+
<VersionMinor>0</VersionMinor>
12+
<VersionMajor>1</VersionMajor>
13+
<Guid>58fbcf7c-e7a9-467c-80b3-fc65e8fcca08</Guid>
14+
<Lcid>0</Lcid>
15+
<Isolated>false</Isolated>
16+
<EmbedInteropTypes>true</EmbedInteropTypes>
17+
</COMReference>
18+
</ItemGroup>
19+
820
<ItemGroup>
921
<PackageReference Include="Atc" Version="2.0.349" />
1022
</ItemGroup>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// ReSharper disable CheckNamespace
2+
namespace Atc.Installer.Integration;
3+
4+
public enum FirewallDirectionType
5+
{
6+
Inbound,
7+
Outbound,
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// ReSharper disable CheckNamespace
2+
namespace Atc.Installer.Integration;
3+
4+
public enum FirewallProtocolType
5+
{
6+
Any,
7+
Tcp,
8+
Udp,
9+
}

src/Atc.Installer.Integration/Extensions/StringExtensions.cs

+16
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,22 @@ public static IList<string> GetTemplateKeys(
2929
.ToList();
3030
}
3131

32+
public static IList<string> SplitTemplate(
33+
this string value)
34+
{
35+
ArgumentNullException.ThrowIfNull(value);
36+
37+
var list = new List<string>();
38+
var sa1 = value.Split("[[", StringSplitOptions.RemoveEmptyEntries);
39+
foreach (var sx1 in sa1)
40+
{
41+
var sa2 = sx1.Split("]]", StringSplitOptions.RemoveEmptyEntries);
42+
list.AddRange(sa2);
43+
}
44+
45+
return list;
46+
}
47+
3248
public static string ReplaceTemplateWithKey(
3349
this string value,
3450
string templateKey,

src/Atc.Installer.Integration/GlobalUsings.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@
1313
global using Atc;
1414
global using Atc.Helpers;
1515

16-
global using Microsoft.Win32;
16+
global using Microsoft.Win32;
17+
global using NetFwTypeLib;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
namespace Atc.Installer.Integration;
2+
3+
public interface IWindowsFirewallService
4+
{
5+
bool DoesRuleExist(
6+
string ruleName);
7+
8+
bool IsRuleEnabled(
9+
string ruleName);
10+
11+
(bool IsSucceeded, string? ErrorMessage) AddInboundRuleForAllowTcp(
12+
string ruleName,
13+
string description,
14+
int port);
15+
16+
(bool IsSucceeded, string? ErrorMessage) AddInboundRuleForAllowUdp(
17+
string ruleName,
18+
string description,
19+
int port);
20+
21+
(bool IsSucceeded, string? ErrorMessage) AddInboundRuleForAllowAny(
22+
string ruleName,
23+
string description,
24+
int port);
25+
26+
(bool IsSucceeded, string? ErrorMessage) AddOutboundRuleForAllowTcp(
27+
string ruleName,
28+
string description,
29+
int port);
30+
31+
(bool IsSucceeded, string? ErrorMessage) AddOutboundRuleForAllowUdp(
32+
string ruleName,
33+
string description,
34+
int port);
35+
36+
(bool IsSucceeded, string? ErrorMessage) AddOutboundRuleForAllowAny(
37+
string ruleName,
38+
string description,
39+
int port);
40+
41+
(bool IsSucceeded, string? ErrorMessage) EnableRule(
42+
string ruleName);
43+
44+
(bool IsSucceeded, string? ErrorMessage) DisableRule(
45+
string ruleName);
46+
47+
(bool IsSucceeded, string? ErrorMessage) RemoveRule(
48+
string ruleName);
49+
}

src/Atc.Installer.Integration/InstallationConfigurations/ApplicationOption.cs

+6-4
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,17 @@ public class ApplicationOption
1616

1717
public string? RawInstallationPath { get; set; }
1818

19-
public IList<string> DependentComponents { get; init; } = new List<string>();
19+
public IList<string> DependentComponents { get; set; } = new List<string>();
2020

2121
public IList<string> DependentServices { get; init; } = new List<string>();
2222

23-
public IDictionary<string, object> ApplicationSettings { get; init; } = new Dictionary<string, object>(StringComparer.Ordinal);
23+
public IDictionary<string, object> ApplicationSettings { get; set; } = new Dictionary<string, object>(StringComparer.Ordinal);
2424

25-
public IList<FolderPermissionOption> FolderPermissions { get; init; } = new List<FolderPermissionOption>();
25+
public IList<FolderPermissionOption> FolderPermissions { get; set; } = new List<FolderPermissionOption>();
2626

27-
public IList<ConfigurationSettingsFileOption> ConfigurationSettingsFiles { get; init; } = new List<ConfigurationSettingsFileOption>();
27+
public IList<FirewallRuleOption> FirewallRules { get; set; } = new List<FirewallRuleOption>();
28+
29+
public IList<ConfigurationSettingsFileOption> ConfigurationSettingsFiles { get; set; } = new List<ConfigurationSettingsFileOption>();
2830

2931
public IList<EndpointOption> Endpoints { get; init; } = new List<EndpointOption>();
3032

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
namespace Atc.Installer.Integration.InstallationConfigurations;
2+
3+
public class FirewallRuleOption
4+
{
5+
public string Name { get; set; } = string.Empty;
6+
7+
public int Port { get; set; }
8+
9+
public FirewallProtocolType Protocol { get; set; } = FirewallProtocolType.Tcp;
10+
11+
public FirewallDirectionType Direction { get; set; } = FirewallDirectionType.Inbound;
12+
13+
public override string ToString()
14+
=> $"{nameof(Name)}: {Name}, {nameof(Port)}: {Port}, {nameof(Protocol)}: {Protocol}, {nameof(Direction)}: {Direction}";
15+
}

0 commit comments

Comments
 (0)