Skip to content

Commit 819f4f9

Browse files
Jared GoodwinJared Goodwin
Jared Goodwin
authored and
Jared Goodwin
committed
Merged PR 5: Replace Server UI with Blazor
1 parent 292b3ff commit 819f4f9

File tree

523 files changed

+22200
-129899
lines changed

Some content is hidden

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

523 files changed

+22200
-129899
lines changed

.dockerignore

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
**/.classpath
2+
**/.dockerignore
3+
**/.env
4+
**/.git
5+
**/.gitignore
6+
**/.project
7+
**/.settings
8+
**/.toolstarget
9+
**/.vs
10+
**/.vscode
11+
**/*.*proj.user
12+
**/*.dbmdl
13+
**/*.jfm
14+
**/azds.yaml
15+
**/bin
16+
**/charts
17+
**/docker-compose*
18+
**/Dockerfile*
19+
**/node_modules
20+
**/npm-debug.log
21+
**/obj
22+
**/secrets.dev.yaml
23+
**/values.dev.yaml
24+
LICENSE
25+
README.md

.github/workflows/build.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# changes. On the GitHub page for your repo, you'll see a message that says,
1111
# "This branch is ## commits behind lucent-sea:master."
1212
#
13-
# Click the "Pull request link next to it."
13+
# Click the "Pull request" link next to it.
1414
#
1515
# On the next page click the "switching the base" link. Now it's pulling from
1616
# my repo into yours. Create and complete the pull request to update your repo.
@@ -114,6 +114,13 @@ jobs:
114114
shell: powershell
115115
run: |
116116
.\Utilities\Publish.ps1 -CertificatePath "$env:GITHUB_WORKSPACE\GitHubActionsWorkflow.pfx" -CertificatePassword $env:PfxKey -Hostname $env:SiteUrl -CurrentVersion $env:CurrentVersion -RID linux-x64 -OutDir "$env:GITHUB_WORKSPACE\publish"
117+
118+
- name: Copy server install scripts
119+
shell: powershell
120+
run: |
121+
Copy-Item -Path ".\Utilities\Ubuntu_Server_Install.sh" -Destination ".\publish\Ubuntu_Server_Install.sh" -Force
122+
Copy-Item -Path ".\Utilities\CentOS_Server_Install.sh" -Destination ".\publish\CentOS_Server_Install.sh" -Force
123+
Copy-Item -Path ".\Utilities\Install-RemotelyServer.ps1" -Destination ".\publish\Install-RemotelyServer.ps1" -Force
117124
118125
# Upload build artifact to be deployed from Ubuntu runner
119126
- name: Upload build artifact

.gitignore

+9-6
Original file line numberDiff line numberDiff line change
@@ -260,25 +260,28 @@ paket-files/
260260
__pycache__/
261261
*.pyc
262262

