Commit Graph

418 Commits

Author SHA1 Message Date
Garrett Delfosse ddbae4da59 fix: error if protocol isn't specified in --access-url (#4835) 2022-11-01 12:59:37 -04:00
Colin Adler 4c5bf42355 feat: add option for exporting traces to a provided Honeycomb team (#4816) 2022-11-01 09:15:41 -05:00
Colin Adler cffb723ecc fix: small typos in proxy-trusted-headers help (#4811) 2022-10-31 17:00:04 +00:00
Bruno Quaresma 46e0953876 refactor: Show template versions as timeline (#4800) 2022-10-31 16:38:07 +00:00
Dean Sheather 10df2fd4fb feat: add new required slug property to coder_app, use in URLs (#4573) 2022-10-28 17:41:31 +00:00
Jon Ayers 90f77a3415 feat: add groups support to the CLI (#4755) 2022-10-27 16:49:35 -05:00
Kyle Carberry b34a67e6cb fix: Allow custom Git OAuth URLs (#4758)
Fixes an issue reported in Discord where custom endpoints
weren't working.
2022-10-27 10:38:05 -07:00
sonnysasaka 7d831e31c6 fix: Line gets erased due to updateJob (#4740)
The first updateJob should be called after the first printStage to
guarantee that only stage prints can get erased and overwritten,
otherwise there could be an unrelated line that gets erased.

fixes #3967
2022-10-25 10:27:44 -05:00
Kyle Carberry eec406b739 feat: Add Git auth for GitHub, GitLab, Azure DevOps, and BitBucket (#4670)
* Add scaffolding

* Move migration

* Add endpoints for gitauth

* Add configuration files and tests!

* Update typesgen

* Convert configuration format for git auth

* Fix unclosed database conn

* Add overriding VS Code configuration

* Fix Git screen

* Write VS Code special configuration if providers exist

* Enable automatic cloning from VS Code

* Add tests for gitaskpass

* Fix feature visibiliy

* Add banner for too many configurations

* Fix update loop for oauth token

* Jon comments

* Add deployment config page
2022-10-24 19:46:24 -05:00
Garrett Delfosse 585045b359 feat: support nested structs, structured arrays, and better secret value handling in config (#4727) 2022-10-25 00:11:00 +00:00
John 0783ca3793 cli: version to the $ coder header in CLI (#4709) 2022-10-24 11:17:48 -05:00
Kyle Carberry c41bdc21cb fix: Add names to config properties for the UI (#4718)
This was reverted in the configuration PR, which broke the UI.
2022-10-24 14:37:37 +00:00
Kyle Carberry bf3224e373 fix: Refactor agent to consume API client (#4715)
* fix: Refactor agent to consume API client

This simplifies a lot of code by creating an interface for
the codersdk client into the agent. It also moves agent
authentication code so instance identity will work between
restarts.

Fixes #3485 and #4082.

* Fix client reconnections
2022-10-23 22:35:08 -05:00
Kyle Carberry f75a54cd1e feat: Support x-forwarded-for headers for IPs (#4684)
* feat: Support x-forwarded-for headers for IPs

Fixes #4430.

* Fix realip accepting headers

* Fix unused headers
2022-10-23 13:21:49 -05:00
Dean Sheather d0fb054a55 fix: improve codersdk error messages when not JSON (#4495) 2022-10-21 23:36:31 +00:00
Kyle Carberry 7bc5b89f7a feat: Support config files with viper (#4696) 2022-10-21 17:08:23 -05:00
Garrett Delfosse e8537067ef Revert "Revert "Revert "feat: Support config files with viper"" (#4693)" (#4695)
This reverts commit 372fb1f345.
2022-10-21 16:07:38 -05:00
Garrett Delfosse 372fb1f345 Revert "Revert "feat: Support config files with viper"" (#4693) 2022-10-21 20:55:20 +00:00
Garrett Delfosse a2fb444911 Revert "feat: Support config files with viper (#4558)" (#4692)
This reverts commit c8e299c8f1.
2022-10-21 20:04:27 +00:00
Garrett Delfosse c8e299c8f1 feat: Support config files with viper (#4558) 2022-10-21 19:26:39 +00:00
Dean Sheather 47cb9abfc2 feat: support wildcard apps over tunnel (#4602) 2022-10-21 08:09:44 +10: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
Kyle Carberry 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
Kyle Carberry 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
Colin Adler 29acd25b4e fix: chrome requests hanging over port-forward (#4588) 2022-10-17 11:45:29 -05:00
Kyle Carberry 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
Dean Sheather a029817d3d feat: allow suffix after wildcard in wildcard access URL (#4524) 2022-10-14 18:25:11 +00:00
Dean Sheather d898737d6d feat: app sharing (now open source!) (#4378) 2022-10-15 02:46:38 +10:00
Jon Ayers 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
Ben Potter 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
Garrett Delfosse 0f3221f9d0 fix: use more descriptive login flags (#4493) 2022-10-11 18:45:30 +00:00
Garrett Delfosse 3cb2d52a08 fix: issue with token auth (#4483) 2022-10-11 15:58:28 +00:00
Garrett Delfosse a70278e0e1 feat: make flags in one place (#4452) 2022-10-11 15:16:19 +00:00
Garrett Delfosse 2687e3db49 fix: bug with CODER_OAUTH2_GITHUB_ALLOW_SIGNUPS (#4451) 2022-10-10 16:19:37 -04:00
Garrett Delfosse d22996ea20 fix: bug with TLS Client auth flag (#4450) 2022-10-11 05:26:27 +10:00
Garrett Delfosse b1faaef482 feat: deployment flags (#4426) 2022-10-10 15:04:15 -04:00
Mathias Fredriksson 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
Kyle Carberry 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
Kyle Carberry 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
Garrett Delfosse a89d6909b2 fix: show help on wraper commands (#4402) 2022-10-06 20:15:28 +00:00
Garrett Delfosse f5df54831a feat: tokens (#4380) 2022-10-06 19:02:27 +00:00
Garrett Delfosse ffbaa93722 feat: add experimental flag (#4364) 2022-10-04 19:45:00 +00:00
Dean Sheather 6325a9ea91 feat: support multiple certificates in coder server and helm (#4150) 2022-10-04 21:45:21 +10:00
Garrett Delfosse 738a38d71f chore: remove resources calls (#4344) 2022-10-03 21:01:13 +00:00
Mathias Fredriksson 092a22f242 feat: Support for comma-separation and ranges in port-forward (#4166)
Fixes #3766
2022-10-03 11:58:43 +03:00
Cian Johnston e6f568fcac refactor: cli: address comments from #4240 (#4259) 2022-09-29 11:04:37 +01:00
Ali Diamond 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
Kyle Carberry 39cf329404 fix: Replace access URL for built-in DERP servers (#4197)
Fixes #4195.
2022-09-26 12:56:04 -05:00
Kyle Carberry 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
Kyle Carberry 28428d1294 feat: Add custom version names (#4186)
Fixes #4137.
2022-09-23 20:17:36 -05:00