Commit Graph

998 Commits

Author SHA1 Message Date
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
Steven Masley b7f4f3a771
chore: Implement workspace proxy going away (graceful shutdown) (#7459)
* chore: Implement workspace proxy going away

When a workspace proxy shuts down, the health status of that
proxy should immediately be updated. This is purely a courtesy
and technically not required
2023-05-10 19:23:16 -05:00
Kira Pilot a42a36a474
feat: add workspace actions cleanup configuration flags to CLI template create and edit (#7453)
* added cleanup flags on template create

* added cleanup flags on template edit

* fixed tests

* added to tests
2023-05-10 12:57:11 -07:00
Steven Masley 3f9af6f5e7
chore: Allow cors requests to workspace proxies for latency checks (#7484)
* CSP addition for web requests
* chore: Add cors to workspace proxies to allow for latency checks
2023-05-10 17:19:55 +00:00
Steven Masley b5ad628460
chore: Allow editing proxy fields via api. (#7435)
* chore: Add ability to update workspace proxy fields
2023-05-09 13:46:50 -05:00
Steven Masley fc1bc374cb
chore: Drop application host call, default to regions for info (#7457)
* chore: Drop application host call, default to regions for info
2023-05-09 09:28:25 -05:00
Ammar Bandukwala 8899dd89ca
chore: add global caching to rbac (#7439)
Co-authored-by: Steven Masley <stevenmasley@coder.com>
2023-05-08 08:59:01 -05: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
Spike Curtis a6a44896bf
fix: pubsub ordering (#7404)
* fix: pubsub sends messages in order

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

* Drop messages rather than block

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

---------

Signed-off-by: Spike Curtis <spike@coder.com>
2023-05-05 09:39:07 +04:00
Kyle Carberry 11ac3be4d8
fix: redirect to login on gitauth invalid session (#7416) 2023-05-04 17:19:44 +00:00
Colin Adler 4e52112112
fix: template versions test flake (#7400) 2023-05-03 20:19:49 -05:00
Colin Adler 8bd9f9c351
feat: unified tracing between coderd<->provisionerd (#7370) 2023-05-03 23:02:35 +00:00
Steven Masley 3368b8b65f
chore: Minor rbac memory optimization (#7391)
* test: Add benchmark for static rbac roles
* static roles should only be allocated once
* A unit test that modifies the ast value should not mess with the globals
* Cache subject AST values to avoid reallocating slices
2023-05-03 14:42:24 -05:00
Kira Pilot 2e9310b203
chore: add workspace actions entitlement and experiment (#7361)
* added workspace actions entitlement

* added workspace actions experiment
2023-05-03 11:34:43 -07:00
Steven Masley 434c4be9f1
chore: Add listing proxies to cli 'coder proxy ls' (#7376)
* feat: Add listing proxies to cli 'coder proxy ls'

* Add unit test

* Ignore errors

* Make gen and update golden files

* Update golden files
2023-05-03 10:12:56 -05:00
Kyle Carberry 90c57a538c
fix: make telemetry source a string not an enum (#7390) 2023-05-03 14:33:51 +00:00
Steven Masley a1db82582f
chore: Dynamic CSP connect-src to support terminals connecting to workspace proxies (#7352)
* chore: Expose proxy hostnames to csp header
2023-05-02 08:30:44 -05:00
Ammar Bandukwala 4b9621f9ae
fix(coderd): don't hang on first gitauth clone (#7331)
Previously, the `coder git ssh` command would hang on the API, which was endlessly polling the database for oauth tokens that expire in the future.

Some oAuth implementations (including GitHub by default) will not give back a token expiry date, and the absence of such a date was represented as a zero data in the database as opposed to a null value.

Follow-up calls to `git clone` would succeed because this hot path doesn't check expiry, perhaps originally by mistake.

In addition to fixing the zero date issue, this PR removes all gitauth PubSub, which added too much complexity when the polling interval is 1 second.
2023-05-01 19:19:41 +00:00
Steven Masley 4a9d1c16c7
chore: UI/UX for regions (#7283)
* chore: Allow regular users to query for all workspaces
* FE to add workspace proxy options to account settings
* WorkspaceProxy context syncs with coderd on region responses

---------

Co-authored-by: Dean Sheather <dean@deansheather.com>
2023-04-28 16:04:52 -05:00
Colin Adler 59efa4a528
fix(audit): ensure template creation errors are audited (#7315) 2023-04-27 18:55:34 -05:00
Marcin Tojek 77d9937dc4
fix: vite fatals on receiving HTTP4xx (#7306)
* fix: vite fatals on receiving HTTP4xx

* tune Vite

* fmt

* rewrite

* fmt
2023-04-27 19:04:24 +02:00
Marcin Tojek bb0a38b161
feat: Implement aggregator for agent metrics (#7259) 2023-04-27 12:34:00 +02:00
Spike Curtis b6666cf1cf
chore: tailnet debug logging (#7260)
* Enable discovery (disco) debug

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

* Better debug on reconnectingPTY

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

* Agent logging in appstest

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

* More reconnectingPTY logging

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

* Add logging to coordinator

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

* Update agent/agent.go

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

* Update agent/agent.go

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

* Update agent/agent.go

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

* Update agent/agent.go

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

* Clarify logs; remove unrelated changes

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

---------

Signed-off-by: Spike Curtis <spike@coder.com>
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
2023-04-27 13:59:01 +04:00
Dean Sheather f1dfeb03db
chore: fix flake in apptest reconnecting-pty test (#7281) 2023-04-26 00:31:41 +00:00
Colin Adler b62b6af0eb
fix(healthcheck): don't allow panics to exit coderd (#7276) 2023-04-25 15:11:45 +00:00
Dean Sheather a98341612c
feat: add regions endpoint for proxies feature (#7277)
* feat: add regions endpoint for proxies feature
2023-04-25 09:37:52 -05:00
Cian Johnston 8fc8559076
fix(coderd): ensure that user API keys are deleted when a user is (#7270)
Fixes an issue where API tokens belonging to a deleted user were
not invalidated:
- Adds a trigger to delete rows from the api_key stable when the
  column deleted is set to true in the users table.
- Adds a trigger to the api_keys table to ensure that new rows
  may not be added where user_id corresponds to a deleted user.
- Adds a migration to delete all API keys from deleted users.
- Adds tests + dbfake implementation for the above.
2023-04-24 21:48:26 +01:00
Steven Masley 3129741e08
chore: Proxy health status checks + endpoint (#7233)
* chore: Implement workspace proxy health check cron

At a given interval will check the reachability of workspace proxies.

* Proxyhealth is an enterprise feature
* Start proxyhealth go routine on enterprise coder
2023-04-24 10:25:35 -05:00
Marcin Tojek c000f2ec28
fix: coder_parameter fallbacks to default (#7240) 2023-04-24 09:51:34 +02:00
Mathias Fredriksson 6f06f8dadb
test: Fix test timeouts due to contexts created too early (#7242) 2023-04-21 17:32:25 +03:00
Mathias Fredriksson ea78ca5dff
test(coderd/workspaceapps): Fix incorrect use of testing.T (#7243) 2023-04-21 17:32:10 +03:00
Steven Masley 4353ad7940
chore: Remove url and wildcard url from moon create (#7224)
* chore: Remove url and wildcard url from moon create
2023-04-20 21:09:14 -05:00
Dean Sheather 68667323f3
chore: support signed token query param for web terminal (#7197)
* chore: add endpoint to get token for web terminal

* chore: support signed token query param for web terminal
2023-04-20 23:59:45 +00:00
Colin Adler 745868fd8a
revert: chore: upgrade tailscale (#7236) 2023-04-20 17:58:22 -05:00
Mathias Fredriksson ad0070354f
test: Fix generated workspace name length (#7228) 2023-04-20 18:40:36 +00:00
Colin Adler a86830a283
chore: upgrade tailscale (#7207) 2023-04-20 13:29:56 -05:00
Kira Pilot e2a7448cc8
fix: allow update of empty template description (#7225) 2023-04-20 10:59:57 -07:00
Steven Masley 7fa1112958
chore: Enforce workspace proxy unique name case insensitive (#7202)
* chore: Enforce workspace proxy unique name case insensitive
2023-04-20 11:30:52 -05:00
Steven Masley a5a5c4d400
chore: Add workspace proxy enterprise cli commands (#7176)
* feat: Add workspace proxy enterprise cli commands
* chore: Handle custom workspace proxy options. Remove excess
* chore: Add endpoint to register workspace proxies
2023-04-20 09:48:47 -05:00
Dean Sheather 528a0686c0
chore: fix deadlock in dbfake and incorrect lock types (#7218)
I manually went through every single dbfake function and ensured it has
the correct lock type depending on whether it writes or only reads.
There were a surprising amount of methods that had the wrong lock type
(Lock when only reading, or RLock when writing (!!!)).

This also manually fixes every method that acquires a RLock and then
calls a method that also acquires it's own RLock to use noLock methods
instead. You cannot rely on acquiring a RLock twice in the same
goroutine as RWMutex prioritizes any waiting Lock calls.

I tried writing a ruleguard rule for this but because of limitations in
ruleguard it doesn't seem possible.
2023-04-20 21:53:34 +10:00
Colin Adler 5f5edb18b0
chore(healthcheck): fix DERP test flakes (#7211) 2023-04-19 20:03:05 -05:00
Colin Adler 57c4de4647
feat(healthcheck): add accessurl check (#7193) 2023-04-18 15:52:00 -05:00
Steven Masley 7f041fecd8
test: Enable filter test with cancelled context (#7189)
* test: Enable filter test with cancelled context

* fixup! test: Enable filter test with cancelled context
2023-04-18 11:06:10 -05:00
Colin Adler b44e6e6711
fix(healthcheck): remove `t.Parallel()` from healthcheck tests (#7174) 2023-04-17 15:01:47 -05:00
Steven Masley 658246d5f2
chore: add workspace proxies to the backend (#7032)
Co-authored-by: Dean Sheather <dean@deansheather.com>
2023-04-17 19:57:21 +00:00
Bruno Quaresma 76b5deea78
chore(site): Remove template editor out of experimental (#7165) 2023-04-17 14:40:21 -03:00
Ammar Bandukwala 80bf042528
chore(coderd): remove timing check (#7144) 2023-04-17 17:40:02 +00:00
Mathias Fredriksson bf0fed4f3f
chore: Update pion/udp and improve parallel/non-parallel tests (#7164)
* test(all): Improve and fix subtests with parallell/nonparallel parents

* chore: Update pion/udp to fix buffer close
2023-04-17 20:23:10 +03:00
Mathias Fredriksson 8b2aead7f4
test(coderd/rbac): Use static name for tests (#7155) 2023-04-17 12:17:18 +00:00
Steven Masley 2137db0445
test: Handle Filter flake with ctx errors (#7119)
* test: Handle Fitler flake with ctx errors
* Add unit test to check filter for proper error
* Correctly return category of errors
2023-04-14 12:30:35 -05:00