Skip to content

feat: support RDP-specific deep links #147

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

Open
wants to merge 6 commits into
base: ethan/push-notif
Choose a base branch
from

Conversation

ethanndickson
Copy link
Member

@ethanndickson ethanndickson commented May 5, 2025

Closes #96.

If a coder_app exists on the workspace, where the URL is of the form:
coder://dev.coder.com/v0/open/ws/<workspace>/agent/<agent>/rdp?username=administrator&password=password the URL will be parsed, validated, and an alert opened.
If Open is clicked on the alert, the password will be written to the clipboard, where it can be pasted when prompted.

rdp.mov

We're unable to avoid the entering of the password, as the password field in an .rdp file, even if encrypted properly, is ignored by the macOS Windows RDP app.

The app supports reading credentials from the macOS keychain, and whilst we could create keychain entries, they have to be associated with an RDP config in the app, and there's no way to automate the creation of that config, and then run that config.

Further reading:
https://stackoverflow.com/questions/48713606/how-to-create-rdp-file-on-mac-os-that-allows-auto-login
https://techcommunity.microsoft.com/discussions/azurevirtualdesktopforum/macos-remote-desktop-client-app---automatic-logon-no-credential-prompt/2596451

The above demo was done by adding this app to the template:

resource "coder_app" "connectrdp" {
  agent_id = coder_agent.main.id
  slug = "connectrdp"
  display_name = "Coder Connect RDP"
  url = "coder://dev.coder.com/v0/open/ws/${data.coder_workspace.me.name}/agent/main/rdp?username=Administrator&password=coderRDP!"
  icon = "/icon/terminal.svg"
  external = true
}

Copy link
Member Author

ethanndickson commented May 5, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ethanndickson ethanndickson force-pushed the ethan/push-notif branch 2 times, most recently from f6bc9e3 to 83b1554 Compare May 6, 2025 02:55
@ethanndickson ethanndickson marked this pull request as ready for review May 6, 2025 03:57
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for RDP-specific deep links by parsing and validating a custom URL format and handling credential display and clipboard copy operations for RDP connections. Key changes include:

  • Adding deep link parsing and error handling for RDP routes across multiple modules.
  • Introducing new error cases such as openError and couldNotCreateRDPURL to better represent RDP failures.
  • Extending the menu state with helper functions to find workspaces and agents by name.

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

File Description
Coder-Desktop/VPNLib/FileSync/FileSyncDaemon.swift Added a comment explaining the location of FileSync code to work around a linking issue.
Coder-Desktop/VPNLib/CoderRouter.swift Extended the router with a new error case (openError) and added error handling improvements for RDP routes.
Coder-Desktop/Coder-Desktop/VPN/MenuState.swift Added helper functions to find agents and workspaces, which are used by the deep link handling.
Coder-Desktop/Coder-Desktop/URLHandler.swift Updated URL handling to process the RDP route, validate connectivity, and manage credentials and clipboard actions.
Files not reviewed (1)
  • scripts/build.sh: Language not supported

@ethanndickson ethanndickson linked an issue May 7, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RDP-specific Coder Desktop deep link
2 participants