From 83539e311b840067848e676a2df95b3fb7d4f539 Mon Sep 17 00:00:00 2001 From: cedrozor Date: Sat, 25 Jan 2020 02:53:01 +0100 Subject: [PATCH] version 2.8.0 --- CHANGELOG | 20 +- DISCLAIMERS.md | 2 +- DOCUMENTATION.md | 41 +- Dockerfile | 100 ++++ .../Controllers/ConnectionController.cs | 2 +- .../Myrtille.Admin.Services.Install.ps1 | Bin 0 -> 3104 bytes .../Myrtille.Admin.Services.Uninstall.ps1 | Bin 0 -> 2984 bytes .../Myrtille.Admin.Services.csproj | 6 + Myrtille.Admin.Services/MyrtilleApiHost.cs | 2 +- Myrtille.Admin.Services/Program.cs | 20 +- .../Properties/AssemblyInfo.cs | 6 +- .../Services/ConnectionService.cs | 2 +- Myrtille.Admin.Services/ServicesInstaller.cs | 168 ++----- Myrtille.Admin.Web/Default.aspx | 2 +- Myrtille.Admin.Web/Default.aspx.cs | 2 +- Myrtille.Admin.Web/Logout.aspx | 20 +- Myrtille.Admin.Web/Logout.aspx.cs | 25 +- Myrtille.Admin.Web/Properties/AssemblyInfo.cs | 6 +- Myrtille.Admin.Web/css/iframe.css | 2 +- Myrtille.Admin.Web/js/iframe.js | 2 +- Myrtille.Admin.Web/src/CaptureClient.cs | 2 +- Myrtille.Admin.Web/src/ConnectionClient.cs | 2 +- Myrtille.Admin.Web/src/DisconnectionClient.cs | 2 +- Myrtille.Admin.Web/src/SharingClient.cs | 2 +- Myrtille.Common/Helpers/AccountHelper.cs | 2 +- Myrtille.Common/Helpers/CertificateHelper.cs | 2 +- Myrtille.Common/Helpers/ClientIPHelper.cs | 2 +- .../{RDPCryptoHelper.cs => CryptoHelper.cs} | 85 +++- Myrtille.Common/Helpers/FileHelper.cs | 2 +- Myrtille.Common/Helpers/FirewallHelper.cs | 2 +- Myrtille.Common/Helpers/GuidHelper.cs | 20 +- Myrtille.Common/Helpers/HttpSessionHelper.cs | 2 +- Myrtille.Common/Helpers/IISHelper.cs | 2 +- Myrtille.Common/Helpers/MailHelper.cs | 195 ++++++++ Myrtille.Common/Helpers/PermissionsHelper.cs | 2 +- Myrtille.Common/Helpers/PipeHelper.cs | 2 +- Myrtille.Common/Helpers/ProcessHelper.cs | 20 +- .../Helpers/RemoteSessionCommand.cs | 128 ----- Myrtille.Common/Helpers/WindowHelper.cs | 2 +- Myrtille.Common/Helpers/XmlTools.cs | 2 +- Myrtille.Common/Log/Log4netTraceFilter.cs | 2 +- Myrtille.Common/Log/Log4netTraceListener.cs | 2 +- Myrtille.Common/Myrtille.Common.csproj | 3 +- Myrtille.Common/Network/Buffer.cs | 20 +- Myrtille.Common/Properties/AssemblyInfo.cs | 6 +- Myrtille.Enterprise/ActiveDirectory.cs | 344 +++++-------- Myrtille.Enterprise/Data/Host.cs | 2 +- Myrtille.Enterprise/Data/HostAccessGroups.cs | 3 +- .../Data/MyrtilleEnterpriseDBContext.cs | 3 +- Myrtille.Enterprise/Data/Session.cs | 6 +- Myrtille.Enterprise/Data/SessionGroup.cs | 3 +- .../Data/SessionHostCredential.cs | 6 +- .../Helpers/DirectoryExceptionHelper.cs | 3 +- Myrtille.Enterprise/LocalAdmin.cs | 471 ++++++++++++++++++ .../Migrations/Configuration.cs | 35 -- .../MigrationConfiguration.cs | 2 +- .../Myrtille.Enterprise.csproj | 5 +- .../Properties/AssemblyInfo.cs | 4 +- .../Properties/AssemblyInfo.cs | 4 +- Myrtille.Printer/Properties/AssemblyInfo.cs | 4 +- Myrtille.SSH/PipeMessaging.cs | 2 +- Myrtille.SSH/Program.cs | 9 +- Myrtille.SSH/Properties/AssemblyInfo.cs | 4 +- .../Adapters/IEnterpriseAdapter.cs | 82 ++- .../IMultifactorAuthenticationAdapter.cs | 2 +- .../Enums/CaptureFormat.cs | 2 +- .../Enums/EnterpriseMode.cs | 28 ++ Myrtille.Services.Contracts/Enums/HostType.cs | 2 +- .../Enums/RemoteSessionCommand.cs | 2 +- .../Enums/RemoteSessionExitCode.cs | 2 +- .../Enums/RemoteSessionState.cs | 2 +- .../Enums/SecurityProtocol.cs | 2 +- .../IApplicationPoolService.cs | 2 +- .../ICaptureService.cs | 2 +- .../IConnectionService.cs | 2 +- .../IDisconnectionService.cs | 2 +- .../IEnterpriseService.cs | 6 +- Myrtille.Services.Contracts/IFileStorage.cs | 2 +- .../IMFAAuthentication.cs | 2 +- .../IPrinterService.cs | 2 +- .../IRemoteSessionProcess.cs | 2 +- .../ISharingService.cs | 2 +- .../Models/Connection.cs | 2 +- .../Models/ConnectionInfo.cs | 2 +- .../EnterpriseAuthenticationErrorHelper.cs | 2 +- .../Models/EnterpriseConnectionDetails.cs | 2 +- .../Models/EnterpriseHost.cs | 2 +- .../Models/EnterpriseHostEdit.cs | 2 +- .../EnterpriseHostSessionCredentials.cs | 2 + .../Models/EnterpriseSession.cs | 3 +- .../Models/GuestInfo.cs | 2 +- .../Models/HostInfo.cs | 2 +- .../Models/UserInfo.cs | 2 +- Myrtille.Services.Contracts/Models/VMInfo.cs | 2 +- .../Myrtille.Services.Contracts.csproj | 1 + .../Properties/AssemblyInfo.cs | 6 +- Myrtille.Services/ApplicationPoolService.cs | 2 +- .../ConnectionBrokerDbContext.cs | 18 + Myrtille.Services/ConnectionBroker/Server.cs | 18 + Myrtille.Services/ConnectionBroker/Session.cs | 18 + .../ConnectionBroker/SessionState.cs | 2 +- .../ConnectionBroker/SessionType.cs | 2 +- Myrtille.Services/ConnectionBroker/Target.cs | 18 + .../ConnectionBroker/TargetIp.cs | 18 + .../ConnectionBroker/TargetProperty.cs | 18 + Myrtille.Services/ConnectionBroker/User.cs | 18 + Myrtille.Services/EnterpriseService.cs | 43 +- Myrtille.Services/FileStorage.cs | 2 +- Myrtille.Services/MFAAuthentication.cs | 2 +- .../Myrtille.Services.Install.ps1 | Bin 0 -> 3026 bytes .../Myrtille.Services.Uninstall.ps1 | Bin 0 -> 2864 bytes Myrtille.Services/Myrtille.Services.csproj | 6 + Myrtille.Services/PrinterService.cs | 2 +- Myrtille.Services/Program.cs | 56 ++- Myrtille.Services/Properties/AssemblyInfo.cs | 6 +- Myrtille.Services/RemoteSessionProcess.cs | 6 +- Myrtille.Services/ServicesInstaller.cs | 170 ++----- Myrtille.Services/app.config | 42 +- Myrtille.Setup/Myrtille.Setup.vdproj | 272 +++++----- Myrtille.Setup/postbuild.cmd | 10 + Myrtille.Setup/wirunsql.vbs | 84 ++++ Myrtille.Web/AudioSocketHandler.ashx | 20 +- Myrtille.Web/AudioSocketHandler.ashx.cs | 2 +- Myrtille.Web/Default.aspx | 64 ++- Myrtille.Web/Default.aspx.cs | 66 ++- Myrtille.Web/Default.aspx.designer.cs | 27 + Myrtille.Web/GetCursor.aspx | 2 +- Myrtille.Web/GetCursor.aspx.cs | 2 +- Myrtille.Web/GetHash.aspx | 2 +- Myrtille.Web/GetHash.aspx.cs | 4 +- Myrtille.Web/GetUpdate.aspx | 2 +- Myrtille.Web/GetUpdate.aspx.cs | 2 +- Myrtille.Web/Global.asax | 2 +- Myrtille.Web/Global.asax.cs | 2 +- Myrtille.Web/Myrtille.Web.Install.ps1 | Bin 0 -> 10598 bytes Myrtille.Web/Myrtille.Web.Uninstall.ps1 | Bin 0 -> 4368 bytes Myrtille.Web/Myrtille.Web.csproj | 2 + Myrtille.Web/PrintDocument.aspx | 20 +- Myrtille.Web/PrintDocument.aspx.cs | 2 +- Myrtille.Web/Properties/AssemblyInfo.cs | 6 +- Myrtille.Web/PushUpdates.aspx | 2 +- Myrtille.Web/PushUpdates.aspx.cs | 2 +- Myrtille.Web/SendInputs.aspx | 2 +- Myrtille.Web/SendInputs.aspx.cs | 80 +-- Myrtille.Web/SocketHandler.ashx | 20 +- Myrtille.Web/SocketHandler.ashx.cs | 2 +- Myrtille.Web/Web.Base.config | 1 - Myrtille.Web/css/Default.css | 17 +- Myrtille.Web/js/audio/audiowebsocket.js | 2 +- Myrtille.Web/js/config.js | 7 +- Myrtille.Web/js/dialog.js | 2 +- Myrtille.Web/js/display.js | 2 +- Myrtille.Web/js/display/canvas.js | 2 +- Myrtille.Web/js/display/divs.js | 2 +- Myrtille.Web/js/display/terminaldiv.js | 3 +- Myrtille.Web/js/myrtille.js | 18 +- Myrtille.Web/js/network.js | 7 +- Myrtille.Web/js/network/buffer.js | 2 +- Myrtille.Web/js/network/longpolling.js | 2 +- Myrtille.Web/js/network/websocket.js | 2 +- Myrtille.Web/js/network/xmlhttp.js | 2 +- Myrtille.Web/js/tools/common.js | 2 +- Myrtille.Web/js/tools/convert.js | 2 +- Myrtille.Web/js/user.js | 33 +- Myrtille.Web/js/user/keyboard.js | 2 +- Myrtille.Web/js/user/mouse.js | 2 +- Myrtille.Web/js/user/touchscreen.js | 2 +- Myrtille.Web/popups/CopyClipboard.aspx | 2 +- Myrtille.Web/popups/CopyClipboard.aspx.cs | 2 +- Myrtille.Web/popups/CredentialsPrompt.aspx | 8 +- Myrtille.Web/popups/CredentialsPrompt.aspx.cs | 12 +- .../popups/CredentialsPrompt.aspx.designer.cs | 9 + Myrtille.Web/popups/EditHost.aspx | 10 +- Myrtille.Web/popups/EditHost.aspx.cs | 12 +- Myrtille.Web/popups/EditHost.aspx.designer.cs | 9 + Myrtille.Web/popups/EditHostSession.aspx | 10 +- Myrtille.Web/popups/EditHostSession.aspx.cs | 9 +- .../popups/EditHostSession.aspx.designer.cs | 9 + .../popups/EnterpriseChangePassword.aspx | 6 +- .../popups/EnterpriseChangePassword.aspx.cs | 28 +- .../EnterpriseChangePassword.aspx.designer.cs | 2 +- Myrtille.Web/popups/FileStorage.aspx | 2 +- Myrtille.Web/popups/FileStorage.aspx.cs | 2 +- Myrtille.Web/popups/PasteClipboard.aspx | 2 +- Myrtille.Web/popups/PasteClipboard.aspx.cs | 2 +- Myrtille.Web/popups/ShareSession.aspx | 2 +- Myrtille.Web/popups/ShareSession.aspx.cs | 2 +- Myrtille.Web/popups/ShowDialog.aspx | 2 +- Myrtille.Web/popups/ShowDialog.aspx.cs | 2 +- Myrtille.Web/popups/VirtualKeyboard.aspx | 2 +- Myrtille.Web/popups/VirtualKeyboard.aspx.cs | 2 +- .../src/Clients/ApplicationPoolClient.cs | 2 +- Myrtille.Web/src/Clients/ConnectionClient.cs | 2 +- Myrtille.Web/src/Clients/EnterpriseClient.cs | 14 +- Myrtille.Web/src/Clients/FileStorageClient.cs | 2 +- .../src/Clients/MFAAuthenticationClient.cs | 2 +- Myrtille.Web/src/Clients/PrinterClient.cs | 2 +- .../src/Clients/RemoteSessionProcessClient.cs | 4 +- .../src/Controllers/CaptureController.cs | 2 +- .../Controllers/DisconnectionController.cs | 2 +- .../src/Controllers/SharingControler.cs | 2 +- .../src/JSKeyCodeToRDPScanCodeMapping.cs | 2 +- Myrtille.Web/src/Models/SharingInfo.cs | 20 +- Myrtille.Web/src/RemoteSession.cs | 5 +- Myrtille.Web/src/RemoteSessionAudio.cs | 2 +- .../src/RemoteSessionAudioSocketHandler.cs | 2 +- Myrtille.Web/src/RemoteSessionImage.cs | 2 +- Myrtille.Web/src/RemoteSessionManager.cs | 30 +- Myrtille.Web/src/RemoteSessionMessage.cs | 2 +- Myrtille.Web/src/RemoteSessionPipes.cs | 14 +- .../src/RemoteSessionSocketHandler.cs | 12 +- Myrtille.Web/src/Services/CaptureService.cs | 2 +- .../src/Services/DisconnectionService.cs | 2 +- Myrtille.Web/src/Services/SharingService.cs | 2 +- Myrtille.Web/src/WebInstaller.cs | 98 ++-- Myrtille.sln | 5 + README.md | 15 +- 217 files changed, 2497 insertions(+), 1211 deletions(-) create mode 100644 Dockerfile create mode 100644 Myrtille.Admin.Services/Myrtille.Admin.Services.Install.ps1 create mode 100644 Myrtille.Admin.Services/Myrtille.Admin.Services.Uninstall.ps1 rename Myrtille.Common/Helpers/{RDPCryptoHelper.cs => CryptoHelper.cs} (59%) create mode 100644 Myrtille.Common/Helpers/MailHelper.cs delete mode 100644 Myrtille.Common/Helpers/RemoteSessionCommand.cs create mode 100644 Myrtille.Enterprise/LocalAdmin.cs delete mode 100644 Myrtille.Enterprise/Migrations/Configuration.cs rename Myrtille.Enterprise/{Data => Migrations}/MigrationConfiguration.cs (97%) create mode 100644 Myrtille.Services.Contracts/Enums/EnterpriseMode.cs create mode 100644 Myrtille.Services/Myrtille.Services.Install.ps1 create mode 100644 Myrtille.Services/Myrtille.Services.Uninstall.ps1 create mode 100644 Myrtille.Setup/postbuild.cmd create mode 100644 Myrtille.Setup/wirunsql.vbs create mode 100644 Myrtille.Web/Myrtille.Web.Install.ps1 create mode 100644 Myrtille.Web/Myrtille.Web.Uninstall.ps1 diff --git a/CHANGELOG b/CHANGELOG index bf2e25c..4bb40f3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,22 @@ -2019-11-27 Version 2.7.1 (stable) +2020-01-24 Version 2.8.0 (stable) + myrtille is now available as a docker image (see DOCUMENTATION.MD) + resynced FreeRDP (among many things, fixes some issues related to the clipboard and audio) + fixed session disconnect occuring under some circumstances on clipboard paste + fixed an issue where only the first letter of the clipboard content was displayed on clipboard paste + simplified hosts management (no domain or enterprise mode required); default login: admin/admin (changed upon first login) + updated the enterprise mode so that a member of "EnterpriseAdminGroup" can connect an host whatever the allowed groups or users defined on it (thanks dgcom) + fixed an issue with the enterprise mode, which prompted to change the password due to expiration whereas the expiration date was just not set (thanks dgcom) + the installer is now shipped without bootstraper (Setup.exe); open Myrtille.msi directly instead + the installer now installs the myrtille pre-requisites automatically (roles and features); the related script (Myrtille.Web\Install.ps1) can also be run manually from outside the installer, if needed + the installer now supports upgrading (thanks to Orca, which allows finer control over msi files), removing the need to uninstall a previous version first + security protocol is now configurable for RDP over VM bus + user domain is now configurable whatever the protocol and displayed into the toolbar, if defined + updated comments to drain disconnected sessions when using a connection broker in HA mode (myrtille services config) + starting with Windows Server 2019 (or Windows 10 release 1903), RDS introduces changes with NLA and the way disconnected sessions are handled (see DOCUMENTATION.MD); myrtille now default to scale instead of reconnect + if scaling the display on browser resize, you can choose whether to preserve or not the aspect ratio (config.js, default = don't keep) + various minor fixes + +2019-11-27 Version 2.7.1 (stable) * HOTFIX * fixed a potential crash of myrtille services when sending a disconnect notification (https://github.com/cedrozor/myrtille/issues/187, thanks gtmsew) the automatic application pool recycling is now disabled by default, and is not applicable if using the enterprise mode (this prevents enterprise sessions to be dropped unexpectedly!) if recycling is enabled, a new http session is now acquired on disconnect; this prevents a subsequent login failure (due to the old http session being invalid) without any error message diff --git a/DISCLAIMERS.md b/DISCLAIMERS.md index 4037d55..a47a1f3 100644 --- a/DISCLAIMERS.md +++ b/DISCLAIMERS.md @@ -929,7 +929,7 @@ END OF TERMS AND CONDITIONS The MIT License (MIT) -Copyright (c) 2017-2019, The xterm.js authors (https://github.com/xtermjs/xterm.js) +Copyright (c) 2017-2020, The xterm.js authors (https://github.com/xtermjs/xterm.js) Copyright (c) 2014-2016, SourceLair Private Company (https://www.sourcelair.com) Copyright (c) 2012-2013, Christopher Jeffrey (https://github.com/chjj/) diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index 7739f68..cff93d7 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -1,6 +1,7 @@ - [Introduction](#introduction) - [History](#history) - [Installation](#installation) +- [Docker](#docker) - [Remote Desktop Services](#remote-desktop-services) - [Auto-connect / Start remote application from URL](#auto-connect--start-remote-application-from-url) - [Syntax](#syntax) @@ -54,6 +55,36 @@ All releases here: https://github.com/cedrozor/myrtille/releases - Setup.exe (preferred installation method): setup bootstrapper - Myrtille.msi: MSI package (x86) +## Docker +From version 2.8.0, Myrtille is available as a docker image. + +No installation is required, you just need Docker Desktop or Toolbox for Windows (Windows 10 Pro or Windows Server 2016 or greater) with Windows containers enabled and Hyper-V isolation. + +Myrtille is fully functional as a container, but there are also some limitations (inherent to Windows containers): print and audio redirection (through RDP) is not supported at the moment (this may change into a future version). + +You can pull it from Docker Hub with the following command (use a tag for a specific version, or latest otherwise): +docker pull cedrozor/myrtille(:tag) + +To list the network adapters available to Docker: +docker network ls + +Run the image (in detached mode) and provide the resulting container a network adapter able to connect your hosts: +docker run -d --network="" cedrozor/myrtille(:tag) + +To list the containers: +docker ps -a + +To open a shell into a container (and be able to explore it, check its **ip address**, logs, etc.): +docker exec -it cmd +docker exec -it powershell + +To stop a container +docker stop + +If you intend to have custom settings, manage your hosts or keep track of the logs, you will need to perform additional steps (**data persistence**). + +More details into **Dockerfile**. + ## Remote Desktop Services **For best experience**, and be able to go over the default limit of 2 concurrent users, you will need to install the [RDS role](https://www.exitthefastlane.com/2016/05/native-rds-in-server2016-part-1-basics.html) on your remote server(s). Optionally, you can install the [RD Connection Broker](https://www.tech-coffee.net/rds-2016-farm-deploy-the-farm-in-azure/) feature to allow load-balancing across an RDS farm (possibly hosted on Azure) and manage the applications allowed to run (and with which parameters) on session start. @@ -62,6 +93,10 @@ You will also need to enable [multiple sessions per user](https://portal.databas The RDS role offers you a **grace period of 120 days** after which you will need to use an [RD License Server](https://www.exitthefastlane.com/2016/06/native-rds-in-server2016-part-3-rdsh.html) with proper licenses (CALs) to suit your licensing mode ("Per Device" or "Per User"). +**PLEASE READ!** starting with Windows Server 2019 (or Windows 10 release 1903), RDS doesn't reconnect a previously disconnected session (due to a network issue or a manual disconnect) when multiple sessions per user is enabled on the RDS host; instead, it creates a new session. A workaround to that behavior is to lock the session before disconnecting the session (see https://nakedsecurity.sophos.com/2019/06/06/microsoft-dismisses-new-windows-rdp-bug-as-a-feature/ and https://social.technet.microsoft.com/Forums/windowsserver/en-US/baa5cb75-2fed-4d90-bbc6-404eab4aa20d/2019-rdsh-not-able-reconnect-to-disconnected-session-every-time-new-session-with?forum=winserverTS). + +Consequently, starting from version 2.8.0, Myrtille scales the session display instead of reconnecting the session (with the new browser size), when the browser is resized. To change that default setting, edit (myrtille path)\js\config.js ("display" section). In addition, you can choose whether or not to keep the aspect ratio of the display (default = don't keep). + ## Auto-connect / Start remote application from URL Starting from version 1.3.0, it's possible to connect and run a program automatically, on session start, from an URL. It's a feature comparable to remoteApp (.rdp files). @@ -241,7 +276,7 @@ NOTE: If you have enabled Enterprise Mode and wish to sync your Active Directory - Create an application (choose Applications from the menu), then click New, enter a Name and save. You will be directed to the application details page, grant access to the user group created in Step 2 - Within the application page, click the button Application Key, this will display the information to configure myrtille -Once these steps are completed, edit the app.config file of Myrtille.Services and uncomment the following appSettings: +Once these steps are completed, edit [myrtille path]\bin\Myrtille.Services.exe.config and uncomment the following appSettings: - `MFAAuthAdapter`, this is the OASIS MFA adapter - `OASISApiKey`, this is the API Key found when you clicked Application Key in step 5 - `OASISAppID`, this is the App ID found when you clicked Application Key in step 5 @@ -264,7 +299,7 @@ The enterprise mode provides the following additional features: - Access to hosts can be restricted based on the groups the authenticated users belongs to - Administrators can create a single use session url to a specific host (with specific login credentials) which can be shared with external (non domain) users and only be used once -To enable enterprise mode, edit the app.config file of Myrtille.Services and uncomment the following appSettings: +To enable enterprise mode, edit [myrtille path]\bin\Myrtille.Services.exe.config and uncomment the following appSettings: - `EnterpriseAdapter`, this is the adapter to use for enterprise mode - `EnterpriseAdminGroup`, this is the security group which will define a user as an administrator who can create, edit, delete hosts, define access to hosts and create single use sessions - `EnterpriseDomain`, this is the name of your domain (i.e. MYDOMAIN or mydomain.local) if myrtille is part of it or the domain controller FQDN or IP otherwise @@ -274,6 +309,8 @@ To specify a custom path for the MyrtilleEnterprise database or use another SQL If you wish to create your own enterprise adapter (with a different authentication, database or behavior), `Myrtille.Services.Contracts` contains the interfaces you need. +From version 2.8.0, myrtille provides a simplified host management designed for a local administrator, without the need for a domain and without group access restrictions. The default credentials are "**admin**"/"**admin**" (username/password) and are changed upon first login. See comments into (myrtille path)\bin\Myrtille.Services.exe.config. + ## REST APIs Myrtille can support custom REST APIs, to have additional controls over connections and remote sessions. diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a45cf6a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,100 @@ +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# IMAGE BUILD +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +# base image +# myrtille works with all versions of Windows (desktop and server), starting from Windows 7 and Windows Server 2008; choose the base image you want to use (size may vary) +# the myrtille installer will anyway install the roles and features required by myrtille (see Install.ps1), if they are not already installed on the base image +FROM mcr.microsoft.com/windows/servercore:ltsc2019 +#FROM mcr.microsoft.com/dotnet/framework/aspnet:4.8 +#FROM mcr.microsoft.com/windows:1909 + +# copy the installer into the container +ADD myrtille.msi /myrtille.msi + +# run the installer within the container +# passing params to msiexec to override the default settings of the installer doesn't work; the custom actions just ignore them +# TODO: dig this issue, maybe use orca to change that unwanted behavior? +#RUN msiexec /i myrtille.msi /quiet PDFPRINTER="" +RUN msiexec /i myrtille.msi /quiet + +# open http and https ports on the container +EXPOSE 80 +EXPOSE 443 + +# entry point +SHELL ["powershell"] +RUN Invoke-WebRequest -UseBasicParsing -Uri 'https://dotnetbinaries.blob.core.windows.net/servicemonitor/2.0.1.6/ServiceMonitor.exe' -OutFile 'C:\ServiceMonitor.exe' +ENTRYPOINT ["C:\\ServiceMonitor.exe", "w3svc"] + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# NOTES AND LIMITATIONS +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +# Docker must be configured to use Windows containers, with Hyper-V isolation (see https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/hyperv-container) +# if you want to run Docker within a VM, you will need to enable nested virtualization with Hyper-V (see https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/user-guide/nested-virtualization) +# the host can be Windows 10 Pro or Windows Server 2016 or greater + +# printer and audio redirection through RDP is not supported by Windows containers at the moment +# the myrtille installer used by this Dockerfile must be built with the PDF printer option unchecked + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# DATA PERSISTENCE +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +# the myrtille image will use the default settings, empty database and logs +# every new container based on it will have the same default settings, empty database and logs + +# if you intend to have custom settings, manage your hosts or keep track of the logs, you can (non-exhaustively): +# - create a Dockerfile with myrtille as a base image and copy your modified files over the original ones (replacing them) +# - commit a modified container into a new image (i.e.: "myrtille_custom") that will be your new image reference + +# the 1st method is preferred because it will help you to keep track of your changes +# this will be helpful when you want to use a newer myrtille version (using a different tag) and report these changes +# for example, you could set the myrtille admin password (bin\myrtille.services.exe.config, "LocalAdminPassword") once for all +# regarding the hosts management, you could use an external database (bin\myrtille.services.exe.config, "enterpriseDBConnection"), so that every container will share the same data +# build your Dockerfile with a different image name (i.e.: "myrtille_custom") + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# USEFUL COMMANDS +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +# IMPORTANT! if you have a ~ 15 secs delay on each Docker command under Windows, disable NETBIOS over TCP/IP on each of your network adapters (TCP/IP v4 Properties) +# see https://github.com/docker/for-win/issues/2131#issuecomment-505286617 + +# to list the network adapters available to Docker: +# docker network ls + +# to build the myrtille image (using Docker Desktop or Toolbox), have this Dockerfile and the myrtille installer (.msi file) into a folder, move into this folder then run this command: +# you also need to provide a network adapter able to download the service monitor during the build. Optionally, you can add a version tag to the image (useful to manage different versions of myrtille) +# docker build --network="" -t myrtille(:tag) . + +# to run an image (in detached mode) and provide the resulting container a network adapter able to connect your hosts: +# docker run -d --network="" (:tag) + +# to list the containers: +# docker ps -a + +# to open a shell into a container (and be able to explore it, check its ip address, logs, etc.): +# docker exec -it cmd +# docker exec -it powershell + +# to stop a container: +# docker stop + +# to commit a container into a new image (and be able to persist its config, data and logs): +# docker commit (:tag) + +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +# DISK CLEANUP +# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +# after a while, you might want to clean the unused containers and images to free some space + +# remove all containers (powershell): +# docker rm $ (docker ps -a -q) + +# remove all dangling images: +# docker image prune + +# more help: https://docs.docker.com/ \ No newline at end of file diff --git a/Myrtille.Admin.Services/Controllers/ConnectionController.cs b/Myrtille.Admin.Services/Controllers/ConnectionController.cs index e8a4f29..e543def 100644 --- a/Myrtille.Admin.Services/Controllers/ConnectionController.cs +++ b/Myrtille.Admin.Services/Controllers/ConnectionController.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Admin.Services/Myrtille.Admin.Services.Install.ps1 b/Myrtille.Admin.Services/Myrtille.Admin.Services.Install.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..c16e1d5735b2b1ad1c39ca89b827f988fdd02342 GIT binary patch literal 3104 zcmd6pU2hUW6o$_&CjN(&asi2K?6vWt()y7oB?ZGpV=M)VM7}IwC5?YwecqX!UACnd z+B7j_XP22X=e+0Zo%!>7&rYmw-)(6_yX0$bkyV*n+Qbg{cVImmvo_(G+X9&m|5xW=m+R66ZIIyx+?6Z?ut?F#_W;W1X?ZyT;maveL45U}`ek=3RG^ZT@Atim4|Tt~R<3 zk5EMD{^>Bw3&mRK6oJUDd1m+-GGAiW%LbVW66>*PBC!C8qP4`^UaGx}T-e=BEL7|z z`@?KxzfzQ?bYHOKqxmA0*kk7yJ*w)6_XVTS3%B%-`T06jPnCwAQyD z$SX^VigNCKsX8QmbS~4?1~MZgyJR+^URN$kbFirUn$G^rA!%T3%71m{JjLE-R$Qt=ffezG@>rmb{kve^YgK@9ty&2+llM5t*O9r};9He06B|my z{ro&+?;HUu@7s#`ld_KF@X!V}!sr+wz`S?{lv1 zTE&mwW9xC;twtZa!xUXr_5fb^LEe<-VZz>?A3QrKs=7Pq1l0-edorALn{J8uGv|aI z9dc9UJ{E2!#q{jeUBGjN?p$?v_lVOzW2pRj7Q;7j!oFF5ih*=dNN4Buc_W9bk#74|z{AV^tr^`6z z`P82H|EV3Ik=T&cb9?P|6F>H?YBf9aS}oRT?FgAxI{!PhLax;*I#v6GUWUcE(~Z5d zioNA~2!=Gb8EiN^wF?l9nLR`A4H_5V?_+0-mDKN7^P_gI*jME8rD31#1LHB4ua@tf zCH^sz6W-_EF9!l=Wh~x+aE^SqlpkO#vr8m>_6*S(c$vd;@o(8jYZA>iqXXj+<00b- z&jaR;mNO^z9!zbd9iE3?v%^9f@Hc!a`X``Tlc7jyg+Iz_5oHBeM?n z-uNiZz@j>6`~4>#NsHaae5*!gIra`x#X3d%$lIOxQEUlSq{_))hr7d`#!7WHJjN-= zg++UaonfuwBJK~7O_$ zUH>lgw_`8+=r!3>F`MG&Dofj-QR@+msXVhI+9XUXKR z@Q;Z|!IpJDqi%btr+lvaRj0z#lf<-#`xxzS<3QY797@<_vx97pin{uPZxZf%xFCs|prNy41V45@yvEWjFCwwI=$d9h^PK>K@jmt?xc# zij8oxgdVkEjclkQXP^y8#U*JbIl~m2ZShcl_!sOcc@zzHzxIBrUx%~wajYy6t8Klh z$n;}*DNcrdueY9$w|Y^mkD_X~W6}v9I)f0YwnK+6*!-~S5o0U%1+F!Tt#~=XYB&`d zRAT7lU6>H=2tr?Cg|yYv*UziH+@I)cd~SMN_`59w_jy}%wEyqv-~0^Tg;9)Dr75G) zyKTNb488O9tZZcVjJU6#PvMLUIJEx`^L_FY``cjIzYD&oio?wz!=}#nfIOaZ_uUcK z&m7ggtkk)U#d}FPKXr8z2;9+)>ySHKlTHyCs~gMeY1V*$jpa#Qco8|ac~jHfD$Ygz G)$9+&K;M}F literal 0 HcmV?d00001 diff --git a/Myrtille.Admin.Services/Myrtille.Admin.Services.csproj b/Myrtille.Admin.Services/Myrtille.Admin.Services.csproj index df7bc81..1c4dc50 100644 --- a/Myrtille.Admin.Services/Myrtille.Admin.Services.csproj +++ b/Myrtille.Admin.Services/Myrtille.Admin.Services.csproj @@ -93,6 +93,12 @@ Designer + + Always + + + Always + SettingsSingleFileGenerator diff --git a/Myrtille.Admin.Services/MyrtilleApiHost.cs b/Myrtille.Admin.Services/MyrtilleApiHost.cs index fdb4317..cb27ce3 100644 --- a/Myrtille.Admin.Services/MyrtilleApiHost.cs +++ b/Myrtille.Admin.Services/MyrtilleApiHost.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Admin.Services/Program.cs b/Myrtille.Admin.Services/Program.cs index 65b01d0..d52891a 100644 --- a/Myrtille.Admin.Services/Program.cs +++ b/Myrtille.Admin.Services/Program.cs @@ -1,4 +1,22 @@ -using System; +/* + Myrtille: A native HTML4/5 Remote Desktop Protocol client. + + Copyright(c) 2014-2020 Cedric Coste + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +using System; using System.ServiceProcess; namespace Myrtille.Admin.Services diff --git a/Myrtille.Admin.Services/Properties/AssemblyInfo.cs b/Myrtille.Admin.Services/Properties/AssemblyInfo.cs index 8617b33..de2be95 100644 --- a/Myrtille.Admin.Services/Properties/AssemblyInfo.cs +++ b/Myrtille.Admin.Services/Properties/AssemblyInfo.cs @@ -10,7 +10,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Myrtille")] -[assembly: AssemblyCopyright("Copyright © 2014-2019 Cedric Coste")] +[assembly: AssemblyCopyright("Copyright © 2014-2020 Cedric Coste")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.7.1.0")] -[assembly: AssemblyFileVersion("2.7.1.0")] +[assembly: AssemblyVersion("2.8.0.0")] +[assembly: AssemblyFileVersion("2.8.0.0")] diff --git a/Myrtille.Admin.Services/Services/ConnectionService.cs b/Myrtille.Admin.Services/Services/ConnectionService.cs index 4d5faf6..9175fa8 100644 --- a/Myrtille.Admin.Services/Services/ConnectionService.cs +++ b/Myrtille.Admin.Services/Services/ConnectionService.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Admin.Services/ServicesInstaller.cs b/Myrtille.Admin.Services/ServicesInstaller.cs index 8e73204..4ffe211 100644 --- a/Myrtille.Admin.Services/ServicesInstaller.cs +++ b/Myrtille.Admin.Services/ServicesInstaller.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,8 +20,8 @@ limitations under the License. using System.Collections; using System.ComponentModel; using System.Configuration.Install; +using System.Diagnostics; using System.IO; -using System.ServiceProcess; using System.Windows.Forms; using System.Xml; using Myrtille.Helpers; @@ -31,43 +31,6 @@ namespace Myrtille.Admin.Services [RunInstaller(true)] public class ServicesInstaller : Installer { - // required designer variable - private Container components = null; - - private ServiceProcessInstaller serviceProcessInstaller; - private ServiceInstaller serviceInstaller; - - #region Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.serviceProcessInstaller = new ServiceProcessInstaller(); - this.serviceProcessInstaller.Account = ServiceAccount.LocalSystem; - this.serviceProcessInstaller.Password = null; - this.serviceProcessInstaller.Username = null; - - this.serviceInstaller = new ServiceInstaller(); - this.serviceInstaller.ServiceName = "Myrtille.Admin.Services"; - this.serviceInstaller.Description = "Myrtille Admin API"; - this.serviceInstaller.StartType = ServiceStartMode.Automatic; - - this.Installers.AddRange(new Installer[] { - this.serviceProcessInstaller, - this.serviceInstaller}); - } - - #endregion - - public ServicesInstaller() - { - // This call is required by the Designer. - InitializeComponent(); - } - public override void Install( IDictionary stateSaver) { @@ -95,6 +58,31 @@ public override void Install( try { + var process = new Process(); + + bool debug = true; + + #if !DEBUG + debug = false; + process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; + #endif + + process.StartInfo.FileName = string.Format(@"{0}\WindowsPowerShell\v1.0\powershell.exe", Environment.Is64BitOperatingSystem && !Environment.Is64BitProcess ? Environment.SystemDirectory.ToLower().Replace("system32", "sysnative") : Environment.SystemDirectory); + process.StartInfo.Arguments = "-ExecutionPolicy Bypass" + + " -Command \"& '" + Path.Combine(Path.GetFullPath(Context.Parameters["targetdir"]), "bin", "Myrtille.Admin.Services.Install.ps1") + "'" + + " -BinaryPath '" + Path.Combine(Path.GetFullPath(Context.Parameters["targetdir"]), "bin", "Myrtille.Admin.Services.exe") + "'" + + " -DebugMode " + (debug ? "1" : "0") + + " 3>&1 2>&1 | Tee-Object -FilePath '" + Path.Combine(Path.GetFullPath(Context.Parameters["targetdir"]), "log", "Myrtille.Admin.Services.Install.log") + "'" + "\""; + + process.Start(); + process.WaitForExit(); + if (process.ExitCode != 0) + { + throw new Exception(string.Format("An error occured while running {0}. See {1} for more information.", + Path.Combine(Path.GetFullPath(Context.Parameters["targetdir"]), "bin", "Myrtille.Admin.Services.Install.ps1"), + Path.Combine(Path.GetFullPath(Context.Parameters["targetdir"]), "log", "Myrtille.Admin.Services.Install.log"))); + } + // load config var config = new XmlDocument(); var configPath = Path.Combine(Path.GetFullPath(Context.Parameters["targetdir"]), "bin", "Myrtille.Admin.Services.exe.config"); @@ -135,13 +123,12 @@ public override void Commit( IDictionary savedState) { base.Commit(savedState); - StartService(); + // insert code as needed } public override void Rollback( IDictionary savedState) { - StopService(); base.Rollback(savedState); DoUninstall(); } @@ -149,81 +136,44 @@ public override void Rollback( public override void Uninstall( IDictionary savedState) { - StopService(); base.Uninstall(savedState); DoUninstall(); } - private void StartService() + private void DoUninstall() { - Context.LogMessage("Starting Myrtille.Admin.Services"); + // enable the line below to debug this installer; disable otherwise + //MessageBox.Show("Attach the .NET debugger to the 'MSI Debug' msiexec.exe process now for debug. Click OK when ready...", "MSI Debug"); - // try to start the service - // in case of failure, ask for a manual start after install + Context.LogMessage("Uninstalling Myrtille.Admin.Services"); try { - var sc = new ServiceController(serviceInstaller.ServiceName); - if (sc.Status == ServiceControllerStatus.Stopped) - { - sc.Start(); - Context.LogMessage("Started Myrtille.Admin.Services"); - } - else - { - Context.LogMessage(string.Format("Myrtille.Admin.Services is not stopped (status: {0})", sc.Status)); - } - } - catch (Exception exc) - { - MessageBox.Show( - ActiveWindow.Active, - serviceInstaller.ServiceName + " windows service could not be started by this installer. Please do it manually once the installation is complete", - serviceInstaller.ServiceName, - MessageBoxButtons.OK, - MessageBoxIcon.Warning); - - Context.LogMessage(string.Format("Failed to start Myrtille.Admin.Services ({0})", exc)); - } - } + var process = new Process(); - private void StopService() - { - Context.LogMessage("Stopping Myrtille.Admin.Services"); + bool debug = true; - // if the service is running while uninstall is going on, the user is asked wether to stop it or not - // problem is, if the user choose "no", the service is not stopped thus won't be removed - // force stop it at this step, if not already done + #if !DEBUG + debug = false; + process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; + #endif - try - { - var sc = new ServiceController(serviceInstaller.ServiceName); - if (sc.Status == ServiceControllerStatus.Running) - { - sc.Stop(); - Context.LogMessage("Stopped Myrtille.Admin.Services"); - } - else + process.StartInfo.FileName = string.Format(@"{0}\WindowsPowerShell\v1.0\powershell.exe", Environment.Is64BitOperatingSystem && !Environment.Is64BitProcess ? Environment.SystemDirectory.ToLower().Replace("system32", "sysnative") : Environment.SystemDirectory); + process.StartInfo.Arguments = "-ExecutionPolicy Bypass" + + " -Command \"& '" + Path.Combine(Path.GetFullPath(Context.Parameters["targetdir"]), "bin", "Myrtille.Admin.Services.Uninstall.ps1") + "'" + + " -DebugMode " + (debug ? "1" : "0") + + " 3>&1 2>&1 | Tee-Object -FilePath '" + Path.Combine(Path.GetFullPath(Context.Parameters["targetdir"]), "log", "Myrtille.Admin.Services.Uninstall.log") + "'" + "\""; + + process.Start(); + process.WaitForExit(); + if (process.ExitCode != 0) { - Context.LogMessage(string.Format("Myrtille.Admin.Services is not running (status: {0})", sc.Status)); + throw new Exception(string.Format("An error occured while running {0}. See {1} for more information.", + Path.Combine(Path.GetFullPath(Context.Parameters["targetdir"]), "bin", "Myrtille.Admin.Services.Uninstall.ps1"), + Path.Combine(Path.GetFullPath(Context.Parameters["targetdir"]), "log", "Myrtille.Admin.Services.Uninstall.log"))); } - } - catch (Exception exc) - { - Context.LogMessage(string.Format("Failed to stop Myrtille.Admin.Services ({0})", exc)); - } - } - - private void DoUninstall() - { - // enable the line below to debug this installer; disable otherwise - //MessageBox.Show("Attach the .NET debugger to the 'MSI Debug' msiexec.exe process now for debug. Click OK when ready...", "MSI Debug"); - - Context.LogMessage("Uninstalling Myrtille.Admin.Services"); - try - { - // if needed + Context.LogMessage("Uninstalled Myrtille.Admin.Services"); } catch (Exception exc) { @@ -231,21 +181,5 @@ private void DoUninstall() throw; } } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( - bool disposing) - { - if (disposing) - { - if (components != null) - { - components.Dispose(); - } - } - base.Dispose(disposing); - } } } \ No newline at end of file diff --git a/Myrtille.Admin.Web/Default.aspx b/Myrtille.Admin.Web/Default.aspx index 1e5c526..802ba95 100644 --- a/Myrtille.Admin.Web/Default.aspx +++ b/Myrtille.Admin.Web/Default.aspx @@ -1,7 +1,7 @@ <%-- Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Admin.Web/Default.aspx.cs b/Myrtille.Admin.Web/Default.aspx.cs index d636308..f790ab5 100644 --- a/Myrtille.Admin.Web/Default.aspx.cs +++ b/Myrtille.Admin.Web/Default.aspx.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Admin.Web/Logout.aspx b/Myrtille.Admin.Web/Logout.aspx index 2b1ef53..691cef4 100644 --- a/Myrtille.Admin.Web/Logout.aspx +++ b/Myrtille.Admin.Web/Logout.aspx @@ -1,4 +1,22 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Logout.aspx.cs" Inherits="Myrtille.Admin.Web.Logout" %> +<%-- + Myrtille: A native HTML4/5 Remote Desktop Protocol client. + + Copyright(c) 2014-2020 Cedric Coste + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--%> + +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Logout.aspx.cs" Inherits="Myrtille.Admin.Web.Logout" %> diff --git a/Myrtille.Admin.Web/Logout.aspx.cs b/Myrtille.Admin.Web/Logout.aspx.cs index 857f5f6..6fda83d 100644 --- a/Myrtille.Admin.Web/Logout.aspx.cs +++ b/Myrtille.Admin.Web/Logout.aspx.cs @@ -1,9 +1,22 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; +/* + Myrtille: A native HTML4/5 Remote Desktop Protocol client. + + Copyright(c) 2014-2020 Cedric Coste + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +using System; namespace Myrtille.Admin.Web { diff --git a/Myrtille.Admin.Web/Properties/AssemblyInfo.cs b/Myrtille.Admin.Web/Properties/AssemblyInfo.cs index 4b1de02..f73b8bd 100644 --- a/Myrtille.Admin.Web/Properties/AssemblyInfo.cs +++ b/Myrtille.Admin.Web/Properties/AssemblyInfo.cs @@ -10,7 +10,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Myrtille")] -[assembly: AssemblyCopyright("Copyright © 2014-2019 Cedric Coste")] +[assembly: AssemblyCopyright("Copyright © 2014-2020 Cedric Coste")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -31,5 +31,5 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("2.7.1.0")] -[assembly: AssemblyFileVersion("2.7.1.0")] +[assembly: AssemblyVersion("2.8.0.0")] +[assembly: AssemblyFileVersion("2.8.0.0")] diff --git a/Myrtille.Admin.Web/css/iframe.css b/Myrtille.Admin.Web/css/iframe.css index b79fa57..8646a56 100644 --- a/Myrtille.Admin.Web/css/iframe.css +++ b/Myrtille.Admin.Web/css/iframe.css @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Admin.Web/js/iframe.js b/Myrtille.Admin.Web/js/iframe.js index 56f3c78..142ba13 100644 --- a/Myrtille.Admin.Web/js/iframe.js +++ b/Myrtille.Admin.Web/js/iframe.js @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Admin.Web/src/CaptureClient.cs b/Myrtille.Admin.Web/src/CaptureClient.cs index 4afecc2..8f49ee0 100644 --- a/Myrtille.Admin.Web/src/CaptureClient.cs +++ b/Myrtille.Admin.Web/src/CaptureClient.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Admin.Web/src/ConnectionClient.cs b/Myrtille.Admin.Web/src/ConnectionClient.cs index e3d1854..c908e7a 100644 --- a/Myrtille.Admin.Web/src/ConnectionClient.cs +++ b/Myrtille.Admin.Web/src/ConnectionClient.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Admin.Web/src/DisconnectionClient.cs b/Myrtille.Admin.Web/src/DisconnectionClient.cs index 07a5c07..ec89532 100644 --- a/Myrtille.Admin.Web/src/DisconnectionClient.cs +++ b/Myrtille.Admin.Web/src/DisconnectionClient.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Admin.Web/src/SharingClient.cs b/Myrtille.Admin.Web/src/SharingClient.cs index 2c69d44..d904df7 100644 --- a/Myrtille.Admin.Web/src/SharingClient.cs +++ b/Myrtille.Admin.Web/src/SharingClient.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Common/Helpers/AccountHelper.cs b/Myrtille.Common/Helpers/AccountHelper.cs index 356496f..9f92768 100644 --- a/Myrtille.Common/Helpers/AccountHelper.cs +++ b/Myrtille.Common/Helpers/AccountHelper.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Common/Helpers/CertificateHelper.cs b/Myrtille.Common/Helpers/CertificateHelper.cs index 7b17d15..a83ad78 100644 --- a/Myrtille.Common/Helpers/CertificateHelper.cs +++ b/Myrtille.Common/Helpers/CertificateHelper.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Common/Helpers/ClientIPHelper.cs b/Myrtille.Common/Helpers/ClientIPHelper.cs index d54225f..46cb27b 100644 --- a/Myrtille.Common/Helpers/ClientIPHelper.cs +++ b/Myrtille.Common/Helpers/ClientIPHelper.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Copyright(c) 2018 Paul Oliver (Olive Innovations) Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/Myrtille.Common/Helpers/RDPCryptoHelper.cs b/Myrtille.Common/Helpers/CryptoHelper.cs similarity index 59% rename from Myrtille.Common/Helpers/RDPCryptoHelper.cs rename to Myrtille.Common/Helpers/CryptoHelper.cs index 87079b7..15dce12 100644 --- a/Myrtille.Common/Helpers/RDPCryptoHelper.cs +++ b/Myrtille.Common/Helpers/CryptoHelper.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -18,14 +18,17 @@ limitations under the License. using System; using System.Diagnostics; +using System.IO; using System.Security.Cryptography; using System.Text; using System.Text.RegularExpressions; namespace Myrtille.Helpers { - public static class RDPCryptoHelper + public static class CryptoHelper { + #region RDP + /* adapted from https://gallery.technet.microsoft.com/scriptcenter/Password-Text-String-34711a5e original script by Ken Sweet @@ -50,7 +53,7 @@ the password hash is 1329 chars length full remoteapp walkthrough: https://mizitechinfo.wordpress.com/2013/07/26/fast-and-easy-how-to-deploy-remoteapp-on-windows-server-2012/ */ - public static string EncryptPassword(string password) + public static string RDP_Encrypt(string password) { try { @@ -71,7 +74,7 @@ public static string EncryptPassword(string password) } } - public static string DecryptPassword(string passwordHash) + public static string RDP_Decrypt(string passwordHash) { try { @@ -91,5 +94,79 @@ public static string DecryptPassword(string passwordHash) throw; } } + + #endregion + + #region AES + + public static string AES_Encrypt(string stringToBeEncrypted, string passwordString) + { + string encrypted; + var passwordBytes = Encoding.UTF8.GetBytes(passwordString); + var bytesToBeEncrypted = Encoding.UTF8.GetBytes(stringToBeEncrypted); + + var saltBytes = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 }; + + using (var ms = new MemoryStream()) + { + using (var AES = new RijndaelManaged()) + { + AES.KeySize = 256; + AES.BlockSize = 128; + + var key = new Rfc2898DeriveBytes(passwordBytes, saltBytes, 1000); + AES.Key = key.GetBytes(AES.KeySize / 8); + AES.IV = key.GetBytes(AES.BlockSize / 8); + + AES.Mode = CipherMode.CBC; + + using (var cs = new CryptoStream(ms, AES.CreateEncryptor(), CryptoStreamMode.Write)) + { + cs.Write(bytesToBeEncrypted, 0, bytesToBeEncrypted.Length); + cs.Close(); + } + encrypted = Convert.ToBase64String(ms.ToArray()); + } + } + + return encrypted; + } + + public static string AES_Decrypt(string stringToBeDecrypted, string passwordString) + { + string decrypted; + var bytesToBeDecrypted = Convert.FromBase64String(stringToBeDecrypted); + var passwordBytes = Encoding.UTF8.GetBytes(passwordString); + + // Set your salt here, change it to meet your flavor: + // The salt bytes must be at least 8 bytes. + var saltBytes = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 }; + + using (var ms = new MemoryStream()) + { + using (var AES = new RijndaelManaged()) + { + AES.KeySize = 256; + AES.BlockSize = 128; + + var key = new Rfc2898DeriveBytes(passwordBytes, saltBytes, 1000); + AES.Key = key.GetBytes(AES.KeySize / 8); + AES.IV = key.GetBytes(AES.BlockSize / 8); + + AES.Mode = CipherMode.CBC; + + using (var cs = new CryptoStream(ms, AES.CreateDecryptor(), CryptoStreamMode.Write)) + { + cs.Write(bytesToBeDecrypted, 0, bytesToBeDecrypted.Length); + cs.Close(); + } + decrypted = Encoding.UTF8.GetString(ms.ToArray()); + } + } + + return decrypted; + } + + #endregion } } \ No newline at end of file diff --git a/Myrtille.Common/Helpers/FileHelper.cs b/Myrtille.Common/Helpers/FileHelper.cs index 9fd8a45..897bdb0 100644 --- a/Myrtille.Common/Helpers/FileHelper.cs +++ b/Myrtille.Common/Helpers/FileHelper.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Common/Helpers/FirewallHelper.cs b/Myrtille.Common/Helpers/FirewallHelper.cs index 6d31632..4f06837 100644 --- a/Myrtille.Common/Helpers/FirewallHelper.cs +++ b/Myrtille.Common/Helpers/FirewallHelper.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Common/Helpers/GuidHelper.cs b/Myrtille.Common/Helpers/GuidHelper.cs index 0de2e42..84d95c5 100644 --- a/Myrtille.Common/Helpers/GuidHelper.cs +++ b/Myrtille.Common/Helpers/GuidHelper.cs @@ -1,4 +1,22 @@ -using System; +/* + Myrtille: A native HTML4/5 Remote Desktop Protocol client. + + Copyright(c) 2014-2020 Cedric Coste + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +using System; namespace Myrtille.Helpers { diff --git a/Myrtille.Common/Helpers/HttpSessionHelper.cs b/Myrtille.Common/Helpers/HttpSessionHelper.cs index aeeadd1..ae79752 100644 --- a/Myrtille.Common/Helpers/HttpSessionHelper.cs +++ b/Myrtille.Common/Helpers/HttpSessionHelper.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Common/Helpers/IISHelper.cs b/Myrtille.Common/Helpers/IISHelper.cs index e071235..687b401 100644 --- a/Myrtille.Common/Helpers/IISHelper.cs +++ b/Myrtille.Common/Helpers/IISHelper.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Common/Helpers/MailHelper.cs b/Myrtille.Common/Helpers/MailHelper.cs new file mode 100644 index 0000000..546d07d --- /dev/null +++ b/Myrtille.Common/Helpers/MailHelper.cs @@ -0,0 +1,195 @@ +/* + Myrtille: A native HTML4/5 Remote Desktop Protocol client. + + Copyright(c) 2014-2020 Cedric Coste + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +using System; +using System.Collections; +using System.ComponentModel; +using System.Diagnostics; +using System.Net.Mail; +using System.Text; + +namespace Myrtille.Helpers +{ + // this class uses "System.Net.Mail", available in .net 2.0+, replacing the deprecated "System.Web.Mail" (.net 1.0) + // a section has to be defined in the project config using this class, as below + + /* + + + + + + + + */ + + public enum MailType + { + Text, + Html + } + + public static class MailHelper + { + // "token" is a user defined value to identify a specific email sent asynchronously. it must be unique. + // if the email has to be sent synchronously, leave "token" null + + public static SmtpClient SendMail( + string from, + string to, + string replyTo, + string cc, + string bcc, + string subject, + string body, + ArrayList filesToAttach, + MailType type, + MailPriority priority, + object token = null) + { + Trace.TraceInformation("Sending mail {0} from {1} to {2}", subject, from, to); + + try + { + var mailMessage = new MailMessage(); + + mailMessage.From = new MailAddress(from); + + // multiple e-mail addresses must be separated with a comma character (",") + mailMessage.To.Add(to); + + if (!string.IsNullOrEmpty(replyTo)) + { + mailMessage.ReplyTo = new MailAddress(replyTo); + } + + if (!string.IsNullOrEmpty(cc)) + { + mailMessage.CC.Add(cc); + } + + if (!string.IsNullOrEmpty(bcc)) + { + mailMessage.Bcc.Add(bcc); + } + + mailMessage.Subject = subject; + mailMessage.SubjectEncoding = Encoding.UTF8; + + mailMessage.Body = body; + mailMessage.BodyEncoding = Encoding.UTF8; + + if (filesToAttach != null && filesToAttach.Count > 0) + { + foreach (string fileToAttach in filesToAttach) + { + mailMessage.Attachments.Add(new Attachment(fileToAttach)); + } + } + + mailMessage.IsBodyHtml = type == MailType.Html; + mailMessage.Priority = priority; + mailMessage.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure; + + var smtpClient = new SmtpClient(); + + if (token != null) + { + smtpClient.SendCompleted += new SendCompletedEventHandler(SendCompletedCallback); + smtpClient.SendAsync(mailMessage, token); + return smtpClient; + } + else + { + smtpClient.Send(mailMessage); + return null; + } + } + catch (SmtpException exc) + { + Trace.TraceError("An SMTP error occurred sending mail {(0)}", exc); + throw; + } + catch (Exception exc) + { + Trace.TraceError("An error occurred sending mail {(0)}", exc); + throw; + } + } + + public static void CancelMail( + SmtpClient smtpClient) + { + try + { + if (smtpClient != null) + { + smtpClient.SendAsyncCancel(); + } + } + catch (SmtpException exc) + { + Trace.TraceError("An SMTP error occurred cancelling mail {(0)}", exc); + throw; + } + catch (Exception exc) + { + Trace.TraceError("An error occurred cancelling mail {(0)}", exc); + throw; + } + } + + private static void SendCompletedCallback( + object sender, + AsyncCompletedEventArgs e) + { + var token = (string)e.UserState; + + if (e.Cancelled) + { + Trace.TraceWarning("The mail was canceled (id:{0})", token); + } + else if (e.Error != null) + { + Trace.TraceError("An error occurred sending mail (id:{0}, error:{1})", token, e.Error.Message); + } + else + { + Trace.TraceInformation("The mail was sent successfully (id:{0})", token); + } + } + + // https://stackoverflow.com/questions/1365407/c-sharp-code-to-validate-email-address + public static bool IsValidEmail(string email) + { + try + { + var addr = new MailAddress(email); + return addr.Address == email; + } + catch + { + return false; + } + } + } +} \ No newline at end of file diff --git a/Myrtille.Common/Helpers/PermissionsHelper.cs b/Myrtille.Common/Helpers/PermissionsHelper.cs index bfe32bd..a63f226 100644 --- a/Myrtille.Common/Helpers/PermissionsHelper.cs +++ b/Myrtille.Common/Helpers/PermissionsHelper.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Common/Helpers/PipeHelper.cs b/Myrtille.Common/Helpers/PipeHelper.cs index dfa499a..4e16a5d 100644 --- a/Myrtille.Common/Helpers/PipeHelper.cs +++ b/Myrtille.Common/Helpers/PipeHelper.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Common/Helpers/ProcessHelper.cs b/Myrtille.Common/Helpers/ProcessHelper.cs index 4e175e4..b949a0b 100644 --- a/Myrtille.Common/Helpers/ProcessHelper.cs +++ b/Myrtille.Common/Helpers/ProcessHelper.cs @@ -1,4 +1,22 @@ -using System; +/* + Myrtille: A native HTML4/5 Remote Desktop Protocol client. + + Copyright(c) 2014-2020 Cedric Coste + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +using System; using System.ComponentModel; using System.Diagnostics; using System.Runtime.InteropServices; diff --git a/Myrtille.Common/Helpers/RemoteSessionCommand.cs b/Myrtille.Common/Helpers/RemoteSessionCommand.cs deleted file mode 100644 index aac6d27..0000000 --- a/Myrtille.Common/Helpers/RemoteSessionCommand.cs +++ /dev/null @@ -1,128 +0,0 @@ -/* - Myrtille: A native HTML4/5 Remote Desktop Protocol client. - - Copyright(c) 2014-2018 Cedric Coste - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -using System.Collections; - -namespace Myrtille.Helpers -{ - public enum RemoteSessionCommand - { - // connection - SendServerAddress = 0, - SendUserDomain = 1, - SendUserName = 2, - SendUserPassword = 3, - SendStartProgram = 4, - ConnectRdpClient = 5, - - // browser - SendBrowserResize = 6, - - // keyboard - SendKeyUnicode = 7, - SendKeyScancode = 8, - - // mouse - SendMouseMove = 9, - SendMouseLeftButton = 10, - SendMouseMiddleButton = 11, - SendMouseRightButton = 12, - SendMouseWheelUp = 13, - SendMouseWheelDown = 14, - - // control - SetStatMode = 15, - SetDebugMode = 16, - SetCompatibilityMode = 17, - SetScaleDisplay = 18, - SetImageEncoding = 19, - SetImageQuality = 20, - SetImageQuantity = 21, - RequestFullscreenUpdate = 22, - RequestRemoteClipboard = 23, - CloseRdpClient = 24 - } - - /* - prefixes (3 chars) are used to serialize commands with strings instead of numbers - they make it easier to read log traces to find out which commands are issued - they must match the prefixes used client side - */ - public static class RemoteSessionCommandMapping - { - public static Hashtable FromPrefix { get; private set; } - public static Hashtable ToPrefix { get; private set; } - - static RemoteSessionCommandMapping() - { - FromPrefix = new Hashtable(); - FromPrefix["SRV"] = RemoteSessionCommand.SendServerAddress; - FromPrefix["DOM"] = RemoteSessionCommand.SendUserDomain; - FromPrefix["USR"] = RemoteSessionCommand.SendUserName; - FromPrefix["PWD"] = RemoteSessionCommand.SendUserPassword; - FromPrefix["PRG"] = RemoteSessionCommand.SendStartProgram; - FromPrefix["CON"] = RemoteSessionCommand.ConnectRdpClient; - FromPrefix["RSZ"] = RemoteSessionCommand.SendBrowserResize; - FromPrefix["KUC"] = RemoteSessionCommand.SendKeyUnicode; - FromPrefix["KSC"] = RemoteSessionCommand.SendKeyScancode; - FromPrefix["MMO"] = RemoteSessionCommand.SendMouseMove; - FromPrefix["MLB"] = RemoteSessionCommand.SendMouseLeftButton; - FromPrefix["MMB"] = RemoteSessionCommand.SendMouseMiddleButton; - FromPrefix["MRB"] = RemoteSessionCommand.SendMouseRightButton; - FromPrefix["MWU"] = RemoteSessionCommand.SendMouseWheelUp; - FromPrefix["MWD"] = RemoteSessionCommand.SendMouseWheelDown; - FromPrefix["STA"] = RemoteSessionCommand.SetStatMode; - FromPrefix["DBG"] = RemoteSessionCommand.SetDebugMode; - FromPrefix["CMP"] = RemoteSessionCommand.SetCompatibilityMode; - FromPrefix["SCA"] = RemoteSessionCommand.SetScaleDisplay; - FromPrefix["ECD"] = RemoteSessionCommand.SetImageEncoding; - FromPrefix["QLT"] = RemoteSessionCommand.SetImageQuality; - FromPrefix["QNT"] = RemoteSessionCommand.SetImageQuantity; - FromPrefix["FSU"] = RemoteSessionCommand.RequestFullscreenUpdate; - FromPrefix["CLP"] = RemoteSessionCommand.RequestRemoteClipboard; - FromPrefix["CLO"] = RemoteSessionCommand.CloseRdpClient; - - ToPrefix = new Hashtable(); - ToPrefix[RemoteSessionCommand.SendServerAddress] = "SRV"; - ToPrefix[RemoteSessionCommand.SendUserDomain] = "DOM"; - ToPrefix[RemoteSessionCommand.SendUserName] = "USR"; - ToPrefix[RemoteSessionCommand.SendUserPassword] = "PWD"; - ToPrefix[RemoteSessionCommand.SendStartProgram] = "PRG"; - ToPrefix[RemoteSessionCommand.ConnectRdpClient] = "CON"; - ToPrefix[RemoteSessionCommand.SendBrowserResize] = "RSZ"; - ToPrefix[RemoteSessionCommand.SendKeyUnicode] = "KUC"; - ToPrefix[RemoteSessionCommand.SendKeyScancode] = "KSC"; - ToPrefix[RemoteSessionCommand.SendMouseMove] = "MMO"; - ToPrefix[RemoteSessionCommand.SendMouseLeftButton] = "MLB"; - ToPrefix[RemoteSessionCommand.SendMouseMiddleButton] = "MMB"; - ToPrefix[RemoteSessionCommand.SendMouseRightButton] = "MRB"; - ToPrefix[RemoteSessionCommand.SendMouseWheelUp] = "MWU"; - ToPrefix[RemoteSessionCommand.SendMouseWheelDown] = "MWD"; - ToPrefix[RemoteSessionCommand.SetStatMode] = "STA"; - ToPrefix[RemoteSessionCommand.SetDebugMode] = "DBG"; - ToPrefix[RemoteSessionCommand.SetCompatibilityMode] = "CMP"; - ToPrefix[RemoteSessionCommand.SetScaleDisplay] = "SCA"; - ToPrefix[RemoteSessionCommand.SetImageEncoding] = "ECD"; - ToPrefix[RemoteSessionCommand.SetImageQuality] = "QLT"; - ToPrefix[RemoteSessionCommand.SetImageQuantity] = "QNT"; - ToPrefix[RemoteSessionCommand.RequestFullscreenUpdate] = "FSU"; - ToPrefix[RemoteSessionCommand.RequestRemoteClipboard] = "CLP"; - ToPrefix[RemoteSessionCommand.CloseRdpClient] = "CLO"; - } - } -} \ No newline at end of file diff --git a/Myrtille.Common/Helpers/WindowHelper.cs b/Myrtille.Common/Helpers/WindowHelper.cs index a7deb74..5d87e06 100644 --- a/Myrtille.Common/Helpers/WindowHelper.cs +++ b/Myrtille.Common/Helpers/WindowHelper.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Common/Helpers/XmlTools.cs b/Myrtille.Common/Helpers/XmlTools.cs index 75f4e95..38eea1e 100644 --- a/Myrtille.Common/Helpers/XmlTools.cs +++ b/Myrtille.Common/Helpers/XmlTools.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Common/Log/Log4netTraceFilter.cs b/Myrtille.Common/Log/Log4netTraceFilter.cs index 9a62ff0..00098aa 100644 --- a/Myrtille.Common/Log/Log4netTraceFilter.cs +++ b/Myrtille.Common/Log/Log4netTraceFilter.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Common/Log/Log4netTraceListener.cs b/Myrtille.Common/Log/Log4netTraceListener.cs index a2ea316..75e3f66 100644 --- a/Myrtille.Common/Log/Log4netTraceListener.cs +++ b/Myrtille.Common/Log/Log4netTraceListener.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Common/Myrtille.Common.csproj b/Myrtille.Common/Myrtille.Common.csproj index 37159d1..a6b8176 100644 --- a/Myrtille.Common/Myrtille.Common.csproj +++ b/Myrtille.Common/Myrtille.Common.csproj @@ -93,10 +93,11 @@ + - + diff --git a/Myrtille.Common/Network/Buffer.cs b/Myrtille.Common/Network/Buffer.cs index 2b8d656..a5e53b0 100644 --- a/Myrtille.Common/Network/Buffer.cs +++ b/Myrtille.Common/Network/Buffer.cs @@ -1,4 +1,22 @@ -using System.Collections.Generic; +/* + Myrtille: A native HTML4/5 Remote Desktop Protocol client. + + Copyright(c) 2014-2020 Cedric Coste + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; diff --git a/Myrtille.Common/Properties/AssemblyInfo.cs b/Myrtille.Common/Properties/AssemblyInfo.cs index 631e4f4..dcc1b1f 100644 --- a/Myrtille.Common/Properties/AssemblyInfo.cs +++ b/Myrtille.Common/Properties/AssemblyInfo.cs @@ -10,7 +10,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Myrtille")] -[assembly: AssemblyCopyright("Copyright © 2014-2019 Cedric Coste")] +[assembly: AssemblyCopyright("Copyright © 2014-2020 Cedric Coste")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -31,5 +31,5 @@ // // Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de révision et de build par défaut // en utilisant '*', comme indiqué ci-dessous : -[assembly: AssemblyVersion("2.7.1.0")] -[assembly: AssemblyFileVersion("2.7.1.0")] +[assembly: AssemblyVersion("2.8.0.0")] +[assembly: AssemblyFileVersion("2.8.0.0")] diff --git a/Myrtille.Enterprise/ActiveDirectory.cs b/Myrtille.Enterprise/ActiveDirectory.cs index 6bf1809..3ed94a6 100644 --- a/Myrtille.Enterprise/ActiveDirectory.cs +++ b/Myrtille.Enterprise/ActiveDirectory.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Copyright(c) 2018 Paul Oliver (Olive Innovations) Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,9 +21,7 @@ limitations under the License. using System.Collections.Generic; using System.DirectoryServices; using System.DirectoryServices.AccountManagement; -using System.IO; using System.Linq; -using System.Security.Cryptography; using System.Text; using Myrtille.Helpers; using Myrtille.Services.Contracts; @@ -41,15 +39,7 @@ public void Initialize() } } - /// - /// Authenticate user against an active directory - /// - /// - /// - /// - /// - /// - public EnterpriseSession Authenticate(string username, string password, string adminGroup, string domain) + public EnterpriseSession Authenticate(string username, string password, string adminGroup, string domain, string netbiosDomain) { try { @@ -86,7 +76,8 @@ public EnterpriseSession Authenticate(string username, string password, string a if (!user.PasswordNeverExpires )//&& !user.UserCannotChangePassword) { var expDate = (DateTime)entry.InvokeGet("PasswordExpirationDate"); - if (expDate <= DateTime.Now) + // if the expiration date is not set, its default value is 1970/01/01 + if (expDate <= DateTime.Now && expDate > new DateTime(1970, 1, 1)) { return new EnterpriseSession { @@ -129,8 +120,9 @@ public EnterpriseSession Authenticate(string username, string password, string a session = new Session { + Domain = netbiosDomain, Username = username, - Password = AES_Encrypt(RDPCryptoHelper.EncryptPassword(password), sessionKey), + Password = CryptoHelper.AES_Encrypt(CryptoHelper.RDP_Encrypt(password), sessionKey), SessionID = sessionID, IsAdmin = isAdmin }; @@ -148,6 +140,8 @@ public EnterpriseSession Authenticate(string username, string password, string a db.SaveChanges(); return new EnterpriseSession { + Domain = netbiosDomain, + UserName = username, SessionID = sessionID, SessionKey = sessionKey, IsAdmin = isAdmin, @@ -179,16 +173,11 @@ public EnterpriseSession Authenticate(string username, string password, string a } } - /// - /// Delete user session - /// - /// public void Logout(string sessionID) { using (var db = new MyrtilleEnterpriseDBContext()) { var session = db.Session.FirstOrDefault(m => m.SessionID == sessionID); - if (session != null) { db.Session.Remove(session); @@ -197,12 +186,6 @@ public void Logout(string sessionID) } } - /// - /// Add new host to the platform - /// - /// - /// - /// public long? AddHost(EnterpriseHostEdit editHost, string sessionID) { using (var db = new MyrtilleEnterpriseDBContext()) @@ -241,12 +224,6 @@ public void Logout(string sessionID) } } - /// - /// Get host information from ID and sesssion ID - /// - /// - /// - /// Host information for connection or null if invalid hostid or sessionId specified public EnterpriseHostEdit GetHost(long hostID, string sessionID) { using (var db = new MyrtilleEnterpriseDBContext()) @@ -286,20 +263,18 @@ public EnterpriseHostEdit GetHost(long hostID, string sessionID) } } - /// - /// Update host information - /// - /// - /// - /// public bool UpdateHost(EnterpriseHostEdit editHost, string sessionID) { using (var db = new MyrtilleEnterpriseDBContext()) { if (!db.Session.Any(m => m.SessionID == sessionID && m.IsAdmin && m.Expire > DateTime.Now)) return false; + if (db.Host.Any(m => m.HostName.Equals(editHost.HostName, StringComparison.InvariantCultureIgnoreCase) && m.ID != editHost.HostID)) return false; + var host = db.Host.FirstOrDefault(m => m.ID == editHost.HostID); + if (host == null) return false; + host.HostName = editHost.HostName; host.HostAddress = editHost.HostAddress; host.VMGuid = editHost.VMGuid; @@ -334,12 +309,6 @@ public bool UpdateHost(EnterpriseHostEdit editHost, string sessionID) } } - /// - /// Delete host - /// - /// - /// - /// public bool DeleteHost(long hostID, string sessionID) { using (var db = new MyrtilleEnterpriseDBContext()) @@ -391,11 +360,6 @@ private List GetDirectoryGroups(DirectoryEntry entry) return directoryGroups; } - /// - /// Retrieve a list of hosts the user session is allowed to access - /// - /// - /// public List SessionHosts(string sessionID) { using (var db = new MyrtilleEnterpriseDBContext()) @@ -458,105 +422,140 @@ join h in db.Host on hag.HostID equals h.ID } } - /// - /// Get the connection details for the session and host - /// - /// - /// - /// - /// public EnterpriseConnectionDetails GetSessionConnectionDetails(string sessionID, long hostID, string sessionKey) { using (var db = new MyrtilleEnterpriseDBContext()) { - var session = db.Session + var sessionInfo = db.Session .Where(m => m.SessionID == sessionID && m.Expire > DateTime.Now) .Select(m => new { - SessionID = m.SessionID - , - OneTime = m.OneTime + SessionID = m.SessionID, + OneTime = m.OneTime, + IsAdmin = m.IsAdmin }) .FirstOrDefault(); EnterpriseConnectionDetails result = null; - if (session != null) + if (sessionInfo != null) { - if (session.OneTime) + if (sessionInfo.OneTime) { result = (from s in db.Session - from h in db.Host - where s.SessionID == sessionID - && h.ID == hostID - && s.Expire > DateTime.Now - select new EnterpriseConnectionDetails - { - HostID = h.ID - , - HostName = h.HostName - , - HostAddress = h.HostAddress - , - VMGuid = h.VMGuid - , - VMEnhancedMode = h.VMEnhancedMode - , - HostType = h.HostType - , - Username = s.Username - , - Password = s.Password - , - Protocol = h.Protocol - , - StartRemoteProgram = h.StartRemoteProgram - }) + from h in db.Host + where s.SessionID == sessionID + && h.ID == hostID + && s.Expire > DateTime.Now + select new EnterpriseConnectionDetails + { + HostID = h.ID + , + HostName = h.HostName + , + HostAddress = h.HostAddress + , + VMGuid = h.VMGuid + , + VMEnhancedMode = h.VMEnhancedMode + , + HostType = h.HostType + , + Domain = s.Domain + , + Username = s.Username + , + Password = s.Password + , + Protocol = h.Protocol + , + StartRemoteProgram = h.StartRemoteProgram + }) .FirstOrDefault(); } else { - result = (from s in db.Session - join sg in db.SessionGroup on s.ID equals sg.SessionID - join hag in db.HostAccessGroups on sg.DirectoryGroup equals hag.AccessGroup - join h in db.Host on hag.HostID equals h.ID - join sc in db.SessionHostCredentials on new { x1 = s.ID, x2 = h.ID } equals new {x1 = sc.SessionID, x2 = sc.HostID } into scl - from sc in scl.DefaultIfEmpty() - where s.SessionID == sessionID - && h.ID == hostID - && s.Expire > DateTime.Now - select new EnterpriseConnectionDetails - { - HostID = h.ID - , - HostName = h.HostName - , - HostAddress = h.HostAddress - , - VMGuid = h.VMGuid - , - VMEnhancedMode = h.VMEnhancedMode - , - HostType = h.HostType - , - Username = (h.PromptForCredentials ? sc.Username : s.Username) - , - Password = (h.PromptForCredentials ? sc.Password : s.Password) - , - Protocol = h.Protocol - , - StartRemoteProgram = h.StartRemoteProgram - }) - .FirstOrDefault(); + if (sessionInfo.IsAdmin) + { + result = (from s in db.Session + from h in db.Host + join sc in db.SessionHostCredentials on new { x1 = s.ID, x2 = h.ID } equals new { x1 = sc.SessionID, x2 = sc.HostID } into scl + from sc in scl.DefaultIfEmpty() + where s.SessionID == sessionID + && h.ID == hostID + && s.Expire > DateTime.Now + select new EnterpriseConnectionDetails + { + HostID = h.ID + , + HostName = h.HostName + , + HostAddress = h.HostAddress + , + VMGuid = h.VMGuid + , + VMEnhancedMode = h.VMEnhancedMode + , + HostType = h.HostType + , + Domain = (h.PromptForCredentials ? sc.Domain : s.Domain) + , + Username = (h.PromptForCredentials ? sc.Username : s.Username) + , + Password = (h.PromptForCredentials ? sc.Password : s.Password) + , + Protocol = h.Protocol + , + StartRemoteProgram = h.StartRemoteProgram + }) + .FirstOrDefault(); + } + else + { + result = (from s in db.Session + join sg in db.SessionGroup on s.ID equals sg.SessionID + join hag in db.HostAccessGroups on sg.DirectoryGroup equals hag.AccessGroup + join h in db.Host on hag.HostID equals h.ID + join sc in db.SessionHostCredentials on new { x1 = s.ID, x2 = h.ID } equals new { x1 = sc.SessionID, x2 = sc.HostID } into scl + from sc in scl.DefaultIfEmpty() + where s.SessionID == sessionID + && h.ID == hostID + && s.Expire > DateTime.Now + select new EnterpriseConnectionDetails + { + HostID = h.ID + , + HostName = h.HostName + , + HostAddress = h.HostAddress + , + VMGuid = h.VMGuid + , + VMEnhancedMode = h.VMEnhancedMode + , + HostType = h.HostType + , + Domain = (h.PromptForCredentials ? sc.Domain : s.Domain) + , + Username = (h.PromptForCredentials ? sc.Username : s.Username) + , + Password = (h.PromptForCredentials ? sc.Password : s.Password) + , + Protocol = h.Protocol + , + StartRemoteProgram = h.StartRemoteProgram + }) + .FirstOrDefault(); + } } if (result != null) { - result.Password = AES_Decrypt(result.Password, sessionKey); + result.Password = CryptoHelper.AES_Decrypt(result.Password, sessionKey); } // when connected from the login page, the session logout is based on expiration or user action // when connected from a one time url, the logout is done immediately - if (session.OneTime) + if (sessionInfo.OneTime) { Logout(sessionID); } @@ -566,15 +565,7 @@ from sc in scl.DefaultIfEmpty() } } - /// - /// Create a session, the session URL returned can be given to external users to connect to a specific host using a URL - /// - /// - /// - /// - /// - /// - public string CreateUserSession(string sessionID, long hostID, string username, string password) + public string CreateUserSession(string sessionID, long hostID, string username, string password, string domain) { using (var db = new MyrtilleEnterpriseDBContext()) { @@ -587,8 +578,9 @@ public string CreateUserSession(string sessionID, long hostID, string username, var session = new Session { + Domain = domain, Username = username, - Password = AES_Encrypt(RDPCryptoHelper.EncryptPassword(password), sessionKey), + Password = CryptoHelper.AES_Encrypt(CryptoHelper.RDP_Encrypt(password), sessionKey), SessionID = newSessionID, IsAdmin = false, Expire = DateTime.Now.AddHours(1), @@ -602,13 +594,6 @@ public string CreateUserSession(string sessionID, long hostID, string username, } } - /// - /// Change password for user - /// - /// - /// - /// - /// public bool ChangeUserPassword(string username, string oldPassword, string newPassword, string domain) { try @@ -626,11 +611,6 @@ public bool ChangeUserPassword(string username, string oldPassword, string newPa } } - /// - /// Add override credentials for specific session host - /// - /// - /// public bool AddSessionHostCredentials(EnterpriseHostSessionCredentials credentials) { using (var db = new MyrtilleEnterpriseDBContext()) @@ -642,7 +622,7 @@ public bool AddSessionHostCredentials(EnterpriseHostSessionCredentials credentia if (!db.Host.Any(m => m.ID == credentials.HostID)) return false; var sessionHost = db.SessionHostCredentials.FirstOrDefault(m => m.SessionID == session.ID - && m.HostID == m.HostID); + && m.HostID == credentials.HostID); if(sessionHost != null) { @@ -653,8 +633,9 @@ public bool AddSessionHostCredentials(EnterpriseHostSessionCredentials credentia { SessionID = session.ID, HostID = credentials.HostID, + Domain = credentials.Domain, Username = credentials.Username, - Password = AES_Encrypt(RDPCryptoHelper.EncryptPassword(credentials.Password), credentials.SessionKey), + Password = CryptoHelper.AES_Encrypt(CryptoHelper.RDP_Encrypt(credentials.Password), credentials.SessionKey) }; @@ -664,78 +645,5 @@ public bool AddSessionHostCredentials(EnterpriseHostSessionCredentials credentia return true; } } - - #region aes encryption - - private static string AES_Encrypt(string stringToBeEncrypted, string passwordString) - { - string encrypted; - byte[] passwordBytes = Encoding.UTF8.GetBytes(passwordString); - byte[] bytesToBeEncrypted = Encoding.UTF8.GetBytes(stringToBeEncrypted); - - byte[] saltBytes = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 }; - - using (MemoryStream ms = new MemoryStream()) - { - using (RijndaelManaged AES = new RijndaelManaged()) - { - AES.KeySize = 256; - AES.BlockSize = 128; - - var key = new Rfc2898DeriveBytes(passwordBytes, saltBytes, 1000); - AES.Key = key.GetBytes(AES.KeySize / 8); - AES.IV = key.GetBytes(AES.BlockSize / 8); - - AES.Mode = CipherMode.CBC; - - using (var cs = new CryptoStream(ms, AES.CreateEncryptor(), CryptoStreamMode.Write)) - { - cs.Write(bytesToBeEncrypted, 0, bytesToBeEncrypted.Length); - cs.Close(); - } - encrypted = Convert.ToBase64String(ms.ToArray()); - - } - } - - return encrypted; - } - - public string AES_Decrypt(string stringToBeDecrypted, string passwordString) - { - string decryptedString; - byte[] bytesToBeDecrypted = Convert.FromBase64String(stringToBeDecrypted); - byte[] passwordBytes = Encoding.UTF8.GetBytes(passwordString); - - // Set your salt here, change it to meet your flavor: - // The salt bytes must be at least 8 bytes. - byte[] saltBytes = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 }; - - using (MemoryStream ms = new MemoryStream()) - { - using (RijndaelManaged AES = new RijndaelManaged()) - { - AES.KeySize = 256; - AES.BlockSize = 128; - - var key = new Rfc2898DeriveBytes(passwordBytes, saltBytes, 1000); - AES.Key = key.GetBytes(AES.KeySize / 8); - AES.IV = key.GetBytes(AES.BlockSize / 8); - - AES.Mode = CipherMode.CBC; - - using (var cs = new CryptoStream(ms, AES.CreateDecryptor(), CryptoStreamMode.Write)) - { - cs.Write(bytesToBeDecrypted, 0, bytesToBeDecrypted.Length); - cs.Close(); - } - decryptedString = Encoding.UTF8.GetString(ms.ToArray()); - } - } - - return decryptedString; - } - - #endregion } } \ No newline at end of file diff --git a/Myrtille.Enterprise/Data/Host.cs b/Myrtille.Enterprise/Data/Host.cs index 22d2917..3072168 100644 --- a/Myrtille.Enterprise/Data/Host.cs +++ b/Myrtille.Enterprise/Data/Host.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Copyright(c) 2018 Paul Oliver (Olive Innovations) Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/Myrtille.Enterprise/Data/HostAccessGroups.cs b/Myrtille.Enterprise/Data/HostAccessGroups.cs index 9e232cc..9a7f4d2 100644 --- a/Myrtille.Enterprise/Data/HostAccessGroups.cs +++ b/Myrtille.Enterprise/Data/HostAccessGroups.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Copyright(c) 2018 Paul Oliver (Olive Innovations) Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,6 +16,7 @@ You may obtain a copy of the License at See the License for the specific language governing permissions and limitations under the License. */ + using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/Myrtille.Enterprise/Data/MyrtilleEnterpriseDBContext.cs b/Myrtille.Enterprise/Data/MyrtilleEnterpriseDBContext.cs index eccdbfc..7104ef7 100644 --- a/Myrtille.Enterprise/Data/MyrtilleEnterpriseDBContext.cs +++ b/Myrtille.Enterprise/Data/MyrtilleEnterpriseDBContext.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Copyright(c) 2018 Paul Oliver (Olive Innovations) Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,6 +16,7 @@ You may obtain a copy of the License at See the License for the specific language governing permissions and limitations under the License. */ + using System.Data.Entity; using System.Data.SqlServerCe; diff --git a/Myrtille.Enterprise/Data/Session.cs b/Myrtille.Enterprise/Data/Session.cs index 9be3a9f..a40be12 100644 --- a/Myrtille.Enterprise/Data/Session.cs +++ b/Myrtille.Enterprise/Data/Session.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Copyright(c) 2018 Paul Oliver (Olive Innovations) Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,6 +16,7 @@ You may obtain a copy of the License at See the License for the specific language governing permissions and limitations under the License. */ + using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; @@ -32,6 +33,9 @@ public class Session [Index(IsClustered = false), StringLength(100)] public string SessionID { get; set; } + [Index, StringLength(250)] + public string Domain { get; set; } + [Index, StringLength(250)] public string Username { get; set; } diff --git a/Myrtille.Enterprise/Data/SessionGroup.cs b/Myrtille.Enterprise/Data/SessionGroup.cs index a0b40e6..6c6f457 100644 --- a/Myrtille.Enterprise/Data/SessionGroup.cs +++ b/Myrtille.Enterprise/Data/SessionGroup.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Copyright(c) 2018 Paul Oliver (Olive Innovations) Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,6 +16,7 @@ You may obtain a copy of the License at See the License for the specific language governing permissions and limitations under the License. */ + using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/Myrtille.Enterprise/Data/SessionHostCredential.cs b/Myrtille.Enterprise/Data/SessionHostCredential.cs index e34e93f..2ae9bae 100644 --- a/Myrtille.Enterprise/Data/SessionHostCredential.cs +++ b/Myrtille.Enterprise/Data/SessionHostCredential.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Copyright(c) 2018 Paul Oliver (Olive Innovations) Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,6 +16,7 @@ You may obtain a copy of the License at See the License for the specific language governing permissions and limitations under the License. */ + using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; @@ -34,6 +35,9 @@ public class SessionHostCredential [ForeignKey("HostID")] public virtual Host Host { get; set; } + [StringLength(250)] + public string Domain { get; set; } + [StringLength(250)] public string Username { get; set; } diff --git a/Myrtille.Enterprise/Helpers/DirectoryExceptionHelper.cs b/Myrtille.Enterprise/Helpers/DirectoryExceptionHelper.cs index 6c1bba2..7bc828f 100644 --- a/Myrtille.Enterprise/Helpers/DirectoryExceptionHelper.cs +++ b/Myrtille.Enterprise/Helpers/DirectoryExceptionHelper.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Copyright(c) 2018 Paul Oliver (Olive Innovations) Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,6 +16,7 @@ You may obtain a copy of the License at See the License for the specific language governing permissions and limitations under the License. */ + using System; using System.Collections.Generic; using System.Linq; diff --git a/Myrtille.Enterprise/LocalAdmin.cs b/Myrtille.Enterprise/LocalAdmin.cs new file mode 100644 index 0000000..315a737 --- /dev/null +++ b/Myrtille.Enterprise/LocalAdmin.cs @@ -0,0 +1,471 @@ +/* + Myrtille: A native HTML4/5 Remote Desktop Protocol client. + + Copyright(c) 2014-2020 Cedric Coste + Copyright(c) 2018 Paul Oliver (Olive Innovations) + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Linq; +using Myrtille.Helpers; +using Myrtille.Services.Contracts; + +namespace Myrtille.Enterprise +{ + public class LocalAdmin : IEnterpriseAdapter + { + public void Initialize() + { + using (var db = new MyrtilleEnterpriseDBContext()) + { + db.Session.RemoveRange(db.Session); + db.SaveChanges(); + } + } + + public EnterpriseSession Authenticate(string username, string password, string adminGroup, string domain, string netbiosDomain) + { + EnterpriseSession enterpriseSession = null; + + try + { + var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); + var localAdminUser = ((AppSettingsSection)config.GetSection("localAdmin")).Settings["LocalAdminUser"].Value; + var localAdminPassword = ((AppSettingsSection)config.GetSection("localAdmin")).Settings["localAdminPassword"].Value; + if (!username.Equals(localAdminUser)) + { + enterpriseSession = new EnterpriseSession + { + AuthenticationErrorCode = EnterpriseAuthenticationErrorCode.USER_NOT_FOUND + }; + } + else + { + if (!localAdminPassword.Equals("admin")) + { + localAdminPassword = CryptoHelper.AES_Decrypt(localAdminPassword, localAdminUser); + } + if (!password.Equals(localAdminPassword)) + { + enterpriseSession = new EnterpriseSession + { + AuthenticationErrorCode = EnterpriseAuthenticationErrorCode.INVALID_LOGIN_CREDENTIALS + }; + } + else + { + if (password.Equals("admin")) + { + enterpriseSession = new EnterpriseSession + { + AuthenticationErrorCode = EnterpriseAuthenticationErrorCode.PASSWORD_EXPIRED + }; + } + else + { + using (var db = new MyrtilleEnterpriseDBContext()) + { + var session = db.Session.FirstOrDefault(m => m.Username == username); + if (session != null) + { + db.Session.Remove(session); + db.SaveChanges(); + } + + string sessionID = Guid.NewGuid().ToString(); + string sessionKey = Guid.NewGuid().ToString("n"); + + session = new Session + { + Domain = netbiosDomain, + Username = username, + Password = CryptoHelper.AES_Encrypt(CryptoHelper.RDP_Encrypt(password), sessionKey), + SessionID = sessionID, + IsAdmin = true + }; + + db.Session.Add(session); + db.SaveChanges(); + + enterpriseSession = new EnterpriseSession + { + Domain = netbiosDomain, + UserName = username, + SessionID = sessionID, + SessionKey = sessionKey, + IsAdmin = true, + SingleUseConnection = false + }; + } + } + } + } + } + catch (Exception) + { + enterpriseSession = new EnterpriseSession + { + AuthenticationErrorCode = EnterpriseAuthenticationErrorCode.UNKNOWN_ERROR + }; + } + + return enterpriseSession; + } + + public void Logout(string sessionID) + { + using (var db = new MyrtilleEnterpriseDBContext()) + { + var session = db.Session.FirstOrDefault(m => m.SessionID == sessionID); + if (session != null) + { + db.Session.Remove(session); + db.SaveChanges(); + } + } + } + + public long? AddHost(EnterpriseHostEdit editHost, string sessionID) + { + long? hostId = null; + + using (var db = new MyrtilleEnterpriseDBContext()) + { + if (db.Session.Any(m => m.SessionID == sessionID && m.IsAdmin && m.Expire > DateTime.Now) && + !db.Host.Any(m => m.HostName.Equals(editHost.HostName, StringComparison.InvariantCultureIgnoreCase))) + { + var host = new Host + { + HostName = editHost.HostName, + HostAddress = editHost.HostAddress, + VMGuid = editHost.VMGuid, + VMEnhancedMode = editHost.VMEnhancedMode, + Protocol = editHost.Protocol, + HostType = editHost.HostType, + StartRemoteProgram = editHost.StartRemoteProgram, + PromptForCredentials = editHost.PromptForCredentials + }; + + db.Host.Add(host); + db.SaveChanges(); + + hostId = host.ID; + } + } + + return hostId; + } + + public EnterpriseHostEdit GetHost(long hostID, string sessionID) + { + EnterpriseHostEdit hostEdit = null; + + using (var db = new MyrtilleEnterpriseDBContext()) + { + if (db.Session.Any(m => m.SessionID == sessionID && m.IsAdmin && m.Expire > DateTime.Now)) + { + var host = db.Host.FirstOrDefault(m => m.ID == hostID); + if (host != null) + { + hostEdit = new EnterpriseHostEdit + { + HostID = host.ID, + HostName = host.HostName, + HostAddress = host.HostAddress, + VMGuid = host.VMGuid, + VMEnhancedMode = host.VMEnhancedMode, + Protocol = host.Protocol, + HostType = host.HostType, + StartRemoteProgram = host.StartRemoteProgram, + PromptForCredentials = host.PromptForCredentials + }; + } + } + } + + return hostEdit; + } + + public bool UpdateHost(EnterpriseHostEdit editHost, string sessionID) + { + var success = false; + + using (var db = new MyrtilleEnterpriseDBContext()) + { + if (db.Session.Any(m => m.SessionID == sessionID && m.IsAdmin && m.Expire > DateTime.Now)) + { + var host = db.Host.FirstOrDefault(m => m.ID == editHost.HostID); + if (host != null) + { + host.HostName = editHost.HostName; + host.HostAddress = editHost.HostAddress; + host.VMGuid = editHost.VMGuid; + host.VMEnhancedMode = editHost.VMEnhancedMode; + host.Protocol = editHost.Protocol; + host.StartRemoteProgram = editHost.StartRemoteProgram; + host.PromptForCredentials = editHost.PromptForCredentials; + + db.SaveChanges(); + success = true; + } + } + } + + return success; + } + + public bool DeleteHost(long hostID, string sessionID) + { + var success = false; + + using (var db = new MyrtilleEnterpriseDBContext()) + { + if (db.Session.Any(m => m.SessionID == sessionID && m.IsAdmin && m.Expire > DateTime.Now)) + { + var host = db.Host.FirstOrDefault(m => m.ID == hostID); + if (host != null) + { + db.Host.Remove(host); + db.SaveChanges(); + success = true; + } + } + } + + return success; + } + + public List SessionHosts(string sessionID) + { + var hosts = new List(); + + using (var db = new MyrtilleEnterpriseDBContext()) + { + var sessionInfo = db.Session + .Where(m => m.SessionID == sessionID && m.Expire > DateTime.Now) + .Select(m => new + { + SessionID = m.SessionID, + IsAdmin = m.IsAdmin + }) + .FirstOrDefault(); + + if (sessionInfo != null && sessionInfo.IsAdmin) + { + hosts = (from s in db.Session + from h in db.Host + where s.SessionID == sessionID + && s.Expire > DateTime.Now + select new EnterpriseHost + { + HostID = h.ID, + HostName = h.HostName, + HostAddress = h.HostAddress, + VMGuid = h.VMGuid, + VMEnhancedMode = h.VMEnhancedMode, + HostType = h.HostType, + StartRemoteProgram = h.StartRemoteProgram, + PromptForCredentials = h.PromptForCredentials + }) + .Distinct() + .OrderBy(m => m.HostName) + .ToList(); + } + } + + return hosts; + } + + public EnterpriseConnectionDetails GetSessionConnectionDetails(string sessionID, long hostID, string sessionKey) + { + EnterpriseConnectionDetails connection = null; + + using (var db = new MyrtilleEnterpriseDBContext()) + { + var sessionInfo = db.Session + .Where(m => m.SessionID == sessionID && m.Expire > DateTime.Now) + .Select(m => new + { + SessionID = m.SessionID, + OneTime = m.OneTime, + IsAdmin = m.IsAdmin + }) + .FirstOrDefault(); + + if (sessionInfo != null) + { + if (sessionInfo.OneTime) + { + connection = (from s in db.Session + from h in db.Host + where s.SessionID == sessionID + && h.ID == hostID + && s.Expire > DateTime.Now + select new EnterpriseConnectionDetails + { + HostID = h.ID, + HostName = h.HostName, + HostAddress = h.HostAddress, + VMGuid = h.VMGuid, + VMEnhancedMode = h.VMEnhancedMode, + HostType = h.HostType, + Domain = s.Domain, + Username = s.Username, + Password = s.Password, + Protocol = h.Protocol, + StartRemoteProgram = h.StartRemoteProgram + }) + .FirstOrDefault(); + } + else if (sessionInfo.IsAdmin) + { + connection = (from s in db.Session + from h in db.Host + join sc in db.SessionHostCredentials on new { x1 = s.ID, x2 = h.ID } equals new { x1 = sc.SessionID, x2 = sc.HostID } into scl + from sc in scl.DefaultIfEmpty() + where s.SessionID == sessionID + && h.ID == hostID + && s.Expire > DateTime.Now + select new EnterpriseConnectionDetails + { + HostID = h.ID, + HostName = h.HostName, + HostAddress = h.HostAddress, + VMGuid = h.VMGuid, + VMEnhancedMode = h.VMEnhancedMode, + HostType = h.HostType, + Domain = sc.Domain, + Username = sc.Username, + Password = sc.Password, + Protocol = h.Protocol, + StartRemoteProgram = h.StartRemoteProgram + }) + .FirstOrDefault(); + } + + if (connection != null) + { + connection.Password = CryptoHelper.AES_Decrypt(connection.Password, sessionKey); + } + + // when connected from the login page, the session logout is based on expiration or user action + // when connected from a one time url, the logout is done immediately + if (sessionInfo.OneTime) + { + Logout(sessionID); + } + } + } + + return connection; + } + + public string CreateUserSession(string sessionID, long hostID, string username, string password, string domain) + { + string sessionUrl = null; + + using (var db = new MyrtilleEnterpriseDBContext()) + { + if (db.Session.Any(m => m.SessionID == sessionID && m.IsAdmin && m.Expire > DateTime.Now) && + db.Host.Any(m => m.ID == hostID)) + { + string newSessionID = Guid.NewGuid().ToString(); + string sessionKey = Guid.NewGuid().ToString("n"); + + var session = new Session + { + Domain = domain, + Username = username, + Password = CryptoHelper.AES_Encrypt(CryptoHelper.RDP_Encrypt(password), sessionKey), + SessionID = newSessionID, + IsAdmin = false, + Expire = DateTime.Now.AddHours(1), + OneTime = true + }; + + db.Session.Add(session); + db.SaveChanges(); + + sessionUrl = string.Format("?SI={0}&SD={1}&SK={2}", newSessionID, hostID, sessionKey); + } + } + + return sessionUrl; + } + + public bool ChangeUserPassword(string username, string oldPassword, string newPassword, string domain) + { + var success = false; + + var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); + var localAdminUser = ((AppSettingsSection)config.GetSection("localAdmin")).Settings["LocalAdminUser"].Value; + var localAdminPassword = ((AppSettingsSection)config.GetSection("localAdmin")).Settings["localAdminPassword"].Value; + if (username.Equals(localAdminUser)) + { + if (!localAdminPassword.Equals("admin")) + { + localAdminPassword = CryptoHelper.AES_Decrypt(localAdminPassword, localAdminUser); + } + if (oldPassword.Equals(localAdminPassword)) + { + ((AppSettingsSection)config.GetSection("localAdmin")).Settings["localAdminPassword"].Value = CryptoHelper.AES_Encrypt(newPassword, localAdminUser); + config.Save(ConfigurationSaveMode.Modified); + ConfigurationManager.RefreshSection("localAdmin"); + success = true; + } + } + + return success; + } + + public bool AddSessionHostCredentials(EnterpriseHostSessionCredentials credentials) + { + var success = false; + + using (var db = new MyrtilleEnterpriseDBContext()) + { + var session = db.Session.FirstOrDefault(m => m.SessionID == credentials.SessionID); + if (session != null && db.Host.Any(m => m.ID == credentials.HostID)) + { + var sessionHost = db.SessionHostCredentials.FirstOrDefault(m => + m.SessionID == session.ID && + m.HostID == credentials.HostID); + + if (sessionHost != null) + { + db.SessionHostCredentials.Remove(sessionHost); + } + + sessionHost = new SessionHostCredential + { + SessionID = session.ID, + HostID = credentials.HostID, + Domain = credentials.Domain, + Username = credentials.Username, + Password = CryptoHelper.AES_Encrypt(CryptoHelper.RDP_Encrypt(credentials.Password), credentials.SessionKey) + }; + + db.SessionHostCredentials.Add(sessionHost); + db.SaveChanges(); + success = true; + } + } + + return success; + } + } +} \ No newline at end of file diff --git a/Myrtille.Enterprise/Migrations/Configuration.cs b/Myrtille.Enterprise/Migrations/Configuration.cs deleted file mode 100644 index 8ec6671..0000000 --- a/Myrtille.Enterprise/Migrations/Configuration.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Data.Entity.Migrations; - -namespace Myrtille.Enterprise.Migrations -{ - internal sealed class Configuration : DbMigrationsConfiguration - { - public Configuration() - { - AutomaticMigrationsEnabled = true; - AutomaticMigrationDataLossAllowed = true; - - //var migrator = new DbMigrator(this); - //if (migrator.GetPendingMigrations().Any()) - //{ - // migrator.Update(); - //} - } - - protected override void Seed(MyrtilleEnterpriseDBContext context) - { - // This method will be called after migrating to the latest version. - - // You can use the DbSet.AddOrUpdate() helper extension method - // to avoid creating duplicate seed data. E.g. - // - // context.People.AddOrUpdate( - // p => p.FullName, - // new Person { FullName = "Andrew Peters" }, - // new Person { FullName = "Brice Lambson" }, - // new Person { FullName = "Rowan Miller" } - // ); - // - } - } -} \ No newline at end of file diff --git a/Myrtille.Enterprise/Data/MigrationConfiguration.cs b/Myrtille.Enterprise/Migrations/MigrationConfiguration.cs similarity index 97% rename from Myrtille.Enterprise/Data/MigrationConfiguration.cs rename to Myrtille.Enterprise/Migrations/MigrationConfiguration.cs index 34b0efc..fc8b05d 100644 --- a/Myrtille.Enterprise/Data/MigrationConfiguration.cs +++ b/Myrtille.Enterprise/Migrations/MigrationConfiguration.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Copyright(c) 2018 Paul Oliver (Olive Innovations) Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/Myrtille.Enterprise/Myrtille.Enterprise.csproj b/Myrtille.Enterprise/Myrtille.Enterprise.csproj index 8b99411..ceec2ad 100644 --- a/Myrtille.Enterprise/Myrtille.Enterprise.csproj +++ b/Myrtille.Enterprise/Myrtille.Enterprise.csproj @@ -61,16 +61,16 @@ + - + - @@ -86,6 +86,7 @@ Myrtille.Services.Contracts + diff --git a/Myrtille.Enterprise/Properties/AssemblyInfo.cs b/Myrtille.Enterprise/Properties/AssemblyInfo.cs index 51d164c..5bda2f3 100644 --- a/Myrtille.Enterprise/Properties/AssemblyInfo.cs +++ b/Myrtille.Enterprise/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.7.1.0")] -[assembly: AssemblyFileVersion("2.7.1.0")] +[assembly: AssemblyVersion("2.8.0.0")] +[assembly: AssemblyFileVersion("2.8.0.0")] diff --git a/Myrtille.MFAProviders/Properties/AssemblyInfo.cs b/Myrtille.MFAProviders/Properties/AssemblyInfo.cs index 0855d3e..d340ad5 100644 --- a/Myrtille.MFAProviders/Properties/AssemblyInfo.cs +++ b/Myrtille.MFAProviders/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.7.1.0")] -[assembly: AssemblyFileVersion("2.7.1.0")] +[assembly: AssemblyVersion("2.8.0.0")] +[assembly: AssemblyFileVersion("2.8.0.0")] diff --git a/Myrtille.Printer/Properties/AssemblyInfo.cs b/Myrtille.Printer/Properties/AssemblyInfo.cs index 8aa6d99..ccbe388 100644 --- a/Myrtille.Printer/Properties/AssemblyInfo.cs +++ b/Myrtille.Printer/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.7.1.0")] -[assembly: AssemblyFileVersion("2.7.1.0")] +[assembly: AssemblyVersion("2.8.0.0")] +[assembly: AssemblyFileVersion("2.8.0.0")] diff --git a/Myrtille.SSH/PipeMessaging.cs b/Myrtille.SSH/PipeMessaging.cs index 3931b79..88dd3b6 100644 --- a/Myrtille.SSH/PipeMessaging.cs +++ b/Myrtille.SSH/PipeMessaging.cs @@ -2,7 +2,7 @@ Myrtille: A native HTML4/5 Remote Desktop Protocol client. Copyright(c) 2018 Paul Oliver (Olive Innovations) - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.SSH/Program.cs b/Myrtille.SSH/Program.cs index d033657..dc180e3 100644 --- a/Myrtille.SSH/Program.cs +++ b/Myrtille.SSH/Program.cs @@ -2,7 +2,7 @@ Myrtille: A native HTML4/5 Remote Desktop and SSH Protocol client. Copyright(c) 2018 Paul Oliver (Olive Innovations) - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -117,9 +117,13 @@ private static void PipeMessaging_OnMessageReceivedEvent(RemoteSessionCommand co WriteOutput(command, data); ClearOrExitTerminal(data); break; + case RemoteSessionCommand.SendUserDomain: + WriteOutput(command, data); + Domain = data; + break; case RemoteSessionCommand.SendUserName: WriteOutput(command, data); - UserName = data; + UserName = string.IsNullOrEmpty(Domain) ? data : string.Format("{0}\\{1}", Domain, data); break; case RemoteSessionCommand.SendServerAddress: WriteOutput(command, data); @@ -374,6 +378,7 @@ private static void WriteOutput(RemoteSessionCommand command, string data) #endregion #region configuration + private static string Domain { get; set; } // Domain use to create SSH connection private static string UserName { get; set; } // Username use to create SSH connection private static string Password { get; set; } // Password use to create SSH connection private static string ServerAddress { get; set; } //Host to establish SSH connection with diff --git a/Myrtille.SSH/Properties/AssemblyInfo.cs b/Myrtille.SSH/Properties/AssemblyInfo.cs index 49ef7ce..17a131f 100644 --- a/Myrtille.SSH/Properties/AssemblyInfo.cs +++ b/Myrtille.SSH/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.7.1.0")] -[assembly: AssemblyFileVersion("2.7.1.0")] +[assembly: AssemblyVersion("2.8.0.0")] +[assembly: AssemblyFileVersion("2.8.0.0")] diff --git a/Myrtille.Services.Contracts/Adapters/IEnterpriseAdapter.cs b/Myrtille.Services.Contracts/Adapters/IEnterpriseAdapter.cs index 9e00b46..2bb3d86 100644 --- a/Myrtille.Services.Contracts/Adapters/IEnterpriseAdapter.cs +++ b/Myrtille.Services.Contracts/Adapters/IEnterpriseAdapter.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Copyright(c) 2018 Paul Oliver (Olive Innovations) Licensed under the Apache License, Version 2.0 (the "License"); @@ -25,26 +25,98 @@ public interface IEnterpriseAdapter { void Initialize(); - EnterpriseSession Authenticate(string username, string password, string adminGroup, string domain); - + /// + /// Authenticate user + /// + /// + /// + /// + /// the name of your domain (i.e. MYDOMAIN or mydomain.local) or the domain controller FQDN or IP + /// the netbios domain name (i.e. MYDOMAIN) + /// + EnterpriseSession Authenticate(string username, string password, string adminGroup, string domain, string netbiosDomain); + + /// + /// Delete user session + /// + /// void Logout(string sessionID); + /// + /// Add new host to the platform + /// + /// + /// + /// long? AddHost(EnterpriseHostEdit editHost, string sessionID); + /// + /// Get host information from ID and session ID + /// + /// + /// + /// Host information for connection or null if invalid hostid or sessionId specified EnterpriseHostEdit GetHost(long hostID, string sessionID); + /// + /// Update host information + /// + /// + /// + /// bool UpdateHost(EnterpriseHostEdit editHost, string sessionID); + /// + /// Delete host + /// + /// + /// + /// bool DeleteHost(long hostID, string sessionID); + /// + /// Retrieve a list of hosts the user session is allowed to access + /// + /// + /// List SessionHosts(string sessionID); + /// + /// Get the connection details for the session and host + /// + /// + /// + /// + /// EnterpriseConnectionDetails GetSessionConnectionDetails(string sessionID, long hostID, string sessionKey); - string CreateUserSession(string sessionID, long hostID, string username, string password); - + /// + /// Create a session, the session URL returned can be given to external users to connect to a specific host using a URL + /// + /// + /// + /// + /// + /// + /// + string CreateUserSession(string sessionID, long hostID, string username, string password, string domain); + + /// + /// Change password for user + /// + /// + /// + /// + /// + /// + /// bool ChangeUserPassword(string username, string oldPassword, string newPassword, string domain); + /// + /// Add override credentials for specific session host + /// + /// + /// bool AddSessionHostCredentials(EnterpriseHostSessionCredentials credentials); } } \ No newline at end of file diff --git a/Myrtille.Services.Contracts/Adapters/IMultifactorAuthenticationAdapter.cs b/Myrtille.Services.Contracts/Adapters/IMultifactorAuthenticationAdapter.cs index d87b40c..9649b45 100644 --- a/Myrtille.Services.Contracts/Adapters/IMultifactorAuthenticationAdapter.cs +++ b/Myrtille.Services.Contracts/Adapters/IMultifactorAuthenticationAdapter.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Copyright(c) 2018 Paul Oliver (Olive Innovations) Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/Myrtille.Services.Contracts/Enums/CaptureFormat.cs b/Myrtille.Services.Contracts/Enums/CaptureFormat.cs index f4e06fd..d0e6b2d 100644 --- a/Myrtille.Services.Contracts/Enums/CaptureFormat.cs +++ b/Myrtille.Services.Contracts/Enums/CaptureFormat.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Services.Contracts/Enums/EnterpriseMode.cs b/Myrtille.Services.Contracts/Enums/EnterpriseMode.cs new file mode 100644 index 0000000..0655c65 --- /dev/null +++ b/Myrtille.Services.Contracts/Enums/EnterpriseMode.cs @@ -0,0 +1,28 @@ +/* + Myrtille: A native HTML4/5 Remote Desktop Protocol client. + + Copyright(c) 2018 Paul Oliver (Olive Innovations) + Copyright(c) 2014-2020 Cedric Coste + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +namespace Myrtille.Services.Contracts +{ + public enum EnterpriseMode + { + None = 0, + Local = 1, + Domain = 2 + } +} \ No newline at end of file diff --git a/Myrtille.Services.Contracts/Enums/HostType.cs b/Myrtille.Services.Contracts/Enums/HostType.cs index 82d4e9e..f2fbcf7 100644 --- a/Myrtille.Services.Contracts/Enums/HostType.cs +++ b/Myrtille.Services.Contracts/Enums/HostType.cs @@ -2,7 +2,7 @@ Myrtille: A native HTML4/5 Remote Desktop Protocol client. Copyright(c) 2018 Paul Oliver (Olive Innovations) - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Services.Contracts/Enums/RemoteSessionCommand.cs b/Myrtille.Services.Contracts/Enums/RemoteSessionCommand.cs index fff0e82..607ef77 100644 --- a/Myrtille.Services.Contracts/Enums/RemoteSessionCommand.cs +++ b/Myrtille.Services.Contracts/Enums/RemoteSessionCommand.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Services.Contracts/Enums/RemoteSessionExitCode.cs b/Myrtille.Services.Contracts/Enums/RemoteSessionExitCode.cs index f0bb645..cae526b 100644 --- a/Myrtille.Services.Contracts/Enums/RemoteSessionExitCode.cs +++ b/Myrtille.Services.Contracts/Enums/RemoteSessionExitCode.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Services.Contracts/Enums/RemoteSessionState.cs b/Myrtille.Services.Contracts/Enums/RemoteSessionState.cs index 8110a43..c1c0429 100644 --- a/Myrtille.Services.Contracts/Enums/RemoteSessionState.cs +++ b/Myrtille.Services.Contracts/Enums/RemoteSessionState.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Services.Contracts/Enums/SecurityProtocol.cs b/Myrtille.Services.Contracts/Enums/SecurityProtocol.cs index 6f742de..78d1995 100644 --- a/Myrtille.Services.Contracts/Enums/SecurityProtocol.cs +++ b/Myrtille.Services.Contracts/Enums/SecurityProtocol.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Copyright(c) 2018 Paul Oliver (Olive Innovations) Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/Myrtille.Services.Contracts/IApplicationPoolService.cs b/Myrtille.Services.Contracts/IApplicationPoolService.cs index 937c60c..bc4b889 100644 --- a/Myrtille.Services.Contracts/IApplicationPoolService.cs +++ b/Myrtille.Services.Contracts/IApplicationPoolService.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Services.Contracts/ICaptureService.cs b/Myrtille.Services.Contracts/ICaptureService.cs index 27c8c3e..f98c7f8 100644 --- a/Myrtille.Services.Contracts/ICaptureService.cs +++ b/Myrtille.Services.Contracts/ICaptureService.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Services.Contracts/IConnectionService.cs b/Myrtille.Services.Contracts/IConnectionService.cs index c363c3f..6179d63 100644 --- a/Myrtille.Services.Contracts/IConnectionService.cs +++ b/Myrtille.Services.Contracts/IConnectionService.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Services.Contracts/IDisconnectionService.cs b/Myrtille.Services.Contracts/IDisconnectionService.cs index 8c91520..29458dc 100644 --- a/Myrtille.Services.Contracts/IDisconnectionService.cs +++ b/Myrtille.Services.Contracts/IDisconnectionService.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Services.Contracts/IEnterpriseService.cs b/Myrtille.Services.Contracts/IEnterpriseService.cs index 3b38deb..0d66be6 100644 --- a/Myrtille.Services.Contracts/IEnterpriseService.cs +++ b/Myrtille.Services.Contracts/IEnterpriseService.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Copyright(c) 2018 Paul Oliver (Olive Innovations) Licensed under the Apache License, Version 2.0 (the "License"); @@ -25,7 +25,7 @@ namespace Myrtille.Services.Contracts public interface IEnterpriseService { [OperationContract] - bool GetState(); + EnterpriseMode GetMode(); [OperationContract] EnterpriseSession Authenticate(string username, string password); @@ -52,7 +52,7 @@ public interface IEnterpriseService EnterpriseConnectionDetails GetSessionConnectionDetails(string sessionID, long hostID, string sessionKey); [OperationContract] - string CreateUserSession(string sessionID, long hostID, string username, string password); + string CreateUserSession(string sessionID, long hostID, string username, string password, string domain); [OperationContract] bool ChangeUserPassword(string username, string oldPassword, string newPassword); diff --git a/Myrtille.Services.Contracts/IFileStorage.cs b/Myrtille.Services.Contracts/IFileStorage.cs index 21b2bcc..f652651 100644 --- a/Myrtille.Services.Contracts/IFileStorage.cs +++ b/Myrtille.Services.Contracts/IFileStorage.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Services.Contracts/IMFAAuthentication.cs b/Myrtille.Services.Contracts/IMFAAuthentication.cs index d49d8d0..b55abbe 100644 --- a/Myrtille.Services.Contracts/IMFAAuthentication.cs +++ b/Myrtille.Services.Contracts/IMFAAuthentication.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Copyright(c) 2018 Paul Oliver (Olive Innovations) Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/Myrtille.Services.Contracts/IPrinterService.cs b/Myrtille.Services.Contracts/IPrinterService.cs index 0c87c45..bce7466 100644 --- a/Myrtille.Services.Contracts/IPrinterService.cs +++ b/Myrtille.Services.Contracts/IPrinterService.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Services.Contracts/IRemoteSessionProcess.cs b/Myrtille.Services.Contracts/IRemoteSessionProcess.cs index f2f5856..ac69773 100644 --- a/Myrtille.Services.Contracts/IRemoteSessionProcess.cs +++ b/Myrtille.Services.Contracts/IRemoteSessionProcess.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Services.Contracts/ISharingService.cs b/Myrtille.Services.Contracts/ISharingService.cs index 9a03f4a..4190673 100644 --- a/Myrtille.Services.Contracts/ISharingService.cs +++ b/Myrtille.Services.Contracts/ISharingService.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Services.Contracts/Models/Connection.cs b/Myrtille.Services.Contracts/Models/Connection.cs index 9d2745a..9f4ec29 100644 --- a/Myrtille.Services.Contracts/Models/Connection.cs +++ b/Myrtille.Services.Contracts/Models/Connection.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Services.Contracts/Models/ConnectionInfo.cs b/Myrtille.Services.Contracts/Models/ConnectionInfo.cs index c2a5842..f839d60 100644 --- a/Myrtille.Services.Contracts/Models/ConnectionInfo.cs +++ b/Myrtille.Services.Contracts/Models/ConnectionInfo.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Services.Contracts/Models/EnterpriseAuthenticationErrorHelper.cs b/Myrtille.Services.Contracts/Models/EnterpriseAuthenticationErrorHelper.cs index 24fd2af..1a819c0 100644 --- a/Myrtille.Services.Contracts/Models/EnterpriseAuthenticationErrorHelper.cs +++ b/Myrtille.Services.Contracts/Models/EnterpriseAuthenticationErrorHelper.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Copyright(c) 2018 Paul Oliver (Olive Innovations) Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/Myrtille.Services.Contracts/Models/EnterpriseConnectionDetails.cs b/Myrtille.Services.Contracts/Models/EnterpriseConnectionDetails.cs index 22997ea..fbea465 100644 --- a/Myrtille.Services.Contracts/Models/EnterpriseConnectionDetails.cs +++ b/Myrtille.Services.Contracts/Models/EnterpriseConnectionDetails.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Copyright(c) 2018 Paul Oliver (Olive Innovations) Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/Myrtille.Services.Contracts/Models/EnterpriseHost.cs b/Myrtille.Services.Contracts/Models/EnterpriseHost.cs index abe1d54..5d0952c 100644 --- a/Myrtille.Services.Contracts/Models/EnterpriseHost.cs +++ b/Myrtille.Services.Contracts/Models/EnterpriseHost.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Copyright(c) 2018 Paul Oliver (Olive Innovations) Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/Myrtille.Services.Contracts/Models/EnterpriseHostEdit.cs b/Myrtille.Services.Contracts/Models/EnterpriseHostEdit.cs index 7bd2b79..bb56132 100644 --- a/Myrtille.Services.Contracts/Models/EnterpriseHostEdit.cs +++ b/Myrtille.Services.Contracts/Models/EnterpriseHostEdit.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Copyright(c) 2018 Paul Oliver (Olive Innovations) Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/Myrtille.Services.Contracts/Models/EnterpriseHostSessionCredentials.cs b/Myrtille.Services.Contracts/Models/EnterpriseHostSessionCredentials.cs index 88157d6..1576d4c 100644 --- a/Myrtille.Services.Contracts/Models/EnterpriseHostSessionCredentials.cs +++ b/Myrtille.Services.Contracts/Models/EnterpriseHostSessionCredentials.cs @@ -1,6 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. + Copyright(c) 2014-2020 Cedric Coste Copyright(c) 2018 Paul Oliver (Olive Innovations) Licensed under the Apache License, Version 2.0 (the "License"); @@ -22,6 +23,7 @@ public class EnterpriseHostSessionCredentials { public string SessionID { get; set; } public long HostID { get; set; } + public string Domain { get; set; } public string Username { get; set; } public string Password { get; set; } public string SessionKey { get; set; } diff --git a/Myrtille.Services.Contracts/Models/EnterpriseSession.cs b/Myrtille.Services.Contracts/Models/EnterpriseSession.cs index 036184f..487f27f 100644 --- a/Myrtille.Services.Contracts/Models/EnterpriseSession.cs +++ b/Myrtille.Services.Contracts/Models/EnterpriseSession.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Copyright(c) 2018 Paul Oliver (Olive Innovations) Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,6 +21,7 @@ namespace Myrtille.Services.Contracts { public class EnterpriseSession { + public string Domain { get; set; } public string UserName { get; set; } public bool IsAdmin { get; set; } public string SessionID { get; set; } diff --git a/Myrtille.Services.Contracts/Models/GuestInfo.cs b/Myrtille.Services.Contracts/Models/GuestInfo.cs index 481955c..255e7cb 100644 --- a/Myrtille.Services.Contracts/Models/GuestInfo.cs +++ b/Myrtille.Services.Contracts/Models/GuestInfo.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Services.Contracts/Models/HostInfo.cs b/Myrtille.Services.Contracts/Models/HostInfo.cs index 3321319..0587931 100644 --- a/Myrtille.Services.Contracts/Models/HostInfo.cs +++ b/Myrtille.Services.Contracts/Models/HostInfo.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Services.Contracts/Models/UserInfo.cs b/Myrtille.Services.Contracts/Models/UserInfo.cs index 2c3e484..3fd9df6 100644 --- a/Myrtille.Services.Contracts/Models/UserInfo.cs +++ b/Myrtille.Services.Contracts/Models/UserInfo.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Services.Contracts/Models/VMInfo.cs b/Myrtille.Services.Contracts/Models/VMInfo.cs index 4c8ec85..dde8921 100644 --- a/Myrtille.Services.Contracts/Models/VMInfo.cs +++ b/Myrtille.Services.Contracts/Models/VMInfo.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Services.Contracts/Myrtille.Services.Contracts.csproj b/Myrtille.Services.Contracts/Myrtille.Services.Contracts.csproj index 6af61f2..159f8d5 100644 --- a/Myrtille.Services.Contracts/Myrtille.Services.Contracts.csproj +++ b/Myrtille.Services.Contracts/Myrtille.Services.Contracts.csproj @@ -51,6 +51,7 @@ + diff --git a/Myrtille.Services.Contracts/Properties/AssemblyInfo.cs b/Myrtille.Services.Contracts/Properties/AssemblyInfo.cs index ffb2171..0387498 100644 --- a/Myrtille.Services.Contracts/Properties/AssemblyInfo.cs +++ b/Myrtille.Services.Contracts/Properties/AssemblyInfo.cs @@ -10,7 +10,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Myrtille")] -[assembly: AssemblyCopyright("Copyright © 2014-2019 Cedric Coste")] +[assembly: AssemblyCopyright("Copyright © 2014-2020 Cedric Coste")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -32,5 +32,5 @@ // Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut // en utilisant '*', comme indiqué ci-dessous : // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.7.1.0")] -[assembly: AssemblyFileVersion("2.7.1.0")] +[assembly: AssemblyVersion("2.8.0.0")] +[assembly: AssemblyFileVersion("2.8.0.0")] diff --git a/Myrtille.Services/ApplicationPoolService.cs b/Myrtille.Services/ApplicationPoolService.cs index 203fb91..c38ad4f 100644 --- a/Myrtille.Services/ApplicationPoolService.cs +++ b/Myrtille.Services/ApplicationPoolService.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Services/ConnectionBroker/ConnectionBrokerDbContext.cs b/Myrtille.Services/ConnectionBroker/ConnectionBrokerDbContext.cs index baad34a..570f02b 100644 --- a/Myrtille.Services/ConnectionBroker/ConnectionBrokerDbContext.cs +++ b/Myrtille.Services/ConnectionBroker/ConnectionBrokerDbContext.cs @@ -1,3 +1,21 @@ +/* + Myrtille: A native HTML4/5 Remote Desktop Protocol client. + + Copyright(c) 2014-2020 Cedric Coste + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + using System.Data.Entity; namespace Myrtille.Services.ConnectionBroker diff --git a/Myrtille.Services/ConnectionBroker/Server.cs b/Myrtille.Services/ConnectionBroker/Server.cs index be7b165..27b4ec8 100644 --- a/Myrtille.Services/ConnectionBroker/Server.cs +++ b/Myrtille.Services/ConnectionBroker/Server.cs @@ -1,3 +1,21 @@ +/* + Myrtille: A native HTML4/5 Remote Desktop Protocol client. + + Copyright(c) 2014-2020 Cedric Coste + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/Myrtille.Services/ConnectionBroker/Session.cs b/Myrtille.Services/ConnectionBroker/Session.cs index f9db289..5b57a18 100644 --- a/Myrtille.Services/ConnectionBroker/Session.cs +++ b/Myrtille.Services/ConnectionBroker/Session.cs @@ -1,3 +1,21 @@ +/* + Myrtille: A native HTML4/5 Remote Desktop Protocol client. + + Copyright(c) 2014-2020 Cedric Coste + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/Myrtille.Services/ConnectionBroker/SessionState.cs b/Myrtille.Services/ConnectionBroker/SessionState.cs index fe8b079..ec0a717 100644 --- a/Myrtille.Services/ConnectionBroker/SessionState.cs +++ b/Myrtille.Services/ConnectionBroker/SessionState.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Services/ConnectionBroker/SessionType.cs b/Myrtille.Services/ConnectionBroker/SessionType.cs index 38d8a52..a81895e 100644 --- a/Myrtille.Services/ConnectionBroker/SessionType.cs +++ b/Myrtille.Services/ConnectionBroker/SessionType.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Services/ConnectionBroker/Target.cs b/Myrtille.Services/ConnectionBroker/Target.cs index d91c16f..4800522 100644 --- a/Myrtille.Services/ConnectionBroker/Target.cs +++ b/Myrtille.Services/ConnectionBroker/Target.cs @@ -1,3 +1,21 @@ +/* + Myrtille: A native HTML4/5 Remote Desktop Protocol client. + + Copyright(c) 2014-2020 Cedric Coste + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; diff --git a/Myrtille.Services/ConnectionBroker/TargetIp.cs b/Myrtille.Services/ConnectionBroker/TargetIp.cs index 9d3f086..0dc01e9 100644 --- a/Myrtille.Services/ConnectionBroker/TargetIp.cs +++ b/Myrtille.Services/ConnectionBroker/TargetIp.cs @@ -1,3 +1,21 @@ +/* + Myrtille: A native HTML4/5 Remote Desktop Protocol client. + + Copyright(c) 2014-2020 Cedric Coste + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/Myrtille.Services/ConnectionBroker/TargetProperty.cs b/Myrtille.Services/ConnectionBroker/TargetProperty.cs index 8cfc718..45fdddd 100644 --- a/Myrtille.Services/ConnectionBroker/TargetProperty.cs +++ b/Myrtille.Services/ConnectionBroker/TargetProperty.cs @@ -1,3 +1,21 @@ +/* + Myrtille: A native HTML4/5 Remote Desktop Protocol client. + + Copyright(c) 2014-2020 Cedric Coste + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/Myrtille.Services/ConnectionBroker/User.cs b/Myrtille.Services/ConnectionBroker/User.cs index cbbc4cd..4be2fbf 100644 --- a/Myrtille.Services/ConnectionBroker/User.cs +++ b/Myrtille.Services/ConnectionBroker/User.cs @@ -1,3 +1,21 @@ +/* + Myrtille: A native HTML4/5 Remote Desktop Protocol client. + + Copyright(c) 2014-2020 Cedric Coste + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/Myrtille.Services/EnterpriseService.cs b/Myrtille.Services/EnterpriseService.cs index 616297d..73aeb07 100644 --- a/Myrtille.Services/EnterpriseService.cs +++ b/Myrtille.Services/EnterpriseService.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Copyright(c) 2018 Paul Oliver (Olive Innovations) Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,31 +19,25 @@ limitations under the License. using System; using System.Collections.Generic; -using System.Configuration; using System.Diagnostics; -using System.Net; +using Myrtille.Enterprise; using Myrtille.Services.Contracts; namespace Myrtille.Services { public class EnterpriseService : IEnterpriseService { - public bool GetState() + public EnterpriseMode GetMode() { - return Program._enterpriseAdapter != null; + return Program._enterpriseAdapter == null ? EnterpriseMode.None : (Program._enterpriseAdapter is LocalAdmin ? EnterpriseMode.Local : EnterpriseMode.Domain); } public EnterpriseSession Authenticate(string username, string password) { try { - Trace.TraceInformation("Requesting authentication of user {0}", username); - var result = Program._enterpriseAdapter.Authenticate(username, password, Program._adminGroup, Program._enterpriseDomain); - if (result != null) - { - result.UserName = username; - } - return result; + Trace.TraceInformation("Requesting authentication of user {0}", string.IsNullOrEmpty(Program._enterpriseNetbiosDomain) ? username : string.Format("{0}\\{1}", Program._enterpriseNetbiosDomain, username)); + return Program._enterpriseAdapter.Authenticate(username, password, Program._enterpriseAdminGroup, Program._enterpriseDomain, Program._enterpriseNetbiosDomain); } catch (Exception ex) { @@ -138,22 +132,7 @@ public EnterpriseConnectionDetails GetSessionConnectionDetails(string sessionID, try { Trace.TraceInformation("Requesting session details"); - var result = Program._enterpriseAdapter.GetSessionConnectionDetails(sessionID, hostID, sessionKey); - - var domain = ConfigurationManager.AppSettings["EnterpriseDomain"]; - var netbiosDomain = ConfigurationManager.AppSettings["EnterpriseNetbiosDomain"]; - - if (!string.IsNullOrEmpty(netbiosDomain) && !result.PromptForCredentials) - { - result.Domain = netbiosDomain; - } - else if (result != null && domain != null - && !IPAddress.TryParse(domain, out IPAddress address) //check if domain is IP, prevent login failure if FQDN not used - && !result.PromptForCredentials) //no need to set this automatically if the user is prompted for credentials - { - result.Domain = domain; - } - return result; + return Program._enterpriseAdapter.GetSessionConnectionDetails(sessionID, hostID, sessionKey); } catch (Exception ex) { @@ -162,12 +141,12 @@ public EnterpriseConnectionDetails GetSessionConnectionDetails(string sessionID, } } - public string CreateUserSession(string sessionID, long hostID, string username, string password) + public string CreateUserSession(string sessionID, long hostID, string username, string password, string domain) { try { - Trace.TraceInformation("Create user session requested, host {0}, user {1}", hostID, username); - return Program._enterpriseAdapter.CreateUserSession(sessionID,hostID,username,password); + Trace.TraceInformation("Create user session requested, host {0}, user {1}", hostID, string.IsNullOrEmpty(domain) ? username : string.Format("{0}\\{1}", domain, username)); + return Program._enterpriseAdapter.CreateUserSession(sessionID, hostID, username, password, domain); } catch (Exception ex) { @@ -194,7 +173,7 @@ public bool AddSessionHostCredentials(EnterpriseHostSessionCredentials credentia { try { - Trace.TraceInformation("creating session credentials for {0}", credentials.Username); + Trace.TraceInformation("creating session credentials for {0}", string.IsNullOrEmpty(credentials.Domain) ? credentials.Username : string.Format("{0}\\{1}", credentials.Domain, credentials.Username)); return Program._enterpriseAdapter.AddSessionHostCredentials(credentials); } catch (Exception ex) diff --git a/Myrtille.Services/FileStorage.cs b/Myrtille.Services/FileStorage.cs index 210f0a2..ed399b1 100644 --- a/Myrtille.Services/FileStorage.cs +++ b/Myrtille.Services/FileStorage.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Services/MFAAuthentication.cs b/Myrtille.Services/MFAAuthentication.cs index cc32d4b..fd770f0 100644 --- a/Myrtille.Services/MFAAuthentication.cs +++ b/Myrtille.Services/MFAAuthentication.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Copyright(c) 2018 Paul Oliver (Olive Innovations) Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/Myrtille.Services/Myrtille.Services.Install.ps1 b/Myrtille.Services/Myrtille.Services.Install.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..71c8015e38315177e219fadc0337ad6360a6c269 GIT binary patch literal 3026 zcmc(h+iy}q5XR>f6aR-JFA~y@PlE!~s{e3%UIX$H} zHO7#$d)S?w`R4M?o}WLq?7;f=)s{B2Gv4NwSe3PBpMJJz!?dlR0yEs*IjPMIIu zqwpMA9f_WeIK8l!LADphft9UdAA?krb2>X_O(&D^JF;wDr~Am1?LBf6G)7A+dtoJO zv$sSdYIF^W9i_O0ae%c_ib3{PLI1)&+tWX^`U(^yEZk)Ggg8vumCaowPQW(+{S@r| zV6PHJ`C9_RG$5_n2YYKZV%)Kd^!+f6+LVU3)V;JdL3O8J7r~n zP0z_NtR-m9o~FICJ#yG$Ou)F$*kEik*V)@ociQ#_Of6OqnHxd!kbjx3;@XqbP#fKV zM<^0>e+!u9g<>sqia=tQJTv@^nJ=;GvQegj#MRiekXV33(OTkdZ>_zITs+-PEmZ6| z=i_Q(-`6Nh>vPePNAuZQVvCbw^r)&6=2J$Y7jEev^Yc0sCr(%&v3kL~c#>y~_WE{? zyt1UIDCh1=H6ZDubGhDaA~Qm=OJ)=5brqsC2aDL(3if9KNfT>R{)?IOHTFYR73)6I z`$6w4jH(vruJ|fGBpcOJ3%JfeEBn%0Bj*$51^88AHPFm$+m5kv%ubej#jG1*)U_|X z4|7oyOESGNFVgGCUAk;f;P`7~7s1#3nayh7#9Ite+QXJ&b4Gn%t;QCpl#L1cM?_Zn z*Sq53{liKPNWM}0#1Dp0RJ7tB3Xrj=9GM68Xxmr=ff%*74}Q0(NKGriKLOw)r)QX^Y+{oKwaFINW6R3QpK-A(>DS?#~7D3Ph?m@7ei&nW4V9 zpL(6DV$_+IplpXKc0YGQHHt&dh;CX#1!8||NB zdOfpu*;lvs>XCJiq_Pk(Jp_?rTCz{DNPSTZ%Q9HQBWH4lO!yt4nB3N_wo~-p*L+m3 zQ4PwkSg&{abbkz0C8N~K9$CyY*V&(S)-Cq`z6bnI{$GvU?dUg2kPDV ze)jwPj~(T%oMsmL+>j5c%74$3tMR(O=KeKH6h&3)06w3S6XkH2_F?C>vs%&9ZLj-J zce3*;-c&bz*X3`I15R|vL6zK8#FG!-^b1vE2-bF=11*Zv9HMGOT#|f2gYM8UoYM} z3;bgwC%n(RUk(J$%2>Pw;SBk3AwR%YW|v6%>=~jn@G^(x;@`55)+Cy3MhC_t#zV#v zo(IewEoM&aJ($`^J3J4)W{0oBRyp_N(r2mX@d$;(_Kn9ZFJ|~Dbc%qpJN^^=j5(+v z4Z2aMhQ@Mi+Gxx`qG-+WHp#75(Tl5liydnAlJ!yQ>}QU$lCO(9g=p^P8au2UVMjS} zJTDoAUbtm{#4j*H?7ToeM0(A;7`w_{&87AOePu~eQO<)eb&n*)<~*Nmp)*9YM`j)D zz4cL=f<<-E_WMsfk`}v-`BsfgbL<_Yigk+ik+(bXqu3IvNR^Yp4!6OchR1aUTJ0~p zVr0-)EX4OAvI#SLcFs=c%oh1q+WLAz@2(3^Q*SM@j9 zzKOT&qts*{#pVirFSD@?B4s1P{*cHj|9V$E=Ey@$-uYOTkYAyrY?WYZc$Q2)3iFsK z6s%bFE$X%xddl0XFLf$Oy+@4tJHMjMZTXG+i604;*So`Jyf$-K!rNufmwgZ3i{q+} zA0Bs}TYNQ|X1U2XMDP`%1Z zom)}7AC&WxP$zQWh;BZI+@+dScx0n)4$G%a1D-V&r)S|s Designer + + Always + + + Always + Always diff --git a/Myrtille.Services/PrinterService.cs b/Myrtille.Services/PrinterService.cs index ab3d6ac..986bbcc 100644 --- a/Myrtille.Services/PrinterService.cs +++ b/Myrtille.Services/PrinterService.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Services/Program.cs b/Myrtille.Services/Program.cs index 1774c4e..591f0d1 100644 --- a/Myrtille.Services/Program.cs +++ b/Myrtille.Services/Program.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ limitations under the License. using System.ServiceModel; using System.ServiceProcess; using log4net.Config; +using Myrtille.Enterprise; using Myrtille.Services.Contracts; namespace Myrtille.Services @@ -40,8 +41,9 @@ public class Program : ServiceBase public static IMultifactorAuthenticationAdapter _multifactorAdapter = null; public static IEnterpriseAdapter _enterpriseAdapter = null; - public static string _adminGroup; + public static string _enterpriseAdminGroup; public static string _enterpriseDomain; + public static string _enterpriseNetbiosDomain; private static ServiceHost OpenService(Type serviceType) { @@ -169,26 +171,46 @@ private static void LoadEnterpriseAdapter() { var configuration = ConfigurationManager.AppSettings["EnterpriseAdapter"]; if (configuration == null) - return; + { + var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); + var section = config.GetSection("localAdmin"); + if (section != null) + { + var localAdminUser = ((AppSettingsSection)section).Settings["LocalAdminUser"]; + var localAdminPassword = ((AppSettingsSection)section).Settings["localAdminPassword"]; + if (localAdminUser != null && !string.IsNullOrEmpty(localAdminUser.Value) && + localAdminPassword != null && !string.IsNullOrEmpty(localAdminPassword.Value)) + { + _enterpriseAdapter = new LocalAdmin(); + } + } + } + else + { + var assemblyDetails = configuration.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries); + if (assemblyDetails.Length != 2) + throw new FormatException("EnterpriseAdapter configuration is invalid!"); - var assemblyDetails = configuration.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries); - if (assemblyDetails.Length != 2) - throw new FormatException("EnterpriseAdapter configuration is invalid!"); + var assembly = Assembly.Load(assemblyDetails[1].Trim()); + _enterpriseAdapter = (IEnterpriseAdapter)assembly.CreateInstance(assemblyDetails[0]); + if (_enterpriseAdapter == null) + throw new InvalidOperationException(string.Format("Unable to create instance of {0}", assemblyDetails[0])); - var assembly = Assembly.Load(assemblyDetails[1].Trim()); - _enterpriseAdapter = (IEnterpriseAdapter)assembly.CreateInstance(assemblyDetails[0]); - if (_enterpriseAdapter == null) - throw new InvalidOperationException(string.Format("Unable to create instance of {0}", assemblyDetails[0])); + _enterpriseAdminGroup = ConfigurationManager.AppSettings["EnterpriseAdminGroup"]; + if (_enterpriseAdminGroup == null) + throw new Exception("EnterpriseAdminGroup has not been configured!"); - _adminGroup = ConfigurationManager.AppSettings["EnterpriseAdminGroup"]; - if (_adminGroup == null) - throw new Exception("EnterpriseAdminGroup has not been configured!"); + _enterpriseDomain = ConfigurationManager.AppSettings["EnterpriseDomain"]; + if (_enterpriseDomain == null) + throw new Exception("EnterpriseDomain has not been configured!"); - _enterpriseDomain = ConfigurationManager.AppSettings["EnterpriseDomain"]; - if (_enterpriseDomain == null) - throw new Exception("EnterpriseDomain has not been configured!"); + _enterpriseNetbiosDomain = ConfigurationManager.AppSettings["EnterpriseNetbiosDomain"]; + } - _enterpriseAdapter.Initialize(); + if (_enterpriseAdapter != null) + { + _enterpriseAdapter.Initialize(); + } } private static void ConfigureEnterpriseDatabase() diff --git a/Myrtille.Services/Properties/AssemblyInfo.cs b/Myrtille.Services/Properties/AssemblyInfo.cs index ad9b729..87b8d97 100644 --- a/Myrtille.Services/Properties/AssemblyInfo.cs +++ b/Myrtille.Services/Properties/AssemblyInfo.cs @@ -10,7 +10,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Myrtille")] -[assembly: AssemblyCopyright("Copyright © 2014-2019 Cedric Coste")] +[assembly: AssemblyCopyright("Copyright © 2014-2020 Cedric Coste")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -32,5 +32,5 @@ // Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut // en utilisant '*', comme indiqué ci-dessous : // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.7.1.0")] -[assembly: AssemblyFileVersion("2.7.1.0")] +[assembly: AssemblyVersion("2.8.0.0")] +[assembly: AssemblyFileVersion("2.8.0.0")] diff --git a/Myrtille.Services/RemoteSessionProcess.cs b/Myrtille.Services/RemoteSessionProcess.cs index 310204f..e2042cd 100644 --- a/Myrtille.Services/RemoteSessionProcess.cs +++ b/Myrtille.Services/RemoteSessionProcess.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -128,7 +128,7 @@ public void StartProcess( hostType == HostType.RDP ? securityProtocol.ToString().ToUpper() : "N/A", serverAddress, hostType == HostType.RDP ? (string.IsNullOrEmpty(vmGuid) ? "(none)" : vmGuid) : "N/A", - hostType == HostType.RDP ? (string.IsNullOrEmpty(userDomain) ? "(none)" : userDomain) : "N/A", + string.IsNullOrEmpty(userDomain) ? "(none)" : userDomain, userName, hostType == HostType.RDP ? (string.IsNullOrEmpty(startProgram) ? "(none)" : startProgram) : "N/A"); @@ -351,7 +351,7 @@ public void StartProcess( (asyncUpdate ? " +" : " -") + "async-update" + // async update (asyncChannels ? " +" : " -") + "async-channels" + // async channels (allowRemoteClipboard ? " +" : " -") + "clipboard" + // clipboard support - (securityProtocol != SecurityProtocol.auto ? " /sec:" + securityProtocol.ToString() : string.Empty) + // security protocol + (securityProtocol != SecurityProtocol.auto ? " /sec:" + securityProtocol.ToString() : string.Empty) + // security protocol (allowAudioPlayback ? " /sound" : string.Empty) + // sound support " /audio-mode:" + (allowAudioPlayback ? "0" : "2"); // audio mode (0: redirect, 1: play on server, 2: do not play) } diff --git a/Myrtille.Services/ServicesInstaller.cs b/Myrtille.Services/ServicesInstaller.cs index 2c8846c..60adc2b 100644 --- a/Myrtille.Services/ServicesInstaller.cs +++ b/Myrtille.Services/ServicesInstaller.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,8 +20,8 @@ limitations under the License. using System.Collections; using System.ComponentModel; using System.Configuration.Install; +using System.Diagnostics; using System.IO; -using System.ServiceProcess; using System.Windows.Forms; using System.Xml; using Myrtille.Helpers; @@ -32,43 +32,6 @@ namespace Myrtille.Services [RunInstaller(true)] public class ServicesInstaller : Installer { - // required designer variable - private Container components = null; - - private ServiceProcessInstaller serviceProcessInstaller; - private ServiceInstaller serviceInstaller; - - #region Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.serviceProcessInstaller = new ServiceProcessInstaller(); - this.serviceProcessInstaller.Account = ServiceAccount.LocalSystem; - this.serviceProcessInstaller.Password = null; - this.serviceProcessInstaller.Username = null; - - this.serviceInstaller = new ServiceInstaller(); - this.serviceInstaller.ServiceName = "Myrtille.Services"; - this.serviceInstaller.Description = "Myrtille HTTP(S) to RDP and SSH gateway"; - this.serviceInstaller.StartType = ServiceStartMode.Automatic; - - this.Installers.AddRange(new Installer[] { - this.serviceProcessInstaller, - this.serviceInstaller}); - } - - #endregion - - public ServicesInstaller() - { - // This call is required by the Designer. - InitializeComponent(); - } - public override void Install( IDictionary stateSaver) { @@ -96,6 +59,31 @@ public override void Install( try { + var process = new Process(); + + bool debug = true; + + #if !DEBUG + debug = false; + process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; + #endif + + process.StartInfo.FileName = string.Format(@"{0}\WindowsPowerShell\v1.0\powershell.exe", Environment.Is64BitOperatingSystem && !Environment.Is64BitProcess ? Environment.SystemDirectory.ToLower().Replace("system32", "sysnative") : Environment.SystemDirectory); + process.StartInfo.Arguments = "-ExecutionPolicy Bypass" + + " -Command \"& '" + Path.Combine(Path.GetFullPath(Context.Parameters["targetdir"]), "bin", "Myrtille.Services.Install.ps1") + "'" + + " -BinaryPath '" + Path.Combine(Path.GetFullPath(Context.Parameters["targetdir"]), "bin", "Myrtille.Services.exe") + "'" + + " -DebugMode " + (debug ? "1" : "0") + + " 3>&1 2>&1 | Tee-Object -FilePath '" + Path.Combine(Path.GetFullPath(Context.Parameters["targetdir"]), "log", "Myrtille.Services.Install.log") + "'" + "\""; + + process.Start(); + process.WaitForExit(); + if (process.ExitCode != 0) + { + throw new Exception(string.Format("An error occured while running {0}. See {1} for more information.", + Path.Combine(Path.GetFullPath(Context.Parameters["targetdir"]), "bin", "Myrtille.Services.Install.ps1"), + Path.Combine(Path.GetFullPath(Context.Parameters["targetdir"]), "log", "Myrtille.Services.Install.log"))); + } + // load config var config = new XmlDocument(); var configPath = Path.Combine(Path.GetFullPath(Context.Parameters["targetdir"]), "bin", "Myrtille.Services.exe.config"); @@ -196,7 +184,7 @@ public override void Install( MessageBox.Show( ActiveWindow.Active, "the myrtille virtual pdf printer could not be installed. Please check logs (into the install log folder)", - serviceInstaller.ServiceName, + "Myrtille.Services", MessageBoxButtons.OK, MessageBoxIcon.Warning); } @@ -215,13 +203,12 @@ public override void Commit( IDictionary savedState) { base.Commit(savedState); - StartService(); + // insert code as needed } public override void Rollback( IDictionary savedState) { - StopService(); base.Rollback(savedState); DoUninstall(); } @@ -229,83 +216,48 @@ public override void Rollback( public override void Uninstall( IDictionary savedState) { - StopService(); base.Uninstall(savedState); DoUninstall(); } - private void StartService() + private void DoUninstall() { - Context.LogMessage("Starting Myrtille.Services"); + // enable the line below to debug this installer; disable otherwise + //MessageBox.Show("Attach the .NET debugger to the 'MSI Debug' msiexec.exe process now for debug. Click OK when ready...", "MSI Debug"); - // try to start the service - // in case of failure, ask for a manual start after install + Context.LogMessage("Uninstalling Myrtille.Services"); try { - var sc = new ServiceController(serviceInstaller.ServiceName); - if (sc.Status == ServiceControllerStatus.Stopped) - { - sc.Start(); - Context.LogMessage("Started Myrtille.Services"); - } - else - { - Context.LogMessage(string.Format("Myrtille.Services is not stopped (status: {0})", sc.Status)); - } - } - catch (Exception exc) - { - MessageBox.Show( - ActiveWindow.Active, - serviceInstaller.ServiceName + " windows service could not be started by this installer. Please do it manually once the installation is complete", - serviceInstaller.ServiceName, - MessageBoxButtons.OK, - MessageBoxIcon.Warning); - - Context.LogMessage(string.Format("Failed to start Myrtille.Services ({0})", exc)); - } - } + var process = new Process(); - private void StopService() - { - Context.LogMessage("Stopping Myrtille.Services"); + bool debug = true; - // if the service is running while uninstall is going on, the user is asked wether to stop it or not - // problem is, if the user choose "no", the service is not stopped thus won't be removed - // force stop it at this step, if not already done + #if !DEBUG + debug = false; + process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; + #endif - try - { - var sc = new ServiceController(serviceInstaller.ServiceName); - if (sc.Status == ServiceControllerStatus.Running) - { - sc.Stop(); - Context.LogMessage("Stopped Myrtille.Services"); - } - else + process.StartInfo.FileName = string.Format(@"{0}\WindowsPowerShell\v1.0\powershell.exe", Environment.Is64BitOperatingSystem && !Environment.Is64BitProcess ? Environment.SystemDirectory.ToLower().Replace("system32", "sysnative") : Environment.SystemDirectory); + process.StartInfo.Arguments = "-ExecutionPolicy Bypass" + + " -Command \"& '" + Path.Combine(Path.GetFullPath(Context.Parameters["targetdir"]), "bin", "Myrtille.Services.Uninstall.ps1") + "'" + + " -DebugMode " + (debug ? "1" : "0") + + " 3>&1 2>&1 | Tee-Object -FilePath '" + Path.Combine(Path.GetFullPath(Context.Parameters["targetdir"]), "log", "Myrtille.Services.Uninstall.log") + "'" + "\""; + + process.Start(); + process.WaitForExit(); + if (process.ExitCode != 0) { - Context.LogMessage(string.Format("Myrtille.Services is not running (status: {0})", sc.Status)); + throw new Exception(string.Format("An error occured while running {0}. See {1} for more information.", + Path.Combine(Path.GetFullPath(Context.Parameters["targetdir"]), "bin", "Myrtille.Services.Uninstall.ps1"), + Path.Combine(Path.GetFullPath(Context.Parameters["targetdir"]), "log", "Myrtille.Services.Uninstall.log"))); } - } - catch (Exception exc) - { - Context.LogMessage(string.Format("Failed to stop Myrtille.Services ({0})", exc)); - } - } - - private void DoUninstall() - { - // enable the line below to debug this installer; disable otherwise - //MessageBox.Show("Attach the .NET debugger to the 'MSI Debug' msiexec.exe process now for debug. Click OK when ready...", "MSI Debug"); - Context.LogMessage("Uninstalling Myrtille.Services"); - - try - { // uninstall Myrtille PDF printer, if exists var scribeInstaller = new PdfScribeInstaller(Context); scribeInstaller.UninstallPdfScribePrinter(); + + Context.LogMessage("Uninstalled Myrtille.Services"); } catch (Exception exc) { @@ -313,21 +265,5 @@ private void DoUninstall() throw; } } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( - bool disposing) - { - if (disposing) - { - if (components != null) - { - components.Dispose(); - } - } - base.Dispose(disposing); - } } } \ No newline at end of file diff --git a/Myrtille.Services/app.config b/Myrtille.Services/app.config index 4caf3b2..1c47d68 100644 --- a/Myrtille.Services/app.config +++ b/Myrtille.Services/app.config @@ -5,20 +5,21 @@
+
- + + + - - + + + + + + + @@ -102,7 +103,7 @@ - + @@ -195,6 +196,14 @@ + + + + + + + + @@ -213,12 +222,15 @@ - - + + - - + + + + + diff --git a/Myrtille.Setup/Myrtille.Setup.vdproj b/Myrtille.Setup/Myrtille.Setup.vdproj index 23de149..533ca6b 100644 --- a/Myrtille.Setup/Myrtille.Setup.vdproj +++ b/Myrtille.Setup/Myrtille.Setup.vdproj @@ -64,7 +64,7 @@ "Entry" { "MsmKey" = "8:_1EE5D98F80FD1E8988C38C20595D35F2" - "OwnerKey" = "8:_AA7B9254EDD24A378250099DC28F1BC1" + "OwnerKey" = "8:_653D6FBBA167416D9037981F1E63EC6A" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -82,13 +82,13 @@ "Entry" { "MsmKey" = "8:_22ADBD516A0D6B0686A1ADB91F100AC4" - "OwnerKey" = "8:_AA7B9254EDD24A378250099DC28F1BC1" + "OwnerKey" = "8:_653D6FBBA167416D9037981F1E63EC6A" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_24F6CA80A4951607FC2D459A1E16FF08" - "OwnerKey" = "8:_AA7B9254EDD24A378250099DC28F1BC1" + "OwnerKey" = "8:_653D6FBBA167416D9037981F1E63EC6A" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -100,7 +100,7 @@ "Entry" { "MsmKey" = "8:_45CB0595F5A7C6F661B3AE7E03FF554B" - "OwnerKey" = "8:_AA7B9254EDD24A378250099DC28F1BC1" + "OwnerKey" = "8:_653D6FBBA167416D9037981F1E63EC6A" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -118,7 +118,7 @@ "Entry" { "MsmKey" = "8:_51BCB2FF21490F04432D6C214807B83B" - "OwnerKey" = "8:_AA7B9254EDD24A378250099DC28F1BC1" + "OwnerKey" = "8:_653D6FBBA167416D9037981F1E63EC6A" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -159,6 +159,12 @@ } "Entry" { + "MsmKey" = "8:_653D6FBBA167416D9037981F1E63EC6A" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { "MsmKey" = "8:_66F2CF0FC3964C14A69521899A2ED1FF" "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" @@ -178,7 +184,7 @@ "Entry" { "MsmKey" = "8:_6CB508B385016CC92F8B4AA8861F2235" - "OwnerKey" = "8:_AA7B9254EDD24A378250099DC28F1BC1" + "OwnerKey" = "8:_653D6FBBA167416D9037981F1E63EC6A" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -226,7 +232,7 @@ "Entry" { "MsmKey" = "8:_7BDFED357A797F9F78D2A2939058F770" - "OwnerKey" = "8:_AA7B9254EDD24A378250099DC28F1BC1" + "OwnerKey" = "8:_653D6FBBA167416D9037981F1E63EC6A" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -262,43 +268,43 @@ "Entry" { "MsmKey" = "8:_83A15477F512314BC17E6D4FAEDDDF13" - "OwnerKey" = "8:_9240A03151B1609F69B0D890ADE451BC" + "OwnerKey" = "8:_A17DBF12B6A6522264FE8C544BE7637C" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_83A15477F512314BC17E6D4FAEDDDF13" - "OwnerKey" = "8:_F14DAE3BE1FDDA0C5904925C132EB39B" + "OwnerKey" = "8:_6A00A4B5E0C64F48AF08EC529C41D062" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_83A15477F512314BC17E6D4FAEDDDF13" - "OwnerKey" = "8:_8509FA2AF779A31287B4B15E10EC1B3E" + "OwnerKey" = "8:_9240A03151B1609F69B0D890ADE451BC" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_83A15477F512314BC17E6D4FAEDDDF13" - "OwnerKey" = "8:_AA7B9254EDD24A378250099DC28F1BC1" + "OwnerKey" = "8:_F14DAE3BE1FDDA0C5904925C132EB39B" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_83A15477F512314BC17E6D4FAEDDDF13" - "OwnerKey" = "8:_A17DBF12B6A6522264FE8C544BE7637C" + "OwnerKey" = "8:_8509FA2AF779A31287B4B15E10EC1B3E" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_83A15477F512314BC17E6D4FAEDDDF13" - "OwnerKey" = "8:_6A00A4B5E0C64F48AF08EC529C41D062" + "OwnerKey" = "8:_653D6FBBA167416D9037981F1E63EC6A" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_8509FA2AF779A31287B4B15E10EC1B3E" - "OwnerKey" = "8:_AA7B9254EDD24A378250099DC28F1BC1" + "OwnerKey" = "8:_653D6FBBA167416D9037981F1E63EC6A" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -358,7 +364,7 @@ "Entry" { "MsmKey" = "8:_917286C9A1719DDE028EAF47B67B458B" - "OwnerKey" = "8:_AA7B9254EDD24A378250099DC28F1BC1" + "OwnerKey" = "8:_653D6FBBA167416D9037981F1E63EC6A" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -376,7 +382,7 @@ "Entry" { "MsmKey" = "8:_9240A03151B1609F69B0D890ADE451BC" - "OwnerKey" = "8:_AA7B9254EDD24A378250099DC28F1BC1" + "OwnerKey" = "8:_653D6FBBA167416D9037981F1E63EC6A" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -400,13 +406,13 @@ "Entry" { "MsmKey" = "8:_990AC498687A0E2ED129023E9CC2D5B5" - "OwnerKey" = "8:_AA7B9254EDD24A378250099DC28F1BC1" + "OwnerKey" = "8:_6A00A4B5E0C64F48AF08EC529C41D062" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_990AC498687A0E2ED129023E9CC2D5B5" - "OwnerKey" = "8:_6A00A4B5E0C64F48AF08EC529C41D062" + "OwnerKey" = "8:_653D6FBBA167416D9037981F1E63EC6A" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -430,7 +436,7 @@ "Entry" { "MsmKey" = "8:_A45F72E723FA6DFC7CAFF899597494CE" - "OwnerKey" = "8:_AA7B9254EDD24A378250099DC28F1BC1" + "OwnerKey" = "8:_653D6FBBA167416D9037981F1E63EC6A" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -447,12 +453,6 @@ } "Entry" { - "MsmKey" = "8:_AA7B9254EDD24A378250099DC28F1BC1" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { "MsmKey" = "8:_ABE4E421EB25401FA22DB71407D36135" "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" @@ -502,13 +502,13 @@ "Entry" { "MsmKey" = "8:_C86279E0F97A6677B41B24460FBAF2B5" - "OwnerKey" = "8:_AA7B9254EDD24A378250099DC28F1BC1" + "OwnerKey" = "8:_6A00A4B5E0C64F48AF08EC529C41D062" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_C86279E0F97A6677B41B24460FBAF2B5" - "OwnerKey" = "8:_6A00A4B5E0C64F48AF08EC529C41D062" + "OwnerKey" = "8:_653D6FBBA167416D9037981F1E63EC6A" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -574,13 +574,13 @@ "Entry" { "MsmKey" = "8:_DF0572015795804F70A9AA695417FBAB" - "OwnerKey" = "8:_AA7B9254EDD24A378250099DC28F1BC1" + "OwnerKey" = "8:_6A00A4B5E0C64F48AF08EC529C41D062" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_DF0572015795804F70A9AA695417FBAB" - "OwnerKey" = "8:_6A00A4B5E0C64F48AF08EC529C41D062" + "OwnerKey" = "8:_653D6FBBA167416D9037981F1E63EC6A" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -610,19 +610,19 @@ "Entry" { "MsmKey" = "8:_DF64623992E0504E6E44F78E0DACDA36" - "OwnerKey" = "8:_AA7B9254EDD24A378250099DC28F1BC1" + "OwnerKey" = "8:_51E1684E0AC9A2E6C91C688F2C9DD4B1" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_DF64623992E0504E6E44F78E0DACDA36" - "OwnerKey" = "8:_51E1684E0AC9A2E6C91C688F2C9DD4B1" + "OwnerKey" = "8:_6A00A4B5E0C64F48AF08EC529C41D062" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_DF64623992E0504E6E44F78E0DACDA36" - "OwnerKey" = "8:_6A00A4B5E0C64F48AF08EC529C41D062" + "OwnerKey" = "8:_653D6FBBA167416D9037981F1E63EC6A" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -646,25 +646,25 @@ "Entry" { "MsmKey" = "8:_E385E6F4F7BC7295F537EC6B3C8250D3" - "OwnerKey" = "8:_AA7B9254EDD24A378250099DC28F1BC1" + "OwnerKey" = "8:_6A00A4B5E0C64F48AF08EC529C41D062" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_E385E6F4F7BC7295F537EC6B3C8250D3" - "OwnerKey" = "8:_6A00A4B5E0C64F48AF08EC529C41D062" + "OwnerKey" = "8:_E76FFE893BD37BAA153E3EFB44999C4E" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_E385E6F4F7BC7295F537EC6B3C8250D3" - "OwnerKey" = "8:_E76FFE893BD37BAA153E3EFB44999C4E" + "OwnerKey" = "8:_51E1684E0AC9A2E6C91C688F2C9DD4B1" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_E385E6F4F7BC7295F537EC6B3C8250D3" - "OwnerKey" = "8:_51E1684E0AC9A2E6C91C688F2C9DD4B1" + "OwnerKey" = "8:_653D6FBBA167416D9037981F1E63EC6A" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -706,7 +706,7 @@ "Entry" { "MsmKey" = "8:_F14DAE3BE1FDDA0C5904925C132EB39B" - "OwnerKey" = "8:_AA7B9254EDD24A378250099DC28F1BC1" + "OwnerKey" = "8:_653D6FBBA167416D9037981F1E63EC6A" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -832,127 +832,127 @@ "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_AA7B9254EDD24A378250099DC28F1BC1" + "OwnerKey" = "8:_2C5EE9B0316B45F3E32CFD4DA799A678" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_1EE5D98F80FD1E8988C38C20595D35F2" + "OwnerKey" = "8:_CFD104DD0F9641079881F7AD9854F50B" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_45CB0595F5A7C6F661B3AE7E03FF554B" + "OwnerKey" = "8:_5B491BD4724B09308F12AFD5B23FE7B6" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_24F6CA80A4951607FC2D459A1E16FF08" + "OwnerKey" = "8:_DBCE7EA11E8AD9C53593890EDB116972" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_6CB508B385016CC92F8B4AA8861F2235" + "OwnerKey" = "8:_E76FFE893BD37BAA153E3EFB44999C4E" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_51BCB2FF21490F04432D6C214807B83B" + "OwnerKey" = "8:_A17DBF12B6A6522264FE8C544BE7637C" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_9240A03151B1609F69B0D890ADE451BC" + "OwnerKey" = "8:_51E1684E0AC9A2E6C91C688F2C9DD4B1" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_F14DAE3BE1FDDA0C5904925C132EB39B" + "OwnerKey" = "8:_F2FF150F59BF51862493844900AF6E49" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_8509FA2AF779A31287B4B15E10EC1B3E" + "OwnerKey" = "8:_653D6FBBA167416D9037981F1E63EC6A" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_917286C9A1719DDE028EAF47B67B458B" + "OwnerKey" = "8:_1EE5D98F80FD1E8988C38C20595D35F2" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_7BDFED357A797F9F78D2A2939058F770" + "OwnerKey" = "8:_45CB0595F5A7C6F661B3AE7E03FF554B" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_22ADBD516A0D6B0686A1ADB91F100AC4" + "OwnerKey" = "8:_24F6CA80A4951607FC2D459A1E16FF08" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_A45F72E723FA6DFC7CAFF899597494CE" + "OwnerKey" = "8:_6CB508B385016CC92F8B4AA8861F2235" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_2C5EE9B0316B45F3E32CFD4DA799A678" + "OwnerKey" = "8:_51BCB2FF21490F04432D6C214807B83B" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_CFD104DD0F9641079881F7AD9854F50B" + "OwnerKey" = "8:_9240A03151B1609F69B0D890ADE451BC" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_5B491BD4724B09308F12AFD5B23FE7B6" + "OwnerKey" = "8:_F14DAE3BE1FDDA0C5904925C132EB39B" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_DBCE7EA11E8AD9C53593890EDB116972" + "OwnerKey" = "8:_8509FA2AF779A31287B4B15E10EC1B3E" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_E76FFE893BD37BAA153E3EFB44999C4E" + "OwnerKey" = "8:_917286C9A1719DDE028EAF47B67B458B" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_A17DBF12B6A6522264FE8C544BE7637C" + "OwnerKey" = "8:_7BDFED357A797F9F78D2A2939058F770" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_51E1684E0AC9A2E6C91C688F2C9DD4B1" + "OwnerKey" = "8:_22ADBD516A0D6B0686A1ADB91F100AC4" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_F2FF150F59BF51862493844900AF6E49" + "OwnerKey" = "8:_A45F72E723FA6DFC7CAFF899597494CE" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -1075,17 +1075,17 @@ { "CustomAction" { - "{4AA51A2D-7D85-4A59-BA75-B0809FC8B380}:_3E8CAD47E80D457CA0A4B6B8325E0635" + "{4AA51A2D-7D85-4A59-BA75-B0809FC8B380}:_2FA1AA1093C14E9F89427047D0A4E208" { "Name" = "8:Primary output from Myrtille.Web (Active)" "Condition" = "8:" - "Object" = "8:_AA7B9254EDD24A378250099DC28F1BC1" + "Object" = "8:_653D6FBBA167416D9037981F1E63EC6A" "FileType" = "3:1" - "InstallAction" = "3:1" + "InstallAction" = "3:2" "Arguments" = "8:" "EntryPoint" = "8:" "Sequence" = "3:1" - "Identifier" = "8:_7A627235_F7FB_4166_AAFF_4EDB2B859E48" + "Identifier" = "8:_E6478927_12B9_48D9_A231_BA6AB3FB6424" "InstallerClass" = "11:TRUE" "CustomActionData" = "8:/TargetDir=\"[TARGETDIR]\\\" /LogToConsole=true /LogFile=\"[TARGETDIR]\\log\\Myrtille.Setup.log\" /ServicesPort=\"[SERVICESPORT]\" /AdminServicesPort=\"[ADMINSERVICESPORT]\" /SslCert=\"[SSLCERT]\" /PdfPrinter=\"[PDFPRINTER]\" /SessionUrl=\"[SESSIONURL]\"" } @@ -1103,17 +1103,17 @@ "InstallerClass" = "11:TRUE" "CustomActionData" = "8:/TargetDir=\"[TARGETDIR]\\\" /LogToConsole=true /LogFile=\"[TARGETDIR]\\log\\Myrtille.Setup.log\" /OasisApiKey=\"[OASISAPIKEY]\" /OasisAppKey=\"[OASISAPPKEY]\" /OasisAppId=\"[OASISAPPID]\" /EnterpriseAdminGroup=\"[ENTERPRISEADMINGROUP]\" /EnterpriseDomain=\"[ENTERPRISEDOMAIN]\" /EnterpriseNetbiosDomain=\"[ENTERPRISENETBIOSDOMAIN]\" /ServicesPort=\"[SERVICESPORT]\" /PdfPrinter=\"[PDFPRINTER]\"" } - "{4AA51A2D-7D85-4A59-BA75-B0809FC8B380}:_48666C6D8CED455399640A11B2D1E9B4" + "{4AA51A2D-7D85-4A59-BA75-B0809FC8B380}:_567058BA31184A4EB214A1A65D3C47EC" { "Name" = "8:Primary output from Myrtille.Admin.Services (Active)" "Condition" = "8:" "Object" = "8:_EF7BA948A8A34B5CB515E968F9EFD966" "FileType" = "3:2" - "InstallAction" = "3:2" + "InstallAction" = "3:1" "Arguments" = "8:" "EntryPoint" = "8:" "Sequence" = "3:3" - "Identifier" = "8:_F20575EE_B8A6_4AC2_AEC7_1A7EB1126643" + "Identifier" = "8:_8CCC19CB_A319_4213_BD2F_8645517B7C06" "InstallerClass" = "11:TRUE" "CustomActionData" = "8:/TargetDir=\"[TARGETDIR]\\\" /LogToConsole=true /LogFile=\"[TARGETDIR]\\log\\Myrtille.Setup.log\" /AdminServicesPort=\"[ADMINSERVICESPORT]\"" } @@ -1131,6 +1131,20 @@ "InstallerClass" = "11:TRUE" "CustomActionData" = "8:/TargetDir=\"[TARGETDIR]\\\" /LogToConsole=true /LogFile=\"[TARGETDIR]\\log\\Myrtille.Setup.log\" /OasisApiKey=\"[OASISAPIKEY]\" /OasisAppKey=\"[OASISAPPKEY]\" /OasisAppId=\"[OASISAPPID]\" /EnterpriseAdminGroup=\"[ENTERPRISEADMINGROUP]\" /EnterpriseDomain=\"[ENTERPRISEDOMAIN]\" /EnterpriseNetbiosDomain=\"[ENTERPRISENETBIOSDOMAIN]\" /ServicesPort=\"[SERVICESPORT]\" /PdfPrinter=\"[PDFPRINTER]\"" } + "{4AA51A2D-7D85-4A59-BA75-B0809FC8B380}:_77FE6101995B4A8F88A586CC9B34E599" + { + "Name" = "8:Primary output from Myrtille.Web (Active)" + "Condition" = "8:" + "Object" = "8:_653D6FBBA167416D9037981F1E63EC6A" + "FileType" = "3:1" + "InstallAction" = "3:1" + "Arguments" = "8:" + "EntryPoint" = "8:" + "Sequence" = "3:1" + "Identifier" = "8:_7C487AA9_B469_4E37_8000_AB8891C22F98" + "InstallerClass" = "11:TRUE" + "CustomActionData" = "8:/TargetDir=\"[TARGETDIR]\\\" /LogToConsole=true /LogFile=\"[TARGETDIR]\\log\\Myrtille.Setup.log\" /ServicesPort=\"[SERVICESPORT]\" /AdminServicesPort=\"[ADMINSERVICESPORT]\" /SslCert=\"[SSLCERT]\" /PdfPrinter=\"[PDFPRINTER]\" /SessionUrl=\"[SESSIONURL]\"" + } "{4AA51A2D-7D85-4A59-BA75-B0809FC8B380}:_814362E4BC5246BC9DE9A8A836B80D9F" { "Name" = "8:Primary output from Myrtille.Services (Active)" @@ -1145,45 +1159,45 @@ "InstallerClass" = "11:TRUE" "CustomActionData" = "8:/TargetDir=\"[TARGETDIR]\\\" /LogToConsole=true /LogFile=\"[TARGETDIR]\\log\\Myrtille.Setup.log\" /OasisApiKey=\"[OASISAPIKEY]\" /OasisAppKey=\"[OASISAPPKEY]\" /OasisAppId=\"[OASISAPPID]\" /EnterpriseAdminGroup=\"[ENTERPRISEADMINGROUP]\" /EnterpriseDomain=\"[ENTERPRISEDOMAIN]\" /EnterpriseNetbiosDomain=\"[ENTERPRISENETBIOSDOMAIN]\" /ServicesPort=\"[SERVICESPORT]\" /PdfPrinter=\"[PDFPRINTER]\"" } - "{4AA51A2D-7D85-4A59-BA75-B0809FC8B380}:_85C9D8F2D451409EA39FD39A771D1E86" + "{4AA51A2D-7D85-4A59-BA75-B0809FC8B380}:_82596355187F4AAAAE2ED43ABB33D30B" { - "Name" = "8:Primary output from Myrtille.Admin.Services (Active)" + "Name" = "8:Primary output from Myrtille.Web (Active)" "Condition" = "8:" - "Object" = "8:_EF7BA948A8A34B5CB515E968F9EFD966" - "FileType" = "3:2" + "Object" = "8:_653D6FBBA167416D9037981F1E63EC6A" + "FileType" = "3:1" "InstallAction" = "3:3" "Arguments" = "8:" "EntryPoint" = "8:" - "Sequence" = "3:3" - "Identifier" = "8:_09EE8396_0B42_45D1_9B8E_906515D90BE7" + "Sequence" = "3:1" + "Identifier" = "8:_EDBE9EE8_798D_4D72_B141_10001A25A4F2" "InstallerClass" = "11:TRUE" - "CustomActionData" = "8:/TargetDir=\"[TARGETDIR]\\\" /LogToConsole=true /LogFile=\"[TARGETDIR]\\log\\Myrtille.Setup.log\" /AdminServicesPort=\"[ADMINSERVICESPORT]\"" + "CustomActionData" = "8:/TargetDir=\"[TARGETDIR]\\\" /LogToConsole=true /LogFile=\"[TARGETDIR]\\log\\Myrtille.Setup.log\" /ServicesPort=\"[SERVICESPORT]\" /AdminServicesPort=\"[ADMINSERVICESPORT]\" /SslCert=\"[SSLCERT]\" /PdfPrinter=\"[PDFPRINTER]\" /SessionUrl=\"[SESSIONURL]\"" } - "{4AA51A2D-7D85-4A59-BA75-B0809FC8B380}:_97B8679BD26D43C0896319B6B12AEBAD" + "{4AA51A2D-7D85-4A59-BA75-B0809FC8B380}:_85C9D8F2D451409EA39FD39A771D1E86" { "Name" = "8:Primary output from Myrtille.Admin.Services (Active)" "Condition" = "8:" "Object" = "8:_EF7BA948A8A34B5CB515E968F9EFD966" "FileType" = "3:2" - "InstallAction" = "3:1" + "InstallAction" = "3:3" "Arguments" = "8:" "EntryPoint" = "8:" "Sequence" = "3:3" - "Identifier" = "8:_021844B1_B532_4721_9D54_08AC1D75122C" + "Identifier" = "8:_09EE8396_0B42_45D1_9B8E_906515D90BE7" "InstallerClass" = "11:TRUE" "CustomActionData" = "8:/TargetDir=\"[TARGETDIR]\\\" /LogToConsole=true /LogFile=\"[TARGETDIR]\\log\\Myrtille.Setup.log\" /AdminServicesPort=\"[ADMINSERVICESPORT]\"" } - "{4AA51A2D-7D85-4A59-BA75-B0809FC8B380}:_A818E89273C341A0807462566C867C46" + "{4AA51A2D-7D85-4A59-BA75-B0809FC8B380}:_9EF8E71F727C4BBC9190FBD2433AB6E3" { "Name" = "8:Primary output from Myrtille.Web (Active)" "Condition" = "8:" - "Object" = "8:_AA7B9254EDD24A378250099DC28F1BC1" + "Object" = "8:_653D6FBBA167416D9037981F1E63EC6A" "FileType" = "3:1" - "InstallAction" = "3:3" + "InstallAction" = "3:4" "Arguments" = "8:" "EntryPoint" = "8:" "Sequence" = "3:1" - "Identifier" = "8:_3CE2F9B0_4571_43DE_A1E1_2FC7A1A0DA72" + "Identifier" = "8:_3082BB14_D5C1_44EA_944A_F265935BF912" "InstallerClass" = "11:TRUE" "CustomActionData" = "8:/TargetDir=\"[TARGETDIR]\\\" /LogToConsole=true /LogFile=\"[TARGETDIR]\\log\\Myrtille.Setup.log\" /ServicesPort=\"[SERVICESPORT]\" /AdminServicesPort=\"[ADMINSERVICESPORT]\" /SslCert=\"[SSLCERT]\" /PdfPrinter=\"[PDFPRINTER]\" /SessionUrl=\"[SESSIONURL]\"" } @@ -1201,20 +1215,6 @@ "InstallerClass" = "11:TRUE" "CustomActionData" = "8:/TargetDir=\"[TARGETDIR]\\\" /LogToConsole=true /LogFile=\"[TARGETDIR]\\log\\Myrtille.Setup.log\" /AdminServicesPort=\"[ADMINSERVICESPORT]\"" } - "{4AA51A2D-7D85-4A59-BA75-B0809FC8B380}:_BFE6EB36E53A456F94035E78B692B834" - { - "Name" = "8:Primary output from Myrtille.Web (Active)" - "Condition" = "8:" - "Object" = "8:_AA7B9254EDD24A378250099DC28F1BC1" - "FileType" = "3:1" - "InstallAction" = "3:4" - "Arguments" = "8:" - "EntryPoint" = "8:" - "Sequence" = "3:1" - "Identifier" = "8:_2FCB018F_0377_4649_A800_71D1F30615E8" - "InstallerClass" = "11:TRUE" - "CustomActionData" = "8:/TargetDir=\"[TARGETDIR]\\\" /LogToConsole=true /LogFile=\"[TARGETDIR]\\log\\Myrtille.Setup.log\" /ServicesPort=\"[SERVICESPORT]\" /AdminServicesPort=\"[ADMINSERVICESPORT]\" /SslCert=\"[SSLCERT]\" /PdfPrinter=\"[PDFPRINTER]\" /SessionUrl=\"[SESSIONURL]\"" - } "{4AA51A2D-7D85-4A59-BA75-B0809FC8B380}:_DF4C16F2E2E34DC9A3DAC82E9F27E87C" { "Name" = "8:Primary output from Myrtille.Services (Active)" @@ -1229,19 +1229,19 @@ "InstallerClass" = "11:TRUE" "CustomActionData" = "8:/TargetDir=\"[TARGETDIR]\\\" /LogToConsole=true /LogFile=\"[TARGETDIR]\\log\\Myrtille.Setup.log\" /OasisApiKey=\"[OASISAPIKEY]\" /OasisAppKey=\"[OASISAPPKEY]\" /OasisAppId=\"[OASISAPPID]\" /EnterpriseAdminGroup=\"[ENTERPRISEADMINGROUP]\" /EnterpriseDomain=\"[ENTERPRISEDOMAIN]\" /EnterpriseNetbiosDomain=\"[ENTERPRISENETBIOSDOMAIN]\" /ServicesPort=\"[SERVICESPORT]\" /PdfPrinter=\"[PDFPRINTER]\"" } - "{4AA51A2D-7D85-4A59-BA75-B0809FC8B380}:_F42254A210A245448AE9A00EEF26D531" + "{4AA51A2D-7D85-4A59-BA75-B0809FC8B380}:_F39D4DAA88044742A022F75C2A4F9E07" { - "Name" = "8:Primary output from Myrtille.Web (Active)" + "Name" = "8:Primary output from Myrtille.Admin.Services (Active)" "Condition" = "8:" - "Object" = "8:_AA7B9254EDD24A378250099DC28F1BC1" - "FileType" = "3:1" + "Object" = "8:_EF7BA948A8A34B5CB515E968F9EFD966" + "FileType" = "3:2" "InstallAction" = "3:2" "Arguments" = "8:" "EntryPoint" = "8:" - "Sequence" = "3:1" - "Identifier" = "8:_8649B7A4_1192_472E_9342_548E7A446A9A" + "Sequence" = "3:3" + "Identifier" = "8:_C82F167E_21DD_4F8C_9901_0D8D8814EEA0" "InstallerClass" = "11:TRUE" - "CustomActionData" = "8:/TargetDir=\"[TARGETDIR]\\\" /LogToConsole=true /LogFile=\"[TARGETDIR]\\log\\Myrtille.Setup.log\" /ServicesPort=\"[SERVICESPORT]\" /AdminServicesPort=\"[ADMINSERVICESPORT]\" /SslCert=\"[SSLCERT]\" /PdfPrinter=\"[PDFPRINTER]\" /SessionUrl=\"[SESSIONURL]\"" + "CustomActionData" = "8:/TargetDir=\"[TARGETDIR]\\\" /LogToConsole=true /LogFile=\"[TARGETDIR]\\log\\Myrtille.Setup.log\" /AdminServicesPort=\"[ADMINSERVICESPORT]\"" } } "DefaultFeature" @@ -1567,7 +1567,7 @@ { "AssemblyRegister" = "3:1" "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:Myrtille.Enterprise, Version=2.7.1.0, Culture=neutral, processorArchitecture=MSIL" + "AssemblyAsmDisplayName" = "8:Myrtille.Enterprise, Version=2.8.0.0, Culture=neutral, processorArchitecture=MSIL" "ScatterAssemblies" { "_51E1684E0AC9A2E6C91C688F2C9DD4B1" @@ -2545,7 +2545,7 @@ { "AssemblyRegister" = "3:1" "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:Myrtille.Common, Version=2.7.1.0, Culture=neutral, processorArchitecture=MSIL" + "AssemblyAsmDisplayName" = "8:Myrtille.Common, Version=2.8.0.0, Culture=neutral, processorArchitecture=MSIL" "ScatterAssemblies" { "_DF64623992E0504E6E44F78E0DACDA36" @@ -2607,7 +2607,7 @@ { "AssemblyRegister" = "3:1" "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:Myrtille.Services.Contracts, Version=2.7.1.0, Culture=neutral, processorArchitecture=MSIL" + "AssemblyAsmDisplayName" = "8:Myrtille.Services.Contracts, Version=2.8.0.0, Culture=neutral, processorArchitecture=MSIL" "ScatterAssemblies" { "_E385E6F4F7BC7295F537EC6B3C8250D3" @@ -2658,7 +2658,7 @@ { "AssemblyRegister" = "3:1" "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:Myrtille.MFAProviders, Version=2.7.1.0, Culture=neutral, processorArchitecture=MSIL" + "AssemblyAsmDisplayName" = "8:Myrtille.MFAProviders, Version=2.8.0.0, Culture=neutral, processorArchitecture=MSIL" "ScatterAssemblies" { "_E76FFE893BD37BAA153E3EFB44999C4E" @@ -2960,15 +2960,15 @@ { "Name" = "8:Microsoft Visual Studio" "ProductName" = "8:Myrtille" - "ProductCode" = "8:{B00BCC6F-3958-4726-9D99-DBAC78513C26}" - "PackageCode" = "8:{482A6AF5-61F8-4238-83D9-9EC7CE0B09EF}" + "ProductCode" = "8:{F948238B-9510-4952-9102-8D0BECD55BA8}" + "PackageCode" = "8:{921046D7-254A-4437-AF87-DA4C9C843C47}" "UpgradeCode" = "8:{86A6145E-11DB-4EE7-9CE0-53F997050716}" "AspNetVersion" = "8:4.0.30319.0" "RestartWWWService" = "11:FALSE" "RemovePreviousVersions" = "11:TRUE" "DetectNewerInstalledVersion" = "11:TRUE" "InstallAllUsers" = "11:TRUE" - "ProductVersion" = "8:2.7.1" + "ProductVersion" = "8:2.8.0" "Manufacturer" = "8:Cedric Coste" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:http://cedrozor.github.io/myrtille" @@ -2984,7 +2984,7 @@ "UseSystemSearchPath" = "11:TRUE" "TargetPlatform" = "3:0" "PreBuildEvent" = "8:" - "PostBuildEvent" = "8:" + "PostBuildEvent" = "8:::@echo on\r\n\"$(ProjectDir)postbuild.cmd\" \"$(ProjectDir)wirunsql.vbs\" \"$(BuiltOuputPath)\"" "RunPostBuildEvent" = "3:0" } "Registry" @@ -3119,8 +3119,8 @@ "Type" = "3:15" "ContextData" = "8:" "Attributes" = "3:0" - "Setting" = "3:1" - "Value" = "8:#1258" + "Setting" = "3:2" + "Value" = "8:Please use Windows Update to check for any critical updates to the .NET Framework.\nSee CHANGELOG for changes related to this version." "DefaultValue" = "8:#1258" "UsePlugInResources" = "11:TRUE" } @@ -3499,7 +3499,7 @@ "ContextData" = "8:" "Attributes" = "3:0" "Setting" = "3:2" - "Value" = "8:If you use an Active Directory, manage your remote hosts and users from a simple dashboard.\nLeave all values empty to skip this feature (can be configured later, see documentation)." + "Value" = "8:If you use an Active Directory, manage your remote hosts and users from a synthetic dashboard.\nIf you don't have a domain, you can use the simplified dashboard (default login: admin/admin).\nLeave all values empty to skip this feature (can be configured later, see documentation)." "DefaultValue" = "8:#1215" "UsePlugInResources" = "11:TRUE" } @@ -3564,7 +3564,7 @@ "ContextData" = "8:" "Attributes" = "3:0" "Setting" = "3:2" - "Value" = "8:Domain Name (or Domain Controller FQDN or IP if this machine is not part of a domain)" + "Value" = "8:Domain Name (i.e. MYDOMAIN or mydomain.local) or Domain Controller FQDN or IP" "DefaultValue" = "8:#1247" "UsePlugInResources" = "11:TRUE" } @@ -3616,7 +3616,7 @@ "ContextData" = "8:" "Attributes" = "3:0" "Setting" = "3:2" - "Value" = "8:NetBios Domain Name (leave empty if using FQDN or IP above)" + "Value" = "8:NetBios Domain Name (i.e. MYDOMAIN)" "DefaultValue" = "8:#1248" "UsePlugInResources" = "11:TRUE" } @@ -4102,7 +4102,7 @@ "ContextData" = "8:Unchecked=;Checked=1" "Attributes" = "3:0" "Setting" = "3:2" - "Value" = "8:1" + "Value" = "8:" "DefaultValue" = "8:" "UsePlugInResources" = "11:TRUE" } @@ -4267,7 +4267,7 @@ "ContextData" = "8:" "Attributes" = "3:0" "Setting" = "3:2" - "Value" = "8:The installer will guide you through the steps required to install [ProductName] [ProductVersion] on your computer.\n\nPLEASE READ BEFORE CONTINUING!\n\n- Ensure IIS and ASP.NET 4.5+ are installed (Server Manager > Roles and Features).\n\n- Enable HTTP Activation (.NET Framework 4.5+ > WCF Services > HTTP Activation).\n\n- If you have IIS 8+, enable WebSockets (IIS > Application Development > WebSocket Protocol)." + "Value" = "8:The installer will guide you through the steps required to install [ProductName] [ProductVersion] on your computer.\n\nIt will attempt to install the [ProductName] prerequisites (see documentation), if not already installed.\n\nIf an older version of [ProductName] is installed, it will upgrade it; preserving your hosts configuration (database and logs) but resetting the [ProductName] admin password (admin/admin). You will be prompted to change it upon the next login.\n\nIn case of any issue during the installation process, please check the install log folder." "DefaultValue" = "8:#1203" "UsePlugInResources" = "11:TRUE" } @@ -4434,7 +4434,7 @@ "ContextData" = "8:" "Attributes" = "3:0" "Setting" = "3:2" - "Value" = "8:The installer will guide you through the steps required to install [ProductName] [ProductVersion] on your computer.\n\nPLEASE READ BEFORE CONTINUING!\n\n- Ensure IIS and ASP.NET 4.5+ are installed (Server Manager > Roles and Features).\n\n- Enable HTTP Activation (.NET Framework 4.5+ > WCF Services > HTTP Activation).\n\n- If you have IIS 8+, enable WebSockets (IIS > Application Development > WebSocket Protocol)." + "Value" = "8:The installer will guide you through the steps required to install [ProductName] [ProductVersion] on your computer.\n\nIt will attempt to install the [ProductName] prerequisites (see documentation), if not already installed.\n\nIf an older version of [ProductName] is installed, it will upgrade it; preserving your hosts configuration (database and logs) but resetting the [ProductName] admin password (admin/admin). You will be prompted to change it upon the next login.\n\nIn case of any issue during the installation process, please check the install log folder." "DefaultValue" = "8:#1203" "UsePlugInResources" = "11:TRUE" } @@ -4616,6 +4616,34 @@ { } } + "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_653D6FBBA167416D9037981F1E63EC6A" + { + "SourcePath" = "8:..\\Myrtille.Web\\obj\\Release\\Myrtille.Web.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_B8E8F5F7726243109EBB878F4275F26E" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + "ProjectOutputGroupRegister" = "3:1" + "OutputConfiguration" = "8:" + "OutputGroupCanonicalName" = "8:Built" + "OutputProjectGuid" = "8:{F00C33EB-EDA4-4980-AC2A-0BF574913A24}" + "ShowKeyOutput" = "11:TRUE" + "ExcludeFilters" + { + } + } "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_68B52B9A90214511BA3A28036A021026" { "SourcePath" = "8:" @@ -4728,12 +4756,12 @@ { } } - "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_84AC3D69B0824060A5632545504E14F3" + "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_819A5A440F374636A42A0DAED2CEFE5A" { "SourcePath" = "8:" "TargetName" = "8:" "Tag" = "8:" - "Folder" = "8:_B8E8F5F7726243109EBB878F4275F26E" + "Folder" = "8:_FA146EB9AE2B44E2AB4B01E26999CAB2" "Condition" = "8:" "Transitive" = "11:FALSE" "Vital" = "11:TRUE" @@ -4750,15 +4778,15 @@ "ProjectOutputGroupRegister" = "3:1" "OutputConfiguration" = "8:" "OutputGroupCanonicalName" = "8:ContentFiles" - "OutputProjectGuid" = "8:{F00C33EB-EDA4-4980-AC2A-0BF574913A24}" + "OutputProjectGuid" = "8:{2705B2A1-B47A-4E4D-96F9-BACE48F9A807}" "ShowKeyOutput" = "11:TRUE" "ExcludeFilters" { } } - "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_AA7B9254EDD24A378250099DC28F1BC1" + "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_84AC3D69B0824060A5632545504E14F3" { - "SourcePath" = "8:..\\Myrtille.Web\\obj\\Release\\Myrtille.Web.dll" + "SourcePath" = "8:" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_B8E8F5F7726243109EBB878F4275F26E" @@ -4777,7 +4805,7 @@ "IsolateTo" = "8:" "ProjectOutputGroupRegister" = "3:1" "OutputConfiguration" = "8:" - "OutputGroupCanonicalName" = "8:Built" + "OutputGroupCanonicalName" = "8:ContentFiles" "OutputProjectGuid" = "8:{F00C33EB-EDA4-4980-AC2A-0BF574913A24}" "ShowKeyOutput" = "11:TRUE" "ExcludeFilters" diff --git a/Myrtille.Setup/postbuild.cmd b/Myrtille.Setup/postbuild.cmd new file mode 100644 index 0000000..5d4dcd4 --- /dev/null +++ b/Myrtille.Setup/postbuild.cmd @@ -0,0 +1,10 @@ +:: update the installer for a quiet install, reinstall all files (except database and logs, which are left unmodified) and suppress the reboot prompt (IIS/.NET doesn't need it) +:: the vbs script used is part of the Windows installer SDK (along with Orca, see https://stackoverflow.com/questions/48315763/how-to-install-orca-which-windows-sdks-contain-the-orca-msi-editing-tool/48316642#48316642) + +::@echo off +SET vbsFile=%1% +SET msiFile=%2% + +cscript //nologo %vbsFile% %msiFile% "UPDATE Dialog SET Attributes = 1 WHERE Dialog = 'FilesInUse'" +cscript //nologo %vbsFile% %msiFile% "INSERT INTO Property (Property, Value) VALUES ('REINSTALLMODE', 'amus')" +cscript //nologo %vbsFile% %msiFile% "INSERT INTO Property (Property, Value) VALUES ('REBOOT', 'Suppress')" diff --git a/Myrtille.Setup/wirunsql.vbs b/Myrtille.Setup/wirunsql.vbs new file mode 100644 index 0000000..60bb3c9 --- /dev/null +++ b/Myrtille.Setup/wirunsql.vbs @@ -0,0 +1,84 @@ +' Windows Installer utility to execute SQL statements against an installer database +' For use with Windows Scripting Host, CScript.exe or WScript.exe +' Copyright (c) Microsoft Corporation. All rights reserved. +' Demonstrates the script-driven database queries and updates +' +Option Explicit + +Const msiOpenDatabaseModeReadOnly = 0 +Const msiOpenDatabaseModeTransact = 1 + +Dim argNum, argCount:argCount = Wscript.Arguments.Count +If (argCount < 2) Then + Wscript.Echo "Windows Installer utility to execute SQL queries against an installer database." &_ + vbLf & " The 1st argument specifies the path to the MSI database, relative or full path" &_ + vbLf & " Subsequent arguments specify SQL queries to execute - must be in double quotes" &_ + vbLf & " SELECT queries will display the rows of the result list specified in the query" &_ + vbLf & " Binary data columns selected by a query will not be displayed" &_ + vblf &_ + vblf & "Copyright (C) Microsoft Corporation. All rights reserved." + Wscript.Quit 1 +End If + +' Scan arguments for valid SQL keyword and to determine if any update operations +Dim openMode : openMode = msiOpenDatabaseModeReadOnly +For argNum = 1 To argCount - 1 + Dim keyword : keyword = Wscript.Arguments(argNum) + Dim keywordLen : keywordLen = InStr(1, keyword, " ", vbTextCompare) + If (keywordLen) Then keyword = UCase(Left(keyword, keywordLen - 1)) + If InStr(1, "UPDATE INSERT DELETE CREATE ALTER DROP", keyword, vbTextCompare) Then + openMode = msiOpenDatabaseModeTransact + ElseIf keyword <> "SELECT" Then + Fail "Invalid SQL statement type: " & keyword + End If +Next + +' Connect to Windows installer object +On Error Resume Next +Dim installer : Set installer = Nothing +Set installer = Wscript.CreateObject("WindowsInstaller.Installer") : CheckError + +' Open database +Dim databasePath:databasePath = Wscript.Arguments(0) +Dim database : Set database = installer.OpenDatabase(databasePath, openMode) : CheckError + +' Process SQL statements +Dim query, view, record, message, rowData, columnCount, delim, column +For argNum = 1 To argCount - 1 + query = Wscript.Arguments(argNum) + Set view = database.OpenView(query) : CheckError + view.Execute : CheckError + If Ucase(Left(query, 6)) = "SELECT" Then + Do + Set record = view.Fetch + If record Is Nothing Then Exit Do + columnCount = record.FieldCount + rowData = Empty + delim = " " + For column = 1 To columnCount + If column = columnCount Then delim = vbLf + rowData = rowData & record.StringData(column) & delim + Next + message = message & rowData + Loop + End If +Next +If openMode = msiOpenDatabaseModeTransact Then database.Commit +If Not IsEmpty(message) Then Wscript.Echo message +Wscript.Quit 0 + +Sub CheckError + Dim message, errRec + If Err = 0 Then Exit Sub + message = Err.Source & " " & Hex(Err) & ": " & Err.Description + If Not installer Is Nothing Then + Set errRec = installer.LastErrorRecord + If Not errRec Is Nothing Then message = message & vbLf & errRec.FormatText + End If + Fail message +End Sub + +Sub Fail(message) + Wscript.Echo message + Wscript.Quit 2 +End Sub diff --git a/Myrtille.Web/AudioSocketHandler.ashx b/Myrtille.Web/AudioSocketHandler.ashx index f95a601..788c509 100644 --- a/Myrtille.Web/AudioSocketHandler.ashx +++ b/Myrtille.Web/AudioSocketHandler.ashx @@ -1 +1,19 @@ -<%@ WebHandler Language="C#" CodeBehind="AudioSocketHandler.ashx.cs" Class="Myrtille.Web.AudioSocketHandler" %> +<%-- + Myrtille: A native HTML4/5 Remote Desktop Protocol client. + + Copyright(c) 2014-2020 Cedric Coste + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--%> + +<%@ WebHandler Language="C#" CodeBehind="AudioSocketHandler.ashx.cs" Class="Myrtille.Web.AudioSocketHandler" %> diff --git a/Myrtille.Web/AudioSocketHandler.ashx.cs b/Myrtille.Web/AudioSocketHandler.ashx.cs index d506fa9..edc2b58 100644 --- a/Myrtille.Web/AudioSocketHandler.ashx.cs +++ b/Myrtille.Web/AudioSocketHandler.ashx.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/Default.aspx b/Myrtille.Web/Default.aspx index 5ba57d2..7cfffe3 100644 --- a/Myrtille.Web/Default.aspx +++ b/Myrtille.Web/Default.aspx @@ -1,7 +1,7 @@ <%-- Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -189,6 +189,13 @@ + + +
@@ -260,7 +267,7 @@ - + @@ -342,31 +349,27 @@ // detect the browser width & height setClientResolution(display); - // the toolbar may be disabled from web.config - if (document.getElementById('<%=toolbar.ClientID%>') == null) - { - // disable the cookies related to the toolbar - setCookie((parent != null && window.name != '' ? window.name + '_' : '') + 'toolbar', 0); - setCookie((parent != null && window.name != '' ? window.name + '_' : '') + 'stat', 0); - setCookie((parent != null && window.name != '' ? window.name + '_' : '') + 'debug', 0); - setCookie((parent != null && window.name != '' ? window.name + '_' : '') + 'browser', 0); - return; - } - - // toolbar state is saved into a cookie to persist across page reload(s) - if (<%=(RemoteSession != null && (RemoteSession.State == RemoteSessionState.Connecting || RemoteSession.State == RemoteSessionState.Connected)).ToString(CultureInfo.InvariantCulture).ToLower()%> && - getToggleCookie((parent != null && window.name != '' ? window.name + '_' : '') + 'toolbar')) + // remote session toolbar + if (<%=(RemoteSession != null && (RemoteSession.State == RemoteSessionState.Connecting || RemoteSession.State == RemoteSessionState.Connected)).ToString(CultureInfo.InvariantCulture).ToLower()%>) { - toggleToolbar(); + // the toolbar is enabled (web.config) + if (document.getElementById('<%=toolbar.ClientID%>') != null) + { + // resume the saved toolbar state + if (getToggleCookie((parent != null && window.name != '' ? window.name + '_' : '') + 'toolbar')) + { + toggleToolbar(); + } + + // in addition to having their states also saved into a cookie, stat, debug and compatibility buttons are always available into the toolbar (even for guest(s) if the remote session is shared) + document.getElementById('stat').value = getToggleCookie((parent != null && window.name != '' ? window.name + '_' : '') + 'stat') ? 'Stat ON' : 'Stat OFF'; + document.getElementById('debug').value = getToggleCookie((parent != null && window.name != '' ? window.name + '_' : '') + 'debug') ? 'Debug ON' : 'Debug OFF'; + document.getElementById('browser').value = getToggleCookie((parent != null && window.name != '' ? window.name + '_' : '') + 'browser') ? 'HTML5 OFF' : 'HTML5 ON'; + + // swipe is disabled on IE/Edge because it emulates mouse events by default (experimental) + document.getElementById('<%=vswipe.ClientID%>').disabled = document.getElementById('<%=vswipe.ClientID%>').disabled || display.isIEBrowser(); + } } - - // in addition to having their states also saved into a cookie, stat, debug and compatibility buttons are always available into the toolbar (even for guest(s) if the remote session is shared) - document.getElementById('stat').value = getToggleCookie((parent != null && window.name != '' ? window.name + '_' : '') + 'stat') ? 'Stat ON' : 'Stat OFF'; - document.getElementById('debug').value = getToggleCookie((parent != null && window.name != '' ? window.name + '_' : '') + 'debug') ? 'Debug ON' : 'Debug OFF'; - document.getElementById('browser').value = getToggleCookie((parent != null && window.name != '' ? window.name + '_' : '') + 'browser') ? 'HTML5 OFF' : 'HTML5 ON'; - - // swipe is disabled on IE/Edge because it emulates mouse events by default (experimental) - document.getElementById('<%=vswipe.ClientID%>').disabled = document.getElementById('<%=vswipe.ClientID%>').disabled || display.isIEBrowser(); } catch (exc) { @@ -379,8 +382,8 @@ var securityProtocolDiv = document.getElementById('securityProtocolDiv'); if (securityProtocolDiv != null) { - securityProtocolDiv.style.visibility = (hostType.selectedIndex == 0 ? 'visible' : 'hidden'); - securityProtocolDiv.style.display = (hostType.selectedIndex == 0 ? 'block' : 'none'); + securityProtocolDiv.style.visibility = (hostType.selectedIndex == 0 || hostType.selectedIndex == 1 ? 'visible' : 'hidden'); + securityProtocolDiv.style.display = (hostType.selectedIndex == 0 || hostType.selectedIndex == 1 ? 'block' : 'none'); } var vmDiv = document.getElementById('vmDiv'); @@ -389,13 +392,6 @@ vmDiv.style.visibility = (hostType.selectedIndex == 1 ? 'visible' : 'hidden'); vmDiv.style.display = (hostType.selectedIndex == 1 ? 'block' : 'none'); } - - var domainDiv = document.getElementById('domainDiv'); - if (domainDiv != null) - { - domainDiv.style.visibility = (hostType.selectedIndex == 0 ? 'visible' : 'hidden'); - domainDiv.style.display = (hostType.selectedIndex == 0 ? 'block' : 'none'); - } } function setClientResolution(display) diff --git a/Myrtille.Web/Default.aspx.cs b/Myrtille.Web/Default.aspx.cs index 5932d35..7bd3e34 100644 --- a/Myrtille.Web/Default.aspx.cs +++ b/Myrtille.Web/Default.aspx.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -53,6 +53,8 @@ public partial class Default : Page private bool _authorizedRequest = true; + private bool _localAdmin; + private EnterpriseSession _enterpriseSession; protected RemoteSession RemoteSession; @@ -207,16 +209,6 @@ protected void Page_Load( { RemoteSession = (RemoteSession)Session[HttpSessionStateVariables.RemoteSession.ToString()]; - // register a message queue for the current http session, if not already done - // used for HTML4 client(s); pushing notifications on websocket(s) otherwise - lock (RemoteSession.Manager.MessageQueues.SyncRoot) - { - if (!RemoteSession.Manager.MessageQueues.ContainsKey(Session.SessionID)) - { - RemoteSession.Manager.MessageQueues.Add(Session.SessionID, new List()); - } - } - // if using a connection service, send the connection state if (Session.SessionID.Equals(RemoteSession.OwnerSessionID) && RemoteSession.ConnectionService) { @@ -303,6 +295,12 @@ protected void Page_Load( } } + // local admin + if (_enterpriseSession == null && RemoteSession == null && _enterpriseClient.GetMode() == EnterpriseMode.Local && !string.IsNullOrEmpty(Request["mode"]) && Request["mode"].Equals("admin")) + { + _localAdmin = true; + } + // postback events may redirect after execution; UI is updated from there if (!IsPostBack) { @@ -341,21 +339,24 @@ private void UpdateControls() { if (_toolbarEnabled) { + // interacting with the remote session is available to guests with control access, but only the remote session owner should have control on the remote session itself + var controlEnabled = Session.SessionID.Equals(RemoteSession.OwnerSessionID) || (Session[HttpSessionStateVariables.GuestInfo.ToString()] != null && ((GuestInfo)Session[HttpSessionStateVariables.GuestInfo.ToString()]).Control); + toolbar.Visible = true; toolbarToggle.Visible = true; serverInfo.Value = !string.IsNullOrEmpty(RemoteSession.VMGuid) ? RemoteSession.VMGuid : (!string.IsNullOrEmpty(RemoteSession.HostName) ? RemoteSession.HostName : RemoteSession.ServerAddress); - userInfo.Value = !string.IsNullOrEmpty(RemoteSession.VMGuid) || RemoteSession.SecurityProtocol == SecurityProtocol.rdp ? string.Empty : RemoteSession.UserName; + userInfo.Value = !string.IsNullOrEmpty(RemoteSession.VMGuid) || RemoteSession.SecurityProtocol == SecurityProtocol.rdp ? string.Empty : (string.IsNullOrEmpty(RemoteSession.UserDomain) ? RemoteSession.UserName : string.Format("{0}\\{1}", RemoteSession.UserDomain, RemoteSession.UserName)); userInfo.Visible = !string.IsNullOrEmpty(userInfo.Value); scale.Value = RemoteSession.BrowserResize == BrowserResize.Scale ? "Scale ON" : "Scale OFF"; scale.Disabled = !Session.SessionID.Equals(RemoteSession.OwnerSessionID) || RemoteSession.HostType == HostType.SSH; reconnect.Value = RemoteSession.BrowserResize == BrowserResize.Reconnect ? "Reconnect ON" : "Reconnect OFF"; reconnect.Disabled = !Session.SessionID.Equals(RemoteSession.OwnerSessionID) || RemoteSession.HostType == HostType.SSH; - keyboard.Disabled = !Session.SessionID.Equals(RemoteSession.OwnerSessionID); - clipboard.Disabled = !Session.SessionID.Equals(RemoteSession.OwnerSessionID) || RemoteSession.HostType == HostType.SSH || !RemoteSession.AllowRemoteClipboard || (!string.IsNullOrEmpty(RemoteSession.VMGuid) && !RemoteSession.VMEnhancedMode); + keyboard.Disabled = !controlEnabled; + clipboard.Disabled = !controlEnabled || RemoteSession.HostType == HostType.SSH || !RemoteSession.AllowRemoteClipboard || (!string.IsNullOrEmpty(RemoteSession.VMGuid) && !RemoteSession.VMEnhancedMode); files.Disabled = !Session.SessionID.Equals(RemoteSession.OwnerSessionID) || RemoteSession.HostType == HostType.SSH || !RemoteSession.AllowFileTransfer || (RemoteSession.ServerAddress.ToLower() != "localhost" && RemoteSession.ServerAddress != "127.0.0.1" && RemoteSession.ServerAddress != "[::1]" && RemoteSession.ServerAddress != Request.Url.Host && string.IsNullOrEmpty(RemoteSession.UserDomain)) || !string.IsNullOrEmpty(RemoteSession.VMGuid); - cad.Disabled = !Session.SessionID.Equals(RemoteSession.OwnerSessionID) || RemoteSession.HostType == HostType.SSH; - mrc.Disabled = !Session.SessionID.Equals(RemoteSession.OwnerSessionID) || RemoteSession.HostType == HostType.SSH; - vswipe.Disabled = !Session.SessionID.Equals(RemoteSession.OwnerSessionID) || RemoteSession.HostType == HostType.SSH; + cad.Disabled = !controlEnabled || RemoteSession.HostType == HostType.SSH; + mrc.Disabled = !controlEnabled || RemoteSession.HostType == HostType.SSH; + vswipe.Disabled = !controlEnabled || RemoteSession.HostType == HostType.SSH; share.Disabled = !Session.SessionID.Equals(RemoteSession.OwnerSessionID) || !RemoteSession.AllowSessionSharing; disconnect.Disabled = !Session.SessionID.Equals(RemoteSession.OwnerSessionID); } @@ -364,7 +365,7 @@ private void UpdateControls() else if (_enterpriseSession != null && _enterpriseSession.AuthenticationErrorCode == EnterpriseAuthenticationErrorCode.NONE) { hosts.Visible = true; - enterpriseUserInfo.Value = _enterpriseSession.UserName; + enterpriseUserInfo.Value = string.IsNullOrEmpty(_enterpriseSession.Domain) ? _enterpriseSession.UserName : string.Format("{0}\\{1}", _enterpriseSession.Domain, _enterpriseSession.UserName); enterpriseUserInfo.Visible = !string.IsNullOrEmpty(enterpriseUserInfo.Value); newRDPHost.Visible = _enterpriseSession.IsAdmin; newSSHHost.Visible = _enterpriseSession.IsAdmin; @@ -386,14 +387,21 @@ private void UpdateControls() } // enterprise mode - if (_enterpriseClient.GetState()) + if (_enterpriseClient.GetMode() == EnterpriseMode.Domain || _localAdmin) { hostConnectDiv.Visible = false; + adminDiv.Visible = _localAdmin; + if (adminDiv.Visible) + { + adminText.InnerText = "Home"; + adminUrl.HRef = "~/"; + } } // standard mode else { connect.Attributes["onclick"] = "initDisplay();"; + adminDiv.Visible = _enterpriseClient.GetMode() == EnterpriseMode.Local; } } } @@ -432,7 +440,7 @@ protected void ConnectButtonClick( } // enterprise mode from login - if (_enterpriseSession == null && _enterpriseClient.GetState()) + if (_enterpriseSession == null && (_enterpriseClient.GetMode() == EnterpriseMode.Domain || _localAdmin)) { CreateEnterpriseSessionFromLogin(); } @@ -508,7 +516,7 @@ private bool ConnectRemoteServer() var loginVMEnhancedMode = vmEnhancedMode.Checked; var loginDomain = domain.Value; var loginUser = user.Value; - var loginPassword = string.IsNullOrEmpty(passwordHash.Value) ? password.Value : RDPCryptoHelper.DecryptPassword(passwordHash.Value); + var loginPassword = string.IsNullOrEmpty(passwordHash.Value) ? password.Value : CryptoHelper.RDP_Decrypt(passwordHash.Value); var startProgram = program.Value; // allowed features @@ -550,7 +558,7 @@ private bool ConnectRemoteServer() loginVMEnhancedMode = connection.VMEnhancedMode; loginDomain = connection.Domain; loginUser = connection.Username; - loginPassword = RDPCryptoHelper.DecryptPassword(connection.Password); + loginPassword = CryptoHelper.RDP_Decrypt(connection.Password); startProgram = connection.StartRemoteProgram; } catch (Exception exc) @@ -727,14 +735,18 @@ private void CreateEnterpriseSessionFromLogin() { try { - // authenticate the user against the enterprise active directory + // authenticate the user _enterpriseSession = _enterpriseClient.Authenticate(user.Value, password.Value); - if (_enterpriseSession.AuthenticationErrorCode != EnterpriseAuthenticationErrorCode.NONE) + if (_enterpriseSession == null || _enterpriseSession.AuthenticationErrorCode != EnterpriseAuthenticationErrorCode.NONE) { - if (_enterpriseSession.AuthenticationErrorCode == EnterpriseAuthenticationErrorCode.PASSWORD_EXPIRED) + if (_enterpriseSession == null) + { + connectError.InnerText = EnterpriseAuthenticationErrorHelper.GetErrorDescription(EnterpriseAuthenticationErrorCode.UNKNOWN_ERROR); + } + else if (_enterpriseSession.AuthenticationErrorCode == EnterpriseAuthenticationErrorCode.PASSWORD_EXPIRED) { - ClientScript.RegisterClientScriptBlock(GetType(), Guid.NewGuid().ToString(), string.Format("openPopup('changePasswordPopup', 'EnterpriseChangePassword.aspx?userName={0}');", user.Value), true); + ClientScript.RegisterClientScriptBlock(GetType(), Guid.NewGuid().ToString(), string.Format("openPopup('changePasswordPopup', 'EnterpriseChangePassword.aspx?userName={0}" + (_localAdmin ? "&mode=admin');" : "');"), user.Value), true); } else { @@ -780,7 +792,7 @@ protected void hostsList_ItemDataBound( { var host = e.Item.DataItem as EnterpriseHost; - if (host.PromptForCredentials) + if (host.PromptForCredentials || string.IsNullOrEmpty(_enterpriseSession.Domain)) { var hostLink = e.Item.FindControl("hostLink") as HtmlAnchor; hostLink.HRef = null; diff --git a/Myrtille.Web/Default.aspx.designer.cs b/Myrtille.Web/Default.aspx.designer.cs index 1aa307c..172ae1e 100644 --- a/Myrtille.Web/Default.aspx.designer.cs +++ b/Myrtille.Web/Default.aspx.designer.cs @@ -192,6 +192,33 @@ public partial class Default { /// protected global::System.Web.UI.HtmlControls.HtmlInputSubmit connect; + /// + /// adminDiv control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl adminDiv; + + /// + /// adminUrl control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlAnchor adminUrl; + + /// + /// adminText control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl adminText; + /// /// connectError control. /// diff --git a/Myrtille.Web/GetCursor.aspx b/Myrtille.Web/GetCursor.aspx index 8299723..de38573 100644 --- a/Myrtille.Web/GetCursor.aspx +++ b/Myrtille.Web/GetCursor.aspx @@ -1,7 +1,7 @@ <%-- Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/GetCursor.aspx.cs b/Myrtille.Web/GetCursor.aspx.cs index 8066935..7a40f28 100644 --- a/Myrtille.Web/GetCursor.aspx.cs +++ b/Myrtille.Web/GetCursor.aspx.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/GetHash.aspx b/Myrtille.Web/GetHash.aspx index 9babb50..02dfd3b 100644 --- a/Myrtille.Web/GetHash.aspx +++ b/Myrtille.Web/GetHash.aspx @@ -1,7 +1,7 @@ <%-- Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/GetHash.aspx.cs b/Myrtille.Web/GetHash.aspx.cs index ffdb120..0006ab4 100644 --- a/Myrtille.Web/GetHash.aspx.cs +++ b/Myrtille.Web/GetHash.aspx.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -42,7 +42,7 @@ protected void Page_Load( using (StreamWriter sw = new StreamWriter(Response.OutputStream)) { String password = Request.QueryString["Password"]; - String encrypted = RDPCryptoHelper.EncryptPassword(password); + String encrypted = CryptoHelper.RDP_Encrypt(password); sw.WriteLine(encrypted); } } diff --git a/Myrtille.Web/GetUpdate.aspx b/Myrtille.Web/GetUpdate.aspx index 9434717..f9463a8 100644 --- a/Myrtille.Web/GetUpdate.aspx +++ b/Myrtille.Web/GetUpdate.aspx @@ -1,7 +1,7 @@ <%-- Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/GetUpdate.aspx.cs b/Myrtille.Web/GetUpdate.aspx.cs index 6c083f6..76e16a9 100644 --- a/Myrtille.Web/GetUpdate.aspx.cs +++ b/Myrtille.Web/GetUpdate.aspx.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/Global.asax b/Myrtille.Web/Global.asax index 4e80d1f..ce6feaf 100644 --- a/Myrtille.Web/Global.asax +++ b/Myrtille.Web/Global.asax @@ -1,7 +1,7 @@ <%-- Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/Global.asax.cs b/Myrtille.Web/Global.asax.cs index 4008882..5fee88b 100644 --- a/Myrtille.Web/Global.asax.cs +++ b/Myrtille.Web/Global.asax.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/Myrtille.Web.Install.ps1 b/Myrtille.Web/Myrtille.Web.Install.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..4c85dd5c3c6977168a5a1b7912744412a9bf7603 GIT binary patch literal 10598 zcmdU#T~i~+6^8qkROLTRKo^i&DL8g=;gl~h%X+DDfLdX5v3A8m(!wUgk!0fQ5}osWda1Io*BEdp`S&{`2p(@G6YMkKsDJ4OhCFh9Y!z?>d}^E&bXG zqj08Y=lV{=Of&->FLeHW_+9+I4%?y_g^5Pb!k3YD6ptriJ#2*UBh`V%G4@RN7+J*6 z>yYjRggH(H4i|(O29F zKSiFA0?oo52o&LGeJ>@aTUtkVjn-*4L{Y`2FN&Es0j+CEI}+zMVqJ7TdRVTo5&ov} zezyp}&bjQ&$N5Tz=H{GYO(V}V50+Wz{6 zo#-7EbZ)YABPV0cc|Cu6pqVB@YbebY^3j`!(p0?Q?ftm^W#r^Qt6k_fkzhLK{YZDg zdMxVwIPYaVVl5Uch!6N*(XgJLbd0U`YJS-h57Y2T_(603ps`8ghE&}KFCz{Ki)qP` zaY)^iOKtzKv*bc&BLCupDRK4a{6PO&Fy zI4UF){>1!XjU`;kJ~+NAIYg4hRMn?gFxH5CFU8GFT;}UeBQ8GMbFK46oZvq*`7+pD z&ylLm{9KYC8Qx3|xsfe`H&~ecRH=RK9nnB_C93N4zGg8G7{(ZYUQ9bxDxc+*o{^V) z{hS8e;r>+73;n<;8b8;%cr3n?ukQ1HEs7I;n*1MV#Va8L=Vn9rRlcsFYlxeL<98P6 zs`6Dwp{yUS_h~bu3oBVA_ub0ufh9!<@9BpDbM4!u6En;a~%B#CE z(irB>bBta4J7#qAZFF(1rluv#GZJ=+gJl*)-B0u+YgksV`(Cq7URZ_Xa|+qaq+xxdM5Bg~?I7O9 zx|G^C-_O|2!q8jM)9rEwt8%~6ubEca7RszXQf?p?or$aNd|}NU)(feFicO^`%Kw<<9kJ z`iGbI(ljv!d+Q4!w>GB)vt(=7g+HOrp+*|dEy8Q!`&&#`5r{0&W($vF1KkpF#|*#r z>pD)$;>&iFnEKUxvKdY8YoFD);dbQb#kS`ZO&jzlYqCG`Hr`d;vo4AuD~jzt*3ZmA zbxjwk&^Og&zLQG1#kx?HcH66xlZYzp%-FjX@jjUw9*Bh? z&$q5O=ejfRXXSCuYQMbKg+;p^V7K|M$m_)-`UW~Do)8=J{U#$%g%o?Psje4smPa7x zBt@X629kc8&)k0>Pp(}_M(=PGt=u{de=H@&*NNYs>GSEGQE;8ycD|3#C8U#u+dhd7 z&AE8H&BjbaxAEl9pRPT5W^39;;<;C9G_MTuxL(bNy)qwpoPQZT?^GT@G%}p&5aXw- z$}=}QS_XBz7M+*r_)BSy?lrOMePEFDJ;Rt+K-CCEx ze=o0RovMCrN4ov)a@?2WeP5i(V%D)EyF3-F?}xE_zMrY!s5~t5q^z+Fn}Hj$10b(PM7i7SC5HK5WQ~VL(-qWTd=ZTrmURHBp}loqUfsi1Ju>KfMp27iC>8MpmnZL#+y~`M%70x$MfU zE65uI>yg=Rth#1SLCmi14&8T~6{p*hQ{+`gK5M<2s%s>t_BzRDW*>rtz6-S~3#}su z_Vswu*EzLLukGYV<=YYVGwh?jjU0Hd)GEMlqwUkNB@4b&P1FmU^UCk(NpuiB2>-L) zy7!Bk(sZ;J!>>~`c?#07GxYxHr{T}B!k?8^zprQZhUTx*!~cs!be-s=SP#kdF_9h7 z!yhQtd=qtWRqi&}X%Tzc2 zFFg_Wx2A-f(YrR)1KHHaj>zhk>E~rx^)P@|Ly$IQ?qWy z-FphvE<_!P$IaHws^jtbwOoCw2teMnelhCa0>hZtD&;t1gRWRozxI*{IP;qHYF-yuR>`$FoM4$>sC&veY}V42F4Cf&7PoETGasMssb^gX<)%fz&o^7dp5>Vq21}VzpALbzCFKUr+kH zL(Q%})-qHCO$%XXcexx6$su2I^!d|{o!G$M+O3W3Po8ELtPAbda@*r=&-ymzTh2AJ z0-g)T3HK-VO}x%+ACA6d%r5Mw$lH(OwY9BduOinm^E7u1O*2FMom)lM>;XJ&`xU+% ziD{*K`_WqVg7*v^2Bl1w5$xP9(P+ZgSMWW9;}ZR^kuyQcAgA(U&@bnlEJEg-qNj_svA$D5~& z0UeJR4;jz6@AK_w{^iVmL8nuwJ?@8*v&UN{t65qyjJtFd^^q0<*?&cyWkrFV(oP-- z_MU5sooNqRP@OmNbl_O@%_$rOn#fzXSlch9x8X~(ujVUs><8v2YOs%`maTGLTFJfn zUCFV-%rSDbCxQErQQAvy$shCch){H1LeHSy@vMklj$M5l*gN>OOY(~L+->PbO$Nxk zEx#Valfik#&IY3QK6+_}F3N+`xc)S1a?ENI-jyS>QuiKI`Fa5NQItE4qoT#LNSTup z9bqkccG+Xas^ZYOoTQD)@mo-$1!ED@Z^4p;@=y{ z@So60vGI=kzprzJR7oG%zG=rRZTncTju)Hv$#*%e}EAgcJCLM*N z!mj}ttvs7BDvy$v|B2Q@j@QJj@JAUkMXqPxENuDD&O1h)F2^*a8JlLgR<(EWsWbOxoK^o z%qGlO)#J-&<70mPujb?9djDTD@-fS{%gOp|5^`kJvo6uEzAfinSSaN3?oR!j*% zi%!bFdGC^H=swvcEbWtB>H)?`S$VPNh@KKP`$)|PbddF@^ z8|hMYU_Q4EhD)}0aOy%Q$n_n1C}O-9mL;ywa&=9%t)u+I@z<~h6*k3^$H@uSq?+9= z<4+hV?oD-Yab|s&vTdX+BD2R#s_kF1YuVO{uaB9V_ieRK2O@JDB-HOC$&pbMDdGDx`?ICC7=gdew kt4@Y_)GH@P2XvqMdBv`}GIgZFiq#Xb&amlQI+u3rZ?crN@&Et; literal 0 HcmV?d00001 diff --git a/Myrtille.Web/Myrtille.Web.csproj b/Myrtille.Web/Myrtille.Web.csproj index 50c96ea..40ead6a 100644 --- a/Myrtille.Web/Myrtille.Web.csproj +++ b/Myrtille.Web/Myrtille.Web.csproj @@ -337,6 +337,8 @@ Designer + + Designer diff --git a/Myrtille.Web/PrintDocument.aspx b/Myrtille.Web/PrintDocument.aspx index 2af6337..4538631 100644 --- a/Myrtille.Web/PrintDocument.aspx +++ b/Myrtille.Web/PrintDocument.aspx @@ -1,2 +1,20 @@ -<%@ Page Language="C#" Inherits="Myrtille.Web.PrintDocument" CodeBehind="PrintDocument.aspx.cs" AutoEventWireup="true" %> +<%-- + Myrtille: A native HTML4/5 Remote Desktop Protocol client. + + Copyright(c) 2014-2020 Cedric Coste + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--%> + +<%@ Page Language="C#" Inherits="Myrtille.Web.PrintDocument" CodeBehind="PrintDocument.aspx.cs" AutoEventWireup="true" %> <%@ OutputCache Location="None" %> \ No newline at end of file diff --git a/Myrtille.Web/PrintDocument.aspx.cs b/Myrtille.Web/PrintDocument.aspx.cs index 6186fbb..7a214b7 100644 --- a/Myrtille.Web/PrintDocument.aspx.cs +++ b/Myrtille.Web/PrintDocument.aspx.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/Properties/AssemblyInfo.cs b/Myrtille.Web/Properties/AssemblyInfo.cs index 24b1729..be7ed1e 100644 --- a/Myrtille.Web/Properties/AssemblyInfo.cs +++ b/Myrtille.Web/Properties/AssemblyInfo.cs @@ -10,7 +10,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Myrtille")] -[assembly: AssemblyCopyright("Copyright © 2014-2019 Cedric Coste")] +[assembly: AssemblyCopyright("Copyright © 2014-2020 Cedric Coste")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -31,5 +31,5 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("2.7.1.0")] -[assembly: AssemblyFileVersion("2.7.1.0")] +[assembly: AssemblyVersion("2.8.0.0")] +[assembly: AssemblyFileVersion("2.8.0.0")] diff --git a/Myrtille.Web/PushUpdates.aspx b/Myrtille.Web/PushUpdates.aspx index d842af2..1d4de17 100644 --- a/Myrtille.Web/PushUpdates.aspx +++ b/Myrtille.Web/PushUpdates.aspx @@ -1,7 +1,7 @@ <%-- Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/PushUpdates.aspx.cs b/Myrtille.Web/PushUpdates.aspx.cs index f06903d..70d5eeb 100644 --- a/Myrtille.Web/PushUpdates.aspx.cs +++ b/Myrtille.Web/PushUpdates.aspx.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/SendInputs.aspx b/Myrtille.Web/SendInputs.aspx index f3e9809..19b999a 100644 --- a/Myrtille.Web/SendInputs.aspx +++ b/Myrtille.Web/SendInputs.aspx @@ -1,7 +1,7 @@ <%-- Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/SendInputs.aspx.cs b/Myrtille.Web/SendInputs.aspx.cs index 1d31d57..929b2e9 100644 --- a/Myrtille.Web/SendInputs.aspx.cs +++ b/Myrtille.Web/SendInputs.aspx.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -49,48 +49,58 @@ protected void Page_Load( // retrieve the remote session for the current http session remoteSession = (RemoteSession)Session[HttpSessionStateVariables.RemoteSession.ToString()]; - // update guest information - if (!Session.SessionID.Equals(remoteSession.OwnerSessionID)) + // filters out the dummy xhr calls (used with websocket to keep the http session alive) + if (!string.IsNullOrEmpty(Request.QueryString["data"])) { - // filters out the dummy xhr calls (used with websocket to keep the http session alive) - if (!string.IsNullOrEmpty(Request.QueryString["data"])) + // register a message queue for the current http session, if not exists + // the http client is now using HTML4 mode + lock (remoteSession.Manager.MessageQueues.SyncRoot) { - if (Session[HttpSessionStateVariables.GuestInfo.ToString()] != null) + if (!remoteSession.Manager.MessageQueues.ContainsKey(Session.SessionID)) { - ((GuestInfo)Session[HttpSessionStateVariables.GuestInfo.ToString()]).Websocket = false; + remoteSession.Manager.MessageQueues.Add(Session.SessionID, new List()); } } - } - // connect the remote server - else if (remoteSession.State == RemoteSessionState.Connecting && !remoteSession.Manager.HostClient.ProcessStarted) - { - try + + // update guest information + if (!Session.SessionID.Equals(remoteSession.OwnerSessionID)) { - // create pipes for the web gateway and the host client to talk - remoteSession.Manager.Pipes.CreatePipes(); - - // the host client does connect the pipes when it starts; when it stops (either because it was closed, crashed or because the remote session had ended), pipes are released - // as the process command line can be displayed into the task manager / process explorer, the connection settings (including user credentials) are now passed to the host client through the inputs pipe - // use http://technet.microsoft.com/en-us/sysinternals/dd581625 to track the existing pipes - remoteSession.Manager.HostClient.StartProcess( - remoteSession.Id, - remoteSession.HostType, - remoteSession.SecurityProtocol, - remoteSession.ServerAddress, - remoteSession.VMGuid, - remoteSession.UserDomain, - remoteSession.UserName, - remoteSession.StartProgram, - remoteSession.ClientWidth, - remoteSession.ClientHeight, - remoteSession.AllowRemoteClipboard, - remoteSession.AllowPrintDownload, - remoteSession.AllowAudioPlayback); + if (Session[HttpSessionStateVariables.GuestInfo.ToString()] != null) + { + ((GuestInfo)Session[HttpSessionStateVariables.GuestInfo.ToString()]).Websocket = false; + } } - catch (Exception exc) + // connect the remote server + else if (remoteSession.State == RemoteSessionState.Connecting && !remoteSession.Manager.HostClient.ProcessStarted) { - System.Diagnostics.Trace.TraceError("Failed to connect the remote session {0} ({1})", remoteSession.Id, exc); - throw; + try + { + // create pipes for the web gateway and the host client to talk + remoteSession.Manager.Pipes.CreatePipes(); + + // the host client does connect the pipes when it starts; when it stops (either because it was closed, crashed or because the remote session had ended), pipes are released + // as the process command line can be displayed into the task manager / process explorer, the connection settings (including user credentials) are now passed to the host client through the inputs pipe + // use http://technet.microsoft.com/en-us/sysinternals/dd581625 to track the existing pipes + remoteSession.Manager.HostClient.StartProcess( + remoteSession.Id, + remoteSession.HostType, + remoteSession.SecurityProtocol, + remoteSession.ServerAddress, + remoteSession.VMGuid, + remoteSession.UserDomain, + remoteSession.UserName, + remoteSession.StartProgram, + remoteSession.ClientWidth, + remoteSession.ClientHeight, + remoteSession.AllowRemoteClipboard, + remoteSession.AllowPrintDownload, + remoteSession.AllowAudioPlayback); + } + catch (Exception exc) + { + System.Diagnostics.Trace.TraceError("Failed to connect the remote session {0} ({1})", remoteSession.Id, exc); + throw; + } } } diff --git a/Myrtille.Web/SocketHandler.ashx b/Myrtille.Web/SocketHandler.ashx index 560b082..3a2567a 100644 --- a/Myrtille.Web/SocketHandler.ashx +++ b/Myrtille.Web/SocketHandler.ashx @@ -1 +1,19 @@ -<%@ WebHandler Language="C#" CodeBehind="SocketHandler.ashx.cs" Class="Myrtille.Web.SocketHandler" %> +<%-- + Myrtille: A native HTML4/5 Remote Desktop Protocol client. + + Copyright(c) 2014-2020 Cedric Coste + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--%> + +<%@ WebHandler Language="C#" CodeBehind="SocketHandler.ashx.cs" Class="Myrtille.Web.SocketHandler" %> diff --git a/Myrtille.Web/SocketHandler.ashx.cs b/Myrtille.Web/SocketHandler.ashx.cs index a00348d..028d90e 100644 --- a/Myrtille.Web/SocketHandler.ashx.cs +++ b/Myrtille.Web/SocketHandler.ashx.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/Web.Base.config b/Myrtille.Web/Web.Base.config index 8732551..33786a5 100644 --- a/Myrtille.Web/Web.Base.config +++ b/Myrtille.Web/Web.Base.config @@ -184,7 +184,6 @@ - diff --git a/Myrtille.Web/css/Default.css b/Myrtille.Web/css/Default.css index 7bcb6b4..6b57498 100644 --- a/Myrtille.Web/css/Default.css +++ b/Myrtille.Web/css/Default.css @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -142,6 +142,13 @@ label, display: inline-block; } +#adminDiv +{ + margin-top: 5px; + font-size: 12px; + text-decoration: underline; +} + #errorDiv { margin-left: 200px; @@ -377,13 +384,13 @@ label, padding-left: 10px; } -/* credential popup*/ +/* credential popup */ #editCredentialPopup, #editCredentialPopupInner { width: 400px; - height: 200px; + height: 250px; } #editCredentialPopupInner @@ -409,7 +416,7 @@ label, #editHostSessionPopupInner { width: 400px; - height: 450px; + height: 500px; } #editHostSessionPopupInner @@ -434,7 +441,7 @@ label, width: 370px; } -/* share session popup*/ +/* share session popup */ #shareSessionPopup, #shareSessionPopupInner diff --git a/Myrtille.Web/js/audio/audiowebsocket.js b/Myrtille.Web/js/audio/audiowebsocket.js index 1121242..ff7124d 100644 --- a/Myrtille.Web/js/audio/audiowebsocket.js +++ b/Myrtille.Web/js/audio/audiowebsocket.js @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/js/config.js b/Myrtille.Web/js/config.js index 3a0b681..eb78cad 100644 --- a/Myrtille.Web/js/config.js +++ b/Myrtille.Web/js/config.js @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -119,7 +119,8 @@ function Config( var keyboardHelperTimeout = 3000; // duration (ms) before removing the keyboard helper // display - var defaultResize = browserResizeEnum.RECONNECT; // default action on browser resize (RDP host only) + var defaultResize = browserResizeEnum.SCALE; // default action on browser resize (RDP host only) + var keepAspectRatio = false; // if scaling the display, preservation of the aspect ratio var displayMode = displayModeEnum.AUTO; // display mode var imageEncoding = imageEncodingEnum.PNG; // image encoding var imageQuality = 100; // image quality (%) higher = better; not applicable for PNG (lossless); tweaked dynamically to fit the available bandwidth if using JPEG, AUTO or WEBP encoding. for best user experience, fullscreen updates are always done in higher quality (75%), regardless of this setting and bandwidth @@ -186,7 +187,9 @@ function Config( this.getCompatibilityMode = function() { return compatibilityMode; }; this.getBrowserResizeEnum = function() { return browserResizeEnum; }; this.getBrowserResize = function() { return (browserResize == null ? null : (browserResize == 'SCALE' ? browserResizeEnum.SCALE : (browserResize == 'RECONNECT' ? browserResizeEnum.RECONNECT : browserResizeEnum.NONE))); }; + this.setBrowserResize = function(action) { browserResize = action; }; this.getDefaultResize = function() { return defaultResize; }; + this.getKeepAspectRatio = function() { return keepAspectRatio; }; this.getDisplayWidth = function() { return displayWidth; }; this.getDisplayHeight = function() { return displayHeight; }; this.getDisplayModeEnum = function() { return displayModeEnum; }; diff --git a/Myrtille.Web/js/dialog.js b/Myrtille.Web/js/dialog.js index 40868f1..9809b0a 100644 --- a/Myrtille.Web/js/dialog.js +++ b/Myrtille.Web/js/dialog.js @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/js/display.js b/Myrtille.Web/js/display.js index 84c5eb1..31fadc2 100644 --- a/Myrtille.Web/js/display.js +++ b/Myrtille.Web/js/display.js @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/js/display/canvas.js b/Myrtille.Web/js/display/canvas.js index 89d4a95..42dbf8e 100644 --- a/Myrtille.Web/js/display/canvas.js +++ b/Myrtille.Web/js/display/canvas.js @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/js/display/divs.js b/Myrtille.Web/js/display/divs.js index 2077574..692201f 100644 --- a/Myrtille.Web/js/display/divs.js +++ b/Myrtille.Web/js/display/divs.js @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/js/display/terminaldiv.js b/Myrtille.Web/js/display/terminaldiv.js index 3bcd855..ce40416 100644 --- a/Myrtille.Web/js/display/terminaldiv.js +++ b/Myrtille.Web/js/display/terminaldiv.js @@ -1,7 +1,8 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2008 Olive Innovations + Copyright(c) 2014-2020 Cedric Coste + Copyright(c) 2018 Olive Innovations Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/js/myrtille.js b/Myrtille.Web/js/myrtille.js index 3f05bc4..55f7338 100644 --- a/Myrtille.Web/js/myrtille.js +++ b/Myrtille.Web/js/myrtille.js @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -223,16 +223,18 @@ function Myrtille(httpServerUrl, connectionState, statEnabled, debugEnabled, com case config.getBrowserResizeEnum().SCALE: var width = display.getBrowserWidth(); var height = display.getBrowserHeight(); - commands.push(commandEnum.SET_SCALE_DISPLAY.text + width + 'x' + height); + commands.push(commandEnum.SET_SCALE_DISPLAY.text + (config.getKeepAspectRatio() ? '1' : '0') + '|' + width + 'x' + height); break; case config.getBrowserResizeEnum().RECONNECT: - commands.push(commandEnum.SET_RECONNECT_SESSION.text + 1); + commands.push(commandEnum.SET_RECONNECT_SESSION.text + 1 + '|' + 0); break; default: - commands.push(commandEnum.SET_RECONNECT_SESSION.text + 0); + commands.push(commandEnum.SET_RECONNECT_SESSION.text + 0 + '|' + 0); } + + config.setBrowserResize(config.getDefaultResize().text); } // initial clipboard synchronization @@ -421,7 +423,7 @@ function toggleScaleDisplay() var height = display.getBrowserHeight(); // send resolution while enabling display scaling - network.send(myrtille.getCommandEnum().SET_SCALE_DISPLAY.text + (config.getBrowserResize() == config.getBrowserResizeEnum().SCALE ? 0 : (width + 'x' + height))); + network.send(myrtille.getCommandEnum().SET_SCALE_DISPLAY.text + (config.getBrowserResize() == config.getBrowserResizeEnum().SCALE ? 0 : ((config.getKeepAspectRatio() ? '1' : '0') + '|' + width + 'x' + height))); } catch (exc) { @@ -434,7 +436,7 @@ function toggleReconnectSession() try { disableToolbar(); - network.send(myrtille.getCommandEnum().SET_RECONNECT_SESSION.text + (config.getBrowserResize() == config.getBrowserResizeEnum().RECONNECT ? 0 : 1)); + network.send(myrtille.getCommandEnum().SET_RECONNECT_SESSION.text + (config.getBrowserResize() == config.getBrowserResizeEnum().RECONNECT ? 0 : 1) + '|' + 1); } catch (exc) { @@ -697,6 +699,10 @@ function handleRemoteSessionExit(exitCode) alert('The remote connection failed due to invalid server address or security protocol'); break; + // invalid username (Hyper-V host) + case 131081: + // invalid password (Hyper-V host) + case 131082: // missing username case 131083: // missing password diff --git a/Myrtille.Web/js/network.js b/Myrtille.Web/js/network.js index d9088bb..8ffe7fb 100644 --- a/Myrtille.Web/js/network.js +++ b/Myrtille.Web/js/network.js @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -184,8 +184,9 @@ function Network(base, config, dialog, display) websocket.init(); } - // websocket enabled and functional, RDP host - if (config.getNetworkMode() == config.getNetworkModeEnum().WEBSOCKET && config.getHostType() == config.getHostTypeEnum().RDP) + // websocket enabled and functional, RDP host, audio enabled + // audio playback can also be switched on the gateway (web.config); this parameter takes precedence over config.js + if (config.getNetworkMode() == config.getNetworkModeEnum().WEBSOCKET && config.getHostType() == config.getHostTypeEnum().RDP && config.getAudioFormat() != config.getAudioFormatEnum().NONE) { // audio audioWebsocket = new AudioWebsocket(base, config, dialog, display, this); diff --git a/Myrtille.Web/js/network/buffer.js b/Myrtille.Web/js/network/buffer.js index 29e2e7b..3c13766 100644 --- a/Myrtille.Web/js/network/buffer.js +++ b/Myrtille.Web/js/network/buffer.js @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/js/network/longpolling.js b/Myrtille.Web/js/network/longpolling.js index bccbca7..a40cba9 100644 --- a/Myrtille.Web/js/network/longpolling.js +++ b/Myrtille.Web/js/network/longpolling.js @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/js/network/websocket.js b/Myrtille.Web/js/network/websocket.js index 6743aed..68aca93 100644 --- a/Myrtille.Web/js/network/websocket.js +++ b/Myrtille.Web/js/network/websocket.js @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/js/network/xmlhttp.js b/Myrtille.Web/js/network/xmlhttp.js index f938fd0..e663c36 100644 --- a/Myrtille.Web/js/network/xmlhttp.js +++ b/Myrtille.Web/js/network/xmlhttp.js @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/js/tools/common.js b/Myrtille.Web/js/tools/common.js index a38388d..287fca4 100644 --- a/Myrtille.Web/js/tools/common.js +++ b/Myrtille.Web/js/tools/common.js @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/js/tools/convert.js b/Myrtille.Web/js/tools/convert.js index 68c08f2..1583008 100644 --- a/Myrtille.Web/js/tools/convert.js +++ b/Myrtille.Web/js/tools/convert.js @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/js/user.js b/Myrtille.Web/js/user.js index 68b4b81..e29b0d6 100644 --- a/Myrtille.Web/js/user.js +++ b/Myrtille.Web/js/user.js @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -82,11 +82,31 @@ function User(base, config, dialog, display, network) }; } + // prompts the user to confirm or not to close the window/tab + + // unfortunately, this method isn't reliable (the browser may decide or not to prompt the user, this is not guaranteed: see https://dev.to/chromiumdev/sure-you-want-to-leavebrowser-beforeunload-event-4eg5) + // the message is not customizable (the browser shows a generic and confusing message, advising to save data; this doesn't apply to a remote session which isn't even disconnected when the page is closed) + // also, the browser doesn't differentiate a page reload and close (such a confirm dialog should only be displayed on close); this is a problem because myrtille reloads the page on several occasions + // this can even be considered as a bad practice to disturb the user with such a confirm dialog (...) + // anyway, if the browser or page is closed by mistake: cross icon, ctrl + w or alt + f4, etc. (these key combinations can't be captured by javascript because the browser or OS are intercepting them first!), the user can still use its browser history > "pages or tabs closed recently" to resume its session + + //eventListener('beforeunload', function(e) { e.preventDefault(); e.returnValue = 'Are you sure you want to close this page?'; }); + if (config.getHostType() == config.getHostTypeEnum().RDP) { // responsive display eventListener('resize', function() { browserResize(); }); + // default action on browser resize + if (config.getBrowserResize() == null) + { + var reconnect = document.getElementById('reconnect'); + if (reconnect != null) + { + reconnect.value = config.getDefaultResize() == config.getBrowserResizeEnum().RECONNECT ? 'Reconnect ON' : 'Reconnect OFF'; + } + } + keyboard = new Keyboard(base, config, dialog, display, network, this); keyboard.init(); @@ -175,8 +195,13 @@ function User(base, config, dialog, display, network) try { - // disable the toolbar while resizing - disableToolbar(); + // disable the toolbar while resizing, if needed + var reconnect = document.getElementById('reconnect'); + var scale = document.getElementById('scale'); + if (reconnect != null && scale != null && !reconnect.disabled && !scale.disabled) + { + disableToolbar(); + } var width = display.getBrowserWidth(); var height = display.getBrowserHeight(); @@ -188,7 +213,7 @@ function User(base, config, dialog, display, network) } // send the new browser resolution - network.send(base.getCommandEnum().SEND_BROWSER_RESIZE.text + width + 'x' + height); + network.send(base.getCommandEnum().SEND_BROWSER_RESIZE.text + (config.getKeepAspectRatio() ? '1' : '0') + '|' + width + 'x' + height); } catch (exc) { diff --git a/Myrtille.Web/js/user/keyboard.js b/Myrtille.Web/js/user/keyboard.js index acf60ff..a33d8ce 100644 --- a/Myrtille.Web/js/user/keyboard.js +++ b/Myrtille.Web/js/user/keyboard.js @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/js/user/mouse.js b/Myrtille.Web/js/user/mouse.js index 9af9283..0e9fc7c 100644 --- a/Myrtille.Web/js/user/mouse.js +++ b/Myrtille.Web/js/user/mouse.js @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/js/user/touchscreen.js b/Myrtille.Web/js/user/touchscreen.js index 988d7b1..725d0c1 100644 --- a/Myrtille.Web/js/user/touchscreen.js +++ b/Myrtille.Web/js/user/touchscreen.js @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/popups/CopyClipboard.aspx b/Myrtille.Web/popups/CopyClipboard.aspx index 3f27a49..971be07 100644 --- a/Myrtille.Web/popups/CopyClipboard.aspx +++ b/Myrtille.Web/popups/CopyClipboard.aspx @@ -1,7 +1,7 @@ <%-- Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/popups/CopyClipboard.aspx.cs b/Myrtille.Web/popups/CopyClipboard.aspx.cs index 25fbcbc..887a010 100644 --- a/Myrtille.Web/popups/CopyClipboard.aspx.cs +++ b/Myrtille.Web/popups/CopyClipboard.aspx.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/popups/CredentialsPrompt.aspx b/Myrtille.Web/popups/CredentialsPrompt.aspx index 2251e1d..7debddc 100644 --- a/Myrtille.Web/popups/CredentialsPrompt.aspx +++ b/Myrtille.Web/popups/CredentialsPrompt.aspx @@ -37,13 +37,17 @@ Login Credentials
+
+
+ +
- +
- +

diff --git a/Myrtille.Web/popups/CredentialsPrompt.aspx.cs b/Myrtille.Web/popups/CredentialsPrompt.aspx.cs index d72ddca..9d93558 100644 --- a/Myrtille.Web/popups/CredentialsPrompt.aspx.cs +++ b/Myrtille.Web/popups/CredentialsPrompt.aspx.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -55,10 +55,15 @@ protected void Page_Load( } } - if(Request["edit"] != null) + if (Request["edit"] != null) { hostID.Value = _hostId.ToString(); } + + if (!IsPostBack) + { + promptDomain.Value = _enterpriseSession.Domain; + } } catch (ThreadAbortException) { @@ -90,6 +95,7 @@ protected void ConnectButtonClick( HostID = _hostId, SessionID = _enterpriseSession.SessionID, SessionKey = _enterpriseSession.SessionKey, + Domain = promptDomain.Value, Username = promptUserName.Value, Password = promptPassword.Value }; @@ -100,7 +106,7 @@ protected void ConnectButtonClick( } // connect to remote host - Response.Redirect(Request.RawUrl + (Request.RawUrl.Contains("?") ? "&" : "?") + "edit=success",false); + Response.Redirect(Request.RawUrl + (Request.RawUrl.Contains("?") ? "&" : "?") + "edit=success", false); } catch (ThreadAbortException) { diff --git a/Myrtille.Web/popups/CredentialsPrompt.aspx.designer.cs b/Myrtille.Web/popups/CredentialsPrompt.aspx.designer.cs index d500f49..4b0e9f7 100644 --- a/Myrtille.Web/popups/CredentialsPrompt.aspx.designer.cs +++ b/Myrtille.Web/popups/CredentialsPrompt.aspx.designer.cs @@ -21,6 +21,15 @@ public partial class CredentialsPrompt { /// protected global::System.Web.UI.HtmlControls.HtmlInputHidden hostID; + /// + /// promptDomain control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputText promptDomain; + /// /// promptUserName control. /// diff --git a/Myrtille.Web/popups/EditHost.aspx b/Myrtille.Web/popups/EditHost.aspx index 22bd513..1b2dc68 100644 --- a/Myrtille.Web/popups/EditHost.aspx +++ b/Myrtille.Web/popups/EditHost.aspx @@ -1,7 +1,7 @@ <%-- Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -55,9 +55,9 @@
-
-
- +
+
+
@@ -75,7 +75,7 @@
- +

diff --git a/Myrtille.Web/popups/EditHost.aspx.cs b/Myrtille.Web/popups/EditHost.aspx.cs index 922acc6..5051868 100644 --- a/Myrtille.Web/popups/EditHost.aspx.cs +++ b/Myrtille.Web/popups/EditHost.aspx.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -109,6 +109,14 @@ protected void Page_Load( vmEnhancedModeInput.Visible = _hostType == HostType.RDP; rdpSecurityInput.Visible = _hostType == HostType.RDP; startProgramInput.Visible = _hostType == HostType.RDP; + + // local admin + groupsAccessInput.Visible = !string.IsNullOrEmpty(_enterpriseSession.Domain); + if (string.IsNullOrEmpty(_enterpriseSession.Domain)) + { + promptCredentials.Checked = true; + promptCredentials.Disabled = true; + } } catch (ThreadAbortException) { @@ -146,7 +154,7 @@ protected void SaveHostButtonClick( DirectoryGroups = groupsAccess.Value, Protocol = (SecurityProtocol)securityProtocol.SelectedIndex, StartRemoteProgram = startProgram.Value, - PromptForCredentials = promptCredentials.Checked + PromptForCredentials = string.IsNullOrEmpty(_enterpriseSession.Domain) ? true : promptCredentials.Checked }; if (_hostId != null) diff --git a/Myrtille.Web/popups/EditHost.aspx.designer.cs b/Myrtille.Web/popups/EditHost.aspx.designer.cs index 6cbfedd..c2f5d9d 100644 --- a/Myrtille.Web/popups/EditHost.aspx.designer.cs +++ b/Myrtille.Web/popups/EditHost.aspx.designer.cs @@ -75,6 +75,15 @@ public partial class EditHost { /// protected global::System.Web.UI.HtmlControls.HtmlInputCheckBox vmEnhancedMode; + /// + /// groupsAccessInput control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl groupsAccessInput; + /// /// groupsAccess control. /// diff --git a/Myrtille.Web/popups/EditHostSession.aspx b/Myrtille.Web/popups/EditHostSession.aspx index 0385da9..5d01530 100644 --- a/Myrtille.Web/popups/EditHostSession.aspx +++ b/Myrtille.Web/popups/EditHostSession.aspx @@ -1,7 +1,7 @@ <%-- Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -38,11 +38,15 @@
-
+
+ +
+
+
-
+
diff --git a/Myrtille.Web/popups/EditHostSession.aspx.cs b/Myrtille.Web/popups/EditHostSession.aspx.cs index 4bcc738..6ca513c 100644 --- a/Myrtille.Web/popups/EditHostSession.aspx.cs +++ b/Myrtille.Web/popups/EditHostSession.aspx.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -79,6 +79,11 @@ protected void Page_Load( } } } + + if (!IsPostBack) + { + userDomain.Value = _enterpriseSession.Domain; + } } catch (ThreadAbortException) { @@ -105,7 +110,7 @@ protected void CreateSessionUrlButtonClick( try { - var url = _enterpriseClient.CreateUserSession(_enterpriseSession.SessionID, _hostId, userName.Value, userPassword.Value); + var url = _enterpriseClient.CreateUserSession(_enterpriseSession.SessionID, _hostId, userName.Value, userPassword.Value, userDomain.Value); if (!string.IsNullOrEmpty(url)) { sessionUrl.Value = Request.Url.Scheme + "://" + Request.Url.Host + (Request.Url.Port != 80 && Request.Url.Port != 443 ? ":" + Request.Url.Port : "") + Request.ApplicationPath + "/" + url + "&__EVENTTARGET=&__EVENTARGUMENT=&connect=Connect%21"; diff --git a/Myrtille.Web/popups/EditHostSession.aspx.designer.cs b/Myrtille.Web/popups/EditHostSession.aspx.designer.cs index 08696cb..691ec8b 100644 --- a/Myrtille.Web/popups/EditHostSession.aspx.designer.cs +++ b/Myrtille.Web/popups/EditHostSession.aspx.designer.cs @@ -21,6 +21,15 @@ public partial class EditHostSession { /// protected global::System.Web.UI.HtmlControls.HtmlGenericControl hostName; + /// + /// userDomain control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputText userDomain; + /// /// userName control. /// diff --git a/Myrtille.Web/popups/EnterpriseChangePassword.aspx b/Myrtille.Web/popups/EnterpriseChangePassword.aspx index fe11998..aac8d68 100644 --- a/Myrtille.Web/popups/EnterpriseChangePassword.aspx +++ b/Myrtille.Web/popups/EnterpriseChangePassword.aspx @@ -1,7 +1,7 @@ <%-- Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -55,11 +55,11 @@
- +

- +
diff --git a/Myrtille.Web/popups/EnterpriseChangePassword.aspx.cs b/Myrtille.Web/popups/EnterpriseChangePassword.aspx.cs index 154747a..1587400 100644 --- a/Myrtille.Web/popups/EnterpriseChangePassword.aspx.cs +++ b/Myrtille.Web/popups/EnterpriseChangePassword.aspx.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -25,7 +25,9 @@ namespace Myrtille.Web public partial class EnterpriseChangePassword : Page { private EnterpriseClient _enterpriseClient = new EnterpriseClient(); - + + private bool _localAdmin; + /// /// page load (postback data is now available) /// @@ -44,6 +46,12 @@ protected void Page_Load( { changePassword.Disabled = true; } + + // local admin + if (!string.IsNullOrEmpty(Request["mode"]) && Request["mode"].Equals("admin")) + { + _localAdmin = true; + } } /// @@ -68,7 +76,21 @@ protected void ChangePasswordButtonClick( { changeError.InnerText = "New and confirmed passwords do not match"; } - else + // ensure password change for local admin + // for the enterprise domain, this is delegated to the domain policy (whether to accept an empty password, same as the old one, on change) + else if (_localAdmin) + { + if (string.IsNullOrEmpty(newPassword.Value)) + { + changeError.InnerText = "New password must be specified"; + } + else if (string.Equals(oldPassword.Value, newPassword.Value)) + { + changeError.InnerText = "Old and new passwords must be different"; + } + } + + if (string.IsNullOrEmpty(changeError.InnerText)) { if (_enterpriseClient.ChangeUserPassword(userName.Value, oldPassword.Value, newPassword.Value)) { diff --git a/Myrtille.Web/popups/EnterpriseChangePassword.aspx.designer.cs b/Myrtille.Web/popups/EnterpriseChangePassword.aspx.designer.cs index 1e86aee..072980f 100644 --- a/Myrtille.Web/popups/EnterpriseChangePassword.aspx.designer.cs +++ b/Myrtille.Web/popups/EnterpriseChangePassword.aspx.designer.cs @@ -64,6 +64,6 @@ public partial class EnterpriseChangePassword { /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.HtmlControls.HtmlInputButton changePassword; + protected global::System.Web.UI.HtmlControls.HtmlInputSubmit changePassword; } } diff --git a/Myrtille.Web/popups/FileStorage.aspx b/Myrtille.Web/popups/FileStorage.aspx index 81b3798..6ac95cf 100644 --- a/Myrtille.Web/popups/FileStorage.aspx +++ b/Myrtille.Web/popups/FileStorage.aspx @@ -1,7 +1,7 @@ <%-- Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/popups/FileStorage.aspx.cs b/Myrtille.Web/popups/FileStorage.aspx.cs index b0d4cb4..3ef2023 100644 --- a/Myrtille.Web/popups/FileStorage.aspx.cs +++ b/Myrtille.Web/popups/FileStorage.aspx.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/popups/PasteClipboard.aspx b/Myrtille.Web/popups/PasteClipboard.aspx index 23eea40..90219d3 100644 --- a/Myrtille.Web/popups/PasteClipboard.aspx +++ b/Myrtille.Web/popups/PasteClipboard.aspx @@ -1,7 +1,7 @@ <%-- Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/popups/PasteClipboard.aspx.cs b/Myrtille.Web/popups/PasteClipboard.aspx.cs index 0c42f5a..8d74ce0 100644 --- a/Myrtille.Web/popups/PasteClipboard.aspx.cs +++ b/Myrtille.Web/popups/PasteClipboard.aspx.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/popups/ShareSession.aspx b/Myrtille.Web/popups/ShareSession.aspx index 2f523a1..2ce62ef 100644 --- a/Myrtille.Web/popups/ShareSession.aspx +++ b/Myrtille.Web/popups/ShareSession.aspx @@ -1,7 +1,7 @@ <%-- Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/popups/ShareSession.aspx.cs b/Myrtille.Web/popups/ShareSession.aspx.cs index cd720c7..d0e357d 100644 --- a/Myrtille.Web/popups/ShareSession.aspx.cs +++ b/Myrtille.Web/popups/ShareSession.aspx.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/popups/ShowDialog.aspx b/Myrtille.Web/popups/ShowDialog.aspx index 5b48fd3..0d87208 100644 --- a/Myrtille.Web/popups/ShowDialog.aspx +++ b/Myrtille.Web/popups/ShowDialog.aspx @@ -1,7 +1,7 @@ <%-- Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/popups/ShowDialog.aspx.cs b/Myrtille.Web/popups/ShowDialog.aspx.cs index 8dbc564..210d904 100644 --- a/Myrtille.Web/popups/ShowDialog.aspx.cs +++ b/Myrtille.Web/popups/ShowDialog.aspx.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/popups/VirtualKeyboard.aspx b/Myrtille.Web/popups/VirtualKeyboard.aspx index 1fd67ce..92e22ad 100644 --- a/Myrtille.Web/popups/VirtualKeyboard.aspx +++ b/Myrtille.Web/popups/VirtualKeyboard.aspx @@ -1,7 +1,7 @@ <%-- Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/popups/VirtualKeyboard.aspx.cs b/Myrtille.Web/popups/VirtualKeyboard.aspx.cs index a0d43ea..7d5efbe 100644 --- a/Myrtille.Web/popups/VirtualKeyboard.aspx.cs +++ b/Myrtille.Web/popups/VirtualKeyboard.aspx.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/src/Clients/ApplicationPoolClient.cs b/Myrtille.Web/src/Clients/ApplicationPoolClient.cs index 10bf357..f6a184f 100644 --- a/Myrtille.Web/src/Clients/ApplicationPoolClient.cs +++ b/Myrtille.Web/src/Clients/ApplicationPoolClient.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/src/Clients/ConnectionClient.cs b/Myrtille.Web/src/Clients/ConnectionClient.cs index 8f45fed..d0d5be4 100644 --- a/Myrtille.Web/src/Clients/ConnectionClient.cs +++ b/Myrtille.Web/src/Clients/ConnectionClient.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/src/Clients/EnterpriseClient.cs b/Myrtille.Web/src/Clients/EnterpriseClient.cs index 6dc0375..2cdbd4a 100644 --- a/Myrtille.Web/src/Clients/EnterpriseClient.cs +++ b/Myrtille.Web/src/Clients/EnterpriseClient.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -26,16 +26,16 @@ namespace Myrtille.Web { public class EnterpriseClient : ClientBase, IEnterpriseService { - public bool GetState() + public EnterpriseMode GetMode() { try { - return Channel.GetState(); + return Channel.GetMode(); } catch (Exception exc) { - Trace.TraceError("Failed to get enterprise adapter state ({0})", exc); - return false; + Trace.TraceError("Failed to get enterprise adapter mode ({0})", exc); + return EnterpriseMode.None; } } @@ -143,11 +143,11 @@ public EnterpriseConnectionDetails GetSessionConnectionDetails(string sessionID, } } - public string CreateUserSession(string sessionID, long hostID, string username, string password) + public string CreateUserSession(string sessionID, long hostID, string username, string password, string domain) { try { - return Channel.CreateUserSession(sessionID,hostID,username,password); + return Channel.CreateUserSession(sessionID, hostID, username, password, domain); } catch (Exception exc) { diff --git a/Myrtille.Web/src/Clients/FileStorageClient.cs b/Myrtille.Web/src/Clients/FileStorageClient.cs index 25eb67a..68283de 100644 --- a/Myrtille.Web/src/Clients/FileStorageClient.cs +++ b/Myrtille.Web/src/Clients/FileStorageClient.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/src/Clients/MFAAuthenticationClient.cs b/Myrtille.Web/src/Clients/MFAAuthenticationClient.cs index bbf546a..38b5407 100644 --- a/Myrtille.Web/src/Clients/MFAAuthenticationClient.cs +++ b/Myrtille.Web/src/Clients/MFAAuthenticationClient.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/src/Clients/PrinterClient.cs b/Myrtille.Web/src/Clients/PrinterClient.cs index 22db2e0..b9dfcc2 100644 --- a/Myrtille.Web/src/Clients/PrinterClient.cs +++ b/Myrtille.Web/src/Clients/PrinterClient.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/src/Clients/RemoteSessionProcessClient.cs b/Myrtille.Web/src/Clients/RemoteSessionProcessClient.cs index 320223f..dac423e 100644 --- a/Myrtille.Web/src/Clients/RemoteSessionProcessClient.cs +++ b/Myrtille.Web/src/Clients/RemoteSessionProcessClient.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -300,7 +300,7 @@ private void CleanupDisconnectedSession(RemoteSessionExitCode exitCode) // don't recycle in case of connection failure, so that the page can handle it (show the related error dialog) if (idleAppPoolRecycling && remoteSessions.Count == 0 && - !_enterpriseClient.GetState() && + (_enterpriseClient.GetMode() == EnterpriseMode.None) && (exitCode == RemoteSessionExitCode.Success || exitCode == RemoteSessionExitCode.SessionDisconnectFromMenu || exitCode == RemoteSessionExitCode.SessionLogoutFromMenu)) { // if using a custom login page, the application pool must be recycled after the redirect diff --git a/Myrtille.Web/src/Controllers/CaptureController.cs b/Myrtille.Web/src/Controllers/CaptureController.cs index 4918f62..6cb1a52 100644 --- a/Myrtille.Web/src/Controllers/CaptureController.cs +++ b/Myrtille.Web/src/Controllers/CaptureController.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/src/Controllers/DisconnectionController.cs b/Myrtille.Web/src/Controllers/DisconnectionController.cs index 928a762..8edc86b 100644 --- a/Myrtille.Web/src/Controllers/DisconnectionController.cs +++ b/Myrtille.Web/src/Controllers/DisconnectionController.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/src/Controllers/SharingControler.cs b/Myrtille.Web/src/Controllers/SharingControler.cs index e3e7014..71240fd 100644 --- a/Myrtille.Web/src/Controllers/SharingControler.cs +++ b/Myrtille.Web/src/Controllers/SharingControler.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/src/JSKeyCodeToRDPScanCodeMapping.cs b/Myrtille.Web/src/JSKeyCodeToRDPScanCodeMapping.cs index 7b47104..2fe1186 100644 --- a/Myrtille.Web/src/JSKeyCodeToRDPScanCodeMapping.cs +++ b/Myrtille.Web/src/JSKeyCodeToRDPScanCodeMapping.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/src/Models/SharingInfo.cs b/Myrtille.Web/src/Models/SharingInfo.cs index 82c4456..47a8e04 100644 --- a/Myrtille.Web/src/Models/SharingInfo.cs +++ b/Myrtille.Web/src/Models/SharingInfo.cs @@ -1,4 +1,22 @@ -using System.Web.SessionState; +/* + Myrtille: A native HTML4/5 Remote Desktop Protocol client. + + Copyright(c) 2014-2020 Cedric Coste + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +using System.Web.SessionState; using Myrtille.Services.Contracts; namespace Myrtille.Web diff --git a/Myrtille.Web/src/RemoteSession.cs b/Myrtille.Web/src/RemoteSession.cs index 460b302..6ae2749 100644 --- a/Myrtille.Web/src/RemoteSession.cs +++ b/Myrtille.Web/src/RemoteSession.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -35,7 +35,7 @@ public class RemoteSession public Guid Id; public RemoteSessionState State; public string HostName; - public HostType HostType; // RDP or SSH + public HostType HostType; // RDP or SSH public SecurityProtocol SecurityProtocol; public string ServerAddress; // :port, if specified public string VMGuid; // RDP over VM bus (Hyper-V) @@ -67,6 +67,7 @@ public class RemoteSession public int ExitCode; public bool Reconnect; public bool ConnectionService; + public string ClipboardText; // clipboard text public RemoteSession( Guid id, diff --git a/Myrtille.Web/src/RemoteSessionAudio.cs b/Myrtille.Web/src/RemoteSessionAudio.cs index 6679993..8d57790 100644 --- a/Myrtille.Web/src/RemoteSessionAudio.cs +++ b/Myrtille.Web/src/RemoteSessionAudio.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/src/RemoteSessionAudioSocketHandler.cs b/Myrtille.Web/src/RemoteSessionAudioSocketHandler.cs index b325767..25ef9ca 100644 --- a/Myrtille.Web/src/RemoteSessionAudioSocketHandler.cs +++ b/Myrtille.Web/src/RemoteSessionAudioSocketHandler.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/src/RemoteSessionImage.cs b/Myrtille.Web/src/RemoteSessionImage.cs index 6b0df6e..a2e5a89 100644 --- a/Myrtille.Web/src/RemoteSessionImage.cs +++ b/Myrtille.Web/src/RemoteSessionImage.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/src/RemoteSessionManager.cs b/Myrtille.Web/src/RemoteSessionManager.cs index 553dbbb..a85678b 100644 --- a/Myrtille.Web/src/RemoteSessionManager.cs +++ b/Myrtille.Web/src/RemoteSessionManager.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -133,6 +133,7 @@ public void ProcessUpdatesPipeData(byte[] data) else if (message.StartsWith("clipboard|")) { Trace.TraceInformation("Sending clipboard content, remote session {0}", RemoteSession.Id); + RemoteSession.ClipboardText = message.Remove(0, 10); SendMessage(new RemoteSessionMessage { Type = MessageType.RemoteClipboard, Prefix = "clipboard|", Text = message.Remove(0, 10) }); } // SSH Terminal data @@ -231,6 +232,9 @@ public void SendCommand(RemoteSessionCommand command, string args = "") if (RemoteSession.State != RemoteSessionState.Connected) return; + if (RemoteSession.BrowserResize == BrowserResize.None) + return; + if (_resizeDelayed) { if (_resizeTimeout != null) @@ -241,7 +245,8 @@ public void SendCommand(RemoteSessionCommand command, string args = "") _resizeTimeout = new CancellationTokenSource(); Task.Delay(500, _resizeTimeout.Token).ContinueWith(task => { - var resolution = args.Split(new[] { "x" }, StringSplitOptions.None); + var parts = args.Split(new[] { "|" }, StringSplitOptions.None); + var resolution = parts[1].Split(new[] { "x" }, StringSplitOptions.None); var width = int.Parse(resolution[0]); var height = int.Parse(resolution[1]); @@ -253,7 +258,7 @@ public void SendCommand(RemoteSessionCommand command, string args = "") RemoteSession.Reconnect = true; SendCommand(RemoteSessionCommand.CloseClient); } - else + else if (RemoteSession.BrowserResize == BrowserResize.Scale) { _resizeDelayed = false; SendCommand(RemoteSessionCommand.SendBrowserResize, args); @@ -318,8 +323,8 @@ public void SendCommand(RemoteSessionCommand command, string args = "") if (RemoteSession.State != RemoteSessionState.Connected) return; - Trace.TraceInformation("Session reconnect {0}, remote session {1}", args == "1" ? "ON" : "OFF", RemoteSession.Id); - RemoteSession.BrowserResize = args == "1" ? BrowserResize.Reconnect : BrowserResize.None; + Trace.TraceInformation("Session reconnect {0}, remote session {1}", args.StartsWith("1") ? "ON" : "OFF", RemoteSession.Id); + RemoteSession.BrowserResize = args.StartsWith("1") ? BrowserResize.Reconnect : BrowserResize.None; break; case RemoteSessionCommand.SetImageEncoding: @@ -444,7 +449,8 @@ public void SendCommand(RemoteSessionCommand command, string args = "") case RemoteSessionCommand.SendLocalClipboard: - if (RemoteSession.State != RemoteSessionState.Connected) + if ((RemoteSession.State != RemoteSessionState.Connecting) && + (RemoteSession.State != RemoteSessionState.Connected)) return; var clipboardText = string.Empty; @@ -462,6 +468,9 @@ public void SendCommand(RemoteSessionCommand command, string args = "") clipboardText = clipboardText.Substring(0, _clipboardMaxLength) + "--- TRUNCATED ---"; } + // set the clipboard text on the gateway; if the remote session is reconnected, it will be sent to the new instance of wfreerdp + RemoteSession.ClipboardText = clipboardText; + commandWithArgs = string.Concat((string)RemoteSessionCommandMapping.ToPrefix[command], clipboardText); Trace.TraceInformation("Sending local clipboard, remote session {0}", RemoteSession.Id); @@ -593,7 +602,7 @@ public void ProcessInputs(HttpSessionState session, string data) var command = (RemoteSessionCommand)RemoteSessionCommandMapping.FromPrefix[input.Substring(0, 3)]; // if the remote session is shared, only the remote session owner and guests with control access can interact with it - // for the latter, such a control is limited to sending keyboard and mouse inputs (not sharing it with others persons or change the remote session configuration) + // for the latter, such a control is limited to some actions (not sharing it with others persons or change the remote session configuration) // only FSUs is allowed for anyone to update their display // TODO: maintain a list of guests for the remote session, with different settings for each guest, then have different processings accordingly @@ -608,7 +617,8 @@ public void ProcessInputs(HttpSessionState session, string data) command == RemoteSessionCommand.SendMouseRightButton || command == RemoteSessionCommand.SendMouseWheelUp || command == RemoteSessionCommand.SendMouseWheelDown || - command == RemoteSessionCommand.SendMouseMove)) || + command == RemoteSessionCommand.SendMouseMove || + command == RemoteSessionCommand.SendLocalClipboard)) || command == RemoteSessionCommand.RequestFullscreenUpdate) { SendCommand(command, input.Remove(0, 3)); @@ -889,10 +899,6 @@ public void StopWaitForImageEvent() // new audio private void ProcessAudio(byte[] data) { - if (RemoteSession.AudioFormat.HasValue && - RemoteSession.AudioFormat.Value == AudioFormat.NONE) - return; - try { var audio = new RemoteSessionAudio diff --git a/Myrtille.Web/src/RemoteSessionMessage.cs b/Myrtille.Web/src/RemoteSessionMessage.cs index acd1776..8eb0fb6 100644 --- a/Myrtille.Web/src/RemoteSessionMessage.cs +++ b/Myrtille.Web/src/RemoteSessionMessage.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/src/RemoteSessionPipes.cs b/Myrtille.Web/src/RemoteSessionPipes.cs index f4189cf..87e351e 100644 --- a/Myrtille.Web/src/RemoteSessionPipes.cs +++ b/Myrtille.Web/src/RemoteSessionPipes.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -152,6 +152,18 @@ private void InputsPipeConnected(IAsyncResult e) if (!string.IsNullOrEmpty(RemoteSession.StartProgram)) RemoteSession.Manager.SendCommand(RemoteSessionCommand.SendStartProgram, RemoteSession.StartProgram); + // (re)sync the clipboard + if (!string.IsNullOrEmpty(RemoteSession.ClipboardText)) + { + // send the clipboard text as unicode code points (same as done from the browser) + var clipboardUnicode = string.Empty; + foreach (var charValue in RemoteSession.ClipboardText) + { + clipboardUnicode += (string.IsNullOrEmpty(clipboardUnicode) ? string.Empty : "-") + char.ConvertToUtf32(charValue.ToString(), 0); + } + RemoteSession.Manager.SendCommand(RemoteSessionCommand.SendLocalClipboard, clipboardUnicode); + } + // connect the host client to the remote host; a fullscreen update will be sent upon connection RemoteSession.Manager.SendCommand(RemoteSessionCommand.ConnectClient); } diff --git a/Myrtille.Web/src/RemoteSessionSocketHandler.cs b/Myrtille.Web/src/RemoteSessionSocketHandler.cs index 75ce429..cef1e72 100644 --- a/Myrtille.Web/src/RemoteSessionSocketHandler.cs +++ b/Myrtille.Web/src/RemoteSessionSocketHandler.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -60,6 +60,16 @@ public override void OnOpen() base.OnOpen(); + // unregister the message queue for the current http session, if exists + // the http client is now using HTML5 mode + lock (_remoteSession.Manager.MessageQueues.SyncRoot) + { + if (_remoteSession.Manager.MessageQueues.ContainsKey(_session.SessionID)) + { + _remoteSession.Manager.MessageQueues.Remove(_session.SessionID); + } + } + // update guest information if (!_session.SessionID.Equals(_remoteSession.OwnerSessionID)) { diff --git a/Myrtille.Web/src/Services/CaptureService.cs b/Myrtille.Web/src/Services/CaptureService.cs index 63a954f..7a8c85f 100644 --- a/Myrtille.Web/src/Services/CaptureService.cs +++ b/Myrtille.Web/src/Services/CaptureService.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/src/Services/DisconnectionService.cs b/Myrtille.Web/src/Services/DisconnectionService.cs index 10f6f63..884dbf3 100644 --- a/Myrtille.Web/src/Services/DisconnectionService.cs +++ b/Myrtille.Web/src/Services/DisconnectionService.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/src/Services/SharingService.cs b/Myrtille.Web/src/Services/SharingService.cs index b538288..45d58f1 100644 --- a/Myrtille.Web/src/Services/SharingService.cs +++ b/Myrtille.Web/src/Services/SharingService.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Myrtille.Web/src/WebInstaller.cs b/Myrtille.Web/src/WebInstaller.cs index e8f80c0..42594b4 100644 --- a/Myrtille.Web/src/WebInstaller.cs +++ b/Myrtille.Web/src/WebInstaller.cs @@ -1,7 +1,7 @@ /* Myrtille: A native HTML4/5 Remote Desktop Protocol client. - Copyright(c) 2014-2019 Cedric Coste + Copyright(c) 2014-2020 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,10 +20,9 @@ limitations under the License. using System.Collections; using System.ComponentModel; using System.Configuration.Install; +using System.Diagnostics; using System.IO; -using System.Net; using System.Security.AccessControl; -using System.Security.Cryptography.X509Certificates; using System.Windows.Forms; using System.Xml; using Myrtille.Helpers; @@ -60,15 +59,34 @@ public override void Install( try { - // register Myrtille.Web to local IIS - if (!IISHelper.IsIISApplicationPoolExists("MyrtilleAppPool")) + var process = new Process(); + + bool debug = true; + + #if !DEBUG + debug = false; + process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; + #endif + + // the install.ps1 (powershell) script enable the myrtille prerequisites (IIS, .NET, websocket, WCF/HTTP activation, etc.), + // create a self-signed certificate (if requested), an application pool and a web application for myrtille, etc. + // it can be adapted and run manually outside of this installer, if needed + // its output is logged under \log\install.log + process.StartInfo.FileName = string.Format(@"{0}\WindowsPowerShell\v1.0\powershell.exe", Environment.Is64BitOperatingSystem && !Environment.Is64BitProcess ? Environment.SystemDirectory.ToLower().Replace("system32", "sysnative") : Environment.SystemDirectory); + process.StartInfo.Arguments = "-ExecutionPolicy Bypass" + + " -Command \"& '" + Path.Combine(Path.GetFullPath(Context.Parameters["targetdir"]), "Myrtille.Web.Install.ps1") + "'" + + " -InstallPath '" + Path.GetFullPath(Context.Parameters["targetdir"]) + "'" + + " -SslCert " + (!string.IsNullOrEmpty(Context.Parameters["SSLCERT"]) ? "1" : "0") + + " -DebugMode " + (debug ? "1" : "0") + + " 3>&1 2>&1 | Tee-Object -FilePath '" + Path.Combine(Path.GetFullPath(Context.Parameters["targetdir"]), "log", "Myrtille.Web.Install.log") + "'" + "\""; + + process.Start(); + process.WaitForExit(); + if (process.ExitCode != 0) { - IISHelper.CreateIISApplicationPool("MyrtilleAppPool", "v4.0"); - } - - if (!IISHelper.IsIISApplicationExists("/Myrtille")) - { - IISHelper.CreateIISApplication("/Myrtille", Path.GetFullPath(Context.Parameters["targetdir"]), "MyrtilleAppPool"); + throw new Exception(string.Format("An error occured while running {0}. See {1} for more information.", + Path.Combine(Path.GetFullPath(Context.Parameters["targetdir"]), "Myrtille.Web.Install.ps1"), + Path.Combine(Path.GetFullPath(Context.Parameters["targetdir"]), "log", "Myrtille.Web.Install.log"))); } // load config @@ -112,16 +130,6 @@ public override void Install( } } - // ssl certificate - if (!string.IsNullOrEmpty(Context.Parameters["SSLCERT"])) - { - // create a self signed certificate - var cert = CertificateHelper.CreateSelfSignedCertificate(Dns.GetHostEntry(Environment.MachineName).HostName, "Myrtille self-signed certificate"); - - // bind it to the default website - IISHelper.BindCertificate(cert); - } - // pdf printer var appSettings = XmlTools.GetNode(navigator, "/configuration/appSettings"); if (appSettings != null) @@ -221,41 +229,31 @@ private void DoUninstall() try { - // unregister Myrtille.Web from local IIS - if (IISHelper.IsIISApplicationExists("/Myrtille")) - { - IISHelper.DeleteIISApplication("/Myrtille"); - } + var process = new Process(); - if (IISHelper.IsIISApplicationPoolExists("MyrtilleAppPool")) - { - IISHelper.DeleteIISApplicationPool("MyrtilleAppPool"); - } + bool debug = true; - // retrieve the myrtille self signed certificate, if exists - var store = new X509Store(StoreName.My, StoreLocation.LocalMachine); - store.Open(OpenFlags.ReadWrite); - var certs = store.Certificates.Find(X509FindType.FindByIssuerName, Dns.GetHostEntry(Environment.MachineName).HostName, false); - if (certs.Count > 0) - { - foreach (var cert in certs) - { - if (cert.FriendlyName == "Myrtille self-signed certificate") - { - // unbind it from the default website - IISHelper.UnbindCertificate(cert); + #if !DEBUG + debug = false; + process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; + #endif - // remove it - store.Remove(cert); + // same logic as for install, with an uninstall script + process.StartInfo.FileName = string.Format(@"{0}\WindowsPowerShell\v1.0\powershell.exe", Environment.Is64BitOperatingSystem && !Environment.Is64BitProcess ? Environment.SystemDirectory.ToLower().Replace("system32", "sysnative") : Environment.SystemDirectory); + process.StartInfo.Arguments = "-ExecutionPolicy Bypass" + + " -Command \"& '" + Path.Combine(Path.GetFullPath(Context.Parameters["targetdir"]), "Myrtille.Web.Uninstall.ps1") + "'" + + " -DebugMode " + (debug ? "1" : "0") + + " 3>&1 2>&1 | Tee-Object -FilePath '" + Path.Combine(Path.GetFullPath(Context.Parameters["targetdir"]), "log", "Myrtille.Web.Uninstall.log") + "'" + "\""; - // normally, there should be only one myrtille self-signed certificate, but let's check further (just in case)... - //break; - } - } + process.Start(); + process.WaitForExit(); + if (process.ExitCode != 0) + { + throw new Exception(string.Format("An error occured while running {0}. See {1} for more information.", + Path.Combine(Path.GetFullPath(Context.Parameters["targetdir"]), "Myrtille.Web.Uninstall.ps1"), + Path.Combine(Path.GetFullPath(Context.Parameters["targetdir"]), "log", "Myrtille.Web.Uninstall.log"))); } - store.Close(); - Context.LogMessage("Uninstalled Myrtille.Web"); } catch (Exception exc) diff --git a/Myrtille.sln b/Myrtille.sln index 42ae132..2b05a92 100644 --- a/Myrtille.sln +++ b/Myrtille.sln @@ -326,6 +326,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Myrtille.Admin.Web", "Myrti EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Myrtille.Admin.Services", "Myrtille.Admin.Services\Myrtille.Admin.Services.csproj", "{2705B2A1-B47A-4E4D-96F9-BACE48F9A807}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Myrtille.Docker", "Myrtille.Docker", "{F5B06DC6-B8A1-40FC-94E4-CEC3BCD3F8B4}" + ProjectSection(SolutionItems) = preProject + Dockerfile = Dockerfile + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|.NET = Debug|.NET diff --git a/README.md b/README.md index 8fa458b..6f56bc1 100644 --- a/README.md +++ b/README.md @@ -54,16 +54,21 @@ All releases here: https://github.com/cedrozor/myrtille/releases See DOCUMENTATION.md for more details. -## Remote Desktop Services +## Docker + +From version 2.8.0, Myrtille is available as a docker image. -**For best experience**, and be able to go over the default limit of 2 concurrent users, you will need to install the [RDS role](https://www.exitthefastlane.com/2016/05/native-rds-in-server2016-part-1-basics.html) on your remote server(s). Optionally, you can install the [RD Connection Broker](https://www.tech-coffee.net/rds-2016-farm-deploy-the-farm-in-azure/) feature to allow load-balancing across an RDS farm (possibly hosted on Azure) and manage the applications allowed to run (and with which parameters) on session start. +You can pull it from Docker Hub with the following command (use a tag for a specific version, or latest otherwise): +docker pull cedrozor/myrtille(:tag) -You will also need to enable [multiple sessions per user](https://portal.databasemart.com/kb/a220/how-to-enable-multiple-single-remote-desktop-sessions-in-windows-server-2012.aspx) if you don't want your users to be limited to 1 session only (if you have several users sharing the same account, they will otherwise disconnect each others). +See DOCUMENTATION.md for more details. + +## Remote Desktop Services -The RDS role offers you a **grace period of 120 days** after which you will need to use an [RD License Server](https://www.exitthefastlane.com/2016/06/native-rds-in-server2016-part-3-rdsh.html) with proper licenses (CALs) to suit your licensing mode ("Per Device" or "Per User"). +This is the primary requirement for RDP connections. Please read DOCUMENTATION.md for more information about the RDS role and features, and how to configure it for the best experience with Myrtille. ## Usage -Once Myrtille is installed on your server, you can use it at http://myserver/myrtille. Set the rdp (or ssh) server address, user domain (if any, for rdp), name and password then click "Connect!" to log in. "Disconnect" to log out. +Once Myrtille is installed on your server, you can use it at http://myserver/myrtille. Set the rdp (or ssh) server address, user domain (if any, for rdp), name and password then click "Connect!" to log in. "Disconnect" to log out. A simplified hosts management dashboard is also available to pre-configure connections with a 1 click access. Multifactor Authentication and Active Directory integration (Enterprise Mode) are disabled by default. Please read documentation for activation of these features.