Commit Graph

88 Commits

Author SHA1 Message Date
Michael Smith 1d254f4680
fix: add tests and improve accessibility for useClickable (#12218) 2024-02-21 10:59:13 -05:00
Bruno Quaresma 1a94686928
refactor(site): add table chosmetic changes (#11977)
- Set default 14px as the default font size for the table content
- Add `xsmall` size for checkboxes
- Remove checkbox wrapper padding on the table heading

Before:
<img width="1512" alt="Screenshot 2024-02-01 at 10 22 10" src="https://github.com/coder/coder/assets/3165839/92b844ae-f2bf-476a-89fe-90b16f19c306">

After: 
<img width="1512" alt="Screenshot 2024-02-01 at 10 26 00" src="https://github.com/coder/coder/assets/3165839/0f87d098-4b13-4373-96d2-2c18ee2587f6">
2024-02-01 10:41:15 -03:00
Spike Curtis 1e8a9c09fe
chore: remove legacy wsconncache (#11816)
Fixes #8218

Removes `wsconncache` and related "is legacy?" functions and API calls that were used by it.

The only leftover is that Agents still use the legacy IP, so that back level clients or workspace proxies can dial them correctly.

We should eventually remove this: #11819
2024-01-30 07:56:36 +04:00
Michael Smith 31f8fac1b9
fix: make ProxyMenu more accessible to screen readers (#11312)
* wip: commit progress on latency update

* chore: add stories and clean up tests

* refactor: clean up code

* fix: make sure headers aren't treated as interactive elements

* refactor: clean up tests

* fix: clean up stories

* docs: add clarifying comment

* fix: update stories again

* fix: clean up/extend prop definitions

* refactor: quick cleanup

* fix: apply Kira's feedback

* refactor: clean up abbr markup to account for pronunciation

* fix: more cleanup

* fix: refine screen reader output for VoiceOver

* refactor: clean up and redefine tests

* feature: add finishing touches
2024-01-07 18:37:01 -05:00
Bruno Quaresma cf17fabcc6
feat(site): refactor workspace header to be more slim (#11327) 2024-01-02 12:42:51 -03:00
Michael Smith d016f93de8
feat: add usePaginatedQuery hook (#10803)
* wip: commit current progress on usePaginatedQuery

* chore: add cacheTime to users query

* chore: update cache logic for UsersPage usersQuery

* wip: commit progress on Pagination

* chore: add function overloads to prepareQuery

* wip: commit progress on usePaginatedQuery

* docs: add clarifying comment about implementation

* chore: remove optional prefetch property from query options

* chore: redefine queryKey

* refactor: consolidate how queryKey/queryFn are called

* refactor: clean up pagination code more

* fix: remove redundant properties

* refactor: clean up code

* wip: commit progress on usePaginatedQuery

* wip: commit current pagination progress

* docs: clean up comments for clarity

* wip: get type signatures compatible (breaks runtime logic slightly)

* refactor: clean up type definitions

* chore: add support for custom onInvalidPage functions

* refactor: clean up type definitions more for clarity reasons

* chore: delete Pagination component (separate PR)

* chore: remove cacheTime fixes (to be resolved in future PR)

* docs: add clarifying/intellisense comments for DX

* refactor: link users queries to same queryKey implementation

* docs: remove misleading comment

* docs: more comments

* chore: update onInvalidPage params for more flexibility

* fix: remove explicit any

* refactor: clean up type definitions

* refactor: rename query params for consistency

* refactor: clean up input validation for page changes

* refactor/fix: update hook to be aware of async data

* chore: add contravariance to dictionary

* refactor: increase type-safety of usePaginatedQuery

* docs: more comments

* chore: move usePaginatedQuery file

* fix: add back cacheTime

* chore: swap in usePaginatedQuery for users table

* chore: add goToFirstPage to usePaginatedQuery

* fix: make page redirects work properly

* refactor: clean up clamp logic

* chore: swap in usePaginatedQuery for Audits table

* refactor: move dependencies around

* fix: remove deprecated properties from hook

* refactor: clean up code more

* docs: add todo comment

* chore: update testing fixtures

* wip: commit current progress for tests

* fix: update useEffectEvent to sync via layout effects

* wip: commit more progress on tests

* wip: stub out all expected test cases

* wip: more test progress

* wip: more test progress

* wip: commit more test progress

* wip: AHHHHHHHH

* chore: finish two more test cases

* wip: add in all tests (still need to investigate prefetching

* refactor: clean up code slightly

* fix: remove math bugs when calculating pages

* fix: wrap up all testing and clean up cases

* docs: update comments for clarity

* fix: update error-handling for invalid page handling

* fix: apply suggestions
2023-11-30 17:44:03 -05:00
Bruno Quaresma fbec79f35d
refactor(site): refactor login screen (#10768) 2023-11-20 11:19:50 -03:00
Dean Sheather c130f8d6d0
chore: disable test on save in vscode (#10730) 2023-11-16 22:27:08 +10:00
Bruno Quaresma 90b6e86555
chore(site): remove xstate (#10659) 2023-11-14 18:34:38 +00:00
Kyle Carberry 5abfe5afd0
chore: rename dbfake to dbmem (#10432) 2023-10-30 17:42:20 +00:00
Kyle Carberry 5596fb20b5
chore: move `/gitauth` to `/externalauth` on the frontend (#9954)
* chore: move `/gitauth` to `/externalauth` on the frontend

This actually took a lot more jank than anticipated,
so I wanted to split this up before adding the ability
to embed new providers.

* Rename FE

* Fix em' up

* Fix linting error

* Fix e2e tests

* chore: update helm golden files
2023-09-30 14:30:01 -05:00
Kayla Washburn 2b5428e95f
refactor: start using emotion for styling (#9909) 2023-09-29 13:08:17 -06:00
Kyle Carberry 82e238b0c6
chore: exclude generated files from vscode search by default (#9530)
Anyone can feel free to revert some of these, but they were constantly
annoying when searching for symbols in our code.
2023-09-05 15:05:46 +00:00
Kira Pilot 7ca624eceb
fix: removing prettier path in vscode config (#8255) 2023-06-29 09:00:51 -04:00
Bruno Quaresma cbd49abfcd
fix(site): resize terminal when dismissing warning (#8028) 2023-06-14 14:40:55 -03:00
Kira Pilot ae3473dc1b
feat: add deleted_at field to workspace model (#7475)
* added impending_deletion workspace field

* gen docs

* update golden files

* added test

* PR comments
2023-05-11 08:47:53 -07:00
Kira Pilot 5ffa6dae50
feat: add inactivity cleanup and failure cleanup configuration fields to Template Schedule Form (#7402)
* added workspace actions entitlement

* added workspace actions experiment

* added new route for template enterprise meta

* removing new route; repurposing old

* add new fields to get endpoints

* removed workspace actions experiment

* added logic to enterprise template store

* added new form fields

* feature flagged new fields

* fix validation

* fixed submit btn

* fix tests

* changed ttl defaults

* added FE tests

* added BE tests

* fixed lint

* adjusted comment language

* fixing unstaged changes check

* fix test

* Update coderd/database/migrations/000122_add_template_cleanup_ttls.down.sql

Co-authored-by: Dean Sheather <dean@deansheather.com>

* Update coderd/database/migrations/000122_add_template_cleanup_ttls.up.sql

Co-authored-by: Dean Sheather <dean@deansheather.com>

---------

Co-authored-by: Dean Sheather <dean@deansheather.com>
2023-05-05 08:19:26 -07:00
Kyle Carberry 8f55f5c28b
chore: ensure go.mod has proper references to forked deps (#6893)
There were a few that have been merged upstream!
2023-03-30 11:19:11 -05:00
Kira Pilot 811a69f371
feat(site): add ability to create tokens from account tokens page (#6608)
* add token actions

* added basic token form

* removed token switch

* refined date field

* limiting lifetime days to maxTokenLifetime

* broke apart files

* added loader and error

* fixed form layout

* added some unit tests

* fixed be tests

* no authorize check
2023-03-16 08:25:08 -07:00
Kira Pilot 6304bfb5c0
feat: add 'Show all tokens' toggle for owners (#6325)
* add tokens switch

* reorged TokensPage

* using Trans component for description

* using Trans component on DeleteDialog

* add owner col

* simplify hook return

* lint

* type for response

* PR feedback

* fix lint
2023-03-01 08:35:55 -08:00
Kira Pilot a32169ccb5
feat: add flag to see all tokens if owner (#6227)
* added query for tokens by user id

* updated query args

* adding owner col

* fix request params

* update-golden-files

* added owners col to ls table output

* added ttoken translations

* prettier

* format table according to arg

* using slice.Contains

* refactored token state

* cleanup
2023-02-23 07:00:27 -08:00
Kyle Carberry 7ad87505c8
chore: move agent functions from `codersdk` into `agentsdk` (#5903)
* chore: rename `AgentConn` to `WorkspaceAgentConn`

The codersdk was becoming bloated with consts for the workspace
agent that made no sense to a reader. `Tailnet*` is an example
of these consts.

* chore: remove `Get` prefix from *Client functions

* chore: remove `BypassRatelimits` option in `codersdk.Client`

It feels wrong to have this as a direct option because it's so infrequently
needed by API callers. It's better to directly modify headers in the two
places that we actually use it.

* Merge `appearance.go` and `buildinfo.go` into `deployment.go`

* Merge `experiments.go` and `features.go` into `deployment.go`

* Fix `make gen` referencing old type names

* Merge `error.go` into `client.go`

`codersdk.Response` lived in `error.go`, which is wrong.

* chore: refactor workspace agent functions into agentsdk

It was odd conflating the codersdk that clients should use
with functions that only the agent should use. This separates
them into two SDKs that are closely coupled, but separate.

* Merge `insights.go` into `deployment.go`

* Merge `organizationmember.go` into `organizations.go`

* Merge `quota.go` into `workspaces.go`

* Rename `sse.go` to `serversentevents.go`

* Rename `codersdk.WorkspaceAppHostResponse` to `codersdk.AppHostResponse`

* Format `.vscode/settings.json`

* Fix outdated naming in `api.ts`

* Fix app host response

* Fix unsupported type

* Fix imported type
2023-01-29 15:47:24 -06:00
Kira Pilot 3d58e6912a
chore: removing unaudited resources (#5885)
* chore: removing unaudited resources

* cleaned up tests

* CI errors
2023-01-26 18:14:09 -05:00
Kira Pilot e2bea2d20f
chore: autogenerate audit log documentation (#5862)
* added script for table creation

* added tags to audit-logs.md

* removed log

* removed empty block line

* PR feedback

* modify check_unstaged

* third times the charm maybe

* spelling

* relative path

* excluding from the right script this time

* sorted resources to ensure table order

* running make cmd

* running make again

* ensuring order on subtable
2023-01-26 18:12:12 -05:00
Bruno Quaresma de66f0d540
docs: Add frontend guide (#5852) 2023-01-25 16:15:06 +00:00
Muhammad Atif Ali 341c4329f4
ci: enable CodeQL code scanning (#5279)
Co-authored-by: Dean Sheather <dean@deansheather.com>
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
Co-authored-by: Geoffrey Huntley <ghuntley@ghuntley.com>
2022-12-22 22:12:55 +02:00
Mathias Fredriksson 81c3948792
fix: Close tty first in `ptytest` cleanup (#5252) 2022-12-02 12:32:50 +00:00
Mathias Fredriksson eff99f78fa
feat: Add support for MOTD file in coder agents (#5147) 2022-11-24 12:22:20 +00:00
Mathias Fredriksson 2b6c229e4e
fix: Trigger workspace event after agent timeout seconds (#5141)
Fixes #5116
2022-11-22 11:01:28 +00:00
Kyle Carberry fb9ca7b830
feat: Add the option to generate a trial license during setup (#5110)
This allows users to generate a 30 day free license during setup to
test out Enterprise features.
2022-11-16 17:09:49 -06:00
Kyle Carberry b6703b11c6
feat: Add external provisioner daemons (#4935)
* Start to port over provisioner daemons PR

* Move to Enterprise

* Begin adding tests for external registration

* Move provisioner daemons query to enterprise

* Move around provisioner daemons schema

* Add tags to provisioner daemons

* make gen

* Add user local provisioner daemons

* Add provisioner daemons

* Add feature for external daemons

* Add command to start a provisioner daemon

* Add provisioner tags to template push and create

* Rename migration files

* Fix tests

* Fix entitlements test

* PR comments

* Update migration

* Fix FE types
2022-11-16 16:34:06 -06:00
Kyle Carberry da05bbbdf7
chore: Separate the provisionerd server into it's own package (#4940)
* chore: Separate the provisionerd server into it's own package

This code should be thoroughly tested now that we understand the abstraction.

I separated it to make our lives a bit easier for external provisioner daemons
as well!

* Add tests

* Add workspace builds

* Add test for workspace resources
2022-11-08 01:10:49 +00:00
Kyle Carberry eec406b739
feat: Add Git auth for GitHub, GitLab, Azure DevOps, and BitBucket (#4670)
* Add scaffolding

* Move migration

* Add endpoints for gitauth

* Add configuration files and tests!

* Update typesgen

* Convert configuration format for git auth

* Fix unclosed database conn

* Add overriding VS Code configuration

* Fix Git screen

* Write VS Code special configuration if providers exist

* Enable automatic cloning from VS Code

* Add tests for gitaskpass

* Fix feature visibiliy

* Add banner for too many configurations

* Fix update loop for oauth token

* Jon comments

* Add deployment config page
2022-10-24 19:46:24 -05:00
Kyle Carberry 2ba4a62a0d
feat: Add high availability for multiple replicas (#4555)
* feat: HA tailnet coordinator

* fixup! feat: HA tailnet coordinator

* fixup! feat: HA tailnet coordinator

* remove printlns

* close all connections on coordinator

* impelement high availability feature

* fixup! impelement high availability feature

* fixup! impelement high availability feature

* fixup! impelement high availability feature

* fixup! impelement high availability feature

* Add replicas

* Add DERP meshing to arbitrary addresses

* Move packages to highavailability folder

* Move coordinator to high availability package

* Add flags for HA

* Rename to replicasync

* Denest packages for replicas

* Add test for multiple replicas

* Fix coordination test

* Add HA to the helm chart

* Rename function pointer

* Add warnings for HA

* Add the ability to block endpoints

* Add flag to disable P2P connections

* Wow, I made the tests pass

* Add replicas endpoint

* Ensure close kills replica

* Update sql

* Add database latency to high availability

* Pipe TLS to DERP mesh

* Fix DERP mesh with TLS

* Add tests for TLS

* Fix replica sync TLS

* Fix RootCA for replica meshing

* Remove ID from replicasync

* Fix getting certificates for meshing

* Remove excessive locking

* Fix linting

* Store mesh key in the database

* Fix replica key for tests

* Fix types gen

* Fix unlocking unlocked

* Fix race in tests

* Update enterprise/derpmesh/derpmesh.go

Co-authored-by: Colin Adler <colin1adler@gmail.com>

* Rename to syncReplicas

* Reuse http client

* Delete old replicas on a CRON

* Fix race condition in connection tests

* Fix linting

* Fix nil type

* Move pubsub to in-memory for twenty test

* Add comment for configuration tweaking

* Fix leak with transport

* Fix close leak in derpmesh

* Fix race when creating server

* Remove handler update

* Skip test on Windows

* Fix DERP mesh test

* Wrap HTTP handler replacement in mutex

* Fix error message for relay

* Fix API handler for normal tests

* Fix speedtest

* Fix replica resend

* Fix derpmesh send

* Ping async

* Increase wait time of template version jobd

* Fix race when closing replica sync

* Add name to client

* Log the derpmap being used

* Don't connect if DERP is empty

* Improve agent coordinator logging

* Fix lock in coordinator

* Fix relay addr

* Fix race when updating durations

* Fix client publish race

* Run pubsub loop in a queue

* Store agent nodes in order

* Fix coordinator locking

* Check for closed pipe

Co-authored-by: Colin Adler <colin1adler@gmail.com>
2022-10-17 13:43:30 +00:00
Joe Previte 94db085b51
chore(site): remove some eslint-disables (#4265)
* fix: await promises in WorkspacePage.test.tsx

* chore: add eventsourcemock to cspell words

* fix: clean up UsersPage.test.tsx

* refactor: clean up eventsource mock

* revert: remove changes from WorkspacePage.test.tsx
2022-10-13 18:09:04 -05:00
Kyle Carberry 915bb41ea2
feat: Add trial property to licenses (#4372)
* feat: Add trial property to licenses

This allows the frontend to display whether the user is on
a trial license of Coder. This is useful for advertising
Enterprise functionality.

* Improve tests for license enablement code

* Add all features property
2022-10-06 19:28:22 -05:00
Joe Previte b8bd3208ca
chore: update cSpell and fix isNotificationTextPrefixed (#4076)
* chore: update cSpell words

* chore: add ignorePaths for cSpell

* fix: update isNotificationTextPrefixed

This removes an eslint-disable rule and adds two new tests to ensure
isNotificationTextPrefixed is working as expected.

* fix(e2e): remove filter in workspacesPage
2022-09-15 16:59:22 -03:00
Mathias Fredriksson 09da3858ce
fix: Terminal emulation used by SSH sessions (#3473)
Fixes #3371
2022-09-12 19:27:51 +03:00
Kyle Carberry f5bbbdf638
chore: Fix VSCode configuration to hide visual test overlay (#3994)
This made it impossible to code 😅
2022-09-11 10:50:50 -05:00
Ammar Bandukwala f6aa025a01
feat: use active users instead of total users in Template views (#3900) 2022-09-09 19:30:31 +00:00
Kyle Carberry 9bd83e5ec7
feat: Add Tailscale networking (#3505)
* fix: Add coder user to docker group on installation

This makes for a simpler setup, and reduces the likelihood
a user runs into a strange issue.

* Add wgnet

* Add ping

* Add listening

* Finish refactor to make this work

* Add interface for swapping

* Fix conncache with interface

* chore: update gvisor

* fix tailscale types

* linting

* more linting

* Add coordinator

* Add coordinator tests

* Fix coordination

* It compiles!

* Move all connection negotiation in-memory

* Migrate coordinator to use net.conn

* Add closed func

* Fix close listener func

* Make reconnecting PTY work

* Fix reconnecting PTY

* Update CI to Go 1.19

* Add CLI flags for DERP mapping

* Fix Tailnet test

* Rename ConnCoordinator to TailnetCoordinator

* Remove print statement from workspace agent test

* Refactor wsconncache to use tailnet

* Remove STUN from unit tests

* Add migrate back to dump

* chore: Upgrade to Go 1.19

This is required as part of #3505.

* Fix reconnecting PTY tests

* fix: update wireguard-go to fix devtunnel

* fix migration numbers

* linting

* Return early for status if endpoints are empty

* Update cli/server.go

Co-authored-by: Colin Adler <colin1adler@gmail.com>

* Update cli/server.go

Co-authored-by: Colin Adler <colin1adler@gmail.com>

* Fix frontend entites

* Fix agent bicopy

* Fix race condition for the last node

* Fix down migration

* Fix connection RBAC

* Fix migration numbers

* Fix forwarding TCP to a local port

* Implement ping for tailnet

* Rename to ForceHTTP

* Add external derpmapping

* Expose DERP region names to the API

* Add global option to enable Tailscale networking for web

* Mark DERP flags hidden while testing

* Update DERP map on reconnect

* Add close func to workspace agents

* Fix race condition in upstream dependency

* Fix feature columns race condition

Co-authored-by: Colin Adler <colin1adler@gmail.com>
2022-08-31 20:09:44 -05:00
Kyle Carberry b0fe9bcdd1
chore: Upgrade to Go 1.19 (#3617)
This is required as part of #3505.
2022-08-21 22:32:53 +00:00
Kyle Carberry c43297937b
feat: Add Kubernetes and resource metadata telemetry (#3548)
Fixes #3524.
2022-08-18 15:57:46 +00:00
Kyle Carberry 3279504cbe
feat: Add active users prometheus metric (#3406)
This  allows deployments using our Prometheus export t determine
the number of active users in the past hour.

The interval is an hour to align with API key last used refresh times.

SSH connections poll to check shutdown time, so this will be accurate
even on long-running connections without dashboard requests.
2022-08-08 10:09:46 -05:00
Kyle Carberry 3d0febdd90
feat: Add OIDC authentication (#3314)
* feat: Add OIDC authentication

* Extract username into a separate package and add OIDC tests

* Add test case for invalid tokens

* Add test case for username as email

* Add OIDC to the frontend

* Improve comments from self-review

* Add authentication docs

* Add telemetry

* Update docs/install/auth.md

Co-authored-by: Ammar Bandukwala <ammar@ammar.io>

* Update docs/install/auth.md

Co-authored-by: Ammar Bandukwala <ammar@ammar.io>

* Remove username package

Co-authored-by: Ammar Bandukwala <ammar@ammar.io>
2022-07-31 23:05:35 -05:00
Mathias Fredriksson d7dee2c069
fix: Improve code coverage reporting in codecov (#2715)
* fix: Remove explicit coverpkg github.com/coder/coder/codersdk

This package is already covered by ./...

* fix: Ignore test utils in coverage (clitest, coderdtest, ptytest)
2022-07-25 19:55:19 +03:00
Dean Sheather 075e891f28
Remove goreleaser in favor of build scripts (#2143) 2022-06-19 05:47:10 +10:00
Kyle Carberry f9290b016e
fix: Use explicit resource order when assocating agents (#2219)
This cleans up agent association code to explicitly map a single
agent to a single resource. This will fix #1884, and unblock
a prospect from beginning a POC.
2022-06-10 15:47:36 +00:00
Kyle Carberry 14701498c9
fix: Improve Terraform agent<->resource association testing (#2187) 2022-06-08 17:40:34 -05:00
Kira Pilot 3bc122b7d5
feat: added include_deleted to getWorkspaceByOwnerAndName (#2164)
* feat: added include_deleted

relates to #1955

* Update coderd/workspaces.go

defining vars in the scope of conditional

Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>

* Update coderd/workspaces.go

avoid newline

Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>

* Update coderd/workspaces.go

Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>

* PR feedback

* wrote test, added type

* Update coderd/workspaces_test.go

shortening test name

Co-authored-by: Cian Johnston <cian@coder.com>

* taking out api.ts change for now

* casing

Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
Co-authored-by: Cian Johnston <cian@coder.com>
2022-06-08 14:04:05 -04:00