Skip to content

Commit

Permalink
Prepare for .NET 6 binary
Browse files Browse the repository at this point in the history
  • Loading branch information
jjxtra committed Dec 26, 2021
1 parent fdf3ba6 commit 19bb57f
Show file tree
Hide file tree
Showing 10 changed files with 131 additions and 121 deletions.
2 changes: 1 addition & 1 deletion IPBan/IPBan.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
<PublishTrimmed>true</PublishTrimmed>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<ApplicationIcon>../ipban_favicon.ico</ApplicationIcon>
<IsTrimmable>false</IsTrimmable>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<IsTrimmable>false</IsTrimmable>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions IPBanCore/Core/IPBan/IPBanBaseFirewall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ namespace DigitalRuby.IPBanCore
/// <summary>
/// Base firewall class that all firewall implementations should inherit from
/// </summary>
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)]
public abstract class IPBanBaseFirewall : IIPBanFirewall
{
protected bool Disposed { get; private set; }
Expand Down
1 change: 1 addition & 0 deletions IPBanCore/Core/IPBan/IPBanMemoryFirewall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ namespace DigitalRuby.IPBanCore
/// </summary>
[RequiredOperatingSystemAttribute(null, Priority = -99)] // low priority, basically any other firewall is preferred unless this one is explicitly specified in the config
[CustomName("Memory")]
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)]
public class IPBanMemoryFirewall : IPBanBaseFirewall
{
public interface IMemoryFirewallRuleRanges
Expand Down
155 changes: 77 additions & 78 deletions IPBanCore/IPBanCore.csproj
Original file line number Diff line number Diff line change
@@ -1,78 +1,77 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>DigitalRuby.IPBanCore</RootNamespace>
<PreserveCompilationContext>true</PreserveCompilationContext>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageId>DigitalRuby.IPBanCore</PackageId>
<Version>1.6.1</Version>
<AssemblyVersion>1.6.1</AssemblyVersion>
<FileVersion>1.6.1</FileVersion>
<Authors>Jeff Johnson</Authors>
<Company>Digital Ruby, LLC</Company>
<Product>IPBan</Product>
<Description>IPBan is the leading solution to block hackers and botnets. Easily monitor events for all kinds of sources and put the bad ip addresses in the firewall automatically.</Description>
<Copyright>(c) 2012 Digital Ruby, LLC</Copyright>
<PackageProjectUrl>https://github.com/DigitalRuby/IPBan</PackageProjectUrl>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<RepositoryUrl>https://github.com/DigitalRuby/IPBan</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>windows linux firewall hacker botnet block rule security software service email smtp rdp remote desktop ssh auto</PackageTags>
<PackageReleaseNotes>Upgrade to .NET core 5</PackageReleaseNotes>
<PublishTrimmed>true</PublishTrimmed>
<NeutralLanguage>en</NeutralLanguage>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<AssemblyName>DigitalRuby.IPBanCore</AssemblyName>
<ApplicationIcon />
<OutputType>Library</OutputType>
<StartupObject />
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<IsTrimmable>false</IsTrimmable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Data.Sqlite" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="6.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NLog" Version="4.7.13" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0" />
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
<Content Include="ipban.override.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="ipban.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<None Include="../LICENSE.md" Pack="true" PackagePath="" />
</ItemGroup>

<ItemGroup>
<Compile Update="IPBanResources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>IPBanResources.resx</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="IPBanResources.resx">
<CustomToolNamespace>DigitalRuby.IPBanCore</CustomToolNamespace>
<LastGenOutput>IPBanResources.Designer.cs</LastGenOutput>
<Generator>PublicResXFileCodeGenerator</Generator>
</EmbeddedResource>
</ItemGroup>

</Project>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>DigitalRuby.IPBanCore</RootNamespace>
<PreserveCompilationContext>true</PreserveCompilationContext>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageId>DigitalRuby.IPBanCore</PackageId>
<Version>1.7.0</Version>
<AssemblyVersion>1.7.0</AssemblyVersion>
<FileVersion>1.7.0</FileVersion>
<Authors>Jeff Johnson</Authors>
<Company>Digital Ruby, LLC</Company>
<Product>IPBan</Product>
<Description>IPBan is the leading solution to block hackers and botnets. Easily monitor events for all kinds of sources and put the bad ip addresses in the firewall automatically.</Description>
<Copyright>(c) 2012 Digital Ruby, LLC</Copyright>
<PackageProjectUrl>https://github.com/DigitalRuby/IPBan</PackageProjectUrl>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<RepositoryUrl>https://github.com/DigitalRuby/IPBan</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>windows linux firewall hacker botnet block rule security software service email smtp rdp remote desktop ssh auto</PackageTags>
<PackageReleaseNotes>Upgrade to .NET core 5</PackageReleaseNotes>
<PublishTrimmed>true</PublishTrimmed>
<NeutralLanguage>en</NeutralLanguage>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<AssemblyName>DigitalRuby.IPBanCore</AssemblyName>
<ApplicationIcon />
<OutputType>Library</OutputType>
<StartupObject />
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IsTrimmable>false</IsTrimmable> </PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Data.Sqlite" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="6.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NLog" Version="4.7.13" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0" />
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
<Content Include="ipban.override.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="ipban.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<None Include="../LICENSE.md" Pack="true" PackagePath="" />
</ItemGroup>

<ItemGroup>
<Compile Update="IPBanResources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>IPBanResources.resx</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="IPBanResources.resx">
<CustomToolNamespace>DigitalRuby.IPBanCore</CustomToolNamespace>
<LastGenOutput>IPBanResources.Designer.cs</LastGenOutput>
<Generator>PublicResXFileCodeGenerator</Generator>
</EmbeddedResource>
</ItemGroup>

</Project>
Expand Down
4 changes: 4 additions & 0 deletions IPBanCore/Linux/IPBanLinuxBaseFirewall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE

namespace DigitalRuby.IPBanCore
{
/// <summary>
/// Linux firewall base class
/// </summary>
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)]
public abstract class IPBanLinuxBaseFirewall : IPBanBaseFirewall
{
private readonly AddressFamily addressFamily;
Expand Down
4 changes: 4 additions & 0 deletions IPBanCore/Linux/IPBanLinuxFirewall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE

namespace DigitalRuby.IPBanCore
{
/// <summary>
/// Linux firewall implementation
/// </summary>
[RequiredOperatingSystem(OSUtility.Linux)]
[CustomName("Default")]
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)]
public class IPBanLinuxFirewall : IPBanLinuxBaseFirewall
{
/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion IPBanCore/Linux/Scripts/Install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# To uninstall: sudo systemctl stop ipban; sudo systemctl disable ipban; sudo rm /opt/ipban -r
#

VERSION_DOTS="1.6.1"
VERSION_DOTS="1.7.0"
VERSION_UNDERSCORES=${VERSION_DOTS//./_}
FILE_NAME="IPBan-Linux-x64_$VERSION_UNDERSCORES.zip"

Expand Down
1 change: 1 addition & 0 deletions IPBanCore/Windows/IPBanWindowsFirewall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ namespace DigitalRuby.IPBanCore
/// </summary>
[RequiredOperatingSystem(OSUtility.Windows)]
[CustomName("Default")]
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)]
public class IPBanWindowsFirewall : IPBanBaseFirewall
{
// DO NOT CHANGE THESE CONST AND READONLY FIELDS!
Expand Down
2 changes: 1 addition & 1 deletion IPBanCore/Windows/Scripts/install_latest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if ($PSVersionTable.PSVersion.Major -lt 5 -or ($PSVersionTable.PSVersion.Major -
exit -1
}

$VERSION_DOTS = "1.6.1"
$VERSION_DOTS = "1.7.0"
$VERSION_UNDERSCORES = $VERSION_DOTS -replace "\.","_"
$FILE_NAME = "IPBan-Windows-x64_$VERSION_UNDERSCORES.zip"
$INSTALL_PATH = "C:/Program Files/IPBan"
Expand Down
80 changes: 40 additions & 40 deletions IPBanTests/IPBanTests.csproj
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<IsPackable>false</IsPackable>
<RootNamespace>DigitalRuby.IPBanTests</RootNamespace>
<AssemblyName>DigitalRuby.IPBanTests</AssemblyName>
<PreserveCompilationContext>true</PreserveCompilationContext>
<LangVersion>latest</LangVersion>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<IsTrimmable>false</IsTrimmable>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<IsPackable>false</IsPackable>
<RootNamespace>DigitalRuby.IPBanTests</RootNamespace>
<AssemblyName>DigitalRuby.IPBanTests</AssemblyName>
<PreserveCompilationContext>true</PreserveCompilationContext>
<LangVersion>latest</LangVersion>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<IsTrimmable>false</IsTrimmable>
</PropertyGroup>

<ItemGroup>
<Compile Remove="package\**" />
<EmbeddedResource Remove="package\**" />
<None Remove="package\**" />
</ItemGroup>
<ItemGroup>
<Compile Remove="package\**" />
<EmbeddedResource Remove="package\**" />
<None Remove="package\**" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.TestPlatform.TestHost" Version="17.0.0" />
<PackageReference Include="nunit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.TestPlatform.TestHost" Version="17.0.0" />
<PackageReference Include="nunit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\IPBanCore\IPBanCore.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\IPBanCore\IPBanCore.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="TestData\LogFiles\Apache\everything.log">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="TestData\LogFiles\Exchange\smtp_auth_successful.log">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="TestData\LogFiles\Exchange\smtp_auth_unsuccessful.log">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Update="TestData\LogFiles\Apache\everything.log">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="TestData\LogFiles\Exchange\smtp_auth_successful.log">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="TestData\LogFiles\Exchange\smtp_auth_unsuccessful.log">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
</Project>

0 comments on commit 19bb57f

Please sign in to comment.