Commit Graph

225 Commits

Author SHA1 Message Date
Kayla Washburn-Love a63d427efd
chore: add unique org name constraint to db (#13311) 2024-05-17 12:40:38 -06:00
Steven Masley cf91eff7cf
chore: implement databased backend for custom roles (#13295)
Includes db schema and dbauthz layer for upserting custom roles. Unit test in `customroles_test.go` verify against escalating permissions through this feature.
2024-05-16 13:11:26 -05:00
Kayla Washburn-Love fab5591cf6
chore: change `site_configs.value` to `text` (#13036)
* chore: change `site_configs.value` to `text`

* `make gen`
2024-04-22 17:25:36 -06:00
Spike Curtis a231b5aef5
feat: add src_id and dst_id indexes to tailnet_tunnels (#12911)
Fixes #12780

Adds indexes to the `tailnet_tunnels` table to speed up `GetTailnetTunnelPeerIDs` and `GetTailnetTunnelPeerBindings` queries, which match on `src_id` and `dst_id`.
2024-04-11 10:05:53 +04:00
Steven Masley a3187dc30f
chore: enforce unique linked_ids (#12815)
* chore: enforce unique linked_ids

Duplicate linked_ids make no sense. 2 users cannot share the same
source user from a provider
2024-04-03 13:17:11 -05:00
Mathias Fredriksson d50c20c453
fix(coderd/database): add fk index for `workspace_agent_scripts` (#12791) 2024-03-28 14:31:58 +02:00
Mathias Fredriksson 04f0510b09
feat(coderd/database): add `template_usage_stats` table and rollup query (#12664)
Add `template_usage_stats` table for aggregating tempalte usage data.
Data is rolled up by the `UpsertTemplateUsageStats` query, which fetches
data from the `workspace_agent_stats` and `workspace_app_stats` tables.
2024-03-22 18:33:34 +02:00
Steven Masley d789a60d47
chore: remove max_ttl from templates (#12644)
* chore: remove max_ttl from templates

Completely removing max_ttl as a feature on template scheduling. Must use other template scheduling features to achieve autostop.
2024-03-20 10:37:57 -05:00
Marcin Tojek cae769eac0
fix: implicit schema in dump (#12646) 2024-03-18 16:25:08 +01:00
Steven Masley b5f866c1cb
chore: add organization_id column to provisioner daemons (#12356)
* chore: add organization_id column to provisioner daemons
* Update upsert to include organization id on set
2024-03-06 12:04:50 -06:00
Dean Sheather 46a2ff1061
feat: allow setting port share protocol (#12383)
Co-authored-by: Garrett Delfosse <garrett@coder.com>
2024-03-06 09:23:57 -05:00
Asher f74532ff50
feat: audit oauth2 app management (#12275)
* Audit oauth2 app management
* Use 201 for creating secrets
2024-02-26 23:52:08 +00:00
Kayla Washburn-Love 475c3650ca
feat: add support for optional external auth providers (#12021) 2024-02-21 11:18:38 -07:00
Asher 4d39da294e
feat: add oauth2 token exchange (#12196)
Co-authored-by: Steven Masley <stevenmasley@gmail.com>
2024-02-20 14:58:43 -09:00
Steven Masley 2dac34276a
fix: add postgres triggers to remove deleted users from user_links (#12117)
* chore: add database test fixture to insert non-unique linked_ids
* chore: create unit test to exercise failed email change bug
* fix: add postgres triggers to keep user_links clear of deleted users
* Add migrations to prevent deleted users with links
* Force soft delete of users, do not allow un-delete
2024-02-20 13:19:38 -06:00
Steven Masley 2bf2f88b09
feat: implement 'is_default' org field (#12142)
The first organization created is now marked as "default". This is
to allow "single org" behavior as we move to a multi org codebase.

It is intentional that the user cannot change the default org at this
stage. Only 1 default org can exist, and it is always the first org.

Closes: https://github.com/coder/coder/issues/11961
2024-02-15 11:01:16 -06:00
Marcin Tojek 7a453608c9
feat: support `order` property of `coder_agent` (#12121) 2024-02-15 13:33:13 +01:00
Garrett Delfosse 3ab3a62bef
feat: add port-sharing backend (#11939) 2024-02-13 09:31:20 -05:00
Dean Sheather e1e352d8c1
feat: add template activity_bump property (#11734)
Allows template admins to configure the activity bump duration. Defaults to 1h.
2024-02-13 07:00:35 +00:00
Marcin Tojek 3e68650791
feat: support `order` property of `coder_app` resource (#12077) 2024-02-12 15:11:31 +01:00
Marcin Tojek c0e169ebf9
feat: support custom order of agent metadata (#12066) 2024-02-08 17:29:34 +01:00
Jon Ayers 4f5a2f0a9b
feat: add backend for jfrog xray support (#11829) 2024-01-29 19:30:02 -06:00
Cian Johnston f92336c4d5
feat(coderd): allow workspace owners to mark workspaces as favorite (#11791)
- Adds column `favorite` to workspaces table
- Adds API endpoints to favorite/unfavorite workspaces
- Modifies sorting order to return owners' favorite workspaces first
2024-01-24 13:39:19 +00:00
Marcin Tojek 5eb3e1cdaa
feat: expose `owner_name` in `coder_workspace` resource (#11639) 2024-01-17 13:20:45 +01:00
Cian Johnston 4355894b2b
fix(coderd/database): revert addition of v prefix to provisioner_daemons.api_version (#11403)
"Reverts" #11385 by adding an inverse migration.
2024-01-04 11:47:31 +00:00
Cian Johnston f80a1cf3c8
fix(coderd/database): add missing v prefix to provisioner_daemons.api_version (#11385) 2024-01-03 14:11:02 +00:00
Asher 5cfa34b31e
feat: add OAuth2 applications (#11197)
* Add database tables for OAuth2 applications

These are applications that will be able to use OAuth2 to get an API key
from Coder.

* Add endpoints for managing OAuth2 applications

These let you add, update, and remove OAuth2 applications.

* Add frontend for managing OAuth2 applications
2023-12-21 21:38:42 +00:00
Cian Johnston 213b768785
feat(coderd): insert provisioner daemons (#11207)
* Adds UpdateProvisionerDaemonLastSeenAt
* Adds heartbeat to provisioner daemons
* Inserts provisioner daemons to database upon start
* Ensures TagOwner is an empty string and not nil
* Adds COALESCE() in idx_provisioner_daemons_name_owner_key
2023-12-18 16:44:52 +00:00
Dean Sheather b36071c6bb
feat: allow templates to specify max_ttl or autostop_requirement (#10920) 2023-12-15 18:27:56 +10:00
Cian Johnston 5b0e6bfa2a
feat(coderd/database): add api_version to provisioner_daemons table (#11204)
Adds column api_version to the provisioner_daemons table.
This is distinct from the coderd version, and is used to handle breaking changes in the provisioner daemon API.
2023-12-14 12:52:41 +00:00
Cian Johnston 4f7ae6461b
feat(coderd/database): add UpsertProvisionerDaemons query (#11178)
Co-authored-by: Marcin Tojek <marcin@coder.com>
2023-12-13 12:31:40 +00:00
Cian Johnston b02796655e
fix(coderd/database): remove column updated_at from provisioner_daemons table (#11108) 2023-12-12 11:19:28 +00:00
Kayla Washburn 6775a86785
chore: make `"users"."avatar_url"` `NOT NULL` (#11112) 2023-12-11 10:09:51 -07:00
Kayla Washburn d8e95001e8
chore: add theme_preference column to users table (#11069) 2023-12-08 21:59:53 +00:00
Jon Ayers ce49a55f56
chore: update build_reason 'autolock' -> 'dormancy' (#11074) 2023-12-07 17:11:57 -06:00
Cian Johnston 5fad611020
feat(coderd): add last_seen_at and version to provisioner_daemons table (#11033)
Related to #10676

- Adds columns last_seen_at and version to provisioner_daemons table
- Adds the above to codersdk.ProvisionerDaemons struct
2023-12-05 13:54:38 +00:00
Colin Adler 8e684c8195
feat: run all migrations in a transaction (#10966)
Updates coder/customers#365

This PR updates our migration framework to run all migrations in a single transaction. This is the same behavior we had in v1 and ensures that failed migrations don't bring the whole deployment down. If a migration fails now, it will automatically be rolled back to the previous version, allowing the deployment to continue functioning.
2023-12-01 16:11:10 -06:00
Marcin Tojek 19b6d194fc
feat: manage health settings using Coder API (#10861) 2023-11-28 18:15:17 +01:00
Steven Masley abb2c7656a
chore: add claims to oauth link in db for debug (#10827)
* chore: add claims to oauth link in db for debug
2023-11-27 10:47:23 -06:00
Cian Johnston abafc0863c
feat(coderd): store workspace proxy version in the database (#10790)
Stores workspace proxy version in database upon registration.
2023-11-21 11:21:25 +00:00
Steven Masley 5229d7fd3a
feat: implement deprecated flag for templates to prevent new workspaces (#10745)
* feat: implement deprecated flag for templates to prevent new workspaces
* Add deprecated filter to template fetching
* Add deprecated to template table
* Add deprecated notice to template page
* Add ui to deprecate a template
2023-11-20 19:16:18 +00:00
Spike Curtis cac29e0b4d
feat: add tables for PGCoordinator v2 (#10442)
Adds tables for a simplified PG Coordinator that only considers Peers and Tunnels, rather than agent/client distinctions we have today.
2023-11-01 16:30:09 +04:00
Spike Curtis 7a8da08124
feat: add api_version column to workspace_agents (#10418)
Adds api_version to workspace_agents table

Part of #10399
2023-10-30 21:30:49 +04:00
Jon Ayers 997493d4ae
feat: add template setting to require active template version (#10277) 2023-10-18 17:07:21 -05:00
Steven Masley 39c0539d42
feat: add controls to template for determining startup days (#10226)
* feat: template controls which days can autostart
* Add unit test to test blocking autostart with DaysOfWeek
2023-10-13 11:57:18 -05:00
Steven Masley 69d13f1676
chore: add archive column to template versions (#10178)
* chore: add archive column to template versions
2023-10-10 10:52:42 -05:00
Kyle Carberry 863c2e7b64
feat: allow storing extra oauth token properties in the database (#10152) 2023-10-09 18:49:30 -05:00
Spike Curtis 983e8c3ae8
feat: add API support for workspace automatic updates (#10099)
* Added automatic_updates to workspaces table

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

* Queries and API updates

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

* Golden files

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

* Enable automatic updates on autostart

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

* db migration number

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

* fix imports and ts mock

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

* code review updates

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

---------

Signed-off-by: Spike Curtis <spike@coder.com>
2023-10-06 13:27:12 +04:00
Marcin Tojek ab9276bd08
feat: modify `workspace_agent_stats` index (#10073) 2023-10-05 14:49:08 +02:00
Steven Masley 5021e23105
chore: compute job status as column (#10024)
* chore: provisioner job status as column
* use provisioner job status for workspace searching
2023-10-04 20:57:46 -05:00