Code Monkey home page Code Monkey logo

remotely's Introduction

Remotely

A remote control and remote scripting solution, built with .NET, Blazor, and SignalR Core.

Build Status Tests

Status

This project is alive! Jared has joined the ImmyBot Team and we have implemented Remotely's Remote Control functionality into ImmyBot.

The shared functionality has been abstracted into the Immense Remote Control Library repository.

This allows both projects to benefit from improvements we make.

Project Links

Subreddit: https://www.reddit.com/r/remotely_app/
Docker: https://hub.docker.com/r/immybot/remotely
Tutorial: https://www.youtube.com/watch?v=t-TFvr7sZ6M (Thanks, @bmcgonag!)

image

Quickstart

mkdir -p /var/www/remotely
wget -q https://raw.githubusercontent.com/immense/Remotely/master/docker-compose/docker-compose.yml
docker-compose up -d

Important: HTTPS and Reverse Proxies

The only supported reverse proxy is Caddy, and only when it is directly facing the internet. The default configuration for Caddy provides everything that ASP.NET Core and SignalR need to function correctly.

If you are having networking issues with any other setup, such as with an additional firewall or with Nginx, please seek out community support in the Discussions tab, on Reddit, or another social site. The Remotely maintainers simply can't provide guidance and support for all the possible environment setups.

With that said, Remotely requires the following headers to be set: X-Forwarded-Proto, X-Forwarded-Host, and X-Forwarded-For. These correlate to the scheme (http/https), the URL of the original request, and the client's IP address, respectively. The resulting scheme and host are injected into the installers and desktop clients, so they know where to send requests. The client IP address is used in the device info.

The Remotely code does not parse or handle these values. It is done internally by ASP.NET Core's built-in middleware. If the values are not appearing as expected, it is because the headers were missing, didn't contain the correct values, were not the correct format, or didn't come through a chain of known proxies (see below).

To avoid injection attacks, ASP.NET Core defaults to only accepting forwarded headers from loopback addresses. Remotely will also add the default Docker host IP (172.17.0.1). If you are using a non-default configuration, you must add all firewall and reverse proxy addresses to the KnownProxies array in the Server Config.

After Installation

  • Data for Remotely will be saved in the container under /app/AppData, which will be mounted to /var/www/remotely/ on your Docker host.
  • This folder will contain Remotely.db and logs generated by the server.
    • These files will persist through teardown and setup of new Remotely containers.
    • If upgrading from a non-Docker version of Remotely, overwrite the DB file from your previous installation.
  • Use Caddy as a reverse proxy if you want to expose the site to the internet.
  • If this is the first run, create your account by clicking the Register button on the main page.
    • This account will be both the server admin and organization admin.
    • An organization is automatically created for the account.
      • Organizations are used to group together users, devices, and other data items into a single pool.
      • By default, only one organization can exist on a server.
      • The Register button will disappear.
      • People will no longer be able to create accounts on their own.
      • To allow self-registration, increase the MaxOrganizationCount or set it to -1 (see Configuration section).

HTTP Logging

You can enable HTTP logging to see all requests and responses in the server logs, including headers. This can be helpful for debugging reverse proxy, API, or SignalR issues. The option can be enabled on the Server Config page.

After changing the above, you must restart the container for the changes to take effect.

Build and Debug Instructions (Windows 11)

The following steps will configure your Windows 11 machine for building the Remotely server and clients.

  • Install Visual Studio 2022.
    • Link: https://visualstudio.microsoft.com/downloads/
    • You should have the following Workloads selected:
      • ASP.NET and web development
      • .NET desktop development
      • .NET Core cross-platform development
    • You should have the following Individual Components selected:
      • .NET SDK (latest version).
      • MSBuild (which auto-selects Roslyn compilers).
      • NuGet targets and build tasks.
      • .NET Framework 4.8 SDK.
      • For debugging and development, you'll need all relevant workloads.
  • Install Git for Windows.
  • Install the latest LTS Node:
  • Clone the git repository: git clone https://github.com/immense/Remotely --recurse
  • When debugging, the agent will use a pre-defined device ID and connect to https://localhost:5001.
  • In development environment, the server will assign all connecting agents to the first organization.
  • The above two allow you to debug the agent and server together, and see your device in the list.

Admin Accounts

The first account created will be an admin for both the server and the organization that's created for the account.

An organization admin has access to the Organization page and server log entries specific to his/her organization. A server admin has access to the Server Config page and can see server log entries that don't belong to an organization.

Branding

Within the Account section, there is a tab for branding, which will apply to the quick support clients and Windows installer.

