Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: Add app support #17

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

Merged
merged 1 commit into from
May 6, 2022
Merged

feat: Add app support #17

merged 1 commit into from
May 6, 2022

Conversation

kylecarbs
Copy link
Member

@kylecarbs kylecarbs commented May 6, 2022

This adds what are presently named "devurls" in v1.
It seems this is a dated term, since this allows
much more than accessing applications via URL.

"coder open " will launch any apps defined.
If in the web, it'll open either a web terminal or
port forward to the desired application. If in the terminal,
it'll open the browser, or launch the command over SSH.

@kylecarbs kylecarbs requested a review from bpmct May 6, 2022 01:29
@kylecarbs kylecarbs self-assigned this May 6, 2022
@kylecarbs kylecarbs requested a review from coadler May 6, 2022 02:02
kylecarbs added a commit to coder/coder that referenced this pull request May 6, 2022
This adds DevURLs as a property to a workspace agent.

The resource is added to the Terraform provider here:
coder/terraform-provider-coder#17

DevURLs will be opened in the dashboard or via the CLI
with `coder open <name>`. If `command` is specified, a
terminal will appear locally and in the web. If `target`
is specified, the browser will open to an exposed instance
of that target.
### Optional

- `command` (String) A command to run in a terminal opening this DevURL. In the web, this will open in a new tab. In the CLI, this will SSH and execute the command.
- `icon` (String) An icon to display in the dashboard.
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't really explain how to use the icon. I see the examples all use builtin:x strings, is there a way to see all builtin icons? Is it possible to use a non-builtin icon?

Copy link
Member Author

Choose a reason for hiding this comment

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

provider.coder.url + "/icons/goland.png"

Copy link
Member Author

Choose a reason for hiding this comment

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

data.coder_workspace.me.external_url

Description: "A URL to be proxied to from inside the workspace.",
ForceNew: true,
Optional: true,
ConflictsWith: []string{"command"},
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't seem to document the ConflictsWith requirements at all.

Copy link
Member Author

Choose a reason for hiding this comment

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

True. I shall fix!

This adds what are presently named "devurls" in v1.
It seems this is a dated term, since this allows
much more than accessing applications via URL.

"coder open <name>" will launch any apps defined.
If in the web, it'll open either a web terminal or
port forward to the desired application. If in the terminal,
it'll open the browser, or launch the command over SSH.
@kylecarbs kylecarbs changed the title feat: Add DevURL support feat: Add app support May 6, 2022
@kylecarbs kylecarbs merged commit 4531753 into main May 6, 2022
@kylecarbs kylecarbs deleted the devurl branch May 6, 2022 17:16
kylecarbs added a commit to coder/coder that referenced this pull request May 6, 2022
This adds DevURLs as a property to a workspace agent.

The resource is added to the Terraform provider here:
coder/terraform-provider-coder#17

DevURLs will be opened in the dashboard or via the CLI
with `coder open <name>`. If `command` is specified, a
terminal will appear locally and in the web. If `target`
is specified, the browser will open to an exposed instance
of that target.
kylecarbs added a commit to coder/coder that referenced this pull request May 6, 2022
This adds apps as a property to a workspace agent.

The resource is added to the Terraform provider here:
coder/terraform-provider-coder#17

Apps will be opened in the dashboard or via the CLI
with `coder open <name>`. If `command` is specified, a
terminal will appear locally and in the web. If `target`
is specified, the browser will open to an exposed instance
of that target.
kylecarbs added a commit to coder/coder that referenced this pull request Jun 4, 2022
* feat: Add app support

This adds apps as a property to a workspace agent.

The resource is added to the Terraform provider here:
coder/terraform-provider-coder#17

Apps will be opened in the dashboard or via the CLI
with `coder open <name>`. If `command` is specified, a
terminal will appear locally and in the web. If `target`
is specified, the browser will open to an exposed instance
of that target.

* Compare fields in apps test

* Update Terraform provider to use relative path

