Commit Graph

3211 Commits

Author SHA1 Message Date
Arthur Normand ad0dd1be5d fix: Add client certs to OAuth HTTPClient context (#5126) 2022-12-14 16:44:29 +02:00
Mathias Fredriksson 4fc4c01cea fix: Enable reconnectingpty loadtest and fix/improve logging (#5403)
* fix: Enable reconnectingpty loadtest and fix/improve logging

This commit re-enabled reconnectingpty loadtests after a logging
refactor of `(*agent).handleReconnectingPTY`. The reasons the tests were
flaking was that `logger.Error` was being called and `slogtest` failing
the test.

We could have set the option for `slogtest` to disable failing, but that
could hide real issues. The current approach improves reconnectingpty
logging overall and provides more insight into what's happening. It's
expected that reconnectingpty sessions fail after the agent is closed,
so calling `logger.Error` at that point is not wanted.

Ref: #5322
2022-12-13 21:28:07 +02:00
Garrett Delfosse 560c8ce0f6 fix: allow example files to be reused and not error (#5402) 2022-12-13 16:27:37 +00:00
Colin Adler 1c42a20865 chore: add debugging to agent stats report (#5395) 2022-12-13 01:03:03 -06:00
Garrett Delfosse 40a5c0476f feat: add flag for token lifetime (#5385) 2022-12-12 15:39:31 -05:00
Garrett Delfosse ca0374b94f feat: add examples to api (#5331)
Co-authored-by: Dean Sheather <dean@deansheather.com>
2022-12-09 14:29:50 -05:00
Kira Pilot c6ae151f49 feat: amending audit string to show workspace owner (#5364)
* resolves #5269

* clean up

* fixed audit link
2022-12-09 12:19:30 -05:00
Bruno Quaresma ce76d9d5a3 feat: Add diff and Dockerfile support for template version page (#5339) 2022-12-08 10:24:15 -05:00
Mathias Fredriksson 687261c827 fix: Close coordinator in wsconncache test (#5348)
Possibly related to #5302
2022-12-08 11:44:03 +00:00
Marcin Tojek c063ac24a3 fix: use doWithRetries when making HTTP calls (#5344) 2022-12-08 10:24:50 +01:00
Marcin Tojek 534bff2ff5 fix: coderd/prometheusmetrics wait for all metrics in require.Eventually (#5338) 2022-12-07 17:50:17 +01:00
Marcin Tojek 3cea5f96f0 fix: wait for creating template versions (#5335) 2022-12-07 14:19:18 +01:00
Dean Sheather 161465db55 fix: do not canonicalize Sec-WebSocket-* headers in apps (#5334)
* fix: do not canonicalize Sec-WebSocket-* headers in apps

* chore: test for non-canonical header name subst
2022-12-07 22:55:02 +10:00
Ammar Bandukwala 1cfe5de1c5 Add Service Banners (#5272) 2022-12-06 18:38:38 +00:00
Kira Pilot df389d429c Add build number to workspace_build audit logs (#5267)
* got links working

* added translations

* fixed translation

* added translation for unavailable ip

* added support for group, template, user links

* cleaned up string

* added deleted label

* querying for workspace id

* remove prints

* fix/write tests

* added build number

* checking for existence of additional fields

* adjust documentation

* PR feedback
2022-12-06 13:33:21 -05:00
Kyle Carberry c77c1b4bc2 fix: Retry if there is no git auth user yet (#5316)
Fixes part of #4900.
2022-12-06 16:06:41 +01:00
Bruno Quaresma e17fd0bb25 feat: Add GET previous template version endpoint (#5230) 2022-12-06 14:15:03 +00:00
dependabot[bot] 825480ae9b chore: bump crate-ci/typos from 1.12.12 to 1.13.3 (#5304)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Geoffrey Huntley <ghuntley@ghuntley.com>
2022-12-06 11:50:33 +00:00
Presley Pizzo ee74df3d07 Fix scope of dbTTL (#5197) 2022-12-05 17:19:30 -05:00
Daniel Carrion 061635c36d feat: Allow multiple OIDC domains (#5210)
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
2022-12-05 20:20:53 +02:00
Colin Adler a02617b66b fix: remove unnecessary WHEREs from AcquireProvisionerJob (#5257) 2022-12-02 23:53:49 +00:00
Marcin Tojek 137a48c215 fix: workspaceapps: overloaded test server responds with 502s (#5255) 2022-12-02 23:16:07 +01:00
Kira Pilot 65407462d1 Add audit links/kira pilot (#5156)
* got links working

* added translations

* fixed translation

* added translation for unavailable ip

* added support for group, template, user links

* cleaned up string

* added deleted label

* querying for workspace id

* remove prints

* fix/write tests

* PR feedback pt 1

* PR feedback part 2
2022-12-02 15:14:45 -05:00
Colin Adler 8469dbc045 fix: add index to provisioner_jobs.started_at (#5245) 2022-12-01 19:29:15 -06:00
Colin Adler 92c217bd85 fix: add index on workspace_agents.auth_token (#5244) 2022-12-02 01:29:05 +00:00
Colin Adler ab3b3d5fca feat: add debouncing to provisionerd rpc calls (#5198) 2022-12-01 16:54:53 -06:00
Tao Yang 5457dd0c65 feat: Let port-forwarding support custom http(s) port (#5084) 2022-12-02 06:39:19 +10:00
Mathias Fredriksson 2ec3b09ca7 fix: Fix nil-pointer deref on checkAuthorization (#5236)
Remove call to `err.Error()` on a `nil` error in `checkAuthorization`.
2022-12-01 18:42:10 +00:00
Mathias Fredriksson d9f2aaf3b4 feat: Add support for update checks and notifications (#4810)
Co-authored-by: Kira Pilot <kira@coder.com>
2022-12-01 19:43:28 +02:00
Kyle Carberry 2a73362026 fix: add mutex to MockAuditor export to prevent race (#5189)
See: https://github.com/coder/coder/actions/runs/3575201153/jobs/6011435900.
2022-11-30 16:25:30 +00:00
Kyle Carberry 8b73844f69 feat: Validate Git tokens before consuming them (#5167)
* feat: Validate Git tokens before consuming them

This works the exact same way that the Git credential manager does. It ensures the user token is valid before returning it to the client.

It's been manually tested on GitHub, GitLab, and BitBucket.

* Fix requested changes
2022-11-29 12:08:27 -06:00
Dean Sheather 15f8967a8a feat: tracing improvements (#4988) 2022-11-29 07:22:10 +10:00
Bruno Quaresma d402914eb7 refactor: Return template version name in the workspace build API (#5178) 2022-11-28 19:53:56 +00:00
Steven Masley ab9298f382 chore: Rewrite rbac rego -> SQL clause (#5138)
* chore: Rewrite rbac rego -> SQL clause

Previous code was challenging to read with edge cases
- bug: OrgAdmin could not make new groups
- Also refactor some function names
2022-11-28 12:12:34 -06:00
Presley Pizzo d5ab4fdeb8 fix: auto-stop bumper works and refreshes (#5162)
* Publish updates to workspace deadline

* Fix sync between machines
2022-11-28 10:59:43 -05:00
Cian Johnston a4a319a76e feat: add CODER_OIDC_IGNORE_EMAIL_VERIFIED config knob (#5165)
* Adds a configuration knob CODER_OIDC_IGNORE_EMAIL_VERIFIED that allows
  ignoring the email_verified OIDC claim
* Adds warning message at startup if CODER_OIDC_IGNORE_EMAIL_VERIFIED=true
* Adds warning whenever an unverified OIDC email is let through
* Skips flaky test on non-linux platforms

Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
2022-11-25 10:10:09 +00:00
Marcin Tojek 25da224513 Filter query: has-agent connecting, connected, disconnected, timeout (#5145)
* WIP

* has-agent:connecting, connected

* Fix

* Fix

* has-agent:disconnected, timeout

* Fix: typo

* Fix

* TODOs

* databasefake

* Fix: typo

* More TODOs

* databasefake

* Timeout tests

* Address PR comments

* Implement FIXMEs

* Renamings

* Address PR comments

* Fix: readability

* Fix: refactor CASE logic

* CASE logic

* Fix

* Use CTE

* Polishing

* Comment

* WIP

* IS NOT NULL

* Without CTE

* One more optimization

* 2nd optimization
2022-11-24 15:33:13 +01:00
Mathias Fredriksson eff99f78fa feat: Add support for MOTD file in coder agents (#5147) 2022-11-24 12:22:20 +00:00
Presley Pizzo 913e461f79 Don't override 0 ttl with template default (#5151) 2022-11-23 10:30:38 -05:00
Kira Pilot 6786ca2854 Audit build outcomes/kira pilot (#5143)
* auditing failed builds

* logging workspace build successes

* remove duplicate workspace build entry

* fixed workspacebuilds_test

* PR feedback

* lint and migrations

* fix nil auditors

* workspace_build test

* fixed workspaces_teest

Co-authored-by: Colin Adler <colin1adler@gmail.com>
2022-11-22 13:22:56 -05:00
Colin Adler 1f20cab110 fix: don't use yamux for in-memory provisioner{,d} streams (#5136) 2022-11-22 12:19:32 -06:00
Mathias Fredriksson 2b6c229e4e fix: Trigger workspace event after agent timeout seconds (#5141)
Fixes #5116
2022-11-22 11:01:28 +00:00
Presley Pizzo 67941b4f80 chore: refactor audit page to use window function for count (#5133)
* Move count query to window function

* Unpack count and update types

* Remove count endpoint

* Update tests, wip

* Fix tests

* Update frontend, wip

* Remove space

* Fix frontend test

* Don't hang on error

* Handle no results

* Don't omit count

* Fix frontend tests
2022-11-21 11:30:41 -05:00
Marcin Tojek e86539db11 feat: Allow user to cancel workspace jobs (#5115)
* Add database column allow_user_cancel_workspace_jobs

* Adjust API

* site: typesGenerated.ts

* Expose template.allow_ in Workspaces API

* Fix: site tests

* Fix: make fmt/prettier

* Fix: enterprise

* Database tests

* Add CLI tests

* Add checkbox

* i18n

* Logic: block cancelling

* Unit tests for conditional cancel

* Fix: message

* Address PR comment

* Address PR comments

* Fix: make
2022-11-21 11:43:53 +01:00
Colin Adler ae38bbeab6 chore: refactor agent stats streaming (#5112) 2022-11-18 16:46:53 -06:00
Dean Sheather 69e8c9e7b4 feat: add reconnectingpty loadtest (#5083) 2022-11-17 16:57:15 +00:00
Ammar Bandukwala acf34d4295 site: support high build time variation in progress bar (#4941) 2022-11-17 16:56:56 +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
Colin Adler 66d20cabac fix: index GetWorkspaceAgentsByResourceIDs query (#5021) 2022-11-16 14:40:57 -06:00