However, the clients will need to have been built from source with the server URL hard-coded in the apps for them to be able to retrieve the branding info.

Configuration

The database provider, connection strings, and ASP.NET Core port are configurable via environment variables in docker-compose.yml.

All other configuration is done in the Server Config page once you're logged in.

  • AllowApiLogin: Whether to allow logging in via the API controller. API access tokens are recommended over this approach.
  • BannedDevices: An array of device IDs, names, or IP addresses to ban. When they try to connect, an uninstall command will immediately be sent back.
  • DataRetentionInDays: How long logs and other data will be kept on the server. Set to -1 to retain indefinitely (not recommended).
  • DBProvider: Determines which of the three connection strings (at the top) will be used. The appropriate DB provider for the database type is automatically loaded in code.
  • EnableWindowsEventLog: Whether to also add server log entries to the Windows Event Log.
  • EnforceAttendedAccess: Clients will be prompted to allow unattended remote control attempts.
  • EnableRemoteControlRecording: Whether to save recordings of remote control sessions on the server.
    • They will be saved in /app/AppData/recordings.
    • Their retention is governed by DataRetentionInDays.
  • KnownProxies: If your reverse proxy is on a different machine and is forwarding requests to the Remotely server, you will need to add the IP of the reverse proxy server to this array.
  • MaxOrganizationCount: By default, one organization can exist on the server, which is created automatically when the first account is registered. Afterward, self-registration will be disabled.
    • Set this to -1 or increase it to a specific number to allow multi-tenancy.
  • RedirectToHttps: Whether ASP.NET Core will redirect all traffic from HTTP to HTTPS. This is independent of Caddy, Nginx, and IIS configurations that do the same.
  • RemoteControlNotifyUsers: Whether to show a notification to the end user when an unattended remote control session starts.
  • RemoteControlSessionLimit: How many concurrent remote control sessions are allowed per organization.
  • RemoteControlRequiresAuthentication: Whether the remote control page requires authentication to establish a connection.
  • Require2FA: Require users to set up 2FA before they can use the main app.
  • Smpt-: SMTP settings for auto-generated system emails (such as registration and password reset).
  • Theme: The color theme to use for the site. Values are "Light" or "Dark". This can also be configured per-user in Account - Options.
  • TrustedCorsOrigins: For cross-origin API requests via JavaScript. The websites listed in this array with be allowed to make requests to the API. This does not grant authentication, which is still required on most endpoints.
  • UseHsts: Whether ASP.NET Core will use HTTP Strict Transport Security.
  • UseHttpLogging: Enables logging for all HTTP requests. Also enables additional log entries in ClientDownloadsController regarding the effective scheme, host, and remote IP address as a result of processing forwarded headers.
    • You must explicitly set a log level for Microsoft.AspNetCore.HttpLogging.HttpLoggingMiddleware for this to work. See the appsettings.json for an example.

Changing the Database

By default, Remotely uses a SQLite database. When first run, it creates a file as specified for the SQLite connection string in appsettings.json.

You can change database by changing DBProvider in ApplicationOptions to SQLServer or PostgreSQL.

Logging

  • On clients, logs are kept in %ProgramData%\Remotely\Logs
  • Within the server container, logs will be written to /app/AppData/logs, which (by default) will be mounted to /var/www/remotely/Logs on the host.
  • Built-in ASP.NET Core logs are written to the console (stdout). You can redirect this to a file if desired.
    • In IIS, this can be done in the web.config file by setting stdoutLogEnabled to true.
  • On Windows Servers, the above logs can also be written to the Windows Event Log.
    • This is enabled in Server Config by setting EnableWindowsEventLog to true.
  • You can configure logging levels and other settings in appsetttings.json.

Remote Control Client Requirements

  • Windows: Only the latest version of Windows 11 is tested. Windows 7 and 8.1 should work, though performance will be reduced on Windows 7.
    • Windows 2019/2022 should work as well, but isn't tested regularly.
  • Linux: Only the latest LTS version of Ubuntu is tested.
  • For the Ubuntu's "quick support" client, you must first install the following dependencies:
    • libx11-dev
    • libxrandr-dev
    • libc6-dev
    • libxtst-dev
    • xclip

Remote Control on Mobile

Ideally, you'd be doing remote control from an actual computer or laptop. However, I've tried to make the remote control at least somewhat usable from a mobile device. Here are the controls:

  • Left-click: Single tap
  • Right-click: Long-press, then release
  • Click-and-drag: Long-press, then drag

End User Support Page

