-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #894 from immense/insufficient-branch-name
Assortment of updates.
- Loading branch information
Showing
40 changed files
with
734 additions
and
252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
[ | ||
{ | ||
"Name": "Agent \u002B Server \u002B Desktop", | ||
"Projects": [ | ||
{ | ||
"Path": "Agent\\Agent.csproj", | ||
"Action": "Start", | ||
"DebugTarget": "Agent" | ||
}, | ||
{ | ||
"Path": "Desktop.Win\\Desktop.Win.csproj", | ||
"Action": "Start", | ||
"DebugTarget": "Desktop.Win" | ||
}, | ||
{ | ||
"Path": "Server\\Server.csproj", | ||
"Action": "Start", | ||
"DebugTarget": "Server" | ||
} | ||
] | ||
}, | ||
{ | ||
"Name": "Agent \u002B Server", | ||
"Projects": [ | ||
{ | ||
"Path": "Agent\\Agent.csproj", | ||
"Action": "Start", | ||
"DebugTarget": "Agent" | ||
}, | ||
{ | ||
"Path": "Server\\Server.csproj", | ||
"Action": "Start", | ||
"DebugTarget": "Server" | ||
} | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
using Remotely.Server.Services; | ||
using Remotely.Shared.Models; | ||
using Remotely.Shared.Services; | ||
|
||
namespace Remotely.Server.API; | ||
|
||
[Route("api/custom-binaries")] | ||
[ApiController] | ||
public class CustomBinariesController( | ||
IDataService _dataService, | ||
IWebHostEnvironment _hostingEnvironment, | ||
IEmbeddedServerDataProvider _embeddedData) : ControllerBase | ||
{ | ||
[HttpGet("win-x86/desktop/{organizationId}")] | ||
public async Task<IActionResult> GetWinX86Desktop(string organizationId) | ||
{ | ||
var embeddedData = await GetEmbeddedData(organizationId); | ||
var filePath = Path.Combine(_hostingEnvironment.ContentRootPath, "AppData", "Win-x86", "Remotely_Desktop.exe"); | ||
var fileName = _embeddedData.GetEncodedFileName(filePath, embeddedData); | ||
var rs = System.IO.File.Open(filePath, FileMode.Open, FileAccess.Read, FileShare.Read); | ||
return File(rs, "application/octet-stream", fileName); | ||
} | ||
|
||
[HttpGet("win-x64/desktop/{organizationId}")] | ||
public async Task<IActionResult> GetWinX64Desktop(string organizationId) | ||
{ | ||
var embeddedData = await GetEmbeddedData(organizationId); | ||
var filePath = Path.Combine(_hostingEnvironment.ContentRootPath, "AppData", "Win-x64", "Remotely_Desktop.exe"); | ||
var fileName = _embeddedData.GetEncodedFileName(filePath, embeddedData); | ||
var rs = System.IO.File.Open(filePath, FileMode.Open, FileAccess.Read, FileShare.Read); | ||
return File(rs, "application/octet-stream", fileName); | ||
} | ||
|
||
private async Task<EmbeddedServerData> GetEmbeddedData(string? organizationId) | ||
{ | ||
var defaultOrg = await _dataService.GetDefaultOrganization(); | ||
|
||
// The default org will be used if unspecified, so might as well save the | ||
// space in the file name. | ||
if (defaultOrg.IsSuccess && | ||
defaultOrg.Value.ID.Equals(organizationId, StringComparison.OrdinalIgnoreCase)) | ||
{ | ||
organizationId = null; | ||
} | ||
|
||
var settings = await _dataService.GetSettings(); | ||
var effectiveScheme = settings.ForceClientHttps ? "https" : Request.Scheme; | ||
var serverUrl = $"{effectiveScheme}://{Request.Host}"; | ||
return new EmbeddedServerData(new Uri(serverUrl), organizationId); | ||
} | ||
} |
Oops, something went wrong.