Merge pull request #412 from immense/net6

Update to .NET 6.
This commit is contained in:
dkattan 2021-12-02 21:25:45 -06:00 committed by GitHub
commit 199fcf8bd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
64 changed files with 510 additions and 8264 deletions

View File

@ -42,7 +42,9 @@ jobs:
uses: actions/checkout@v2
- name: Install .NET Core
uses: actions/setup-dotnet@v1.8.0
uses: actions/setup-dotnet@v1.9.0
with:
dotnet-version: 6.0.x
- name: Setup NuGet.exe for use with actions
uses: NuGet/setup-nuget@v1.0.5
@ -121,7 +123,9 @@ jobs:
# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v1.8.0
uses: actions/setup-dotnet@v1.9.0
with:
dotnet-version: 6.0.x
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
- name: Setup MSBuild.exe

View File

@ -31,7 +31,9 @@ jobs:
# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v1.6.0
uses: actions/setup-dotnet@v1.9.0
with:
dotnet-version: 6.0.x
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
- name: Setup MSBuild.exe

View File

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<Copyright>Copyright © 2021 Translucency Software</Copyright>
@ -23,16 +23,17 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="5.0.8" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.EventLog" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="5.0.8" />
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.1.3" />
<PackageReference Include="Microsoft.WSMan.Management" Version="7.1.3" />
<PackageReference Include="Microsoft.WSMan.Runtime" Version="7.1.3" />
<PackageReference Include="System.Management.Automation" Version="7.1.3" />
<PackageReference Include="System.ServiceProcess.ServiceController" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.EventLog" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="6.0.0" />
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.2.0" />
<PackageReference Include="Microsoft.WSMan.Management" Version="7.2.0" />
<PackageReference Include="Microsoft.WSMan.Runtime" Version="7.2.0" />
<PackageReference Include="System.Management.Automation" Version="7.2.0" />
<PackageReference Include="System.ServiceProcess.ServiceController" Version="6.0.0" />
</ItemGroup>
<ItemGroup>

View File