* Add some basic structure for routing

* chore: Remove interface from coderd and lift API surface

Abstracting coderd into an interface added misdirection because
the interface was never intended to be fulfilled outside of a single
implementation.

This lifts the abstraction, and attaches all handlers to a root struct
named `*coderd.API`.

* Add basic proxy logic

* Add proxying based on path

* Add app proxying for wildcards

* Add wsconncache

* fix: Race when writing to a closed pipe

This is such an intermittent race it's difficult to track,
but regardless this is an improvement to the code.

* fix: Race when writing to a closed pipe

This is such an intermittent race it's difficult to track,
but regardless this is an improvement to the code.

* fix: Race when writing to a closed pipe

This is such an intermittent race it's difficult to track,
but regardless this is an improvement to the code.

* fix: Race when writing to a closed pipe

This is such an intermittent race it's difficult to track,
but regardless this is an improvement to the code.

* Add workspace route proxying endpoint

- Makes the workspace conn cache concurrency-safe
- Reduces unnecessary open checks in `peer.Channel`
- Fixes the use of a temporary context when dialing a workspace agent

* Add embed errors

* chore: Refactor site to improve testing

It was difficult to develop this package due to the
embed build tag being mandatory on the tests. The logic
to test doesn't require any embedded files.

* Add test for error handler

* Remove unused access url

* Add RBAC tests

* Fix dial agent syntax

* Fix linting errors

* Fix gen

* Fix icon required

* Adjust migration number

* Fix proxy error status code

* Fix empty db lookup
kylecarbs added a commit to coder/coder that referenced this pull request Jun 10, 2022
* feat: Add app support

This adds apps as a property to a workspace agent.

The resource is added to the Terraform provider here:
coder/terraform-provider-coder#17

Apps will be opened in the dashboard or via the CLI
with `coder open <name>`. If `command` is specified, a
terminal will appear locally and in the web. If `target`
is specified, the browser will open to an exposed instance
of that target.

* Compare fields in apps test

* Update Terraform provider to use relative path

* Add some basic structure for routing

* chore: Remove interface from coderd and lift API surface

Abstracting coderd into an interface added misdirection because
the interface was never intended to be fulfilled outside of a single
implementation.

This lifts the abstraction, and attaches all handlers to a root struct
named `*coderd.API`.

* Add basic proxy logic

* Add proxying based on path

* Add app proxying for wildcards

* Add wsconncache

* fix: Race when writing to a closed pipe

This is such an intermittent race it's difficult to track,
but regardless this is an improvement to the code.

* fix: Race when writing to a closed pipe

This is such an intermittent race it's difficult to track,
but regardless this is an improvement to the code.

* fix: Race when writing to a closed pipe

This is such an intermittent race it's difficult to track,
but regardless this is an improvement to the code.

* fix: Race when writing to a closed pipe

This is such an intermittent race it's difficult to track,
but regardless this is an improvement to the code.

* Add workspace route proxying endpoint

- Makes the workspace conn cache concurrency-safe
- Reduces unnecessary open checks in `peer.Channel`
- Fixes the use of a temporary context when dialing a workspace agent

* Add embed errors

* chore: Refactor site to improve testing

It was difficult to develop this package due to the
embed build tag being mandatory on the tests. The logic
to test doesn't require any embedded files.

* Add test for error handler

* Remove unused access url

* Add RBAC tests

* Fix dial agent syntax

* Fix linting errors

* Fix gen

* Fix icon required

* Adjust migration number

* Fix proxy error status code

* Fix empty db lookup
DanielleMaywood pushed a commit that referenced this pull request Sep 5, 2024
This adds what are presently named "devurls" in v1.
It seems this is a dated term, since this allows
much more than accessing applications via URL.

"coder open <name>" will launch any apps defined.
If in the web, it'll open either a web terminal or
port forward to the desired application. If in the terminal,
it'll open the browser, or launch the command over SSH.
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.

3 participants