There's a page at /get-support where end users can request support. When the form is submitted, an alert appears on the main page, above the grid.

A shortcut to this page is placed in the \Program Files\Remotely\ folder. You can copy it anywhere you like. You can also have it copied to the desktop automatically by using the -supportshortcut switch on the installer.

.NET Deployments

  • .NET has two methods of deployment: framework-dependent and self-contained.
    • Framework-dependent deployments require the .NET runtime to be installed on the target computers. It must be the same version that was used to build the app.
    • Self-contained deployments include a copy of the runtime, so you don't need to install it on the target computers. As a result, the total file size is much larger.
  • .NET uses runtime identifiers that are targeted when building.

Shortcut Keys

There are a few shortcut keys available when using the console.

  • / : Slash will allow you to switch between shells. The names are configurable in the Options page.
  • Up/Down: Use arrow up/down to cycle through input history.
  • Ctrl + Q: Clear the output window.

Port Configuration

Ports are configured in the docker-compose.yml file. If you change the internal port for the container, make sure you update ASPNETCORE_HTTP_PORTS variable to match.

API and Integrations

Remotely has a basic API, which can be browsed at https://{your_server_url}/swagger. Most endpoints require authentication via an API access token, which can be created by going to Account - API Access.

When accessing the API from the browser on another website, you'll need to set up CORS in appsettings by adding the website origin URL to the TrustedCorsOrigins array. If you're not familiar with how CORS works, I recommend reading up on it before proceeding. For example, if I wanted to create a login form on https://exmaple.com that logged into the Remotely API, I'd need to add "https://example.com" to the TrustedCorsOrigins.

Each request to the API must have a header named "X-Api-Key". The value should be the API key's ID and secret, separated by a colon (i.e. [ApiKey]:[ApiSecret]).

Below is an example API request:

