Skip to content

Commit

Permalink
Remove old target frameworks (#10)
Browse files Browse the repository at this point in the history
* Remove old target frameworks
* Add comments
  • Loading branch information
WojciechNagorski authored May 15, 2023
1 parent 3f5a7d7 commit 1ee6063
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
7 changes: 6 additions & 1 deletion docker/DockerFile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ COPY --chown=root:root server/ssh /etc/ssh/
COPY --chown=root:root server/script /opt/sshnet
COPY --chown=sshnet:sshnet user/sshnet /home/sshnet/.ssh

RUN apk add --no-cache syslog-ng && \
RUN apk update && apk upgrade --no-cache && \
apk add --no-cache syslog-ng && \
# install and configure sshd
apk add --no-cache openssh && \
# install openssh-server-pam to allow for keyboard-interactive authentication
apk add --no-cache openssh-server-pam && \
# make sure scripts and keys have unix (LF) line endings
dos2unix /etc/ssh/* && \
chmod 400 /etc/ssh/ssh*key && \
sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config && \
sed -i 's/#LogLevel\s*INFO/LogLevel DEBUG3/' /etc/ssh/sshd_config && \
Expand All @@ -25,6 +28,7 @@ RUN apk add --no-cache syslog-ng && \
adduser -D sshnet && \
passwd -u sshnet && \
echo 'sshnet:ssh4ever' | chpasswd && \
# make sure scripts and keys have unix (LF) line endings
dos2unix /home/sshnet/.ssh/* && \
chown -R sshnet:sshnet /home/sshnet && \
chmod -R 700 /home/sshnet/.ssh && \
Expand All @@ -34,6 +38,7 @@ RUN apk add --no-cache syslog-ng && \
passwd -u sshnetadm && \
echo 'sshnetadm:ssh4ever' | chpasswd && \
addgroup sshnetadm sudo && \
# make sure scripts and keys have unix (LF) line endings
dos2unix /opt/sshnet/* && \
# install shadow package; we use chage command in this package to expire/unexpire password of the sshnet user
apk add --no-cache shadow && \
Expand Down
3 changes: 2 additions & 1 deletion src/SshNetBenchmarks/SshNetBenchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.1" />
<PackageReference Include="SSH.NET" Version="2020.0.1" />
<PackageReference Include="SSH.NET" Version="2020.0.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\SshNetTests\SshNetTests.csproj" />
<!-- <ProjectReference Include="..\..\..\SSH.NET\src\Renci.SshNet\Renci.SshNet.csproj" /> -->
</ItemGroup>

</Project>
7 changes: 6 additions & 1 deletion src/SshNetTests/Common/AsyncSocketListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,14 @@ private void AcceptCallback(IAsyncResult ar)
var state = new SocketStateObject(handler);
handler.BeginReceive(state.Buffer, 0, state.Buffer.Length, 0, ReadCallback, state);
}
catch (SocketException)
{
// when the socket is closed, an SocketException is thrown since .NET 5
// by Socket.EndAccept(IAsyncResult)
}
catch (ObjectDisposedException)
{
// when the socket is closed, an ObjectDisposedException is thrown
// when the socket is closed, an ObjectDisposedException is thrown on old .NET Framework
// by Socket.EndAccept(IAsyncResult)
}
}
Expand Down
9 changes: 5 additions & 4 deletions src/SshNetTests/SshNetTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>net45;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net472;net7.0</TargetFrameworks>
<AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1' or '$(TargetFramework)' == 'netcoreapp3.1' ">
<PropertyGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
<DefineConstants>TRACE;FEATURE_MSTEST_DATATEST;FEATURE_SOCKET_EAP;FEATURE_ENCODING_ASCII;FEATURE_THREAD_SLEEP;FEATURE_THREAD_THREADPOOL</DefineConstants>
</PropertyGroup>

Expand All @@ -28,16 +28,17 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.0" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.0" />
<PackageReference Include="SSH.NET" Version="2020.0.1" />
<PackageReference Include="SSH.NET" Version="2020.0.2" />
<PackageReference Include="System.Management" Version="4.7.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net40' or '$(TargetFramework)' == 'net45' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'net472' ">
<PackageReference Include="Tamir.SharpSSH" Version="1.1.1.13" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\SSH.NET-TestTools\src\SshNet.TestTools.OpenSSH\SshNet.TestTools.OpenSSH.csproj" />
<!-- <ProjectReference Include="..\..\..\SSH.NET\src\Renci.SshNet\Renci.SshNet.csproj" /> -->
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 1ee6063

Please sign in to comment.