Skip to content

Commit 1b5bc77

Browse files
committed
Add Server.Installer project.
1 parent ebdbe46 commit 1b5bc77

26 files changed

+1723
-29
lines changed

.editorconfig

+3
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22

33
# CA1416: Validate platform compatibility
44
dotnet_diagnostic.CA1416.severity = none
5+
6+
# CS1591: Missing XML comment for publicly visible type or member
7+
dotnet_diagnostic.CS1591.severity = none

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -289,4 +289,5 @@ Server/wwwroot/Content/Win-x86/*
289289
.vscode/launch.json
290290
.vscode/tasks.json
291291
Server/.config/dotnet-tools.json
292-
/Server/Properties/ServiceDependencies/*
292+
/Server/Properties/ServiceDependencies/*
293+
Server.Installer/Properties/launchSettings.json

Desktop.Linux/ViewModels/MainWindowViewModel.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public async Task Init()
141141
{
142142
try
143143
{
144-
if (Libc.geteuid() != 0)
144+
if (!EnvironmentHelper.IsDebug && Libc.geteuid() != 0)
145145
{
146146
await MessageBox.Show("Please run with sudo.", "Sudo Required", MessageBoxType.OK);
147147
Environment.Exit(0);

README.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Remotely
2-
A remote control and remote scripting solution, built with .NET Core, SignalR Core, and WebRTC.
2+
A remote control and remote scripting solution, built with .NET 5, Blazor, SignalR Core, and WebRTC.
33

44
[![Build Status](https://dev.azure.com/translucency/Remotely/_apis/build/status/Remotely-ReleaseBuild?branchName=master)](https://dev.azure.com/translucency/Remotely/_build/latest?definitionId=17&branchName=master)
55
![GitHub Build](https://github.com/lucent-sea/Remotely/workflows/GitHub%20Build/badge.svg)
@@ -26,29 +26,29 @@ Subreddit: https://www.reddit.com/r/remotely_app/
2626

2727

2828
## Disclaimer
29-
Hosting a Remotely server requires building and running an ASP.NET Core web app behind IIS (Windows), Nginx (Ubuntu), or Caddy Server (any OS). It's expected that the person deploying and maintaining the server is familiar with this process.
29+
Hosting a Remotely server requires running an ASP.NET Core web app behind IIS (Windows), Nginx (Ubuntu), or Caddy Server (any OS). It's expected that the person deploying and maintaining the server is familiar with this process. Since this is a hobby project that I develop in between working full time and raising a family, there simply isn't time available to provide support in this capacity.
3030

31-
It's *highly* encouraged that you get comfortable building and deploying from source. This allows you to hard-code your server's hostname into the desktop client and the installer, which makes for a better experience for the end user. I've tried to make this as easy as possible using the GitHub Actions workflows mentioned below. You can begin using these immediately, or use them as a reference for creating your own customized build process. You can also use Azure Pipelines for free (which I personally use).
31+
## Build Instructions
32+
GitHub Actions allows you to build and deploy Remotely for free from their cloud servers. Since the Windows agent can only be built on Windows, and the Mac agent can only be built on Mac, using a build platform like GitHub Actions or Azure Pipelines is the only reasonable way to build the whole project. The definitions for the build processes are located in `/.github/workflows/` folder.
3233

33-
## Build Instructions (GitHub)
34-
GitHub Actions allows you to build and deploy Remotely for free from their cloud servers. The definitions for the build processes are located in `/.github/workflows/` folder.
34+
I've created a cross-platform command line tool that will leverage the GitHub Actions REST API to build the project and install it on your private server. This process will also embed your server's URL into the clients, so that they won't need to prompt the end user to enter it.
3535

36-
After forking the repo, follow the instructions in the workflow YML file. The easiest workflow to use is the Build.yml worfklow, and I'd recommend starting with that one. It will produce a build artifact (ZIP package) identical to what was on the Releases page, only the clients will have your server URL hard-coded.
37-
38-
### Instructions for using the Build workflow:
36+
### Instructions for using the Remotely_Server_Installer CLI tool:
3937
- Fork the repo if you haven't already.
4038
- If you've already forked the repo, you need to keep your repo updated with mine. This doesn't happen automatically.
39+
- This can be done via the command line if you've cloned your repo locally. Refer to [GitHub's docs](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork) on how to do this. Otherwise, see below for how to do it completely through the GitHub website.
4140
- On the GitHub page for your repo, you'll see a message that says, "This branch is ## commits behind lucent-sea:master".
4241
- Click the "Pull request" link next to it.
4342
- On the next page, click the "switching the base" link. Now it's pulling from my repo into yours.
4443
- Create and complete the pull request to update your repo.
45-
- Now go to the Actions tab.
46-
- Click the "Build" workflow.
47-
- Click "Run workflow".
48-
- Enter the Server URL where your Remotely app will be running (e.g. https://app.remotely.one).
49-
- If you're going to host on Windows, change the Server Runtime Identifier to `win-x64`.
50-
- Click "Run workflow".
51-
- When it's finished, there will be a build artifact for download that contains the server and clients.
44+
- Create a Personal Access Token that the installer will use to authenticate with GitHub.
45+
- Located here: https://github.com/settings/tokens
46+
- Save the PAT when it's displayed. It will only be shown once.
47+
- On your server, download the latest server installer executable (Linux or Windows) from [my releases page](https://github.com/lucent-sea/Remotely/releases).
48+
- Run the app with elevation (e.g. sudo or "Run as admin").
49+
- Follow the prompts to build and install the server.
50+
- Use `--help` argument to see all the command line arguments.
51+
- If values are provided for all arguments, it will run non-interactive.
5252

5353

5454
## Hosting a Server (Windows)

Remotely.sln

+14-3
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Agent", "Agent\Agent.csproj
77
EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utilities", "Utilities", "{2CAC9A2B-1402-465F-83F8-958B4E081CA3}"
99
ProjectSection(SolutionItems) = preProject
10-
Utilities\CentOS_Server_Install.sh = Utilities\CentOS_Server_Install.sh
1110
Utilities\Example_Apache_Config.txt = Utilities\Example_Apache_Config.txt
1211
Example_Nginx_Config.txt = Example_Nginx_Config.txt
1312
Utilities\Get-PSCommands.ps1 = Utilities\Get-PSCommands.ps1
1413
Utilities\Get-WindowsCommands.ps1 = Utilities\Get-WindowsCommands.ps1
15-
Utilities\Install-RemotelyServer.ps1 = Utilities\Install-RemotelyServer.ps1
1614
Utilities\Publish.ps1 = Utilities\Publish.ps1
1715
Utilities\signtool.exe = Utilities\signtool.exe
18-
Utilities\Ubuntu_Server_Install.sh = Utilities\Ubuntu_Server_Install.sh
1916
EndProjectSection
2017
EndProject
2118
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Assets", "Assets", "{D96B47F6-EF3E-4AF6-A1BE-006D531DDBA4}"
@@ -49,6 +46,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
4946
EndProject
5047
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Server", "Server\Server.csproj", "{75EC5DCD-DC76-4799-8623-206B1F73CA95}"
5148
EndProject
49+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Server.Installer", "Server.Installer\Server.Installer.csproj", "{BE7799D6-204C-4D35-83E7-7FB24DEBAE94}"
50+
EndProject
5251
Global
5352
GlobalSection(SolutionConfigurationPlatforms) = preSolution
5453
Debug|Any CPU = Debug|Any CPU
@@ -167,6 +166,18 @@ Global
167166
{75EC5DCD-DC76-4799-8623-206B1F73CA95}.Release|x64.Build.0 = Release|Any CPU
168167
{75EC5DCD-DC76-4799-8623-206B1F73CA95}.Release|x86.ActiveCfg = Release|Any CPU
169168
{75EC5DCD-DC76-4799-8623-206B1F73CA95}.Release|x86.Build.0 = Release|Any CPU
169+
{BE7799D6-204C-4D35-83E7-7FB24DEBAE94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
170+
{BE7799D6-204C-4D35-83E7-7FB24DEBAE94}.Debug|Any CPU.Build.0 = Debug|Any CPU
171+
{BE7799D6-204C-4D35-83E7-7FB24DEBAE94}.Debug|x64.ActiveCfg = Debug|Any CPU
172+
{BE7799D6-204C-4D35-83E7-7FB24DEBAE94}.Debug|x64.Build.0 = Debug|Any CPU
173+
{BE7799D6-204C-4D35-83E7-7FB24DEBAE94}.Debug|x86.ActiveCfg = Debug|Any CPU
174+
{BE7799D6-204C-4D35-83E7-7FB24DEBAE94}.Debug|x86.Build.0 = Debug|Any CPU
175+
{BE7799D6-204C-4D35-83E7-7FB24DEBAE94}.Release|Any CPU.ActiveCfg = Release|Any CPU
176+
{BE7799D6-204C-4D35-83E7-7FB24DEBAE94}.Release|Any CPU.Build.0 = Release|Any CPU
177+
{BE7799D6-204C-4D35-83E7-7FB24DEBAE94}.Release|x64.ActiveCfg = Release|Any CPU
178+
{BE7799D6-204C-4D35-83E7-7FB24DEBAE94}.Release|x64.Build.0 = Release|Any CPU
179+
{BE7799D6-204C-4D35-83E7-7FB24DEBAE94}.Release|x86.ActiveCfg = Release|Any CPU
180+
{BE7799D6-204C-4D35-83E7-7FB24DEBAE94}.Release|x86.Build.0 = Release|Any CPU
170181
EndGlobalSection
171182
GlobalSection(SolutionProperties) = preSolution
172183
HideSolutionNode = FALSE

Server.Installer/Models/CliParams.cs

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace Server.Installer.Models
8+
{
9+
public class CliParams
10+
{
11+
public bool? CreateNew { get; set; }
12+
public string GitHubPat { get; set; }
13+
public string GitHubUsername { get; set; }
14+
public string InstallDirectory { get; set; }
15+
public string Reference { get; set; }
16+
public Uri ServerUrl { get; set; }
17+
public WebServerType? WebServer { get; set; }
18+
}
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace Server.Installer.Models
8+
{
9+
public class ArtifactsResponsePayload
10+
{
11+
public int total_count { get; set; }
12+
public Artifact[] artifacts { get; set; }
13+
}
14+
15+
public class Artifact
16+
{
17+
public int id { get; set; }
18+
public string node_id { get; set; }
19+
public string name { get; set; }
20+
public int size_in_bytes { get; set; }
21+
public string url { get; set; }
22+
public string archive_download_url { get; set; }
23+
public bool expired { get; set; }
24+
public DateTime created_at { get; set; }
25+
public DateTime expires_at { get; set; }
26+
public DateTime updated_at { get; set; }
27+
}
28+
}
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.ComponentModel.DataAnnotations;
4+
using System.Linq;
5+
using System.Runtime.Serialization;
6+
using System.Text;
7+
using System.Threading.Tasks;
8+
9+
namespace Server.Installer.Models
10+
{
11+
public enum WebServerType
12+
{
13+
UbuntuCaddy,
14+
UbuntuNginx,
15+
CentOsCaddy,
16+
CentOsNginx,
17+
IisWindows
18+
}
19+
}

0 commit comments

Comments
 (0)