de1a7a9210
chore: join user information to workspace_build and template_version ( #8625 )
...
* include minimial user on template version and build
* Add unit test to ensure join is superset
2023-07-25 09:14:38 -04:00
f827829afe
feat: synchronize oidc user roles ( #8595 )
...
* feat: oidc user role sync
User roles come from oidc claims. Prevent manual user role changes
if set.
* allow mapping 1:many
2023-07-24 08:34:24 -04:00
30fe153296
feat(coderd): add user latency and template insights endpoints ( #8519 )
...
Part of #8514
Refs #8109
2023-07-21 18:00:19 +00:00
b47d076756
feat: add deleting_at column to workspaces ( #8333 )
2023-07-20 22:01:11 -05:00
dc8b73168e
feat: add user quiet hours schedule and restart requirement feature flag ( #8115 )
2023-07-20 23:35:41 +10:00
aceedefce3
chore: add template_with_user
view to include user contextual data ( #8568 )
...
* chore: Refactor template sql queries to use new view
* TemplateWithUser -> Template
* Add unit test to enforce good view
2023-07-19 16:07:33 -04:00
67494a3012
chore: push GetUsers authorization filter to SQL ( #8497 )
...
* feat: push GetUsers filter to SQL
* Remove GetAuthorizedUserFilter
* Remove GetFilteredUserCount
* remove GetUsersWithCount
2023-07-17 09:44:58 -04:00
3b433181be
chore: add custom querier functions to dbgen ( #8496 )
...
* chore: add custom querier functions to dbgen
* chore: parse package was missing some imports, so force them
2023-07-13 13:12:29 -04:00
b5f26d9bdf
feat: add ability for users to convert their password login type to oauth/github login ( #8105 )
...
* Currently toggled by experiment flag
---------
Co-authored-by: Bruno Quaresma <bruno@coder.com >
2023-06-30 08:38:48 -04:00
749307ef08
feat: provide endpoint to lock/unlock workspace ( #8239 )
2023-06-28 16:12:49 -05:00
98a5ae7f48
feat: add provisioner job hang detector ( #7927 )
2023-06-25 13:17:00 +00:00
ba9d038d42
feat: add periodic cleanup of PG Coordinator state ( #8142 )
...
* PG Coordinator cleans orphaned state
Signed-off-by: Spike Curtis <spike@coder.com >
* Don't need pubsub
Signed-off-by: Spike Curtis <spike@coder.com >
---------
Signed-off-by: Spike Curtis <spike@coder.com >
2023-06-23 13:23:28 +04:00
1b0124ecdb
feat: automatically stop workspaces based on failure_ttl ( #7989 )
2023-06-22 00:33:22 -04:00
cc17d2feea
refactor: add postgres tailnet coordinator ( #8044 )
...
* postgres tailnet coordinator
Signed-off-by: Spike Curtis <spike@coder.com >
* Fix db migration; tests
Signed-off-by: Spike Curtis <spike@coder.com >
* Add fixture, regenerate
Signed-off-by: Spike Curtis <spike@coder.com >
* Fix fixtures
Signed-off-by: Spike Curtis <spike@coder.com >
* review comments, run clean gen
Signed-off-by: Spike Curtis <spike@coder.com >
* Rename waitForConn -> cleanupConn
Signed-off-by: Spike Curtis <spike@coder.com >
* code review updates
Signed-off-by: Spike Curtis <spike@coder.com >
* db migration order
Signed-off-by: Spike Curtis <spike@coder.com >
* fix log field name last_heartbeat
Signed-off-by: Spike Curtis <spike@coder.com >
* fix heartbeat_from log field
Signed-off-by: Spike Curtis <spike@coder.com >
* fix slog fields for linting
Signed-off-by: Spike Curtis <spike@coder.com >
---------
Signed-off-by: Spike Curtis <spike@coder.com >
2023-06-21 16:20:58 +04:00
69f911dfd5
feat: add queue_position and queue_size to provisioner jobs ( #8074 )
2023-06-20 15:07:18 -05:00
8dac0356ed
refactor: replace startup script logs EOF with starting/ready time ( #8082 )
...
This commit reverts some of the changes in #8029 and implements an
alternative method of keeping track of when the startup script has ended
and there will be no more logs.
This is achieved by adding new agent fields for tracking when the agent
enters the "starting" and "ready"/"start_error" lifecycle states. The
timestamps simplify logic since we don't need understand if the current
state is before or after the state we're interested in. They can also be
used to show data like how long the startup script took to execute. This
also allowed us to remove the EOF field from the logs as the
implementation was problematic when we returned the EOF log entry in the
response since requesting _after_ that ID would give no logs and the API
would thus lose track of EOF.
2023-06-20 14:41:55 +03:00
b1d1b63113
chore: ensure logs consistency across Coder ( #8083 )
2023-06-20 12:30:45 +02:00
0c5077464b
fix: avoid missed logs when streaming startup logs ( #8029 )
...
* feat(coderd,agent): send startup log eof at the end
* fix(coderd): fix edge case in startup log pubsub
* fix(coderd): ensure startup logs are closed on lifecycle state change (fallback)
* fix(codersdk): fix startup log channel shared memory bug
* fix(site): remove the EOF log line
2023-06-16 17:14:22 +03:00
a658c94a67
chore: automatically generate dbauthz when new queries are added ( #8007 )
...
* chore: automatically generate dbauthz when new queries are added
* Merge system functions
2023-06-13 13:40:46 -05:00
fa8153a0fd
chore: make default workspace proxy editable ( #7903 )
...
* chore: add editing the default workspace proxy
2023-06-08 10:30:15 -05:00
660bbb8d38
refactor: deprecate login_before_ready
in favor of startup_script_behavior
( #7837 )
...
Fixes #7758
2023-06-06 11:58:07 +03:00
93378daeb3
feat: sort users by username ( #7838 )
2023-06-06 08:47:59 +02:00
fa8f50a169
fix: fix workspace status filter returning more statuses that requested ( #7732 )
2023-06-05 18:12:10 -05:00
a7366a8b76
feat!: drop support for legacy parameters ( #7663 )
2023-06-02 11:16:46 +02:00
784696dfa5
feat: add prometheus metrics to database.Store ( #7713 )
...
* Adds dbmetrics package and wraps database.Store with a Prometheus HistogramVec of timings.
* Adds Wrappers method to database.Store to avoid double-wrapping interfaces
* Fixes test flake in TestLicensesListFake
2023-05-31 14:55:57 +01:00
c795a0e500
feat: Fix Deployment DAUs to work with local timezones ( #7647 )
...
* chore: Add timezone param to DAU SQL query
* Merge DAUs response
* Pass time offsets to metricscache
2023-05-30 13:18:27 -04:00
ec5ef51b49
feat: add session token injection to provisioner ( #7461 )
2023-05-17 23:29:22 -05:00
00a2413c03
feat: add telemetry support for workspace agent subsystem ( #7579 )
2023-05-17 22:49:25 -05:00
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
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
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
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
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
942aba3a66
feat: expose agent stats via Prometheus endpoint ( #7115 )
...
* WIP
* WIP
* WIP
* Agents
* fix
* 1min
* fix
* WIP
* Test
* docs
* fmt
* Add timer to measure the metrics collection
* Use CachedGaugeVec
* Unit tests
* WIP
* WIP
* db: GetWorkspaceAgentStatsAndLabels
* fmt
* WIP
* gauges
* feat: collect
* fix
* fmt
* minor fixes
* Prometheus flag
* fix
* WIP
* fix tests
* WIP
* fix json
* Rx Tx bytes
* CloseFunc
* fix
* fix
* Fixes
* fix
* fix: IgnoreErrors
* Fix: Windows
* fix
* reflect.DeepEquals
2023-04-14 16:14:52 +02:00
38e5b9679b
chore: Rbac errors should be returned, and not hidden behind 404 ( #7122 )
...
* chore: Rbac errors should be returned, and not hidden behind 404
SqlErrNoRows was hiding actual errors
* Replace sql.ErrNoRow checks
* Remove sql err no rows check from dbauthz test
* Fix to use dbauthz system user
2023-04-13 13:06:16 -05:00
a3c6cb1768
fix: don't query workspace in UpdateWorkspaceAgentConnectionByID
( #7042 )
2023-04-07 15:21:52 -05:00
eb66cc9f35
chore: move app proxying code to workspaceapps pkg ( #6998 )
...
* chore: move app proxying code to workspaceapps pkg
Moves path-app, subdomain-app and reconnecting PTY proxying to the new
workspaceapps.WorkspaceAppServer struct. This is in preparation for
external workspace proxies.
Updates app logout flow to avoid redirecting to coder-logout.${app_host}
on logout. Instead, all subdomain app tokens owned by the logging-out
user will be deleted every time you logout for simplicity sake.
Tests will remain in their original package, pending being moved to an
apptest package (or similar).
Co-authored-by: Steven Masley <stevenmasley@coder.com >
2023-04-05 13:41:55 -05:00
b4afbe7720
feat: Implement experiment gated CRUD for workspace proxies ( #6928 )
...
* feat: Implement basic moon crud
* chore: Implement enterprise endpoints for moons
2023-04-04 15:07:29 -05:00
e33941b7c2
feat: allow disabling autostart and custom autostop for template ( #6933 )
...
API only, frontend in upcoming PR.
2023-04-04 12:48:35 +00:00
ca4fa81570
feat: add agent metadata ( #6614 )
2023-03-31 15:26:19 -05:00
334d9820fa
fix(coderd): update provisionderd authz policy to allow updating user data ( #6925 )
2023-03-31 15:11:07 +01:00
665b84de0d
feat: use app tickets for web terminal ( #6628 )
2023-03-30 23:24:51 +10:00
42b3d90221
chore: rename "InsertOrUpdate" to Upsert around the codebase ( #6823 )
...
* chore: rename "InsertOrUpdate" to Upsert around the codebase
The shorter name uses up less line width, is easier to read
and is used more often.
* make gen
2023-03-28 00:55:10 +00:00
7fa5afa268
fix: Users that can update a template can also read the file ( #6776 )
...
* fix: Users that can update a template can also read the file
This currently has a strange RBAC story. An issue will be filed
to streamline this.
This is a hotfix to resolve current functionality
* Only showsource code tab if the user has permission to edit the template
---------
Co-authored-by: Bruno Quaresma <bruno_nonato_quaresma@hotmail.com >
2023-03-27 09:21:41 -05:00
8187992e7f
fix: Validate template version name ( #6804 )
...
* WIP
* Update
* Validation
2023-03-27 13:54:01 +02:00
cb7375450b
feat: add startup script logs to the ui ( #6558 )
...
* Add startup script logs to the database
* Add coderd endpoints for startup script logs
* Push startup script logs from agent
* Pull startup script logs on frontend
* Rename queries
* Add constraint
* Start creating log sending loop
* Add log sending to the agent
* Add tests for streaming logs
* Shorten notify channel name
* Add FE
* Improve bulk log performance
* Finish UI display
* Fix startup log visibility
* Add warning for overflow
* Fix agent queue logs overflow
* Display staartup logs in a virtual DOM for performance
* Fix agent queue with loads of logs
* Fix authorize test
* Remove faulty test
* Fix startup and shutdown reporting error
* Fix gen
* Fix comments
* Periodically purge old database entries
* Add test fixture for migration
* Add Storybook
* Check if there are logs when displaying features
* Fix startup component overflow gap
* Fix startup log wrapping
---------
Co-authored-by: Asher <ash@coder.com >
2023-03-23 14:09:13 -05:00
8857971552
feat(coder): Add PATCH /templateversions/:templateversion endpoint ( #6698 )
2023-03-23 13:26:50 -03:00
dab4a0e6ef
fix: add ResourceUserData
to provisionerd to allow git auth ( #6743 )
...
This was breaking passing a git auth token through!
2023-03-22 17:23:49 -05:00
ab764db8c8
chore: dbgen passing nil slices to postgres is not valid ( #6714 )
2023-03-22 09:10:49 -05:00
2321160c62
feat: Dbauthz is now default, remove out of experimental ( #6650 )
...
* feat: dbauthz always on, out of experimental
* Add ability to do rbac checks in unit tests
* Remove AuthorizeAllEndpoints
* Remove duplicate rbac checks
2023-03-21 09:10:22 -05:00