@ -42,6 +42,7 @@ namespace Remotely.Agent
private static void BuildServices()
{
var serviceCollection = new ServiceCollection();
serviceCollection.AddHttpClient();
serviceCollection.AddLogging(builder =>
{
builder.AddConsole().AddDebug();

View File

@ -6,6 +6,8 @@ using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
@ -16,17 +18,19 @@ namespace Remotely.Agent.Services
public class UpdaterLinux : IUpdater
{
private readonly SemaphoreSlim _checkForUpdatesLock = new SemaphoreSlim(1, 1);
private readonly SemaphoreSlim _checkForUpdatesLock = new(1, 1);
private readonly ConfigService _configService;
private readonly IWebClientEx _webClientEx;
private readonly SemaphoreSlim _installLatestVersionLock = new SemaphoreSlim(1, 1);
private readonly IHttpClientFactory _httpClientFactory;
private readonly SemaphoreSlim _installLatestVersionLock = new(1, 1);
private DateTimeOffset _lastUpdateFailure;
private readonly System.Timers.Timer _updateTimer = new System.Timers.Timer(TimeSpan.FromHours(6).TotalMilliseconds);
private readonly System.Timers.Timer _updateTimer = new(TimeSpan.FromHours(6).TotalMilliseconds);
public UpdaterLinux(ConfigService configService, IWebClientEx webClientEx)
public UpdaterLinux(ConfigService configService, IWebClientEx webClientEx, IHttpClientFactory httpClientFactory)
{
_configService = configService;
_webClientEx = webClientEx;
_httpClientFactory = httpClientFactory;
_webClientEx.SetRequestTimeout((int)_updateTimer.Interval);
}
@ -66,26 +70,22 @@ namespace Remotely.Agent.Services
var fileUrl = serverUrl + $"/Content/Remotely-Linux.zip";
var lastEtag = string.Empty;
using var httpClient = _httpClientFactory.CreateClient();
using var request = new HttpRequestMessage(HttpMethod.Head, fileUrl);
if (File.Exists("etag.txt"))
{
lastEtag = await File.ReadAllTextAsync("etag.txt");
}
try
{
var wr = WebRequest.CreateHttp(fileUrl);
wr.Method = "Head";
wr.Headers.Add("If-None-Match", lastEtag);
using var response = (HttpWebResponse)await wr.GetResponseAsync();
if (response.StatusCode == HttpStatusCode.NotModified)
var lastEtag = await File.ReadAllTextAsync("etag.txt");
if (!string.IsNullOrEmpty(lastEtag))
{
Logger.Write("Service Updater: Version is current.");
return;
var etagValue = new EntityTagHeaderValue(lastEtag.Trim());
request.Headers.IfNoneMatch.Add(etagValue);
}
}
catch (WebException ex) when ((ex.Response as HttpWebResponse).StatusCode == HttpStatusCode.NotModified)
using var response = await httpClient.SendAsync(request);
if (response.StatusCode == HttpStatusCode.NotModified)
{
Logger.Write("Service Updater: Version is current.");
return;
@ -96,6 +96,11 @@ namespace Remotely.Agent.Services
await InstallLatestVersion();
}
catch (WebException ex) when ((ex.Response as HttpWebResponse).StatusCode == HttpStatusCode.NotModified)
{
Logger.Write("Service Updater: Version is current.");
return;
}
catch (Exception ex)
{
Logger.Write(ex);
@ -109,6 +114,7 @@ namespace Remotely.Agent.Services
public void Dispose()
{
_webClientEx?.Dispose();
GC.SuppressFinalize(this);
}
public async Task InstallLatestVersion()
@ -150,7 +156,8 @@ namespace Remotely.Agent.Services
serverUrl + $"/API/AgentUpdate/DownloadPackage/linux/{downloadId}",
zipPath);
(await WebRequest.CreateHttp(serverUrl + $"/api/AgentUpdate/ClearDownload/{downloadId}").GetResponseAsync()).Dispose();
using var httpClient = _httpClientFactory.CreateClient();
using var response = httpClient.GetAsync($"{serverUrl}/api/AgentUpdate/ClearDownload/{downloadId}");
Logger.Write("Launching installer to perform update.");

View File

@ -6,6 +6,8 @@ using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
@ -17,16 +19,18 @@ namespace Remotely.Agent.Services
public class UpdaterMac : IUpdater
{
private readonly string _achitecture = RuntimeInformation.OSArchitecture.ToString().ToLower();
private readonly SemaphoreSlim _checkForUpdatesLock = new SemaphoreSlim(1, 1);
private readonly SemaphoreSlim _checkForUpdatesLock = new(1, 1);
private readonly ConfigService _configService;
private readonly IHttpClientFactory _httpClientFactory;
private readonly IWebClientEx _webClientEx;
private readonly SemaphoreSlim _installLatestVersionLock = new SemaphoreSlim(1, 1);
private readonly SemaphoreSlim _installLatestVersionLock = new(1, 1);
private DateTimeOffset _lastUpdateFailure;
private readonly System.Timers.Timer _updateTimer = new System.Timers.Timer(TimeSpan.FromHours(6).TotalMilliseconds);
private readonly System.Timers.Timer _updateTimer = new(TimeSpan.FromHours(6).TotalMilliseconds);
public UpdaterMac(ConfigService configService, IWebClientEx webClientEx)
public UpdaterMac(ConfigService configService, IWebClientEx webClientEx, IHttpClientFactory httpClientFactory)
{
_configService = configService;
_httpClientFactory = httpClientFactory;
_webClientEx = webClientEx;
_webClientEx.SetRequestTimeout((int)_updateTimer.Interval);
}
@ -67,26 +71,21 @@ namespace Remotely.Agent.Services
var fileUrl = serverUrl + $"/Content/Remotely-MacOS-{_achitecture}.zip";
var lastEtag = string.Empty;
using var httpClient = _httpClientFactory.CreateClient();
using var request = new HttpRequestMessage(HttpMethod.Head, fileUrl);
if (File.Exists("etag.txt"))
{
lastEtag = await File.ReadAllTextAsync("etag.txt");
}
try
{
var wr = WebRequest.CreateHttp(fileUrl);
wr.Method = "Head";
wr.Headers.Add("If-None-Match", lastEtag);
using var response = (HttpWebResponse)await wr.GetResponseAsync();
if (response.StatusCode == HttpStatusCode.NotModified)
var lastEtag = await File.ReadAllTextAsync("etag.txt");
if (!string.IsNullOrEmpty(lastEtag))
{
Logger.Write("Service Updater: Version is current.");
return;
request.Headers.IfNoneMatch.Add(new EntityTagHeaderValue(lastEtag.Trim()));
}
}
catch (WebException ex) when ((ex.Response as HttpWebResponse).StatusCode == HttpStatusCode.NotModified)
using var response = await httpClient.SendAsync(request);
if (response.StatusCode == HttpStatusCode.NotModified)
{
Logger.Write("Service Updater: Version is current.");
return;
@ -97,6 +96,11 @@ namespace Remotely.Agent.Services
await InstallLatestVersion();
}
catch (WebException ex) when ((ex.Response as HttpWebResponse).StatusCode == HttpStatusCode.NotModified)
{
Logger.Write("Service Updater: Version is current.");
return;
}
catch (Exception ex)
{
Logger.Write(ex);
@ -110,6 +114,7 @@ namespace Remotely.Agent.Services
public void Dispose()
{
_webClientEx?.Dispose();
GC.SuppressFinalize(this);
}
public async Task InstallLatestVersion()
@ -136,7 +141,8 @@ namespace Remotely.Agent.Services
serverUrl + $"/API/AgentUpdate/DownloadPackage/macos-{_achitecture}/{downloadId}",
zipPath);
(await WebRequest.CreateHttp(serverUrl + $"/api/AgentUpdate/ClearDownload/{downloadId}").GetResponseAsync()).Dispose();
using var httpClient = _httpClientFactory.CreateClient();
using var response = httpClient.GetAsync($"{serverUrl}/api/AgentUpdate/ClearDownload/{downloadId}");
Logger.Write("Launching installer to perform update.");

View File

@ -4,6 +4,8 @@ using System;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading;
using System.Threading.Tasks;
@ -11,18 +13,20 @@ namespace Remotely.Agent.Services
{
public class UpdaterWin : IUpdater
{
private readonly SemaphoreSlim _checkForUpdatesLock = new SemaphoreSlim(1, 1);
private readonly SemaphoreSlim _checkForUpdatesLock = new(1, 1);
private readonly ConfigService _configService;
private readonly IWebClientEx _webClientEx;
private readonly SemaphoreSlim _installLatestVersionLock = new SemaphoreSlim(1, 1);
private readonly System.Timers.Timer _updateTimer = new System.Timers.Timer(TimeSpan.FromHours(6).TotalMilliseconds);
private readonly IHttpClientFactory _httpClientFactory;
private readonly SemaphoreSlim _installLatestVersionLock = new(1, 1);
private readonly System.Timers.Timer _updateTimer = new(TimeSpan.FromHours(6).TotalMilliseconds);
private DateTimeOffset _lastUpdateFailure;
public UpdaterWin(ConfigService configService, IWebClientEx webClientEx)
public UpdaterWin(ConfigService configService, IWebClientEx webClientEx, IHttpClientFactory httpClientFactory)
{
_configService = configService;
_webClientEx = webClientEx;
_httpClientFactory = httpClientFactory;
_webClientEx.SetRequestTimeout((int)_updateTimer.Interval);
}
@ -62,36 +66,36 @@ namespace Remotely.Agent.Services
var platform = Environment.Is64BitOperatingSystem ? "x64" : "x86";
var fileUrl = serverUrl + $"/Content/Remotely-Win10-{platform}.zip";
var lastEtag = string.Empty;
using var httpClient = _httpClientFactory.CreateClient();
using var request = new HttpRequestMessage(HttpMethod.Head, fileUrl);
if (File.Exists("etag.txt"))
{
lastEtag = await File.ReadAllTextAsync("etag.txt");
}
try
{
var wr = WebRequest.CreateHttp(fileUrl);
wr.Method = "Head";
wr.Headers.Add("If-None-Match", lastEtag);
using var response = (HttpWebResponse)await wr.GetResponseAsync();
if (response.StatusCode == HttpStatusCode.NotModified)
var lastEtag = await File.ReadAllTextAsync("etag.txt");
if (!string.IsNullOrEmpty(lastEtag))
{
Logger.Write("Service Updater: Version is current.");
return;
request.Headers.IfNoneMatch.Add(new EntityTagHeaderValue(lastEtag.Trim()));
}
}
catch (WebException ex) when ((ex.Response as HttpWebResponse).StatusCode == HttpStatusCode.NotModified)
using var response = await httpClient.SendAsync(request);
if (response.StatusCode == HttpStatusCode.NotModified)
{
Logger.Write("Service Updater: Version is current.");
return;
}
Logger.Write("Service Updater: Update found.");
await InstallLatestVersion();
}
catch (WebException ex) when ((ex.Response as HttpWebResponse).StatusCode == HttpStatusCode.NotModified)
{
Logger.Write("Service Updater: Version is current.");
return;
}
catch (Exception ex)
{
Logger.Write(ex);
@ -105,6 +109,7 @@ namespace Remotely.Agent.Services
public void Dispose()
{
_webClientEx?.Dispose();
GC.SuppressFinalize(this);
}
public async Task InstallLatestVersion()
@ -132,8 +137,8 @@ namespace Remotely.Agent.Services
serverUrl + $"/api/AgentUpdate/DownloadPackage/win-{platform}/{downloadId}",
zipPath);
(await WebRequest.CreateHttp(serverUrl + $"/api/AgentUpdate/ClearDownload/{downloadId}").GetResponseAsync()).Dispose();
using var httpClient = _httpClientFactory.CreateClient();
using var response = httpClient.GetAsync($"{serverUrl}/api/AgentUpdate/ClearDownload/{downloadId}");
foreach (var proc in Process.GetProcessesByName("Remotely_Installer"))
{

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Remotely.Desktop.Core</RootNamespace>
<AssemblyName>Remotely_Desktop.Core</AssemblyName>
<Platforms>AnyCPU;x64;x86</Platforms>
@ -40,14 +40,14 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="5.0.8" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="5.0.8" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="6.0.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.EventLog" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.EventLog" Version="6.0.0" />
<PackageReference Include="Microsoft.MixedReality.WebRTC" Version="2.0.2" />
<PackageReference Include="System.Drawing.Common" Version="5.0.2" />
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="5.0.0" />
</ItemGroup>

View File

@ -118,7 +118,13 @@ namespace Remotely.Desktop.Core.Services
}
// Wait until the first image is received.
TaskHelper.DelayUntil(() => !viewer.PendingSentFrames.Any(), TimeSpan.MaxValue);
if (!TaskHelper.DelayUntil(() => !viewer.PendingSentFrames.Any(), TimeSpan.FromSeconds(30)))
{
Logger.Write("Timed out while waiting for first frame receipt.");
_conductor.Viewers.TryRemove(viewer.ViewerConnectionID, out _);
viewer.Dispose();
return;
}
while (!viewer.DisconnectRequested && viewer.IsConnected)
{

View File

@ -12,7 +12,7 @@ namespace Remotely.Desktop.Core.Utilities
{
public class ImageUtils
{
private static ImageCodecInfo _jpegEncoder = ImageCodecInfo.GetImageEncoders().FirstOrDefault(x => x.FormatID == ImageFormat.Jpeg.Guid);
private static readonly ImageCodecInfo _jpegEncoder = ImageCodecInfo.GetImageEncoders().FirstOrDefault(x => x.FormatID == ImageFormat.Jpeg.Guid);
//public static byte[] EncodeWithSkia(Bitmap bitmap, SKEncodedImageFormat format, int quality)
//{

View File

@ -2,13 +2,12 @@
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net5.0-windows</TargetFramework>
<TargetFramework>net6.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>
<AssemblyName>Remotely_Desktop</AssemblyName>
<RootNamespace>Remotely.Desktop.Win</RootNamespace>
<ApplicationIcon>Assets\favicon.ico</ApplicationIcon>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Description>Desktop client for allowing your IT admin to provide remote support.</Description>
<Copyright>Copyright © 2021 Translucency Software</Copyright>
<PackageId>Remotely Desktop</PackageId>
@ -28,6 +27,10 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<AdditionalFiles Remove="app.manifest" />
</ItemGroup>
<ItemGroup>
<None Remove="Assets\favicon.ico" />
<None Remove="Assets\Remotely_Icon.png" />
@ -39,7 +42,7 @@
<PackageReference Include="SharpDX" Version="4.2.0" />
<PackageReference Include="SharpDX.Direct3D11" Version="4.2.0" />
<PackageReference Include="SharpDX.DXGI" Version="4.2.0" />
<PackageReference Include="System.Drawing.Common" Version="5.0.2" />
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
</ItemGroup>
<ItemGroup>
@ -83,7 +86,7 @@
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="if $(SolutionDir) == *Undefined* (&#xD;&#xA; exit 0&#xD;&#xA;)&#xD;&#xA;if $(ConfigurationName) == Debug (&#xD;&#xA; if $(PlatformName) == AnyCPU (&#xD;&#xA; md &quot;$(SolutionDir)Agent\bin\Debug\net5.0\Desktop\&quot;&#xD;&#xA; xcopy &quot;$(TargetDir)*&quot; &quot;$(SolutionDir)Agent\bin\Debug\net5.0\Desktop\&quot; /y /e /i&#xD;&#xA; )&#xD;&#xA; if $(PlatformName) == x64 (&#xD;&#xA; md &quot;$(SolutionDir)Agent\bin\x64\Debug\net5.0\Desktop\&quot;&#xD;&#xA; xcopy &quot;$(TargetDir)*&quot; &quot;$(SolutionDir)Agent\bin\x64\Debug\net5.0\Desktop\&quot; /y /e /i&#xD;&#xA; )&#xD;&#xA; if $(PlatformName) == x86 (&#xD;&#xA; md &quot;$(SolutionDir)Agent\bin\x86\Debug\net5.0\Desktop\&quot;&#xD;&#xA; xcopy &quot;$(TargetDir)*&quot; &quot;$(SolutionDir)Agent\bin\x86\Debug\net5.0\Desktop\&quot; /y /e /i&#xD;&#xA; )&#xD;&#xA;)" />
<Exec Command="if $(SolutionDir) == *Undefined* (&#xD;&#xA; exit 0&#xD;&#xA;)&#xD;&#xA;if $(ConfigurationName) == Debug (&#xD;&#xA; if $(PlatformName) == AnyCPU (&#xD;&#xA; md &quot;$(SolutionDir)Agent\bin\Debug\net6.0\Desktop\&quot;&#xD;&#xA; xcopy &quot;$(TargetDir)*&quot; &quot;$(SolutionDir)Agent\bin\Debug\net6.0\Desktop\&quot; /y /e /i&#xD;&#xA; )&#xD;&#xA; if $(PlatformName) == x64 (&#xD;&#xA; md &quot;$(SolutionDir)Agent\bin\x64\Debug\net6.0\Desktop\&quot;&#xD;&#xA; xcopy &quot;$(TargetDir)*&quot; &quot;$(SolutionDir)Agent\bin\x64\Debug\net6.0\Desktop\&quot; /y /e /i&#xD;&#xA; )&#xD;&#xA; if $(PlatformName) == x86 (&#xD;&#xA; md &quot;$(SolutionDir)Agent\bin\x86\Debug\net6.0\Desktop\&quot;&#xD;&#xA; xcopy &quot;$(TargetDir)*&quot; &quot;$(SolutionDir)Agent\bin\x86\Debug\net6.0\Desktop\&quot; /y /e /i&#xD;&#xA; )&#xD;&#xA;)" />
</Target>
</Project>

View File

@ -5,10 +5,11 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.*</ApplicationVersion>
<ApplicationVersion>1.0.0.0</ApplicationVersion>
<BootstrapperEnabled>True</BootstrapperEnabled>
<Configuration>Release</Configuration>
<CreateDesktopShortcut>True</CreateDesktopShortcut>
<CreateWebPageOnPublish>True</CreateWebPageOnPublish>
<ErrorReportUrl>https://remotely.one/Contact</ErrorReportUrl>
<ExcludeDeploymentUrl>False</ExcludeDeploymentUrl>
<GenerateManifests>True</GenerateManifests>
@ -33,15 +34,17 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<SignManifests>False</SignManifests>
<SuiteName>Remotely</SuiteName>
<SupportUrl>https://remotely.one/Contact</SupportUrl>
<TargetFramework>net5.0-windows</TargetFramework>
<TargetFramework>net6.0-windows</TargetFramework>
<TrustUrlParameters>True</TrustUrlParameters>
<UpdateEnabled>True</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateRequired>False</UpdateRequired>
<WebPageFileName>Publish.html</WebPageFileName>
</PropertyGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.NetCore.DesktopRuntime.5.0.x64">
<BootstrapperPackage Include="Microsoft.NetCore.DesktopRuntime.6.0.x64">
<Install>true</Install>
<ProductName>.NET Desktop Runtime 5.0.1 (x64)</ProductName>
<ProductName>.NET Desktop Runtime 6.0.0 (x64)</ProductName>
</BootstrapperPackage>
</ItemGroup>
</Project>

View File

@ -5,10 +5,11 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.*</ApplicationVersion>
<ApplicationVersion>1.0.0.0</ApplicationVersion>
<BootstrapperEnabled>True</BootstrapperEnabled>
<Configuration>Release</Configuration>
<CreateDesktopShortcut>True</CreateDesktopShortcut>
<CreateWebPageOnPublish>True</CreateWebPageOnPublish>
<ErrorReportUrl>https://remotely.one/Contact</ErrorReportUrl>
<ExcludeDeploymentUrl>False</ExcludeDeploymentUrl>
<GenerateManifests>True</GenerateManifests>
@ -33,15 +34,17 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<SignManifests>False</SignManifests>
<SuiteName>Remotely</SuiteName>
<SupportUrl>https://remotely.one/Contact</SupportUrl>
<TargetFramework>net5.0-windows</TargetFramework>
<TargetFramework>net6.0-windows</TargetFramework>
<TrustUrlParameters>True</TrustUrlParameters>
<UpdateEnabled>True</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateRequired>False</UpdateRequired>
<WebPageFileName>Publish.html</WebPageFileName>
</PropertyGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.NetCore.DesktopRuntime.5.0.x86">
<BootstrapperPackage Include="Microsoft.NetCore.DesktopRuntime.6.0.x86">
<Install>true</Install>
<ProductName>.NET Desktop Runtime 5.0.1 (x86)</ProductName>
<ProductName>.NET Desktop Runtime 6.0.0 (x86)</ProductName>
</BootstrapperPackage>
</ItemGroup>
</Project>

View File

@ -7,7 +7,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PublishProtocol>FileSystem</PublishProtocol>
<Configuration>Release</Configuration>
<Platform>x64</Platform>
<TargetFramework>net5.0-windows</TargetFramework>
<TargetFramework>net6.0-windows</TargetFramework>
<PublishDir>..\Server\wwwroot\Content\Win-x64\</PublishDir>
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
<SelfContained>true</SelfContained>
@ -15,5 +15,6 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PublishReadyToRun>False</PublishReadyToRun>
<PublishTrimmed>False</PublishTrimmed>
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
<EnableCompressionInSingleFile>true</EnableCompressionInSingleFile>
</PropertyGroup>
</Project>

View File

@ -7,7 +7,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PublishProtocol>FileSystem</PublishProtocol>
<Configuration>Release</Configuration>
<Platform>x86</Platform>
<TargetFramework>net5.0-windows</TargetFramework>
<TargetFramework>net6.0-windows</TargetFramework>
<PublishDir>..\Server\wwwroot\Content\Win-x86\</PublishDir>
<RuntimeIdentifier>win10-x86</RuntimeIdentifier>
<SelfContained>true</SelfContained>
@ -15,5 +15,6 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PublishReadyToRun>False</PublishReadyToRun>
<PublishTrimmed>False</PublishTrimmed>
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
<EnableCompressionInSingleFile>true</EnableCompressionInSingleFile>
</PropertyGroup>
</Project>

View File

@ -8,7 +8,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Platform>x64</Platform>
<PublishDir>C:\Program Files\Remotely\Desktop</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net5.0-windows</TargetFramework>
<TargetFramework>net6.0-windows</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>

View File

@ -7,8 +7,8 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PublishProtocol>FileSystem</PublishProtocol>
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
<TargetFramework>net5.0-windows</TargetFramework>
<PublishDir>..\Agent\bin\Release\net5.0\win10-x64\publish\Desktop</PublishDir>
<TargetFramework>net6.0-windows</TargetFramework>
<PublishDir>..\Agent\bin\Release\net6.0\win10-x64\publish\Desktop</PublishDir>
<SelfContained>true</SelfContained>
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
<PublishSingleFile>True</PublishSingleFile>

View File

@ -7,8 +7,8 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PublishProtocol>FileSystem</PublishProtocol>
<Configuration>Release</Configuration>
<Platform>x64</Platform>
<TargetFramework>net5.0-windows</TargetFramework>
<PublishDir>..\Agent\bin\Release\net5.0\win10-x64\publish\Desktop</PublishDir>
<TargetFramework>net6.0-windows</TargetFramework>
<PublishDir>..\Agent\bin\Release\net6.0\win10-x64\publish\Desktop</PublishDir>
<SelfContained>true</SelfContained>
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
<PublishSingleFile>False</PublishSingleFile>

View File

@ -7,8 +7,8 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PublishProtocol>FileSystem</PublishProtocol>
<Configuration>Release</Configuration>
<Platform>x86</Platform>
<TargetFramework>net5.0-windows</TargetFramework>
<PublishDir>..\Agent\bin\Release\net5.0\win10-x86\publish\Desktop</PublishDir>
<TargetFramework>net6.0-windows</TargetFramework>
<PublishDir>..\Agent\bin\Release\net6.0\win10-x86\publish\Desktop</PublishDir>
<RuntimeIdentifier>win10-x86</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>

View File

@ -7,7 +7,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PublishProtocol>FileSystem</PublishProtocol>
<Configuration>Release</Configuration>
<Platform>x64</Platform>
<TargetFramework>net5.0-windows</TargetFramework>
<TargetFramework>net6.0-windows</TargetFramework>
<PublishDir>bin\Release\win-x64\publish\</PublishDir>
<SelfContained>true</SelfContained>
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>

View File

@ -7,7 +7,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PublishProtocol>FileSystem</PublishProtocol>
<Configuration>Release</Configuration>
<Platform>x86</Platform>
<TargetFramework>net5.0-windows</TargetFramework>
<TargetFramework>net6.0-windows</TargetFramework>
<PublishDir>bin\Release\win-x86\publish\</PublishDir>
<SelfContained>true</SelfContained>
<RuntimeIdentifier>win10-x86</RuntimeIdentifier>

View File

@ -1,77 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
Specifying requestedExecutionLevel element will disable file and registry virtualization.
Remove this element if your application requires this virtualization for backwards
compatibility.
-->
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of the Windows versions that this application has been tested on
and is designed to work with. Uncomment the appropriate elements
and Windows will automatically select the most compatible environment. -->
<!-- Windows Vista -->
<!-- <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" /> -->
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
</application>
</compatibility>
<!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher
DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need
to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should
also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config. -->
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
</windowsSettings>
</application>
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
<!--
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
-->
</assembly>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<ApplicationIcon>Assets\favicon.ico</ApplicationIcon>
<AssemblyName>Remotely_Desktop</AssemblyName>
<RootNamespace>Remotely.Desktop.XPlat</RootNamespace>
@ -52,9 +52,9 @@
<EmbeddedResource Include="Assets\Remotely_Icon.png" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.6" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.6" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.6" />
<PackageReference Include="Avalonia" Version="0.10.10" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.10" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.10" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Desktop.Core\Desktop.Core.csproj" />

View File

@ -7,12 +7,13 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PublishProtocol>FileSystem</PublishProtocol>
<Configuration>Release</Configuration>
<Platform>x64</Platform>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<PublishDir>..\Server\wwwroot\Content\Linux-x64\</PublishDir>
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<PublishSingleFile>True</PublishSingleFile>
<PublishTrimmed>False</PublishTrimmed>
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
<EnableCompressionInSingleFile>true</EnableCompressionInSingleFile>
</PropertyGroup>
</Project>

View File

@ -7,8 +7,8 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PublishProtocol>FileSystem</PublishProtocol>
<Configuration>Release</Configuration>
<Platform>x64</Platform>
<TargetFramework>net5.0</TargetFramework>
<PublishDir>..\Agent\bin\Release\net5.0\linux-x64\publish\Desktop</PublishDir>
<TargetFramework>net6.0</TargetFramework>
<PublishDir>..\Agent\bin\Release\net6.0\linux-x64\publish\Desktop</PublishDir>
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>

View File

@ -8,7 +8,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Platform>x64</Platform>
<PublishDir>publish\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<PublishSingleFile>True</PublishSingleFile>

View File

@ -8,7 +8,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Platform>x64</Platform>
<PublishDir>publish\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<PublishSingleFile>True</PublishSingleFile>

View File

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<AssemblyName>Remotely_Server_Installer</AssemblyName>
<ApplicationIcon>Remotely_Icon.ico</ApplicationIcon>
<RootNamespace>Remotely.Server.Installer</RootNamespace>
@ -32,7 +32,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
</ItemGroup>
<ItemGroup>

View File

@ -5,6 +5,8 @@ using Remotely.Shared.Models;
using System;
using System.IO;
using System.Net;
using System.Net.Http;
using System.Net.Http.Json;
using System.Text.Json;
using System.Threading.Tasks;
@ -15,31 +17,33 @@ namespace Remotely.Server.API
[ServiceFilter(typeof(ApiAuthorizationFilter))]
public class AlertsController : ControllerBase
{
public AlertsController(IDataService dataService, IEmailSenderEx emailSender)
{
DataService = dataService;
EmailSender = emailSender;
}
private readonly IDataService _dataService;
private readonly IEmailSenderEx _emailSender;
private readonly IHttpClientFactory _httpClientFactory;
private IDataService DataService { get; }
private IEmailSenderEx EmailSender { get; }
public AlertsController(IDataService dataService, IEmailSenderEx emailSender, IHttpClientFactory httpClientFactory)
{
_dataService = dataService;
_emailSender = emailSender;
_httpClientFactory = httpClientFactory;
}
[HttpPost("Create")]
public async Task<IActionResult> Create(AlertOptions alertOptions)
{
Request.Headers.TryGetValue("OrganizationID", out var orgID);
DataService.WriteEvent("Alert created. Alert Options: " + JsonSerializer.Serialize(alertOptions), orgID);
_dataService.WriteEvent("Alert created. Alert Options: " + JsonSerializer.Serialize(alertOptions), orgID);
if (alertOptions.ShouldAlert)
{
try
{
await DataService.AddAlert(alertOptions.AlertDeviceID, orgID, alertOptions.AlertMessage);
await _dataService.AddAlert(alertOptions.AlertDeviceID, orgID, alertOptions.AlertMessage);
}
catch (Exception ex)
{
DataService.WriteEvent(ex, orgID);
_dataService.WriteEvent(ex, orgID);
}
}
@ -47,14 +51,14 @@ namespace Remotely.Server.API
{
try
{
await EmailSender.SendEmailAsync(alertOptions.EmailTo,
await _emailSender.SendEmailAsync(alertOptions.EmailTo,
alertOptions.EmailSubject,
alertOptions.EmailBody,
orgID);
}
catch (Exception ex)
{
DataService.WriteEvent(ex, orgID);
_dataService.WriteEvent(ex, orgID);
}
}
@ -63,24 +67,25 @@ namespace Remotely.Server.API
{
try
{
var httpRequest = WebRequest.CreateHttp(alertOptions.ApiRequestUrl);
httpRequest.Method = alertOptions.ApiRequestMethod;
httpRequest.ContentType = "application/json";
using var httpClient = _httpClientFactory.CreateClient();
using var request = new HttpRequestMessage(
new HttpMethod(alertOptions.ApiRequestMethod),
alertOptions.ApiRequestUrl);
request.Content = new StringContent(alertOptions.ApiRequestBody);
request.Content.Headers.ContentType.MediaType = "application/json";
foreach (var header in alertOptions.ApiRequestHeaders)
{
httpRequest.Headers.Add(header.Key, header.Value);
request.Headers.TryAddWithoutValidation(header.Key, header.Value);
}
using (var rs = httpRequest.GetRequestStream())
using (var sw = new StreamWriter(rs))
{
sw.Write(alertOptions.ApiRequestBody);
}
using var response = (HttpWebResponse)httpRequest.GetResponse();
DataService.WriteEvent($"Alert API Response Status: {response.StatusCode}.", orgID);
using var response = await httpClient.SendAsync(request);
_dataService.WriteEvent($"Alert API Response Status: {response.StatusCode}.", orgID);
}
catch (Exception ex)
{
DataService.WriteEvent(ex, orgID);
_dataService.WriteEvent(ex, orgID);
}
}
@ -93,11 +98,11 @@ namespace Remotely.Server.API
{
Request.Headers.TryGetValue("OrganizationID", out var orgID);
var alert = await DataService.GetAlert(alertID);
var alert = await _dataService.GetAlert(alertID);
if (alert?.OrganizationID == orgID)
{
await DataService.DeleteAlert(alert);
await _dataService.DeleteAlert(alert);
return Ok();
}
@ -112,11 +117,11 @@ namespace Remotely.Server.API
if (User.Identity.IsAuthenticated)
{
await DataService.DeleteAllAlerts(orgID, User.Identity.Name);
await _dataService.DeleteAllAlerts(orgID, User.Identity.Name);
}
else
{
await DataService.DeleteAllAlerts(orgID);
await _dataService.DeleteAllAlerts(orgID);
}
return Ok();

View File

@ -221,29 +221,26 @@ namespace Remotely.Server.Components.Devices
continue;
}
if (_selectedGroupId == _deviceGroupNone &&
!string.IsNullOrWhiteSpace(device.DeviceGroupID))
{
continue;
}
else if (_selectedGroupId != _deviceGroupAll &&
_selectedGroupId != device.DeviceGroupID)
{
continue;
}
if (!string.IsNullOrWhiteSpace(_filter) &&
device.Alias?.Contains(_filter, StringComparison.OrdinalIgnoreCase) != true &&
device.CurrentUser?.Contains(_filter, StringComparison.OrdinalIgnoreCase) != true &&
device.DeviceName?.Contains(_filter, StringComparison.OrdinalIgnoreCase) != true &&
device.Notes?.Contains(_filter, StringComparison.OrdinalIgnoreCase) != true &&
device.Platform?.Contains(_filter, StringComparison.OrdinalIgnoreCase) != true &&
device.Tags?.Contains(_filter, StringComparison.OrdinalIgnoreCase) != true)
device.Alias?.Contains(_filter, StringComparison.OrdinalIgnoreCase) != true &&
device.CurrentUser?.Contains(_filter, StringComparison.OrdinalIgnoreCase) != true &&
device.DeviceName?.Contains(_filter, StringComparison.OrdinalIgnoreCase) != true &&
device.Notes?.Contains(_filter, StringComparison.OrdinalIgnoreCase) != true &&
device.Platform?.Contains(_filter, StringComparison.OrdinalIgnoreCase) != true &&
device.Tags?.Contains(_filter, StringComparison.OrdinalIgnoreCase) != true)
{
continue;
}
_filteredDevices.Add(device);
if (_selectedGroupId == _deviceGroupAll ||
_selectedGroupId == device.DeviceGroupID ||
(
_selectedGroupId == _deviceGroupNone &&
string.IsNullOrWhiteSpace(device.DeviceGroupID
)))
{
_filteredDevices.Add(device);
}
}
if (!string.IsNullOrWhiteSpace(_selectedSortProperty))

View File

@ -16,16 +16,11 @@ namespace Remotely.Server.Data
{
public class AppDb : IdentityDbContext
{
private static ValueComparer<string[]> _stringArrayComparer = new(
private static readonly ValueComparer<string[]> _stringArrayComparer = new(
(a, b) => a.SequenceEqual(b),
c => c.Aggregate(0, (a, b) => HashCode.Combine(a, b.GetHashCode())),
c => c.ToArray());
public AppDb(DbContextOptions context)
: base(context)
{
}
public DbSet<Alert> Alerts { get; set; }
public DbSet<ApiToken> ApiTokens { get; set; }
@ -106,8 +101,8 @@ namespace Remotely.Server.Data
builder.Entity<RemotelyUser>()
.Property(x => x.UserOptions)
.HasConversion(
x => JsonSerializer.Serialize(x, null),
x => JsonSerializer.Deserialize<RemotelyUserOptions>(x, null));
x => JsonSerializer.Serialize(x, (JsonSerializerOptions)null),
x => JsonSerializer.Deserialize<RemotelyUserOptions>(x, (JsonSerializerOptions)null));
builder.Entity<RemotelyUser>()
.HasMany(x => x.SavedScripts)
.WithOne(x => x.Creator);
@ -121,8 +116,8 @@ namespace Remotely.Server.Data
builder.Entity<Device>()
.Property(x => x.Drives)
.HasConversion(
x => JsonSerializer.Serialize(x, null),
x => JsonSerializer.Deserialize<List<Drive>>(x, null));
x => JsonSerializer.Serialize(x, (JsonSerializerOptions)null),
x => JsonSerializer.Deserialize<List<Drive>>(x, (JsonSerializerOptions)null));
builder.Entity<Device>()
.Property(x => x.Drives)
.Metadata.SetValueComparer(new ValueComparer<List<Drive>>(true));
@ -157,16 +152,16 @@ namespace Remotely.Server.Data
builder.Entity<ScriptResult>()
.Property(x => x.ErrorOutput)
.HasConversion(
x => JsonSerializer.Serialize(x, null),
x => JsonSerializer.Deserialize<string[]>(x, null))
x => JsonSerializer.Serialize(x, (JsonSerializerOptions)null),
x => JsonSerializer.Deserialize<string[]>(x, (JsonSerializerOptions)null))
.Metadata
.SetValueComparer(_stringArrayComparer);
builder.Entity<ScriptResult>()
.Property(x => x.StandardOutput)
.HasConversion(
x => JsonSerializer.Serialize(x, null),
x => JsonSerializer.Deserialize<string[]>(x, null))
x => JsonSerializer.Serialize(x, (JsonSerializerOptions)null),
x => JsonSerializer.Deserialize<string[]>(x, (JsonSerializerOptions)null))
.Metadata
.SetValueComparer(_stringArrayComparer);

View File

@ -14,8 +14,7 @@ namespace Remotely.Server.Data
{
private readonly IConfiguration _configuration;
public PostgreSqlDbContext(DbContextOptions context, IConfiguration configuration)
: base(context)
public PostgreSqlDbContext(IConfiguration configuration)
{
_configuration = configuration;
}

View File

@ -13,8 +13,7 @@ namespace Remotely.Server.Data
{
private readonly IConfiguration _configuration;
public SqlServerDbContext(DbContextOptions context, IConfiguration configuration)
: base(context)
public SqlServerDbContext(IConfiguration configuration)
{
_configuration = configuration;
}

View File

@ -13,8 +13,7 @@ namespace Remotely.Server.Data
{
private readonly IConfiguration _configuration;
public SqliteDbContext(DbContextOptions context, IConfiguration configuration)
: base(context)
public SqliteDbContext(IConfiguration configuration)
{
_configuration = configuration;
}

View File

@ -0,0 +1,20 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Remotely.Server.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Remotely.Server.Data
{
public class TestingDbContext : AppDb
{
protected override void OnConfiguring(DbContextOptionsBuilder options)
{
options.UseInMemoryDatabase("Remotely");
base.OnConfiguring(options);
}
}
}

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<UserSecretsId>aspnet-Server-F297B939-4A64-4B42-8C70-E142EBDAA131</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<DockerfileTag>remotely</DockerfileTag>
@ -23,28 +23,29 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MailKit" Version="2.14.0" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="5.0.8" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.8" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="5.0.8" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="5.0.8" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.8" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.8" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.8">
<PackageReference Include="MailKit" Version="2.15.0" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.EventLog" Version="5.0.0" />
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="4.3.5">
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.EventLog" Version="6.0.0" />
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="4.5.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.13" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.2" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.14.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.0" />
<PackageReference Include="Microsoft.Web.LibraryManager.Build" Version="2.1.113" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="5.0.7" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.1.5" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
</ItemGroup>
<ItemGroup>

File diff suppressed because it is too large Load Diff

View File

@ -49,34 +49,22 @@ namespace Remotely.Server
var dbProvider = Configuration["ApplicationOptions:DBProvider"].ToLower();
if (dbProvider == "sqlite")
{
services.AddDbContextFactory<SqliteDbContext>(options =>
services.AddDbContext<AppDb, SqliteDbContext>(options =>
{
options.UseSqlite(Configuration.GetConnectionString("SQLite"));
});
services.AddScoped<IDbContextFactory<AppDb>>(p =>
p.GetRequiredService<IDbContextFactory<SqliteDbContext>>());
services.AddScoped<AppDb, SqliteDbContext>(p =>
p.GetRequiredService<IDbContextFactory<SqliteDbContext>>().CreateDbContext());
}
else if (dbProvider == "sqlserver")
{
services.AddDbContextFactory<SqlServerDbContext>(options =>
services.AddDbContext<AppDb, SqlServerDbContext>(options =>
{
options.UseSqlServer(Configuration.GetConnectionString("SQLServer"));
});
services.AddScoped<IDbContextFactory<AppDb>>(p =>
p.GetRequiredService<IDbContextFactory<SqlServerDbContext>>());
services.AddScoped<AppDb, SqlServerDbContext>(p =>
p.GetRequiredService<IDbContextFactory<SqlServerDbContext>>().CreateDbContext());
}
else if (dbProvider == "postgresql")
{
services.AddDbContextFactory<PostgreSqlDbContext>(options =>
services.AddDbContext<AppDb, PostgreSqlDbContext>(options =>
{
// Password should be set in User Secrets in dev environment.
// See https://docs.microsoft.com/en-us/aspnet/core/security/app-secrets?view=aspnetcore-3.1
@ -93,12 +81,6 @@ namespace Remotely.Server
options.UseNpgsql(Configuration.GetConnectionString("PostgreSQL"));
}
});
services.AddScoped<IDbContextFactory<AppDb>>(p =>
p.GetRequiredService<IDbContextFactory<PostgreSqlDbContext>>());
services.AddScoped<AppDb, PostgreSqlDbContext>(p =>
p.GetRequiredService<IDbContextFactory<PostgreSqlDbContext>>().CreateDbContext());
}
services.AddIdentity<RemotelyUser, IdentityRole>(options =>

View File

@ -37,19 +37,17 @@
"RemoteControlRequiresAuthentication": true,
"RemoteControlSessionLimit": 3,
"Require2FA": false,
"ServerUrl": "",
"SmtpDisplayName": "",
"SmtpEmail": "",
"SmtpEnableSsl": true,
"SmtpHost": "",
"SmtpLocalDomain": "",
"SmtpCheckCertificateRevocation": true,
"SmtpPassword": "",
"SmtpPort": 587,
"SmtpUserName": "",
"SmtpCheckCertificateRevocation": true,
"Theme": "Dark",
"TrustedCorsOrigins": [],
"UseHsts": false,
"UseWebRtc": true
"UseWebRtc": false
}
}
}

View File

@ -3,7 +3,7 @@
"defaultProvider": "cdnjs",
"libraries": [
{
"library": "microsoft-signalr@5.0.7",
"library": "microsoft-signalr@6.0.0",
"destination": "wwwroot/lib/microsoft-signalr/"
},
{
@ -12,7 +12,7 @@
},
{
"provider": "unpkg",
"library": "@microsoft/signalr-protocol-msgpack@5.0.7",
"library": "@microsoft/signalr-protocol-msgpack@6.0.0",
"destination": "wwwroot/lib/microsoft/signalr-protocol-msgpack/",
"files": [
"dist/browser/signalr-protocol-msgpack.js",

View File

@ -22,7 +22,7 @@ do
done
pacman -Sy
pacman -S dotnet-runtime-5.0 --noconfirm
pacman -S dotnet-runtime-6.0 --noconfirm
pacman -S libx11 --noconfirm
pacman -S unzip --noconfirm
pacman -S libc6 --noconfirm

View File

@ -28,7 +28,7 @@ dpkg -i packages-microsoft-prod.deb
apt-get update
apt-get -y install apt-transport-https
apt-get update
apt-get -y install dotnet-runtime-5.0
apt-get -y install dotnet-runtime-6.0
rm packages-microsoft-prod.deb
apt-get -y install libx11-dev

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -106,13 +106,15 @@ export class MessageSender {
return ViewerApp.RtcSession.DataChannel && ViewerApp.RtcSession.DataChannel.readyState == "open";
}
SendToAgent(rtcSend, websocketSend) {
var _a;
if (ViewerApp.RtcSession.DataChannel && ViewerApp.RtcSession.DataChannel.readyState == "open") {
rtcSend();
}
else if ((_a = ViewerApp.ViewerHubConnection.Connection) === null || _a === void 0 ? void 0 : _a.connectionStarted) {
else if (ViewerApp.ViewerHubConnection.Connection) {
websocketSend();
}
else {
console.warn("No connection available.");
}
}
async SendToAgentAsync(rtcSend, websocketSend) {
if (this.IsWebRtcAvailable()) {

File diff suppressed because one or more lines are too long

View File

@ -158,9 +158,12 @@ export class MessageSender {
if (ViewerApp.RtcSession.DataChannel && ViewerApp.RtcSession.DataChannel.readyState == "open") {
rtcSend();
}
else if (ViewerApp.ViewerHubConnection.Connection?.connectionStarted) {
else if (ViewerApp.ViewerHubConnection.Connection) {
websocketSend();
}
else {
console.warn("No connection available.");
}
}
private async SendToAgentAsync(rtcSend: () => Promise<any>, websocketSend: () => Promise<any>) {

View File

@ -1,7 +1,7 @@
export type HubConnection = {
start: () => Promise<any>;
onclose: (callback: () => any) => any;
connectionStarted: boolean;
closedCallbacks: any[];
invoke: (...rest) => any;
stop: () => any;
}

View File

@ -28,7 +28,7 @@ export class RtcSession {
UI.VideoScreenViewer.setAttribute("hidden", "hidden");
};
this.DataChannel.onerror = (ev) => {
console.log("Data channel error.", ev.error);
console.log("Data channel error.", ev);
UI.ConnectionP2PIcon.style.display = "none";
UI.ConnectionRelayedIcon.style.display = "unset";
UI.StreamVideoButton.setAttribute("hidden", "hidden");

View File

@ -1 +1 @@
{"version":3,"file":"RtcSession.js","sourceRoot":"","sources":["RtcSession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAGrC,MAAM,OAAO,UAAU;IAAvB;QAGI,gBAAW,GAAQ,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC;IA6F5C,CAAC;IA5FG,IAAI,CAAC,UAA4B;QAE7B,IAAI,CAAC,cAAc,GAAG,IAAI,iBAAiB,CAAC;YACxC,UAAU,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;gBAC3B,OAAO;oBACH,IAAI,EAAE,CAAC,CAAC,GAAG;oBACX,QAAQ,EAAE,CAAC,CAAC,YAAY;oBACxB,UAAU,EAAE,CAAC,CAAC,YAAY;oBAC1B,cAAc,EAAE,UAAU;iBAC7B,CAAA;YACL,CAAC,CAAC;SACL,CAAC,CAAC;QAEH,IAAI,CAAC,cAAc,CAAC,aAAa,GAAG,CAAC,EAAE,EAAE,EAAE;YACvC,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;YACtC,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC,OAAO,CAAC;YAC9B,IAAI,CAAC,WAAW,CAAC,UAAU,GAAG,aAAa,CAAC;YAC5C,IAAI,CAAC,WAAW,CAAC,OAAO,GAAG,CAAC,EAAE,EAAE,EAAE;gBAC9B,OAAO,CAAC,G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AK,CAAC,gBAAgB,CAAC,SAA0B;QAC7C,MAAM,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;QACrD,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IACtC,CAAC;IAED,OAAO,CAAC,GAAQ;QACZ,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IACxD,CAAC;CACJ"}

View File

@ -34,7 +34,7 @@ export class RtcSession {
UI.VideoScreenViewer.setAttribute("hidden", "hidden");
};
this.DataChannel.onerror = (ev) => {
console.log("Data channel error.", ev.error);
console.log("Data channel error.", ev);
UI.ConnectionP2PIcon.style.display = "none";
UI.ConnectionRelayedIcon.style.display = "unset";

View File

@ -23,7 +23,7 @@ export class ViewerHubConnection {
UI.StatusMessage.innerHTML = `Connection error: ${err.message}`;
UI.ToggleConnectUI(true);
});
this.Connection.closedCallbacks.push((ev) => {
this.Connection.onclose(() => {
UI.ToggleConnectUI(true);
});
ViewerApp.ClipboardWatcher.WatchClipboard();

View File

@ -1 +1 @@
{"version":3,"file":"ViewerHubConnection.js","sourceRoot":"","sources":["ViewerHubConnection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAGrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAMtC,IAAI,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AAEhC,MAAM,OAAO,mBAAmB;IAAhC;QAEI,gBAAW,GAAQ,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC;QACxC,yBAAoB,GAAiB,EAAE,CAAC;IAqI5C,CAAC;IAlIG,OAAO;QACH,IAAI,CAAC,UAAU,GAAG,IAAI,OAAO,CAAC,oBA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CAAC,EAAE,CAAC,sBAAsB,EAAE,GAAG,EAAE;YAC1C,WAAW,CAAC,8BAA8B,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;QAGH,aAAa,CAAC,EAAE,CAAC,iBAAiB,EAAE,KAAK,EAAE,GAAW,EAAE,UAA4B,EAAE,EAAE;YACpF,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;YACvC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YACtC,MAAM,SAAS,CAAC,UAAU,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;QAEpD,CAAC,CAAC,CAAC;QACH,aAAa,CAAC,EAAE,CAAC,qBAAqB,EAAE,CAAC,SAAiB,EAAE,aAAqB,EAAE,MAAc,EAAE,EAAE;YACjG,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;YACvC,SAAS,CAAC,UAAU,CAAC,gBAAgB,CAAC;gBAClC,SAAS,EAAE,SAAS;gBACpB,aAAa,EAAE,aAAa;gBAC5B,MAAM,EAAE,MAAM;aACV,CAAC,CAAC;QACd,CAAC,CAAC,CAAC;QACH,aAAa,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC,OAAe,EAAE,EAAE;YAChD,WAAW,CAAC,OAAO,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC;QACH,aAAa,CAAC,EAAE,CAAC,iBAAiB,EAAE,CAAC,eAAsC,EAAE,EAAE;YAC3E,EAAE,CAAC,qBAAqB,CAAC,eAAe,CAAC,CAAC;QAC9C,CAAC,CAAC,CAAC;IACP,CAAC;CACJ"}

View File

@ -35,7 +35,8 @@ export class ViewerHubConnection {
UI.StatusMessage.innerHTML = `Connection error: ${err.message}`;
UI.ToggleConnectUI(true);
});
this.Connection.closedCallbacks.push((ev) => {
this.Connection.onclose(() => {
UI.ToggleConnectUI(true);
});

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<AssemblyName>Remotely_Shared</AssemblyName>
<Platforms>AnyCPU;x64;x86</Platforms>
@ -10,10 +10,10 @@
<ItemGroup>
<PackageReference Include="ConcurrentList" Version="1.4.0" />
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="5.0.8" />
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="6.0.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.Security.Principal.Windows" Version="5.0.0" />
<PackageReference Include="System.Text.Json" Version="5.0.2" />
<PackageReference Include="System.Text.Json" Version="6.0.0" />
</ItemGroup>
<ItemGroup>

View File

@ -2,13 +2,13 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0-windows</TargetFramework>
<TargetFramework>net6.0-windows</TargetFramework>
<AssemblyName>Remotely.Tests.LoadTester</AssemblyName>
<RootNamespace>Remotely.Tests.LoadTester</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="5.0.8" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="6.0.0" />
</ItemGroup>
<ItemGroup>

View File

@ -3,7 +3,9 @@ using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Primitives;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Remotely.Agent.Interfaces;
using Remotely.Agent.Services;
@ -13,6 +15,8 @@ using Remotely.Server.Services;
using Remotely.Shared.Models;
using Remotely.Shared.Utilities;
using System;
using System.Collections.Generic;
using System.Configuration;
namespace Remotely.Tests
{
@ -28,7 +32,14 @@ namespace Remotely.Tests
{
builder = WebHost.CreateDefaultBuilder()
.UseStartup<Startup>()
.CaptureStartupErrors(true);
.CaptureStartupErrors(true)
.ConfigureAppConfiguration(config =>
{
config.AddInMemoryCollection(new Dictionary<string, string>()
{
["ApplicationOptions:DBProvider"] = "InMemory"
});
});
builder.Build();
}
@ -46,13 +57,7 @@ namespace Remotely.Tests
{
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContextFactory<AppDb>(options =>
{
options.UseInMemoryDatabase("Remotely");
});
services.AddScoped(p =>
p.GetRequiredService<IDbContextFactory<AppDb>>().CreateDbContext());
services.AddDbContext<AppDb, TestingDbContext>();
services.AddIdentity<RemotelyUser, IdentityRole>(options => options.Stores.MaxLengthForKeys = 128)
.AddEntityFrameworkStores<AppDb>()
@ -80,5 +85,4 @@ namespace Remotely.Tests
}
}
}

View File

@ -65,6 +65,11 @@ namespace Remotely.Tests
dbContext.DeviceGroups.RemoveRange(dbContext.DeviceGroups.ToList());
dbContext.Users.RemoveRange(dbContext.Users.ToList());
dbContext.Organizations.RemoveRange(dbContext.Organizations.ToList());
dbContext.Alerts.RemoveRange(dbContext.Alerts.ToList());
dbContext.ScriptResults.RemoveRange(dbContext.ScriptResults.ToList());
dbContext.ScriptRuns.RemoveRange(dbContext.ScriptRuns.ToList());
dbContext.ScriptSchedules.RemoveRange(dbContext.ScriptSchedules.ToList());
dbContext.SavedScripts.RemoveRange(dbContext.SavedScripts.ToList());
dbContext.SaveChanges();
}

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0-windows</TargetFramework>
<TargetFramework>net6.0-windows</TargetFramework>
<IsPackable>false</IsPackable>
@ -23,12 +23,12 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.8" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="5.0.8" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="Moq" Version="4.16.1" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.5" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.5" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.8" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.8" />
</ItemGroup>
<ItemGroup>

View File

@ -107,25 +107,25 @@ else {
# Clear publish folders.
if ((Test-Path -Path "$Root\Agent\bin\Release\net5.0\win10-x64\publish") -eq $true) {
Get-ChildItem -Path "$Root\Agent\bin\Release\net5.0\win10-x64\publish" | Remove-Item -Force -Recurse
if ((Test-Path -Path "$Root\Agent\bin\Release\net6.0\win10-x64\publish") -eq $true) {
Get-ChildItem -Path "$Root\Agent\bin\Release\net6.0\win10-x64\publish" | Remove-Item -Force -Recurse
}
if ((Test-Path -Path "$Root\Agent\bin\Release\net5.0\win10-x86\publish" ) -eq $true) {
Get-ChildItem -Path "$Root\Agent\bin\Release\net5.0\win10-x86\publish" | Remove-Item -Force -Recurse
if ((Test-Path -Path "$Root\Agent\bin\Release\net6.0\win10-x86\publish" ) -eq $true) {
Get-ChildItem -Path "$Root\Agent\bin\Release\net6.0\win10-x86\publish" | Remove-Item -Force -Recurse
}
if ((Test-Path -Path "$Root\Agent\bin\Release\net5.0\linux-x64\publish") -eq $true) {
Get-ChildItem -Path "$Root\Agent\bin\Release\net5.0\linux-x64\publish" | Remove-Item -Force -Recurse
if ((Test-Path -Path "$Root\Agent\bin\Release\net6.0\linux-x64\publish") -eq $true) {
Get-ChildItem -Path "$Root\Agent\bin\Release\net6.0\linux-x64\publish" | Remove-Item -Force -Recurse
}
# Publish Core clients.
dotnet publish /p:Version=$CurrentVersion /p:FileVersion=$CurrentVersion --runtime win10-x64 --configuration Release --output "$Root\Agent\bin\Release\net5.0\win10-x64\publish" "$Root\Agent"
dotnet publish /p:Version=$CurrentVersion /p:FileVersion=$CurrentVersion --runtime linux-x64 --configuration Release --output "$Root\Agent\bin\Release\net5.0\linux-x64\publish" "$Root\Agent"
dotnet publish /p:Version=$CurrentVersion /p:FileVersion=$CurrentVersion --runtime win10-x86 --configuration Release --output "$Root\Agent\bin\Release\net5.0\win10-x86\publish" "$Root\Agent"
dotnet publish /p:Version=$CurrentVersion /p:FileVersion=$CurrentVersion --runtime win10-x64 --self-contained --configuration Release --output "$Root\Agent\bin\Release\net6.0\win10-x64\publish" "$Root\Agent"
dotnet publish /p:Version=$CurrentVersion /p:FileVersion=$CurrentVersion --runtime linux-x64 --self-contained --configuration Release --output "$Root\Agent\bin\Release\net6.0\linux-x64\publish" "$Root\Agent"
dotnet publish /p:Version=$CurrentVersion /p:FileVersion=$CurrentVersion --runtime win10-x86 --self-contained --configuration Release --output "$Root\Agent\bin\Release\net6.0\win10-x86\publish" "$Root\Agent"
New-Item -Path "$Root\Agent\bin\Release\net5.0\win10-x64\publish\Desktop\" -ItemType Directory -Force
New-Item -Path "$Root\Agent\bin\Release\net5.0\win10-x86\publish\Desktop\" -ItemType Directory -Force
New-Item -Path "$Root\Agent\bin\Release\net5.0\linux-x64\publish\Desktop\" -ItemType Directory -Force
New-Item -Path "$Root\Agent\bin\Release\net6.0\win10-x64\publish\Desktop\" -ItemType Directory -Force
New-Item -Path "$Root\Agent\bin\Release\net6.0\win10-x86\publish\Desktop\" -ItemType Directory -Force
New-Item -Path "$Root\Agent\bin\Release\net6.0\linux-x64\publish\Desktop\" -ItemType Directory -Force
# Publish Linux ScreenCaster
@ -168,21 +168,21 @@ if ($SignAssemblies) {
}
# Compress Core clients.
$PublishDir = "$Root\Agent\bin\Release\net5.0\win10-x64\publish"
$PublishDir = "$Root\Agent\bin\Release\net6.0\win10-x64\publish"
Compress-Archive -Path "$PublishDir\*" -DestinationPath "$PublishDir\Remotely-Win10-x64.zip" -Force
while ((Test-Path -Path "$PublishDir\Remotely-Win10-x64.zip") -eq $false){
Start-Sleep -Seconds 1
}
Move-Item -Path "$PublishDir\Remotely-Win10-x64.zip" -Destination "$Root\Server\wwwroot\Content\Remotely-Win10-x64.zip" -Force
$PublishDir = "$Root\Agent\bin\Release\net5.0\win10-x86\publish"
$PublishDir = "$Root\Agent\bin\Release\net6.0\win10-x86\publish"
Compress-Archive -Path "$PublishDir\*" -DestinationPath "$PublishDir\Remotely-Win10-x86.zip" -Force
while ((Test-Path -Path "$PublishDir\Remotely-Win10-x86.zip") -eq $false){
Start-Sleep -Seconds 1
}
Move-Item -Path "$PublishDir\Remotely-Win10-x86.zip" -Destination "$Root\Server\wwwroot\Content\Remotely-Win10-x86.zip" -Force
$PublishDir = "$Root\Agent\bin\Release\net5.0\linux-x64\publish"
$PublishDir = "$Root\Agent\bin\Release\net6.0\linux-x64\publish"
Compress-Archive -Path "$PublishDir\*" -DestinationPath "$PublishDir\Remotely-Linux.zip" -Force
while ((Test-Path -Path "$PublishDir\Remotely-Linux.zip") -eq $false){
Start-Sleep -Seconds 1
@ -196,7 +196,7 @@ if ($RID.Length -gt 0 -and $OutDir.Length -gt 0) {
New-Item -Path $OutDir -ItemType Directory
}
dotnet publish /p:Version=$CurrentVersion /p:FileVersion=$CurrentVersion --runtime $RID --configuration Release --output $OutDir "$Root\Server\"
dotnet publish /p:Version=$CurrentVersion /p:FileVersion=$CurrentVersion --runtime $RID --self-contained --configuration Release --output $OutDir "$Root\Server\"
}
else {
Write-Host "`nSkipping server deployment. Params -outdir and -rid not specified." -ForegroundColor DarkYellow