POST https://localhost:5001/API/Scripting/ExecuteCommand/PSCore/f2b0a595-5ea8-471b-975f-12e70e0f3497 HTTP/1.1
Content-Type: application/json
X-Api-Key: 31fb288d-af97-4ce1-ae7b-ceebb98281ac:HLkrKaZGExYvozSPvcACZw9awKkhHnNK
User-Agent: PostmanRuntime/7.22.0
Accept: */*
Cache-Control: no-cache
Host: localhost:5001
Accept-Encoding: gzip, deflate, br
Content-Length: 12
Connection: close

Get-Location

Below are examples of using the cookie-based login API (JavaScript):

// Log in with one request, then launch remote control with another.
fetch("https://localhost:5001/api/Login/", {
	method: "post",
	credentials: "include",
	mode: "cors",
	body: '{"email":"[email protected]", "password":"P@ssword1"}',
	headers: {
		"Content-Type": "application/json",
	}
}).then(response=>{
	if (response.ok) {
		fetch("https://localhost:44351/api/RemoteControl/Viewer/b68c24b0-2c67-4524-ad28-dadea7a576a4", {
			method: "get",
			credentials: "include",
			mode: "cors"
		}).then(response=>{
			if (response.ok) {
				response.text().then(url=>{
					window.open(url);
				})
			}
		})
	}
})

// Log in and launch remote control in the same request.
fetch("https://localhost:5001/api/RemoteControl/Viewer/", {
	method: "post",
	credentials: "include",
	mode: "cors",
	body: '{"email":"[email protected]", "password":"P@ssword1", "deviceID":"b68c24b0-2c67-4524-ad28-dadea7a576a4"}',
	headers: {
		"Content-Type": "application/json",
	}
}).then(response=>{
	if (response.ok) {
		response.text().then(url=>{
			window.open(url);
		})
	}
})

Alerts

The Alerts API gives you the ability to add monitoring and alerting functionality to your device endpoints. This feature is intended to add basic RMM-type functionality without diverging too far from Remotely's primary purpose.

Alerts can be set up to show a notification on the Remotely website, send an email, and/or perform a separate API request.

To use Alerts, you'd first need to make an API token (or multiple tokens) for your devices to use. Then create a scheduled task or some other recurring script to do the work. Below is an example of how to use PowerShell to create a Scheduled Job that checks the disk space on a daily schedule.

$Trigger = New-JobTrigger -Daily -At "5 AM"
$Option = New-ScheduledJobOption -RequireNetwork

Register-ScheduledJob -ScriptBlock {
    $OsDrive = Get-PSDrive -Name C
    $FreeSpace = $OsDrive.Free / ($OsDrive.Used + $OsDrive.Free)
    if ($FreeSpace -lt .1) {
        Invoke-WebRequest -Uri "https://localhost:5001/api/Alerts/Create/" -Method Post -Headers @{ 
            X-Api-Key="3e9d8273-1dc1-4303-bd50-7a133e36b9b7:S+82XKZdvg278pSFHWtUklqHENuO5IhH"
        } -Body @"
            {
                "AlertDeviceID": "f2b0a595-5ea8-471b-975f-12e70e0f3497",
                "AlertMessage": "Low hard drive space. Free Space: $([Math]::Round($FreeSpace * 100))%",
                "ApiRequestBody": null,
                "ApiRequestHeaders": null,
                "ApiRequestMethod": null,
                "ApiRequestUrl": null,
                "EmailBody": "Low hard drive space for device Maker.",
                "EmailSubject": "Hard Drive Space Alert",
                "EmailTo": "[email protected]",
                "ShouldAlert": true,
                "ShouldEmail": true,
                "ShouldSendApiRequest": false
            }
"@ -ContentType "application/json"
    }
} -Name "Check OS Drive Space" -Trigger $Trigger -ScheduledJobOption $Option

remotely's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

remotely's Issues

View All Connected Users

Would there be a way I could view everyone that has downloaded and opened the client, view their session ID, and attempt to connect? Similar to the way Teamviewer and ScreenConnect/ConnectWise do it....

transfer the sound of Windows

Hello, Great Master.
Is it possible to transfer the sound of Windows together with the image in the "Remotely" program?

Account Locked Out

Sooo... how long before my only account unlocks itself again and I can try logging in without Caps-lock on?

Registration or how to shoot yourself in the foot

  1. As TCP:5000 is required to be published on the hosted server for remote clients to connect, anyone on the Internet might actually browse your webpage. How about splitting data port from web management? I'm not sure yet I wanna publish admin page outside.

  2. Anyone can register.. that will apparently create a new organization. "Allow registration" checkbox better exist and be disabled by default. Invites-only should be default mode.

  3. Shooting in own foot: on Account - Organization page admin might untick own "Administrator" checkbox. That's enough to lose admin rights. It must be grayed for own account.

Your connection was lost. Refresh the page or enter a command to reconnect.

Hi,

I am running Remotely server on an Ubuntu machine, which already has a apache server which acts as a reverse proxy.
So I installed nginx on port 88 and let the apache do the SSL thing so redirect apache 443 -> nginx 88
But I do get the connection lost message on the web interface... and of course the clients cant register on the server.
So it seems some routing is wrong.

Also tried to direct reverse proxy from the running apache -> server:5000 but then the web interface dont start at all.
Do you have an idea?
Thanks

SMTP send through Exchange server fails with timeout

I've setup a fresh install on Server 2012 R2.
I have Exchange 2013 running, also on Server 2012 R2.
Exchange has an expectation that anything connecting on port 25 for SMTP will switch to TLS before completing the send.
It seems that your call to send email is using System.Net.Mail.SmtpClient, which does not support this.
MS article on issue and workaround:
https://support.microsoft.com/en-ca/help/950260/you-cannot-use-system-net-mail-smtpclient-to-send-an-e-mail-message-wi

Anyone else who wants to reproduce or confirm:
My SMTP receive logs on Exchange server show 220 connection, 250 options, then "Remote(SocketError)"
Log:
TransportRoles\Logs\FrontEnd\ProtocolLogs\SmtpReceive

I'll wait for your review.

Crashing Avast? ... O.o ...

When attempting to remote control a machine that has Avast Business installed, it will inadvertently cause Avast to completely crash and fail on initial connect. But then when you attempt to connect a 2nd time, it works because Avast is no longer running and trying to block the connection. I then have to manually restart Avast Business. Even though I've set the Remotely folder to be excluded, it still causes this panic. Any way to remedy this with antivirus?

How to change server listening IP/port on Linux?

I already have an Nginx reverse proxy set up on another machine where I can manage all my Let's Encrypt certs in one place. I'd like to use that server to act as the frontend for Remotely which runs on its own machine. How do I make it so that the Remotely listens on *:5000 instead of localhost:5000?

SQL error on registration

I'm hosting in IIS and used both pre25/03 and current master branch.
Spent an hour figuring out I need to grant full access to IIS_IUSRS to c:\inetpub\Remotely folder.

Website now starts fine, but on first user registration an SQL error is thrown. Here's my stdout.log:

warn: Microsoft.EntityFrameworkCore.Query[20500]
      The LINQ expression 'where ((DateTime.Now - [x].TimeStamp) > __FromDays_0)' could not be translated and will be evaluated locally.
warn: Microsoft.EntityFrameworkCore.Query[20500]
      The LINQ expression 'where ((DateTime.Now - [x].TimeStamp) > __FromDays_0)' could not be translated and will be evaluated locally.
warn: Microsoft.EntityFrameworkCore.Query[20500]
      The LINQ expression 'where ((DateTime.Now - [x].LastOnline) > __FromDays_0)' could not be translated and will be evaluated locally.
Hosting environment: Production
Content root path: C:\inetpub\Remotely
Now listening on: http://127.0.0.1:47678
Application started. Press Ctrl+C to shut down.
fail: Microsoft.EntityFrameworkCore.Database.Command[20102]
      Failed executing DbCommand (3ms) [Parameters=[@p0='?' (Size = 36), @p1='?' (Size = 5), @p2='?' (Size = 4), @p3='?' (Size = 7), @p4='?' (Size = 4), @p5='?' (Size = 6), @p6='?' (Size = 2)], CommandType='Text', CommandTimeout='30']
      INSERT INTO "RemotelyUserOptions" ("ID", "CommandModeShortcutBash", "CommandModeShortcutCMD", "CommandModeShortcutPSCore", "CommandModeShortcutWeb", "CommandModeShortcutWinPS", "ConsolePrompt")
      VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6);
Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 1: 'table RemotelyUserOptions has no column named CommandModeShortcutWeb'.
   at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
   at Microsoft.Data.Sqlite.SqliteCommand.PrepareAndEnumerateStatements(Stopwatch timer)+MoveNext()
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteAsync(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues, CancellationToken cancellationToken)
fail: Microsoft.EntityFrameworkCore.Update[10000]
      An exception occurred in the database while saving changes for context type 'Remotely_Server.Data.ApplicationDbContext'.
      Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while updating the entries. See the inner exception for details. ---> Microsoft.Data.Sqlite.SqliteException: SQLite Error 1: 'table RemotelyUserOptions has no column named CommandModeShortcutWeb'.
         at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
         at Microsoft.Data.Sqlite.SqliteCommand.PrepareAndEnumerateStatements(Stopwatch timer)+MoveNext()
         at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
         at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
         at Microsoft.Data.Sqlite.SqliteCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
         at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteAsync(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues, CancellationToken cancellationToken)
         at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)
         --- End of inner exception stack trace ---
         at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)
         at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(DbContext _, ValueTuple`2 parameters, CancellationToken cancellationToken)
         at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IReadOnlyList`1 entriesToSave, CancellationToken cancellationToken)
         at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)
         at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)
Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while updating the entries. See the inner exception for details. ---> Microsoft.Data.Sqlite.SqliteException: SQLite Error 1: 'table RemotelyUserOptions has no column named CommandModeShortcutWeb'.
   at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
   at Microsoft.Data.Sqlite.SqliteCommand.PrepareAndEnumerateStatements(Stopwatch timer)+MoveNext()
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteAsync(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(DbContext _, ValueTuple`2 parameters, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IReadOnlyList`1 entriesToSave, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)
fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
      An unhandled exception has occurred while executing the request.
Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while updating the entries. See the inner exception for details. ---> Microsoft.Data.Sqlite.SqliteException: SQLite Error 1: 'table RemotelyUserOptions has no column named CommandModeShortcutWeb'.
   at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
   at Microsoft.Data.Sqlite.SqliteCommand.PrepareAndEnumerateStatements(Stopwatch timer)+MoveNext()
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteAsync(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(DbContext _, ValueTuple`2 parameters, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IReadOnlyList`1 entriesToSave, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Identity.EntityFrameworkCore.UserStore`9.CreateAsync(TUser user, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Identity.UserManager`1.CreateAsync(TUser user)
   at Microsoft.AspNetCore.Identity.UserManager`1.CreateAsync(TUser user, String password)
   at Remotely_Server.Areas.Identity.Pages.Account.RegisterModel.OnPostAsync(String returnUrl) in C:\Users\ftravinsky\Downloads\Remotely-master\Remotely_Server\Areas\Identity\Pages\Account\Register.cshtml.cs:line 72
   at Microsoft.AspNetCore.Mvc.RazorPages.Internal.ExecutorFactory.GenericTaskHandlerMethod.Convert[T](Object taskAsObject)
   at Microsoft.AspNetCore.Mvc.RazorPages.Internal.ExecutorFactory.GenericTaskHandlerMethod.Execute(Object receiver, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.RazorPages.Internal.PageActionInvoker.InvokeHandlerMethodAsync()
   at Microsoft.AspNetCore.Mvc.RazorPages.Internal.PageActionInvoker.InvokeNextPageFilterAsync()
   at Microsoft.AspNetCore.Mvc.RazorPages.Internal.PageActionInvoker.Rethrow(PageHandlerExecutedContext context)
   at Microsoft.AspNetCore.Mvc.RazorPages.Internal.PageActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.RazorPages.Internal.PageActionInvoker.InvokeInnerFilterAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.Invoke(HttpContext httpContext)
   at Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.Invoke(HttpContext httpContext)
   at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.Invoke(HttpContext context)

Ubuntu 18.04 install

Either i'm being really dense, or the instructions for installing on Ubuntu 18.04 seem to be missing some fundamental steps...

Are you assuming Apache2 is installed already before the install script is run? Or will this run on a OOTB Ubuntu 18.04 install with no extras?

macOS support

Would be amazing to have macOS client support aswell.

Linux Client

Hello sir

Can you give linux 64 bit and 32 portable Client please

Can this be used in presentation mode ?

Firstly, this looks very cool.
Can it be used for doing presentations remotely.?
For example , I am sharing my desktop with a colleague and I want to make someone else the presenter to show his desktop.
The other person shares his screen with me but I cannot control his desktop. Only see what he is showing me.
Thanks for this great project.
John.

Issue with permissions & tags

Here's my scenario:

I created an admin account, setup my org, installed the agent on three machines, setup two permissions groups - "dev machines" & "servers". Put two boxes in "dev machines", one in "servers".

I created another account and invited it into my org. Gave it only permission to the "dev machines" group. I see the computers I'm supposed to when logged into the secondary acct.

After a time (maybe 3 min or so) suddenly the computer in my "Servers" group will show up in my secondary acct. As a side note, when this happens my tags are typically permanently erased as well.

If I log out, then back in, the list of available computers shows the correct boxes - but after approx 3 min, the other computer shows back up in the list again.

One final note - also, remote control does not work at all on my secondary acct. The remote control graphic comes up, slides away, nothing happens. I logout, login to my primary acct, and remote control works.

Linux install without https

Is there a way to invoke Remotely_Server_Install.sh without https?

I already have a standalone reverse proxy that handles all my subdomains.

Preventing abuse with remote assistance

Is there a way to secure my server from use by unknown parties? For instance, currently it seems that if someone discovered my URL, they could start using my server for their own production environment, or even impersonate me - this includes more nefarious characters like tech support scammers, or some unscrupulous company overwhelming my server with their support traffic.

Maybe an option to put the remote control section behind the authentication system, so it can only be accessed by logged in users? This seems like an easy way to prevent a whole host of potential abuse issues.

Ok, I'm back again..

How do i go about updating my install on Ubuntu?

I tried just re-downloading server.zip and unzipping it over the top, but not only did that bring back the register button (duh) but i couldn't log in anymore :(

Pre-emptively connecting clients to https

Hey! Found your project on r/msp and absolutely love it so far, great work on this!

I have my install positioned behind a reverse proxy handling https:// which is working fine. However I've noticed that the client installation scripts point to the server using http://.

On my machines, this causes them to not want to connect, since I have nginx on my reverse proxy redirecting all http requests to https. On machines with the service already installed, adjusting the Host parameter in ConnectionInfo.json to use https:// and restarting the service immediately causes it to connect to the server. Alternatively, editing the client installer script before running it so that "hostname" reflects https:// accomplishes the same thing.

I tried enabling "RedirecttoHttps" in appsettings.json but I believe that setting assumes incoming connections are http and not already looking for https.

Is there a way to enforce https connections by the client through a server config option I may be missing, so that the script already points to it with https without needing to edit it? Thanks in advance!

Changing URL from Base URL to a folder URL

I found that when installing Remotely in a folder it won't work, it requires Remotely to be installed on the root folder.

What do I need to change to make it work ?!

Not seeing any logs in the Event Logs

Running on Server 2012 R2 and not see any logs from Remotely in Event Logs.

I'm happy to test some things but I'm not sure where to go. I need this feature working so I can figure out my emailing issues.

Error when enabling recording

Hi, I have enabled recording, I copied FFMPEG to Windows and the WWWROOT folder and made sure that application is running as a local admin.
When disconnecting from the client I get the following error:
The description for Event ID 1 from source Application cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event:

Microsoft.AspNetCore.SignalR.HubConnectionHandler
Error when dispatching 'OnDisconnectedAsync' on hub.

System.Collections.Generic.KeyNotFoundException: The given key '8WyX1LdgRijO0ULH_SSPBw' was not present in the dictionary.
at System.Collections.Concurrent.ConcurrentDictionary2.ThrowKeyNotFoundException(Object key) at System.Collections.Concurrent.ConcurrentDictionary2.get_Item(TKey key)
at Remotely.Server.Services.RemoteControlSessionRecorder.StopProcessing(String viewerID) in E:\BitBucket\Remotely-master_RemovingPS\Server\Services\RemoteControlSessionRecorder.cs:line 114
at Remotely.Server.Services.RCBrowserSocketHub.OnDisconnectedAsync(Exception exception) in E:\BitBucket\Remotely-master_RemovingPS\Server\Services\RCBrowserSocketHub.cs:line 142
at Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher1.OnDisconnectedAsync(HubConnectionContext connection, Exception exception) at Microsoft.AspNetCore.SignalR.HubConnectionHandler1.HubOnDisconnectedAsync(HubConnectionContext connection, Exception exception)

the message resource is present but the message is not found in the string/message table

What could be wrong ?!

Agent install failing on Ubuntu 16.04 - at creating the service

I am trying to install the agent onto a linux 16.04 machine, and its failing to install the service. I set the shell script with set -x so i can see where the issue is, and its failing here:
` inflating: System.Xml.ReaderWriter.dll
inflating: System.Xml.Serialization.dll
inflating: System.Xml.XDocument.dll
inflating: System.Xml.XmlDocument.dll
inflating: System.Xml.XmlSerializer.dll
inflating: System.Xml.XPath.dll
inflating: System.Xml.XPath.XDocument.dll
inflating: WindowsBase.dll

  • chmod +x ./Remotely_Agent
  • chmod +x ./ScreenCast/Remotely_ScreenCast.Linux
  • cat
  • echo Creating service...
    Creating service...
    Install-Linux-x64.sh: 47: Install-Linux-x64.sh: Syntax error: "(" unexpected`

Looking at the shell script, i copied/pasted the lines into the shell, and it installed the service and started it without issue:
`root@remotely_01:/tmp# usersArr=($(users))
root@remotely_01:/tmp# targetUser=${usersArr[0]}
root@remotely_01:/tmp# cat > /etc/systemd/system/remotely-agent.service << EOL

[Unit]
Description=The Remotely agent used for remote access.

[Service]
WorkingDirectory=/usr/local/bin/Remotely/
ExecStart=/usr/local/bin/Remotely/Remotely_Agent
Restart=always
RestartSec=10
Environment=DISPLAY=:0
Environment="XAUTHORITY=/home/$targetUser/.Xauthority"

[Install]
WantedBy=graphical.target
EOL
root@remotely_01:/tmp# systemctl enable remotely-agent
systemctl start remotely-agentCreated symlink /etc/systemd/system/graphical.target.wants/remotely-agent.service → /etc/systemd/system/remotely-agent.service.
root@remotely_01:/tmp# systemctl start remotely-agent
`

Segmenting Client Sessions

Hi Jared,

First and foremost, thank you for working on this project, I have not implemented it yet but it looks very promising. Do you know if it’s possible to segment groups of client users/machines in the web client? For example, if I have different organizations I am managing is it possible to securely segment them? Also has this project been pentested? I can help to test this application for any vulnerabilities, especially when exposed via the internet.

Thanks

Portable Remotely_Desktop doesn't appear on a grid

I've launched client locally on the server, it connected successfully to http://localhost:5000 and is manageable, however didn't appear on a Grid. Console also tells, that no service is installed around.

Looks like only clients deployed as service supported..?

P.S. I'd prefer "Grid" as a primary tab and "Console" as secondary. That better be an option.

Build platform for debian

How are the binary files in the server.zip for linux built? Must those be built on a windows machine or can they also be built on linux (debian)?

Windows Sound

Can you not send Windows sound to the server with the image?

How do i update a Windows Install

I'm a bit lost how to update a Windows installation of Remotely.. it's all working great but i've noticed some updated stuff in the github and wondering how i would go about updating..do i just run the install file again?

How to launch Remotely_Server.exe as service?

Hello again!

I'm hosting on IIS 8.5 (Server 2012R2).
http://localhost:5000 only works when Remotely_Server.exe is launched (with user logged on).
Any way to make it run as NT-service or through IIS configuration?

How about implementing "remotely_server.exe --install"?

Seems, I'm going NSSM.exe again for now.

Emails not sending because of coded SSL requirement on SMTP

New installation on Server 2012 R2
I setup the SMTP settings in the config file but when it tried to send, it was always failing to a connection timeout issue
My 'receive connector' in Exchange is what I setup to allow connections and I specifically took off the ability to receive over SSL because I was using the connector for devices that don't support SSL
This caused an error that I could not find on the Remotely server because of logging issues but in Exchange, it logged as a connection timeout.
I did notice that in this file, there is the setting 'mailClient.EnableSsl = true;' which I guess enforces SSL always and that should be either an option for the user in a config file or if you can find another setting, try to use SSL when available but still send if not there:
Remotely/Remotely_Server/Services/EmailSender.cs

The RemoteControl page needs a "back to home" button

Hi,

When a session ended I am redirected back to the RemoteControl page on the tryout server. What would be really handy to have in that case is something like a "back to home" button which takes me back to the grid view that I came from before I started the session.
Currently Remotely opens a new tab when you start a session which I personally don't find very pratical. This forces me to go back and find the single Remotely tab I have not started a session on.

API /RemoteControl/DeviceName doesn't authenticate request

Well, It does authenticate the request, but internally if you track the request you will find that in

public async Task SendScreenCastRequestToDevice(string screenCasterID, string requesterName, int remoteControlMode)
{
requesterName = Context?.User?.Identity?.Name;

you will find that requesterName is null, although the request was initially authenticated.

It works nicely with the post method of the API.

Remotely is reporting Lost Connection

Hey all, I installed remotely on my server and decided to try and use Apache for the reverse proxy instead of NGINX, as I already had apache running some stuff. It does seem to work, but when I log in, the dashboard console keeps saying that the connection has been lost and that I need to reload the page to reconnect. Reloading doesn't help, as the same message appears once the page reloads.
I've attached my Apache config below, I tried to mimic the NGINX config as best I could, but maybe I missed something.
Thanks,
Andrew

BEGIN Apache2 CONFIG:

<IfModule mod_ssl.c>
<VirtualHost [<IPs REMOVED.]:443 <IPs REMOVED>:443>
        ServerName remotely.mysite.com
        ServerAdmin [email protected]

        ProxyPreserveHost On
        #Proxy Requests to Remotely Server
        <LocationMatch "/">
                ProxyPass http://localhost:5000/ 
                ProxyPassReverse http://remotely.mysite.com/
        </LocationMatch>
        <Location "/BrowserHub">
                ProxyPass http://localhost:5000/
                ProxyPassReverse http://remotely.mysite.com/
        </Location>

        <LocationMatch "/DeviceHub">
                ProxyPass http://localhost:5000/
                ProxyPassReverse http://remotely.mysite.com/
        </LocationMatch>

        <LocationMatch "/RCBrowserHub">
                ProxyPass http://localhost:5000/
                ProxyPassReverse http://remotely.mysite.com/
        </LocationMatch>

        <LocationMatch "/RCDeviceHub">
                ProxyPass http://localhost:5000/
                ProxyPassReverse http://remotely.mysite.com/
        </LocationMatch>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

SSLCertificateFile /etc/apache2/certs/mysite.com/fullchain.pem
SSLCertificateKeyFile /etc/apache2/certs/mysite.com/key.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
</IfModule>

Clients don't register with account

Hi,
I have downloaded and tried the agent Local and on tryout server, I can't see the device on both servers, I know that devices register themselves with the server using organization ID, but where shall I put this ID as there is no place to enter account details on the client.

Thanks.

502 bad gateway

Deployed on ubuntu 18.04 and ran the setup sh but I get 502 bad gateway.

Server not Found in IIS

I've got Remotely set up under IIS in Server 2012 R2, and when I access it from the internal network, it works fine, but when i try to access it outside the internal network (e.g. from my home computer) I get a Server Not Found error. Any other URL configured in IIS resolves properly to the outside network.... any ideas?

Remotely session on Windows does not survive user logout

Hi,

First of all, thank you so much for creating this project! I love the idea of having something like this and self-hosting such a solution really is the icing on the cake! :)

I have upgraded my Powershell version to 5.1 on a Windows 8.1 x64 VM and installed the Agent. Everything works fine until the user logs out, which is when Remotely goes into a "Reconnecting" loop. It takes a disconnect from Remotely and a new session for the Windows Login screen to reappear.

REQUEST: Change the API to connect to devices using IDs

Can you change the API to connect to device ID instead of Device name, this will allow us to have multiple devices with the same name working nicely.

I know we shouldn't have multiple devices with the same name, but it happens.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.