-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(host): devolutions-session bootstrap #997
Conversation
3131bbd
to
e3f5b1f
Compare
ci/tlk.ps1
Outdated
@@ -345,6 +345,7 @@ class TlkRecipe | |||
if ($this.Target.IsWindows()) { | |||
$agentPackages += [TlkPackage]::new("devolutions-pedm-hook", "crates/devolutions-pedm-hook", $true) | |||
$agentPackages += [TlkPackage]::new("devolutions-pedm-contextmenu", "crates/devolutions-pedm-contextmenu", $true) | |||
$agentPackages += [TlkPackage]::new("devolutions-host", "crates/devolutions-host", $false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor changes just to build binary; Packaging + Installer changes will be in the follow-up PR soon
@@ -556,7 +673,18 @@ pub fn create_process_as_user( | |||
let application_name = application_name.map(WideString::from).unwrap_or_default(); | |||
let current_directory = current_directory.map(WideString::from).unwrap_or_default(); | |||
|
|||
let environment = environment.map(serialize_environment).transpose()?; | |||
let environment = if let Some(env) = environment { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now we correctly spawn the user's environment variables for the process if environment is not explicitly specified
devolutions-agent/src/config.rs
Outdated
/// Devolutions PEDM configuration | ||
#[serde(default, skip_serializing_if = "Option::is_none")] | ||
pub pedm: Option<PedmConf>, | ||
|
||
/// Devolutions Session Host configuration | ||
#[serde(default, skip_serializing_if = "Option::is_none")] | ||
pub session_host: Option<SessionHostConf>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming is debatable - maybe someone has a better idea instead of "host"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions:
now_host: NowHostConf
now_dvc: NowDvcConf
remote_desktop_host: RemoteDesktopHostConf
remote_desktop_dvc: RemoteDesktopDvcConf
By the way, is the name "Devolutions Host" already agreed upon?
Should it be "Devolutions Now" or "Devolutions Now Host" or "Devolutions Now Dvc", or something else?
devolutions-host/src/main.rs
Outdated
@@ -0,0 +1,46 @@ | |||
// Start the program without a console window. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing fancy here yet; Just logic to initialize log and config and copy-pasted test logic for DVC from MSRDPEX
aa24d2b
to
5d8a1e9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well documented, easy to read code. Thank you!
General style notes:
7741b2a
to
9bfc56e
Compare
9bfc56e
to
e53a0d3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’ll leave you squash and merge when you are satisfied!
There is also this comment that you may want to check again: #997 (comment) |
Yep, I'll clarify the naming with Marc-Andre 👍 |
NOTE: #1005 should be merged first; do not enable auto-merge |
.github/workflows/ci.yml
Outdated
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: You may have added unintentional blank lines
/// # Safety | ||
/// | ||
/// - The caller should ensure that `handle` is a pseudo handle, as its validity is not checked. | ||
pub unsafe fn new_pseudo_handle(handle: HANDLE) -> Self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@CBenoit FYI I was pulling my hair while trying to find why the process didn't want to start after my last refactoring, but it turned out that current_process
function has been broken after #998 was merged :( I added the separate new_pseudo_handle
function to create handle without invalid_handle
check (CurrentProcess
returns (HANDLE)-1
value)
package.ps1
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pacmancoder Can you document the purpose of this file, please? Is it an helper or something we use in the CI? Should it go in the ci
folder or the tools
folder instead of the root?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was reverted already in the last commit, - I accidentally committed it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, got you!
This PR adds the following:
devolution-session
executable, which will be hostingRDP dynamic virtual channel
server for remote execution / other tasks specified in theNowProto
protocolDevolutionSession.exe
in RDP sessions and terminating it after session terminationWinAPI
wrappers for process/session/permissions management which were required for newagent
logicBlocked by #1005