Commit Graph

12434 Commits

Author SHA1 Message Date
Kyle Carberry 013f028e55 feat: Add workspace application support (#1773)
* feat: Add app support

This adds apps as a property to a workspace agent.

The resource is added to the Terraform provider here:
https://github.com/coder/terraform-provider-coder/pull/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
2022-06-04 15:13:37 -05:00
dependabot[bot] 2c089d5a99 chore: bump github.com/ory/dockertest/v3 from 3.9.0 to 3.9.1 (#1892)
Bumps [github.com/ory/dockertest/v3](https://github.com/ory/dockertest) from 3.9.0 to 3.9.1.
- [Release notes](https://github.com/ory/dockertest/releases)
- [Commits](https://github.com/ory/dockertest/compare/v3.9.0...v3.9.1)

---
updated-dependencies:
- dependency-name: github.com/ory/dockertest/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-04 15:12:54 -05:00
Kyle Carberry 5edd086b69 chore: Reduce deployment times by excluding Docker images (#1945)
* chore: Reduce deployment times by excluding Docker images

Only the Windows and Linux binaries are build during deploy, so we
can save many minutes by excluding Docker images.

* Stop docker image builds on snapshot

* Fix artifact upload

* Skip typecheck for release

* Flag deploy
2022-06-04 19:56:45 +00:00
Steven Masley c9a4642a12 chore: Update BE http errors to be ui friendly (#1994)
* chore: More UI friendly errors

Mainly capitlization + messages prefix error
2022-06-03 21:48:09 +00:00
Spike Curtis 847e2b18da Don't use parameters to pass secrets to GCP or AWS (#2039)
* Don't use parameters to pass secrets to GCP or AWS

Signed-off-by: Spike Curtis <spike@coder.com>

* Fix fmt

Signed-off-by: Spike Curtis <spike@coder.com>
2022-06-03 14:29:22 -07:00
Kyle Carberry 43f622a52d fix: Remove unused workspace routes in favor of list with filter (#2038)
* fix: Remove unused workspace routes in favor of list with filter

This consolidates the workspace routes into a single place.
It allows users to fetch a workspace by their username and
workspace name, which will be used by the frontend for routing.

* Fix RBAC

* Fix CLI usages
v0.6.1
2022-06-03 14:36:08 -05:00
Spike Curtis d8c440188e feat: Remove organization and user scoped parameters (#2007)
* feat: Remove organization and user scoped parameters

Signed-off-by: Spike Curtis <spike@coder.com>

* Fixup dump.sql

Signed-off-by: Spike Curtis <spike@coder.com>

* Fix dump.sql again

Signed-off-by: Spike Curtis <spike@coder.com>

* Fix down migration

Signed-off-by: Spike Curtis <spike@coder.com>
2022-06-03 11:49:58 -07:00
David Wahler 582d636e54 feat: support fully-qualified workspace names in CLI (#2036) 2022-06-03 12:47:56 -05:00
Abhineet Jain fc38b61819 feat: use ConfirmDialog for ResetPasswordDialog (#2035)
* feat: use ConfirmDialog for ResetPasswordDialog

* fix lint

* make description typography a div

* use paragraph for string description, div otherwise

* fix lint
2022-06-03 17:35:09 +00:00
Colin Adler 60102cb22f chore: fix codecov ignore for queries.sql.go (#2037) 2022-06-03 12:26:59 -05:00
Garrett Delfosse 8b03e2b0e1 feat: Workspaces filtering (#1972)
Co-authored-by: G r e y <grey@coder.com>
Co-authored-by: Kira Pilot <kira@coder.com>
2022-06-03 17:20:28 +00:00
G r e y ac6cb269db feat: ws schedule timezone select (#2032)
Resolves: #1959

Summary:

The package tzdata is used to create a meaningful select-list for
timezone in the workspace schedule form.

Impact:

Improved UX. Furthermore, we guess your timezone if the form is being
initialized from scratch.
2022-06-03 12:52:02 -04:00
Abhineet Jain 2b12beef98 feat: Update success confirmation dialog and snackbar (#2005)
* feat: update success confirmation dialog and snackbar

* add success variants to confirm dialog and snackbar

* update story name

* use success variant for snackbar
2022-06-03 11:42:46 -04:00
G r e y 37aff0c8a9 fix: FE parsing of schedule with day strings (#2006)
Resolves: #1901

Summary:

We had a homegrown parser that only understood numbers, not strings like
MON or TUES. We replace the homegrown parser with cron-parser.

Details:

This was nearly a straight drop-in.

Impact:

Much less code/maintenance burden :D

What I learned:

Don't trust the README, sometimes you just gotta read the code or import
it and try it out. The `fields` representation of the parsed expression
was missing from their docs. I might open an issue or PR to update them!
2022-06-03 11:08:57 -04:00
Abhineet Jain 7e89d91ce3 feat: link to timezone database spells out timezone (#2026) 2022-06-03 14:57:09 +00:00
G r e y c2720577cb fix: ws schedule top-down restriction (#2008)
Resolves: #1958

Summary:

The workspace schedule form no longer disables certain fields based on
whether or not a start time is filled out. Instead, we validate that a
start time is provided if any of the days are checked.
2022-06-03 10:50:36 -04:00
Bruno Quaresma 88e8c96ddd feature: Load workspace build logs from streaming (#1997) 2022-06-03 09:23:45 -05:00
Abhineet Jain d6e9eab258 feat: Use consistent colors for links and highlighting (#1989)
* feat: consistent highlight colors

* update user dropdown menu border

* update borderedmenurow active color
2022-06-03 10:16:50 -04:00
Bruno Quaresma 6bb76782a6 feat: Open terminal in a new window (#2017) 2022-06-03 09:06:44 -05:00
Mathias Fredriksson b4f5920df5 fix: Avoid use of r.Context() after r.Hijack() (#1978) 2022-06-03 12:50:10 +03:00
Kyle Carberry 61aacff444 chore: Refactor site to improve testing (#2014)
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.
2022-06-03 04:27:21 +00:00
Colin Adler 89dde21837 fix: ensure listen websocket isn't opened for non-latest agents (#2002)
Exponential backoff is only enabled if the websocket fails to open. If
the websocket is opened but immediately killed, the agent will try to
immediately reconnect. This is desireable in cases where coderd is being
replaced or network conditions cause the connection to die, but not for
permanent errors.
2022-06-02 15:03:01 -05:00
Ketan Gangatirkar 0e1f868f5f tweak README.md headings around one liner 2022-06-02 14:48:22 -05:00
Ketan Gangatirkar 597994548d added one liner to run Coder at very top of README.md 2022-06-02 14:47:34 -05:00
G r e y 0b59ed30d0 feat: ui autostop extension (#1987)
Resolves: #1460

Summary:

An 'Extend' CTA on workspace schedule banner is added so that a user can
extend their workspace lease from the UI.

Details:

* feat: putWorkspaceExtension handler

* refactor: TypesGen dflt import in workspace.ts

* feat: defaultWorkspaceExtension util

Impact:

This completes the UI<-->CLI parity epic in an MVP way. Of course, a
future improvement to make is extending by times other than the default
90 minutes.
2022-06-02 15:44:11 -04:00
Oxylibrium 1a07d021fe ux: change colors for inflight workspace actions (#1986) 2022-06-02 12:52:20 -04:00
Abhineet Jain e09cd3e9cf feat: Update UI for error dialog and snackbar (#1971)
* feat: update ui for error dialog and snackbar

* update padding for buttons
2022-06-02 11:23:52 -04:00
Abhineet Jain 47c7eda670 feat: add a divider after Account menu item (#1927)
* add a divider after Account menu item

* test: improve Storybook tests

* add closed and open userdropdown tests

* add default isOpen

* extract UserDropdownContent into a single component

* remove the isOpen prop

* address nit comments

* update test name
2022-06-02 11:09:19 -04:00
Steven Masley e6ee7dd652 chore: Add linting rule to help catch InTx misuse (#1980)
* chore: Add linting rule to help catch InTx misuse

This isn't perfect, as if you nest your misuse in another code block
like an if statement, it won't catch it :/. It is better
than nothing
2022-06-02 14:50:15 +00:00
Abhineet Jain c463e7801c feat: Update TTL language to Time until shutdown (#1948)
* feat: update ttl language in frontend

* Update TTL Helper text

Co-authored-by: Presley Pizzo <1290996+presleyp@users.noreply.github.com>

* update TTL helper string

Co-authored-by: Presley Pizzo <1290996+presleyp@users.noreply.github.com>
2022-06-02 10:15:36 -04:00
G r e y ab69c22ddc fix: missing FE ttl constraint validation (#1952)
Resolves: #1908
2022-06-02 10:14:42 -04:00
Steven Masley b9983e417f feat: Handle pagination cases where after_id does not exist (#1947)
* feat: Handle pagination cases where after_id does not exist

Throw an error to the user in these cases
- Templateversions
- Workspacebuilds

User pagination does not need it as suspended users still
have rows in the database
2022-06-02 09:01:45 -05:00
Kira Pilot 419dc6b036 feat: flexbox updates on workspace page (#1963)
* feat: flexbox work on workspace page

resolves 1910

* fixing cancel text

* chromatic fixes

* resolves #1953

no overflox text on smaller screens
2022-06-02 09:57:36 -04:00
Bruno Quaresma 3fd4dcd9d5 fix: Display member role when user has no role (#1965) 2022-06-02 08:46:06 -05:00
Cian Johnston dcf03d8ba3 chore: refactor time.Duration -> int64 milliseconds for FE consumption (#1944)
* Changes all public-facing codersdk types to use a plain int64 (milliseconds) instead of time.Duration.
* Makes autostart_schedule a *string as it may not be present.
* Adds a utils/ptr package with some useful methods.
2022-06-02 11:23:34 +01:00
Mathias Fredriksson 51c420c90a feat: Add support for --identity-agent in coder ssh (#1954) 2022-06-02 11:13:38 +03:00
Spike Curtis 9e3a625898 Show workspace name in WorkspaceBuildStats component (#1933)
* Show workspace name in WorkspaceBuildStats component

Signed-off-by: Spike Curtis <spike@coder.com>

* Fix WorkspaceBuildPage tests

Signed-off-by: Spike Curtis <spike@coder.com>
2022-06-01 16:49:43 -07:00
Cian Johnston b203d40123 fix: fix duplicate migrations (#1968) 2022-06-01 20:58:22 +00:00
Steven Masley 913c0f5e7f feat: Longer lived api keys for cli (#1935)
* feat: Longer lived api keys for cli
* feat: Refresh tokens based on their lifetime set in the db
* test: Add unit test for refreshing
2022-06-01 14:58:55 -05:00
Presley Pizzo bb400a4e82 fix: Show error message from backend on create existing user (#1964)
* Show error message from backend on create existing user

* Format
2022-06-01 15:52:54 -04:00
Ben Potter 46ffb67d60 feat: one-line install script (#1924)
* feat: one-line install script

* remove homebrew support

* remove arch linux

* use proper filename for packages

* fix variable format

* fix systemd instructions

* fixes to standalone script

* fix missing var bugs

* fix standalone install

* fix for MacOS

* format

* fix armv7 assets and zips

* remove windows

* update install docs

* support external sources with shellcheck

* shfmt

* add external sources to GitHub action & unfold

* change wording

* first template docs

* default to /usr/local instead

* add option for binary name
2022-06-01 14:15:09 -05:00
Bruno Quaresma f5a8d17aa8 feat: Add copy button to the SSH Page (#1962) 2022-06-01 19:01:36 +00:00
Bruno Quaresma b85de3ee79 feat: Improve empty states for workspaces and templates (#1950) 2022-06-01 17:32:55 +00:00
Dean Sheather 6be8a373e0 feat: run a terraform plan before creating workspaces with the given template parameters (#1732) 2022-06-02 00:44:53 +10:00
Steven Masley cc87a0cf6b feat: Implied 'member' roles for site and organization (#1917)
* feat: Member roles are implied and never exlpicitly added
* Rename "GetAllUserRoles" to "GetAuthorizationRoles"
* feat: Add migration to remove implied roles
* rename user auth role middleware
2022-06-01 09:07:50 -05:00
Presley Pizzo 2878346f19 Use backend error if possible (#1938) 2022-06-01 09:09:58 -04:00
Kyle Carberry 1fa50a9da1 fix: Race when writing to a closed pipe (#1916) 2022-06-01 07:59:03 -05:00
Cian Johnston 1c5d94ed5b fix: add all regions to aws examples (#1934) 2022-06-01 11:20:14 +01:00
Cian Johnston 7b40c692eb fix: coderd: dev mode should show verbose output by default (#1898)
* check buildinfo for devel prerelease tag and show verbose output if so
2022-06-01 11:00:42 +01:00
Steven Masley 7acb742218 feat: Prevent role changing on yourself. (#1931)
* feat: Prevent role changing on yourself.

Only allow changing roles on other users. Not much value in self changing
at the moment
2022-05-31 15:50:38 -05:00