Commit Graph

87 Commits

Author SHA1 Message Date
Steven Masley 94a3e3a563
chore: allow terraform & echo built-in provisioners (#13121)
* chore: allow terraform & echo built-in provisioners

Built-in provisioners serve all specified types. This allows running terraform, echo, or both in built in.
The cli flag to control the types is hidden by default, to be used primarily for testing purposes.
2024-05-03 10:14:26 -05:00
Danny Kopping 79fb8e43c5
feat: expose workspace statuses (with details) as a prometheus metric (#12762)
Implements #12462
2024-04-02 09:57:36 +02:00
elasticspoon cfb94284e0
feat(cli): add golden tests for errors (#11588) (#12698)
* feat(cli): add golden tests for errors (#11588)

Creates golden files from `coder/cli/errors.go`.
Adds a unit test to test against golden files.
Adds a make file command to regenerate golden files.
Abstracts test against golden files.
2024-04-01 09:19:26 -05:00
Colin Adler 37a05372fa
fix: disable relay if built-in DERP is disabled (#12654)
Fixes https://github.com/coder/coder/issues/12493
2024-03-21 16:53:41 -05:00
Cian Johnston 5454f4997b
chore(ci): clean up databases after test finishes in CI (#12702) 2024-03-21 14:53:16 +00:00
Kyle Carberry 895df54051
fix: separate signals for passive, active, and forced shutdown (#12358)
* fix: separate signals for passive, active, and forced shutdown

`SIGTERM`: Passive shutdown stopping provisioner daemons from accepting new
jobs but waiting for existing jobs to successfully complete.

`SIGINT` (old existing behavior): Notify provisioner daemons to cancel in-flight jobs, wait 5s for jobs to be exited, then force quit.

`SIGKILL`: Untouched from before, will force-quit.

* Revert dramatic signal changes

* Rename

* Fix shutdown behavior for provisioner daemons

* Add test for graceful shutdown
2024-03-15 13:16:36 +00:00
Cian Johnston eba8cd7c07
chore: consolidate various randomPort() implementations (#12362)
Consolidates our existing randomPort() implementations to package testutil
2024-02-29 12:51:44 +00:00
Cian Johnston 2b307c7c4e
fix(cli/server): do not redirect /healthz (#12080) 2024-02-09 13:44:47 +00:00
Steven Masley b246f08d84
chore: move app URL parsing to its own package (#11651)
* chore: move app url parsing to it's own package
2024-01-17 10:41:42 -06:00
Spike Curtis 5173bce5cc
fix: stop redirecting DERP and replicasync http requests (#10752)
Fixes an issue where setting CODER_REDIRECT_TO_ACCESS_URL breaks use of multiple Coder server replicas for DERP traffic.
2023-11-20 14:46:59 +04:00
Dean Sheather 95e5419626
chore: fail server startup on invalid DERP map (#10536) 2023-11-06 23:04:07 +10:00
Kyle Carberry 45b53c285f
feat: allow external services to be authable (#9996)
* feat: allow external services to be authable

* Refactor external auth config structure for defaults

* Add support for new config properties

* Change the name of external auth

* Move externalauth -> external-auth

* Run gen

* Fix tests

* Fix MW tests

* Fix git auth redirect

* Fix lint

* Fix name

* Allow any ID

* Fix invalid type test

* Fix e2e tests

* Fix comments

* Fix colors

* Allow accepting any type as string

* Run gen

* Fix href
2023-10-03 14:04:39 +00:00
Steven Masley 92308bec3b
chore: color `value_source` for deployment values (#9922)
* chore: Return populated options vs a blank
* Strip secret values
2023-09-29 12:04:28 -05:00
Ammar Bandukwala b63dfe7b75
perf(cli): optimize CPU consumption of help pages (#9607)
This change reduces the CPU consumption of --help by ~50%.

Also, this change removes ANSI escape codes from our golden files. I
don't think those were worth the inability to parallelize golden file tests and
global state fragility.
2023-09-14 19:48:29 -05:00
Cian Johnston 7d7c84bb4d
feat(coderd): connect dbcrypt package implementation (#9523)
See also: https://github.com/coder/coder/pull/9522

- Adds commands `server dbcrypt {rotate,decrypt,delete}` to re-encrypt, decrypt, or delete encrypted data, respectively.
- Plumbs through dbcrypt in enterprise/coderd (including unit tests).
- Adds documentation in admin/encryption.md.

This enables dbcrypt by default, but the feature is soft-enforced on supplying external token encryption keys. Without specifying any keys, encryption/decryption is a no-op.
2023-09-07 15:49:49 +01:00
Ammar Bandukwala 6ba92ef924
ci: enable gocognit (#9359)
And, bring the server under 300:

* Removed the undocumented "disable" STUN address in favor of the
--disable-direct flag.
2023-08-27 14:46:44 -05:00
Kyle Carberry 22e781eced
chore: add /v2 to import module path (#9072)
* chore: add /v2 to import module path

go mod requires semantic versioning with versions greater than 1.x

This was a mechanical update by running:
```
go install github.com/marwan-at-work/mod/cmd/mod@latest
mod upgrade
```

Migrate generated files to import /v2

* Fix gen
2023-08-18 18:55:43 +00:00
Colin Adler 612f1c6a55
chore: use echo provisioners in logging tests (#9008) 2023-08-09 19:03:02 +00:00
Ammar Bandukwala 25e30c6f41
feat(cli): support fine-grained server log filtering (#8748) 2023-07-26 16:46:22 -05:00
Steven Masley 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
Cian Johnston 6e598234b6
fix: only collect prometheus database metrics when explicitly enabled (#8045)
* fix: only collect prometheus database metrics when explicitly enabled

* add missing test

* de-duplicate wrapping
2023-06-15 12:34:16 +01:00
Steven Masley 065206345e
test: add golden files to enterprise cli (#7924)
* test: Add golden files to enterprise cli
2023-06-09 11:35:20 -05:00
Mathias Fredriksson 05efd64320
test: Skip tests that send `os.Interrupt` to test pid (#7695)
This can cause test flakes due to clitest commands running in memory and
listening to interrupt signals.
2023-05-26 16:17:09 +03:00
Kyle Carberry 6e7175b589
chore: fix lengthy tests in psql (#7545)
* chore: fix lengthy tests in psql

This was adding at a minimum 3mins to our psql tests!

* fix: automatically cancel tests on cleanup
2023-05-17 11:26:53 -05: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
Ammar Bandukwala c6b2861493
feat: allow disabling stun addresses via env (#7066)
* feat: allow disabling stun addresses via env

Resolves #6791

* Specify a dummy access URL so the tunnel wouldn't start

* Document

---------

Co-authored-by: Kyle Carberry <kyle@carberry.com>
2023-04-17 17:20:26 +00:00
Kevin Conley 4dd5d79412
fix: Parse `CODER_GITAUTH_N_NO_REFRESH` env var value instead of key (#7051) 2023-04-11 09:18:17 -05:00
Ammar Bandukwala 4b99e2d07e
feat: add YAML support to server (#6934) 2023-04-07 22:58:21 +00:00
Dean Sheather 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
Cian Johnston 9c4ccd76a0
fix(coderd)!: add CODER_OIDC_IGNORE_USERINFO configuration option (#6922)
* add CODER_OIDC_IGNORE_USERINFO option
* chore: update docs for CODER_OIDC_IGNORE_USERINFO w.r.t ADFS
* fix!: codersdk: fix incorrectly named OIDC_GROUP_MAPPING -> CODER_OIDC_GROUP_MAPPING
2023-04-05 09:07:43 +01:00
Ammar Bandukwala 599699b3a9
fix: truly allow overridding default string array (#6874) 2023-03-31 12:12:03 -05:00
Cian Johnston 563c3ade06
feat: allow configuring OIDC email claim and OIDC auth url parameters (#6867)
This commit:

- Allows configuring the OIDC claim Coder uses for email addresses (by default, this is still email)
- Allows customising the parameters sent to the upstream identity provider when requesting a token. This is still access_type=offline by default.
- Updates documentation related to the above.
2023-03-30 09:36:57 +01:00
Ammar Bandukwala 2bd6d2908e
feat: convert entire CLI to clibase (#6491)
I'm sorry.
2023-03-23 17:42:20 -05:00
Ammar Bandukwala 3b73321a6c
feat: refactor deployment config (#6347) 2023-03-07 15:10:01 -06:00
Kyle Carberry 1617268859
fix: stop redirecting away from wildcard url (#6113)
Fixes #6097.
2023-02-08 13:48:17 -06:00
Kyle Carberry b9b402cd0c
feat!: generate a self-signed certificate if no certificates are specified (#5973)
* feat: generate a self-signed certificate if no certificates are specified

Clouds like AWS automatically navigate to https://<ip-here>. This
allows us to bind to that immediately, serve a self-signed certificate,
then reroute to the access URL.

* Add new flag and deprecate old one

* Fix redirect if not using tunnel

* Add deprecation notice

* Fix TLS redirect

* Run `make gen`

* Fix bad test

* Fix gen
2023-02-02 17:08:35 +00:00
Ben Potter a040bcc0cf
docs: clarify access URL in install flow (#5626)
* fix: TLS disabled copy

* clarify default access URL

* add docs for coder address
2023-01-18 23:23:55 +00:00
Mathias Fredriksson 145d101512
test: Refactor ptytest to use contexts and less duplication (#5740) 2023-01-17 16:02:38 +02:00
Mathias Fredriksson db7877012c
test: Fix flaky TestServer/Logging/{Multiple,Stackdriver} (#5727)
* test: Fix flaky TestServer/Logging/Multiple

* test: Fix flaky TestServer/Logging/Stackdriver

* test: Add testutil.TempFile and testutil.CreateTemp, cleanup tests
        relying on temp file
2023-01-17 14:14:29 +02:00
Colin Adler dcab87358e
feat: add stackdriver and json log options to `coder server` (#5682) 2023-01-12 20:08:23 -06:00
Colin Adler 7bcbf197c1
fix: print correct listen adress in `coder server` (#5634) 2023-01-09 13:59:23 -06:00
Dean Sheather f1fe2b5c06
feat: add GPG forwarding to coder ssh (#5482) 2023-01-06 07:52:19 +00:00
Mathias Fredriksson c7ce3e70da
feat: Add --raw-url to coder server postgres-builtin-* commands (#5478) 2022-12-20 18:51:17 +00:00
Dean Sheather 31d38d4246
feat: allow http and https listening simultaneously (#5365) 2022-12-15 20:09:19 +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
Mathias Fredriksson 9fb710a04f
feat: Add allow everyone option to GitHub OAuth2 logins (#5086)
* feat: Add allow everyone option for GitHub OAuth

* fix: Detect team when multiple orgs are present

Co-authored-by: 李董睿煊 <dongruixuan@hotmail.com>
2022-11-15 18:56:46 +02:00
Kyle Carberry 49c7648af5
chore: Close idle connections on test cleanup (#4993)
It's possible that this was the source of a leak on Windows...
2022-11-13 14:06:03 -06:00
Dean Sheather 8e5af82275
feat: add api-rate-limit flag (#5013) 2022-11-10 21:53:48 +00:00
Garrett Delfosse ddbae4da59
fix: error if protocol isn't specified in --access-url (#4835) 2022-11-01 12:59:37 -04:00
Kyle Carberry 3c40698033
chore: Enforce PostgreSQL >=13 (#4612)
* chore: Enforce PostgreSQL >=13

Fixes #4608.

* Fix version string parsing
2022-10-17 20:02:25 -05:00