- Notifications
You must be signed in to change notification settings - Fork1
impl: add support for matching agent by name#146
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
5 changes: 5 additions & 0 deletionsCHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
55 changes: 30 additions & 25 deletionsREADME.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -64,9 +64,9 @@ You can use specially crafted JetBrains Gateway URIs to automatically: | ||
### Example URIs | ||
```text | ||
fioan89 marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
jetbrains://gateway/com.coder.toolbox?url=https%3A%2F%2Fdev.coder.com&token=zeoX4SbSpP-j2qGpajkdwxR9jBdcekXS2&workspace=bobiverse-bob&agent_name=dev&ide_product_code=GO&ide_build_number=241.23774.119&folder=%2Fhome%2Fcoder%2Fworkspace%2Fhello-world-rs | ||
fioan89 marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
jetbrains://gateway/coder?url=https%3A%2F%2Fj5gj2r1so5nbi.pit-1.try.coder.app%2F&token=gqEirOoI1U-FfCQ6uj8iOLtybBIk99rr8&workspace=bobiverse-riker&agent_name=dev&ide_product_code=RR&ide_build_number=243.26053.17&folder=%2Fhome%2Fcoder%2Fworkspace%2Fhello-world-rs | ||
``` | ||
### URI Breakdown | ||
@@ -76,13 +76,15 @@ jetbrains://gateway/com.coder.toolbox | ||
?url=http(s)://<your-coder-deployment> | ||
&token=<auth-token> | ||
&workspace=<workspace-name> | ||
&agent_name=<agent-name> | ||
&ide_product_code=<IDE-code> | ||
&ide_build_number=<IDE-build> | ||
&folder=<absolute-path-to-a-project-folder> | ||
``` | ||
Starting from Toolbox 2.7, you can use `coder` as a shortcut in place of the full plugin ID. The URI can be simplified | ||
as: | ||
```text | ||
jetbrains://gateway/coder?url=http(s)://<your-coder-deployment> | ||
``` | ||
@@ -92,16 +94,16 @@ jetbrains://gateway/coder?url=http(s)://<your-coder-deployment> | ||
| url | Your Coder deployment URL (encoded) | Yes | | ||
| token | Coder authentication token | Yes | | ||
| workspace | Name of the Coder workspace to connect to. | Yes | | ||
|agent_name |The nameof the agent with the workspace | No | | ||
| ide_product_code | JetBrains IDE product code (e.g., GO for GoLand, RR for Rider) | No | | ||
| ide_build_number | Specific build number of the JetBrains IDE to install on the workspace | No | | ||
| folder | Absolute path to the project folder to open in the remote IDE (URL-encoded) | No | | ||
> [!NOTE] | ||
> If only a single agent is available, specifying an agentname is optional. However, if multiple agents exist, you must | ||
> provide the | ||
>agent name. Note that this version of the Coder Toolbox plugin does not automatically start agents if they | ||
>are offline, so please ensure the selected agent is running beforeproceeding. | ||
If `ide_product_code` and `ide_build_number` is missing, Toolbox will only open and highlight the workspace environment | ||
page. Coder Toolbox will attempt to start the workspace if it’s not already running; however, for the most reliable | ||
@@ -151,7 +153,9 @@ mitmweb --ssl-insecure --set stream_large_bodies="10m" --mode socks5 | ||
> [!NOTE] | ||
> Coder Toolbox plugin handles only HTTP/HTTPS proxy authentication. | ||
> SOCKS5 proxy authentication is currently not supported due to limitations | ||
> described | ||
> | ||
in: https://youtrack.jetbrains.com/issue/TBX-14532/Missing-proxy-authentication-settings#focus=Comments-27-12265861.0-0 | ||
## Debugging and Reporting issues | ||
@@ -198,56 +202,56 @@ storage paths. The options can be configured from the plugin's main Workspaces p | ||
### CLI related settings | ||
- `Binary source` specifies the source URL or relative path from which the Coder CLI should be downloaded. | ||
If a relative path is provided, it is resolved against the deployment domain. | ||
- `Enable downloads` allows automatic downloading of the CLI if the current version is missing or outdated. | ||
- `Binary directory` specifies the directory where CLI binaries are stored. If omitted, it defaults to the data | ||
directory. | ||
- `Enable binary directory fallback` if enabled, falls back to the data directory when the specified binary | ||
directory is not writable. | ||
- `Data directory` directory where plugin-specific data such as session tokens and binaries are stored if not | ||
overridden by the binary directory setting. | ||
- `Header command` command that outputs additional HTTP headers. Each line of output must be in the format key=value. | ||
The environment variable CODER_URL will be available to the command process. | ||
### TLS settings | ||
The following options control the secure communication behavior of the plugin with Coder deployment and its available | ||
API. | ||
- `TLS cert path` path to a client certificate file for TLS authentication with Coder deployment. | ||
The certificate should be in X.509 PEM format. | ||
- `TLS key path` path to the private key corresponding to the TLS certificate from above. | ||
The certificate should be in X.509 PEM format. | ||
- `TLS CA path` the path of a file containing certificates for an alternate certificate authority used to verify TLS | ||
certs returned by the Coder deployment. The file should be in X.509 PEM format. This option can also be used to verify | ||
proxy certificates. | ||
- `TLS alternate hostname` overrides the hostname used in TLS verification. This is useful when the hostname | ||
used to connect to the Coder deployment does not match the hostname in the TLS certificate. | ||
### SSH settings | ||
The following options control the SSH behavior of the Coder CLI. | ||
- `Disable autostart` adds the --disable-autostart flag to the SSH proxy command, preventing the CLI from keeping | ||
workspaces constantly active. | ||
- `Enable SSH wildcard config` enables or disables wildcard entries in the SSH configuration, which allow generic | ||
rules for matching multiple workspaces. | ||
- `SSH proxy log directory` directory where SSH proxy logs are written. Useful for debugging SSH connection issues. | ||
- `SSH network metrics directory` directory where network information used by the SSH proxy is stored. | ||
- `Extra SSH options` additional options appended to the SSH configuration. Can be used to customize the behavior of | ||
SSH connections. | ||
### Saving Changes | ||
@@ -256,7 +260,7 @@ support, may trigger regeneration of SSH configurations. | ||
### Security considerations | ||
> [!IMPORTANT] | ||
> Token authentication is required when TLS certificates are not configured. | ||
## Releasing | ||
@@ -269,6 +273,7 @@ support, may trigger regeneration of SSH configurations. | ||
JetBrains enabled auto-approval for the plugin, so we need to ensure we continue to meet the following requirements: | ||
- do **not** use Kotlin experimental APIs. | ||
- do **not** add any lambdas, handlers, or class handles to Java runtime hooks. | ||
- do **not** create threads manually (including via libraries). If you must, ensure they are properly cleaned up in | ||
the plugin's `CoderRemoteProvider#close()` method. | ||
- do **not** bundle libraries that are already provided by Toolbox. | ||
- do **not** perform any ill-intentioned actions. |
21 changes: 10 additions & 11 deletionssrc/main/kotlin/com/coder/toolbox/util/CoderProtocolHandler.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletionssrc/main/kotlin/com/coder/toolbox/util/LinkMap.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
85 changes: 35 additions & 50 deletionssrc/test/kotlin/com/coder/toolbox/util/CoderProtocolHandlerTest.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.