Commit Graph

396 Commits

Author SHA1 Message Date
c5afaffa7e fix: Tidy up closes for nicer output (#4605)
* fix: Tidy up closes for nicer output

There was a context canceled message that would appear
because of traces, and this was using the wrong close.

I don't think it was causing any specific problems, but
it could make a replica warning appear on restart.

* Fix migration and experimental
2022-10-17 18:36:23 -05:00
4e44716b0c docs: add high availability (#4583)
- Rename `CODER_DERP_SERVER_RELAY_ADDRESS`

Co-authored-by: Ammar Bandukwala <ammar@ammar.io>
2022-10-17 14:27:38 -05:00
29acd25b4e fix: chrome requests hanging over port-forward (#4588) 2022-10-17 11:45:29 -05:00
2ba4a62a0d feat: Add high availability for multiple replicas (#4555)
* feat: HA tailnet coordinator

* fixup! feat: HA tailnet coordinator

* fixup! feat: HA tailnet coordinator

* remove printlns

* close all connections on coordinator

* impelement high availability feature

* fixup! impelement high availability feature

* fixup! impelement high availability feature

* fixup! impelement high availability feature

* fixup! impelement high availability feature

* Add replicas

* Add DERP meshing to arbitrary addresses

* Move packages to highavailability folder

* Move coordinator to high availability package

* Add flags for HA

* Rename to replicasync

* Denest packages for replicas

* Add test for multiple replicas

* Fix coordination test

* Add HA to the helm chart

* Rename function pointer

* Add warnings for HA

* Add the ability to block endpoints

* Add flag to disable P2P connections

* Wow, I made the tests pass

* Add replicas endpoint

* Ensure close kills replica

* Update sql

* Add database latency to high availability

* Pipe TLS to DERP mesh

* Fix DERP mesh with TLS

* Add tests for TLS

* Fix replica sync TLS

* Fix RootCA for replica meshing

* Remove ID from replicasync

* Fix getting certificates for meshing

* Remove excessive locking

* Fix linting

* Store mesh key in the database

* Fix replica key for tests

* Fix types gen

* Fix unlocking unlocked

* Fix race in tests

* Update enterprise/derpmesh/derpmesh.go

Co-authored-by: Colin Adler <colin1adler@gmail.com>

* Rename to syncReplicas

* Reuse http client

* Delete old replicas on a CRON

* Fix race condition in connection tests

* Fix linting

* Fix nil type

* Move pubsub to in-memory for twenty test

* Add comment for configuration tweaking

* Fix leak with transport

* Fix close leak in derpmesh

* Fix race when creating server

* Remove handler update

* Skip test on Windows

* Fix DERP mesh test

* Wrap HTTP handler replacement in mutex

* Fix error message for relay

* Fix API handler for normal tests

* Fix speedtest

* Fix replica resend

* Fix derpmesh send

* Ping async

* Increase wait time of template version jobd

* Fix race when closing replica sync

* Add name to client

* Log the derpmap being used

* Don't connect if DERP is empty

* Improve agent coordinator logging

* Fix lock in coordinator

* Fix relay addr

* Fix race when updating durations

* Fix client publish race

* Run pubsub loop in a queue

* Store agent nodes in order

* Fix coordinator locking

* Check for closed pipe

Co-authored-by: Colin Adler <colin1adler@gmail.com>
2022-10-17 13:43:30 +00:00
a029817d3d feat: allow suffix after wildcard in wildcard access URL (#4524) 2022-10-14 18:25:11 +00:00
d898737d6d feat: app sharing (now open source!) (#4378) 2022-10-15 02:46:38 +10:00
4e57b9fbdc fix: allow regular users to push files (#4500)
- As part of merging support for Template RBAC
  and user groups a permission check on reading files
  was relaxed.

  With the addition of admin roles on individual templates, regular
  users are now able to push template versions if they have
  inherited the 'admin' role for a template. In order to do so
  they need to be able to create and read their own files. Since
  collisions on hash in the past were ignored, this means that a regular user
  who pushes a template version with a file hash that collides with
  an existing hash will not be able to read the file (since it belongs to
  another user).

  This commit fixes the underlying problem which was that
  the files table had a primary key on the 'hash' column.
  This was not a problem at the time because only template
  admins and other users with similar elevated roles were
  able to read all files regardless of ownership. To fix this
  a new column and primary key 'id' has been introduced to the files
  table. The unique constraint has been updated to be hash+created_by.
  Tables (provisioner_jobs) that referenced files.hash have been updated
  to reference files.id. Relevant API endpoints have also been updated.
2022-10-13 18:02:52 -05:00
2a1bfb3e44 docs: API tokens & CI automation (#4510)
* reword: chore: add CI to dogfood template

* use hardcoded URL

* use consistent name for tokens

* chore: add docs for template change management

* add an example

* fix case
2022-10-12 15:43:59 +00:00
0f3221f9d0 fix: use more descriptive login flags (#4493) 2022-10-11 18:45:30 +00:00
3cb2d52a08 fix: issue with token auth (#4483) 2022-10-11 15:58:28 +00:00
a70278e0e1 feat: make flags in one place (#4452) 2022-10-11 15:16:19 +00:00
2687e3db49 fix: bug with CODER_OAUTH2_GITHUB_ALLOW_SIGNUPS (#4451) 2022-10-10 16:19:37 -04:00
d22996ea20 fix: bug with TLS Client auth flag (#4450) 2022-10-11 05:26:27 +10:00
b1faaef482 feat: deployment flags (#4426) 2022-10-10 15:04:15 -04:00
3ad27b547f chore: Rename context in cli/agent (#4422)
Rename context from common `ctx` to `retryCtx` to avoid later re-use.

Also kind of a bug-fix since client post was using `cmd.Context()`.
2022-10-07 18:06:20 +00:00
3cc77d96eb feat: Add tunnel by default (#4399)
* feat: Add tunnel by default

If an access URL is not specified, we will always tunnel.

This is from community-member feedback who exclaimed that
it's confusing having the default for `coder server` display
a warning message, and I agree.

There is very little (maybe none) in running `coder server`
without tunnel and without an access URL, so this seems like
overall a much better UX.

* Update install.sh

Co-authored-by: Ben Potter <ben@coder.com>

* Update docs/install/packages.md

Co-authored-by: Ben Potter <ben@coder.com>

* Fix reset pass test

* Fix e2e test

Co-authored-by: Ben Potter <ben@coder.com>
2022-10-07 08:05:56 -05:00
3049a56355 fix: Use the maximum number of users for a license warning (#4410)
This was causing a banner on dev.coder.com. But now we have a test!
2022-10-06 20:59:25 -05:00
a89d6909b2 fix: show help on wraper commands (#4402) 2022-10-06 20:15:28 +00:00
f5df54831a feat: tokens (#4380) 2022-10-06 19:02:27 +00:00
ffbaa93722 feat: add experimental flag (#4364) 2022-10-04 19:45:00 +00:00
6325a9ea91 feat: support multiple certificates in coder server and helm (#4150) 2022-10-04 21:45:21 +10:00
738a38d71f chore: remove resources calls (#4344) 2022-10-03 21:01:13 +00:00
092a22f242 feat: Support for comma-separation and ranges in port-forward (#4166)
Fixes #3766
2022-10-03 11:58:43 +03:00
e6f568fcac refactor: cli: address comments from #4240 (#4259) 2022-09-29 11:04:37 +01:00
0c75ea6286 feat: coder ls should show possible columns to filter by (#4240)
* added showing columns in help call, need to format to make pretty

* finished formatting column  strings for print of list /ls command

Co-authored-by: Ali Diamond <user@ali.dev>
2022-09-28 16:39:44 -04:00
39cf329404 fix: Replace access URL for built-in DERP servers (#4197)
Fixes #4195.
2022-09-26 12:56:04 -05:00
413bfb8d58 fix: Retry reporting agent version (#4190)
It's possible that an agent starts before a build is reported
as complete. This ensures the version is successfully sent
before the startup completes.

Fixes #4151.
2022-09-25 11:11:36 -05:00
28428d1294 feat: Add custom version names (#4186)
Fixes #4137.
2022-09-23 20:17:36 -05:00
3c215a83b6 feat: Allow admins to create workspaces (#4183)
Fixes #3263.

This is now possible via the API, but still isn't possible via the UI.
2022-09-23 20:17:10 -05:00
4c8be34d81 feat: add health check monitoring to workspace apps (#4114) 2022-09-23 15:51:04 -04:00
f160830226 fix: Update default cache directory (#4175)
Fixes #2534.
2022-09-23 14:26:29 -05:00
6deef06ad2 feat: secure and cross-domain subdomain-based proxying (#4136)
Co-authored-by: Kyle Carberry <kyle@carberry.com>
2022-09-22 22:30:32 +00:00
a7ee8b31e0 fix: Don't use StatusAbnormalClosure (#4155) 2022-09-22 18:26:05 +00:00
57c84d6446 chore: add option for specifically disabling Coder tracing (#4153) 2022-09-22 11:53:08 -05:00
5e2efb68f1 feat: add SCIM provisioning via Okta (#4132)
Co-authored-by: Ben Potter <ben@coder.com>
2022-09-20 15:16:26 -05:00
2ca7214259 fix: Produce unknown subcommand errors for bad command names (#4089)
Fixes #1616
2022-09-20 15:31:38 +03:00
8d7954b015 fix: ignore context canceled error on server (#4128) 2022-09-19 23:56:51 -05:00
67230babc0 fix: properly shutdown tracers (#4127) 2022-09-19 23:35:18 -05:00
db0ba8588e chore: Refactor Enterprise code to layer on top of AGPL (#4034)
* chore: Refactor Enterprise code to layer on top of AGPL

This is an experiment to invert the import order of the Enterprise
code to layer on top of AGPL.

* Fix Garrett's comments

* Add pointer.Handle to atomically obtain references

This uses a context to ensure the same value persists through
multiple executions to `Load()`.

* Remove entitlements API from AGPL coderd

* Remove AGPL Coder entitlements endpoint test

* Fix warnings output

* Add command-line flag to toggle audit logging

* Fix hasLicense being set

* Remove features interface

* Fix audit logging default

* Add bash as a dependency

* Add comment

* Add tests for resync and pubsub, and add back previous exp backoff retry

* Separate authz code again

* Add pointer loading example from comment

* Fix duplicate test, remove pointer.Handle

* Fix expired license

* Add entitlements struct

* Fix context passing
2022-09-19 23:11:01 -05:00
714c366d16 chore: Remove WebRTC networking (#3881)
* chore: Remove WebRTC networking

* Fix race condition

* Fix WebSocket not closing
2022-09-19 19:46:29 -05:00
29d804e692 feat: add API key scopes and application_connect scope (#4067) 2022-09-19 17:39:02 +00:00
6f82ad09c8 fix: Improve consistency on CLI help (#4112)
This makes the english consistent on flags, and improves
the contrast for the placeholder color on dark themes.
2022-09-19 11:36:18 -05:00
68ee82437e fix: Remove hiding Tailscale flags (#4103)
Now that Tailscale is defualt, we shouldn't be hiding these!

Fixes #4083.
2022-09-18 20:24:26 -05:00
d499416024 housekeeping(branding): be consistent (#4075) 2022-09-19 09:57:18 +10:00
77acf0c340 feat: provisionerd tracing, add public trace ingestion (#4070) 2022-09-16 11:43:22 -05:00
b2bc74e3af chore: Skip TestPortForward due to flakes (#4081)
We'll have to fix this in a future PR... it's unfortunate but
these are *really* flakey.
2022-09-15 21:05:43 +00:00
87ab6ae8a0 fix: incorrect templates list test assert (#4079) 2022-09-15 15:03:29 -05:00
e847e7386a fix: Resolve flake in TestPortForward (#4069) 2022-09-14 20:21:53 -05:00
ec453f01e4 fix: Wait for connections before port-forwarding (#4057)
UDP packets were being dropped if a connection was started
before the Tailscale connection has been established.
2022-09-14 21:57:42 +00:00
22e49c4316 feat(cli): add error message for bad login URL (#4042) 2022-09-14 20:15:47 +00:00