263-
/Server/wwwroot/Downloads/*.exe
264-
/Server/wwwroot/Downloads/*.zip
265-
/Server/wwwroot/Downloads/*.appimage
266263
/Server/Server.db
267264
/Server/Recordings/*
268265
/Server/ffmpeg.exe
269266
/Server/Properties/PublishProfiles
270267
*.msi
271-
/Server/wwwroot/Downloads/WinDesktop/*
272268
/Server/CurrentVersion.txt
273269
/Server/Server.db-shm
274270
/Server/Server.db-wal
271+
/Server/wwwroot/Downloads/*.exe
272+
/Server/wwwroot/Downloads/*.zip
273+
/Server/wwwroot/Downloads/*.appimage
275274
/Server/wwwroot/Downloads/Remotely_Desktop
276275
Server/wwwroot/Downloads/Win-x64/*
277276
Server/wwwroot/Downloads/Win-x86/*
278-
/ScreenCast.Win/Properties/launchSettings.json
277+
/Server/wwwroot/Content/Remotely_Desktop
278+
Server/wwwroot/Content/Win-x64/*
279+
Server/wwwroot/Content/Win-x86/*
280+
/Server/wwwroot/Content/*.exe
281+
/Server/wwwroot/Content/*.zip
282+
/Server/wwwroot/Content/*.appimage
279283
/Server/ScaffoldingReadMe.txt
280284
/Server/Remotely.db
281-
/Desktop.Win.Wrapper/Remotely_Desktop.zip
282285
/Server/Remotely.db-wal
283286
/Server/Remotely.db-shm
284287
/Server/wwwroot/out.js

Agent.Installer.Win/Agent.Installer.Win.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@
203203
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
204204
<PropertyGroup>
205205
<PostBuildEvent>if $(ConfigurationName) == Debug (
206-
xcopy "$(TargetPath)" "$(SolutionDir)Server\wwwroot\Downloads\" /y /e /i
206+
xcopy "$(TargetPath)" "$(SolutionDir)Server\wwwroot\Content\" /y /e /i
207207
)</PostBuildEvent>
208208
</PropertyGroup>
209209
</Project>

Agent.Installer.Win/MainWindow.xaml

+49-21
Original file line numberDiff line numberDiff line change
@@ -56,35 +56,63 @@
5656
<RowDefinition/>
5757
</Grid.RowDefinitions>
5858

59-
<TextBlock Grid.Column="0" Grid.Row="0" Margin="0,0,15,0" FontSize="14">
60-
<Run>Server URL:</Run>
61-
<Run Text="&#xE897;"
59+
<StackPanel Orientation="Horizontal" Grid.Column="0" Grid.Row="0">
60+
<TextBlock FontSize="14">Server URL:</TextBlock>
61+
62+
<Button Grid.Column="1" Grid.Row="0"
63+
Background="White"
64+
FontSize="14"
65+
Margin="5,0"
66+
BorderThickness="0"
67+
Padding="3"
68+
Cursor="Hand"
69+
Click="ShowServerUrlHelp">
70+
<TextBlock Text="&#xE897;"
6271
FontWeight="Bold"
6372
FontFamily="Segoe MDL2 Assets"
64-
Cursor="Hand"
65-
ToolTip="This is the URL of the server that your device will connect to after Remotely is installed."></Run>
66-
</TextBlock>
73+
PreviewMouseUp="ShowServerUrlHelp"></TextBlock>
74+
</Button>
75+
</StackPanel>
76+
77+
6778
<TextBox Grid.Column="1" Grid.Row="0" TextWrapping="Wrap" Text="{Binding ServerUrl}" FontSize="14" />
6879

69-
<TextBlock Grid.Column="0" Grid.Row="2" Margin="0,0,15,0" FontSize="14">
70-
<Run>Organization ID:</Run>
71-
<Run Text="&#xE897;"
80+
<StackPanel Orientation="Horizontal" Grid.Column="0" Grid.Row="2">
81+
<TextBlock FontSize="14">Organization ID</TextBlock>
82+
83+
<Button Grid.Column="1" Grid.Row="0"
84+
Background="White"
85+
FontSize="14"
86+
Margin="5,0"
87+
BorderThickness="0"
88+
Padding="3"
89+
Cursor="Hand"
90+
Click="ShowOrganizationIdHelp">
91+
<TextBlock Text="&#xE897;"
7292
FontWeight="Bold"
73-
FontFamily="Segoe MDL2 Assets"
74-
Cursor="Hand"
75-
ToolTip="Enter the organization ID that will have access to this device."></Run>
76-
</TextBlock>
93+
FontFamily="Segoe MDL2 Assets"></TextBlock>
94+
</Button>
95+
</StackPanel>
96+
7797
<TextBox Grid.Column="1" Grid.Row="2" TextWrapping="Wrap" Text="{Binding OrganizationID}" FontSize="14" />
7898

79-
<TextBlock Grid.Column="0" Grid.Row="4" Margin="0,0,15,0" FontSize="14">
80-
<Run>Support Shortcut:</Run>
81-
<Run Text="&#xE897;"
99+
<StackPanel Orientation="Horizontal" Grid.Column="0" Grid.Row="4">
100+
<TextBlock FontSize="14">Support Shortcut</TextBlock>
101+
102+
<Button Grid.Column="1" Grid.Row="0"
103+
Background="White"
104+
FontSize="14"
105+
Margin="5,0"
106+
BorderThickness="0"
107+
Padding="3"
108+
Cursor="Hand"
109+
Click="ShowSupportShortcutHelp">
110+
<TextBlock Text="&#xE897;"
82111
FontWeight="Bold"
83-
FontFamily="Segoe MDL2 Assets"
84-
Cursor="Hand"
85-
ToolTip="Create a desktop shortcut to the Get Support page for this device."></Run>
86-
</TextBlock>
87-
<CheckBox Grid.Column="1" Grid.Row="4" IsChecked="{Binding CreateSupportShortcut}" />
112+
FontFamily="Segoe MDL2 Assets"></TextBlock>
113+
</Button>
114+
</StackPanel>
115+
<CheckBox Grid.Column="1" Grid.Row="4" VerticalAlignment="Center" IsChecked="{Binding CreateSupportShortcut}" />
88116

89117
</Grid>
90118

Agent.Installer.Win/MainWindow.xaml.cs

+30
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
using Remotely.Agent.Installer.Win.Utilities;
22
using Remotely.Agent.Installer.Win.ViewModels;
3+
using System;
34
using System.Windows;
5+
using System.Windows.Documents;
46
using System.Windows.Input;
57

68
namespace Remotely.Agent.Installer.Win
@@ -40,5 +42,33 @@ private void MinimizeButton_Click(object sender, RoutedEventArgs e)
4042
{
4143
this.WindowState = WindowState.Minimized;
4244
}
45+
46+
private void ShowServerUrlHelp(object sender, RoutedEventArgs e)
47+
{
48+
MessageBox.Show(
49+
"This is the URL of the Remotely server that you're hosting. The device will connect to this URL.",
50+
"Server URL",
51+
MessageBoxButton.OK,
52+
MessageBoxImage.Information);
53+
}
54+
55+
private void ShowOrganizationIdHelp(object sender, RoutedEventArgs e)
56+
{
57+
MessageBox.Show(
58+
"This is your organization ID on the Remotely server. Since Remotely supports multi-tenancy, " +
59+
"this ID needs to be provided to determine who should have access."
60+
+ Environment.NewLine + Environment.NewLine +
61+
"You can find this ID on the Organization tab on the web app.",
62+
"Organization ID",
63+
MessageBoxButton.OK,
64+
MessageBoxImage.Information);
65+
}
66+
private void ShowSupportShortcutHelp(object sender, RoutedEventArgs e)
67+
{
68+
MessageBox.Show("If selected, the installer will create a desktop shortcut to the Get Support page for this device.",
69+
"Support Shortcut",
70+
MessageBoxButton.OK,
71+
MessageBoxImage.Information);
72+
}
4373
}
4474
}

Agent.Installer.Win/Services/InstallerService.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ private async Task DownloadRemotelyAgent(string serverUrl)
268268
ProgressValueChanged?.Invoke(this, args.ProgressPercentage);
269269
};
270270

271-
await client.DownloadFileTaskAsync($"{serverUrl}/Downloads/Remotely-Win10-{Platform}.zip", targetFile);
271+
await client.DownloadFileTaskAsync($"{serverUrl}/Content/Remotely-Win10-{Platform}.zip", targetFile);
272272
}
273273
}
274274

@@ -287,7 +287,7 @@ private async Task DownloadRemotelyAgent(string serverUrl)
287287
await Task.Delay(10);
288288
}
289289

290-
var wr = WebRequest.CreateHttp($"{serverUrl}/Downloads/Remotely-Win10-{Platform}.zip");
290+
var wr = WebRequest.CreateHttp($"{serverUrl}/Content/Remotely-Win10-{Platform}.zip");
291291
wr.Method = "Head";
292292
using (var response = (HttpWebResponse)await wr.GetResponseAsync())
293293
{

Agent.Installer.Win/ViewModels/MainWindowViewModel.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ private bool CheckParams()
334334
(serverUri.Scheme != Uri.UriSchemeHttp && serverUri.Scheme != Uri.UriSchemeHttps))
335335
{
336336
Logger.Write("ServerUrl is not valid.");
337-
MessageBoxEx.Show("Server URL must be a valid Uri.", "Invalid Server URL", MessageBoxButton.OK, MessageBoxImage.Error);
337+
MessageBoxEx.Show("Server URL must be a valid Uri (e.g. https://app.remotely.one).", "Invalid Server URL", MessageBoxButton.OK, MessageBoxImage.Error);
338338
return false;
339339
}
340340

Agent/Agent.csproj

-5
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,7 @@
2828
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="5.0.0" />
2929
<PackageReference Include="Microsoft.Extensions.Logging.EventLog" Version="5.0.0" />
3030
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="5.0.4" />
31-
<PackageReference Include="Microsoft.PowerShell.Commands.Diagnostics" Version="7.1.3" />
32-
<PackageReference Include="Microsoft.PowerShell.Commands.Management" Version="7.1.3" />
33-
<PackageReference Include="Microsoft.PowerShell.Commands.Utility" Version="7.1.3" />
34-
<PackageReference Include="Microsoft.PowerShell.CoreCLR.Eventing" Version="7.1.3" />
3531
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.1.3" />
36-
<PackageReference Include="Microsoft.PowerShell.Security" Version="7.1.3" />
3732
<PackageReference Include="Microsoft.WSMan.Management" Version="7.1.3" />
3833
<PackageReference Include="Microsoft.WSMan.Runtime" Version="7.1.3" />
3934
<PackageReference Include="System.Management.Automation" Version="7.1.3" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using Remotely.Shared.Models;
2+
using Remotely.Shared.Utilities;
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Linq;
6+
using System.Management.Automation;
7+
using System.Text;
8+
using System.Threading.Tasks;
9+
10+
namespace Remotely.Agent.Extensions
11+
{
12+
public static class PowerShellCompletionExtensions
13+
{
14+
public static PwshCommandCompletion ToPwshCompletion(this CommandCompletion completion)
15+
{
16+
return new PwshCommandCompletion()
17+
{
18+
CurrentMatchIndex = completion.CurrentMatchIndex,
19+
ReplacementIndex = completion.ReplacementIndex,
20+
ReplacementLength = completion.ReplacementLength,
21+
CompletionMatches = completion.CompletionMatches
22+
.Select(x => new PwshCompletionResult(x.CompletionText,
23+
x.ListItemText,
24+
EnumMapper.ToEnum<PwshCompletionResultType, CompletionResultType>(x.ResultType),
25+
x.ToolTip))
26+
.ToList()
27+
};
28+
29+
}
30+
}
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using Remotely.Shared.Models;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
8+
namespace Remotely.Agent.Interfaces
9+
{
10+
public interface IDeviceInformationService
11+
{
12+
Task<Device> CreateDevice(string deviceId, string orgId);
13+
Device GetDeviceBase(string deviceID, string orgID);
14+
(double usedStorage, double totalStorage) GetSystemDriveInfo();
15+
(double usedGB, double totalGB) GetMemoryInGB();
16+
string GetAgentVersion();
17+
List<Drive> GetAllDrives();
18+
Task<double> GetCpuUtilization();
19+
}
20+
}

Agent/Program.cs

+4-5
Original file line numberDiff line numberDiff line change
@@ -47,24 +47,23 @@ private static void BuildServices()
4747
});
4848
serviceCollection.AddSingleton<AgentSocket>();
4949
serviceCollection.AddScoped<ChatClientService>();
50-
serviceCollection.AddTransient<Bash>();
51-
serviceCollection.AddTransient<CMD>();
5250
serviceCollection.AddTransient<PSCore>();
53-
serviceCollection.AddTransient<WindowsPS>();
51+
serviceCollection.AddTransient<ExternalScriptingShell>();
5452
serviceCollection.AddScoped<ConfigService>();
5553
serviceCollection.AddScoped<Uninstaller>();
56-
serviceCollection.AddScoped<ScriptRunner>();
57-
serviceCollection.AddScoped<CommandExecutor>();
54+
serviceCollection.AddScoped<ScriptExecutor>();
5855

5956
if (EnvironmentHelper.IsWindows)
6057
{
6158
serviceCollection.AddScoped<IAppLauncher, AppLauncherWin>();
6259
serviceCollection.AddSingleton<IUpdater, UpdaterWin>();
60+
serviceCollection.AddSingleton<IDeviceInformationService, DeviceInformationServiceWin>();
6361
}
6462
else if (EnvironmentHelper.IsLinux)
6563
{
6664
serviceCollection.AddScoped<IAppLauncher, AppLauncherLinux>();
6765
serviceCollection.AddSingleton<IUpdater, UpdaterLinux>();
66+
serviceCollection.AddSingleton<IDeviceInformationService, DeviceInformationServiceLinux>();
6867
}
6968
else if (EnvironmentHelper.IsMac)
7069
{

0 commit comments

Comments
 (0)