Commit Graph

648 Commits

Author SHA1 Message Date
eda85a0141 fix: force logs to flush on close in peer.(*Conn) (#1268) 2022-05-03 08:36:48 -05:00
9319c39257 fix: additional provisionerd test double closes (#1267) 2022-05-03 08:02:54 -05:00
55ad97bbd7 feat: add pprof and prometheus metrics to coder server (#1266) 2022-05-03 12:48:02 +00:00
5dcaf940b6 fix: Build site in deploy (#1265) v0.5.3 2022-05-02 23:12:13 +00:00
fd49a18b47 feat: Add "state" command to pull and push workspace state (#1264)
It's possible for a workspace to become in an invalid state.
This is something we'll detect for jobs, and allow monitoring of.

These commands will allow admins to manually reconcile state.
2022-05-02 17:51:58 -05:00
43c6bff5ae fix: Use "terraform state pull" instead of "terraform show" (#1262)
Although the terraform-exec docs don't indicate this, the result of
"terraform show" isn't actually the state... it's a trimmed version
of the state that excludes resource identifiers, essentially removing
all state that did exist.

Tests will be written to ensure Terraform state reconciliation can occur.
This will happen in another PR, as dogfood is currently broken because of this.
2022-05-02 20:02:38 +00:00
fc642edf51 fix: Use GoReleaser Action in deploy script (#1263)
This reduces conflictions with our Makefile, which is presently
primarily a user script.
2022-05-02 20:00:08 +00:00
81bef1c83e feat: add audit logging database schema (#1225) 2022-05-02 19:30:46 +00:00
e4e60256ac fix: Use "make build" on deploy (#1261)
This was a missed item in https://github.com/coder/coder/pull/1259.
2022-05-02 14:04:45 -05:00
dacc025cf3 fix: Adjust Makefile tagets to use dependencies (#1259)
It was getting slow to run `make gen` and other operations,
but this resolves it by targeting files properly.
2022-05-02 13:23:13 -05:00
2293d7efd1 chore: bump github.com/gohugoio/hugo from 0.97.3 to 0.98.0 (#1247)
Bumps [github.com/gohugoio/hugo](https://github.com/gohugoio/hugo) from 0.97.3 to 0.98.0.
- [Release notes](https://github.com/gohugoio/hugo/releases)
- [Changelog](https://github.com/gohugoio/hugo/blob/master/goreleaser.yml)
- [Commits](https://github.com/gohugoio/hugo/compare/v0.97.3...v0.98.0)

---
updated-dependencies:
- dependency-name: github.com/gohugoio/hugo
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-02 17:49:02 +00:00
9032b7e33f chore: bump github.com/open-policy-agent/opa from 0.39.0 to 0.40.0 (#1245)
Bumps [github.com/open-policy-agent/opa](https://github.com/open-policy-agent/opa) from 0.39.0 to 0.40.0.
- [Release notes](https://github.com/open-policy-agent/opa/releases)
- [Changelog](https://github.com/open-policy-agent/opa/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-policy-agent/opa/compare/v0.39.0...v0.40.0)

---
updated-dependencies:
- dependency-name: github.com/open-policy-agent/opa
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-02 17:36:02 +00:00
6dd378c194 chore: bump google.golang.org/api from 0.75.0 to 0.77.0 (#1249)
Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.75.0 to 0.77.0.
- [Release notes](https://github.com/googleapis/google-api-go-client/releases)
- [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md)
- [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.75.0...v0.77.0)

---
updated-dependencies:
- dependency-name: google.golang.org/api
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-02 17:32:27 +00:00
3d96785bf5 fix: Add lock around read/write of circular buffer (#1258)
This fixes a race seen in:
https://github.com/coder/coder/runs/6260926628?check_suite_focus=true#step:10:666
2022-05-02 17:31:04 +00:00
7fb3c5728b chore: bump gopkg.in/DataDog/dd-trace-go.v1 from 1.38.0 to 1.38.1 (#1246)
Bumps [gopkg.in/DataDog/dd-trace-go.v1](https://github.com/DataDog/dd-trace-go) from 1.38.0 to 1.38.1.
- [Release notes](https://github.com/DataDog/dd-trace-go/releases)
- [Commits](https://github.com/DataDog/dd-trace-go/compare/v1.38.0...v1.38.1)

---
updated-dependencies:
- dependency-name: gopkg.in/DataDog/dd-trace-go.v1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-02 17:16:45 +00:00
3176e10562 fix: Use atomic value for logger in peer (#1257)
This caused many races where logs would escape the tests
by milliseconds. By using an atomic on the logger,
we can fix all of it!
2022-05-02 11:49:59 -05:00
e531c0930c fix: Write agent logs to "/tmp/coder-agent.log" for debugging (#1239)
It was difficult to obtain logs for the agent if it failed to
start for some reason. Now they'll go to a consistent spot!
2022-05-02 16:36:51 +00:00
c2b5009208 fix: Unnest workspaces command to the top-level (#1241)
This changes all "coder workspace *" commands to root.
A few of these were already at the root, like SSH. The
inconsistency made for a confusing experience.
2022-05-02 11:08:52 -05:00
252d868298 fix: Prefix buildinfo tag with "v" (#1256)
This fixes the format of production and development build
tags.
2022-05-02 15:58:36 +00:00
d139a16446 fix: Allow remote state to be used with Terraform (#1242)
The Terraform Provisioner depended on the statefile content
being at a specific path, which disallowed the use of external
state providers. This fixes it!
2022-05-02 15:41:27 +00:00
aaf6aee979 fix: clarify AWS access key ID vs secret (#1231) 2022-05-02 10:28:58 -05:00
8701e0084c feat: Update Terraform provider to support "dir" in "coder_agent" (#1219)
This allows users to specify a starting directory for shell sessions.
2022-05-02 10:27:34 -05:00
a79aa6418a fix: Use cliui.WorkspaceBuild to prevent cancel of builds jobs (#1255)
Build jobs cannot gracefully terminate because Terraform generally
cannot gracefully terminate.
2022-05-02 10:20:47 -05:00
75343288ff feat: Add user menu on users table (#1222) 2022-05-02 14:58:49 +00:00
a71f3934c5 chore: bump github.com/go-playground/validator/v10 (#1254)
Bumps [github.com/go-playground/validator/v10](https://github.com/go-playground/validator) from 10.10.1 to 10.11.0.
- [Release notes](https://github.com/go-playground/validator/releases)
- [Commits](https://github.com/go-playground/validator/compare/v10.10.1...v10.11.0)

---
updated-dependencies:
- dependency-name: github.com/go-playground/validator/v10
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-02 08:21:35 -05:00
2043d1a4cc chore: Port ConfirmDialog from v1 (#1228) 2022-05-02 08:17:15 -05:00
4ff5734720 chore: bump github.com/charmbracelet/charm from 0.11.0 to 0.12.0 (#1248)
Bumps [github.com/charmbracelet/charm](https://github.com/charmbracelet/charm) from 0.11.0 to 0.12.0.
- [Release notes](https://github.com/charmbracelet/charm/releases)
- [Changelog](https://github.com/charmbracelet/charm/blob/main/.goreleaser.yml)
- [Commits](https://github.com/charmbracelet/charm/compare/v0.11.0...v0.12.0)

---
updated-dependencies:
- dependency-name: github.com/charmbracelet/charm
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-02 07:59:46 -05:00
34dbca7166 fix: Remove unnecessary warnings on SSH (#1243)
This disables the "Warning: Permanently added 'hostname' (RSA) to the list of known hosts."
message from appearing on every SSH. This happens because we ignore the known hosts.
2022-05-01 20:31:22 -05:00
9b37a0de31 fix: Disable ErrorLog in http.Server (#1244)
Vault does similarly: e2490059d0/command/server.go (L2714)

These messages have primarily been noise.
2022-05-01 20:31:12 -05:00
b948f2dab5 fix: Use environment variables for agent authentication (#1238)
* fix: Update GIT_COMMITTER_NAME to use username

This was a mistake when adding the committer fields 🤦.

* fix: Use environment variables for agent authentication

Using files led to situations where running "coder server --dev" would
break `gitssh`. This is applicable in a production environment too. Users
should be able to log into another Coder deployment from their workspace.

Users can still set "CODER_URL" if they'd like with agent env vars!
v0.5.2
2022-04-30 16:40:30 +00:00
eb606924ab fix: Update GIT_COMMITTER_NAME to use username (#1237)
This was a mistake when adding the committer fields 🤦.
2022-04-29 20:51:11 -05:00
2acdd3b44f fix: Add "GIT_COMMITTER_*" to remove Git prompt (#1236) 2022-04-30 01:22:17 +00:00
e15566c7fa test: Regenerate GitSSHKey flake when comparing times (#1235)
This is a crazy one! The in-memory DB is fast, which allows the same
exact timestamp to occur for regenerating the key!

See: https://github.com/coder/coder/runs/6234173911?check_suite_focus=true#step:9:82
2022-04-29 20:19:16 -05:00
81577f120a feat: Add web terminal with reconnecting TTYs (#1186)
* feat: Add web terminal with reconnecting TTYs

This adds a web terminal that can reconnect to resume sessions!
No more disconnects, and no more bad bufferring!

* Add xstate service

* Add the webpage for accessing a web terminal

* Add terminal page tests

* Use Ticker instead of Timer

* Active Windows mode on Windows
2022-04-29 17:30:10 -05:00
23e5636dd0 fix: Use verified and primary email for GitHub signup (#1230)
This was causing a panic due to nil pointer dereference.
It required all users signing up had a public email,
which is an unreasonable requirement!
2022-04-29 15:13:35 -05:00
021e4cd957 refactor: Load users from the API (#1218) 2022-04-29 13:59:14 -05:00
69e26c4036 feat: Allow using username in user queries (#1221)
* feat: Allow using username in user queries
* Test needs a username/email to not match empty string
2022-04-29 11:44:22 -05:00
365c96ccaa chore: bump @fontsource/fira-code from 4.5.8 to 4.5.9 in /site (#1188)
Bumps [@fontsource/fira-code](https://github.com/fontsource/fontsource/tree/HEAD/fonts/google/fira-code) from 4.5.8 to 4.5.9.
- [Release notes](https://github.com/fontsource/fontsource/releases)
- [Changelog](https://github.com/fontsource/fontsource/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fontsource/fontsource/commits/HEAD/fonts/google/fira-code)

---
updated-dependencies:
- dependency-name: "@fontsource/fira-code"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-29 15:58:33 +00:00
a3decc4fba chore: bump eslint-plugin-react-hooks from 4.4.0 to 4.5.0 in /site (#1190)
Bumps [eslint-plugin-react-hooks](https://github.com/facebook/react/tree/HEAD/packages/eslint-plugin-react-hooks) from 4.4.0 to 4.5.0.
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/main/packages/eslint-plugin-react-hooks/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/HEAD/packages/eslint-plugin-react-hooks)

---
updated-dependencies:
- dependency-name: eslint-plugin-react-hooks
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-29 10:55:15 -05:00
27811976ad chore: bump ts-loader from 9.2.8 to 9.2.9 in /site (#1192)
Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 9.2.8 to 9.2.9.
- [Release notes](https://github.com/TypeStrong/ts-loader/releases)
- [Changelog](https://github.com/TypeStrong/ts-loader/blob/main/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/ts-loader/compare/v9.2.8...v9.2.9)

---
updated-dependencies:
- dependency-name: ts-loader
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-29 10:54:54 -05:00
3ebe1d27b1 chore: bump @playwright/test from 1.21.0 to 1.21.1 in /site (#1191)
Bumps [@playwright/test](https://github.com/Microsoft/playwright) from 1.21.0 to 1.21.1.
- [Release notes](https://github.com/Microsoft/playwright/releases)
- [Commits](https://github.com/Microsoft/playwright/compare/v1.21.0...v1.21.1)

---
updated-dependencies:
- dependency-name: "@playwright/test"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-29 10:54:39 -05:00
35211e2190 feat: Add user roles, but do not yet enforce them (#1200)
* chore: Rework roles to be expandable by name alone
2022-04-29 09:04:19 -05:00
ba4c3ce3b9 feat: add filter by status on GET /users (#1206) 2022-04-29 08:29:53 -05:00
82364d174f fix: ensure rtc state changes can't log after close (#1213) 2022-04-28 16:38:59 -05:00
00cac37a07 chore: force desktop view on mobile (#1214) 2022-04-28 17:05:03 -04:00
c16f105727 feat: Create user page (#1197)
* Add button and route

* Hook up api

* Lint

* Add basic form

* Get users on page mount

* Make cancel work

* Creating -> idle bc users page refetches

* Import as TypesGen

* Handle api errors

* Lint

* Add handler

* Add FormFooter

* Add FullPageForm

* Lint

* Better form, error, stories

bug in formErrors story

* Make detail optional

* Use Language

* Remove detail prop

* Add back autoFocus

* Remove displayError, use displaySuccess

* Lint, export Language

* Tests - wip

* Fix cancel tests

* Switch back to mock

* Add navigate to xservice

Doesn't work in test

* Move error type predicate to xservice

* Lint

* Switch to using creation mode in XState

still problems in tests

* Lint

* Lint

* Lint

* Revert "Switch to using creation mode in XState"

This reverts commit cf8442fa4b.

* Give XService a navigate action

* Add missing validation messages

* Fix XState warning

* Fix tests

IRL is broken bc I need to send org id

* Pretend user has org id and make it work

* Format

* Lint

* Switch to org ids array

* Skip lines between tests

Co-authored-by: G r e y <grey@coder.com>

* Punctuate notification messages

Co-authored-by: G r e y <grey@coder.com>
2022-04-28 16:32:23 -04:00
4efde58726 fix: Restore static credentials for develop.sh (#1212) 2022-04-28 21:47:35 +03:00
1661588bd1 fix: user passwords cleanup (#1202)
1. Adds benchmarks comparing bcrypt and our pbkdf2 settings
1. Changes the pbkdf2 hash iterations back to 65k. 1024 is insecure
1. Gets rid of the short circuit when the user isn't found, preventing
   timing attacks which can reveal which emails exist on a deployment

```
$ go test -bench .
goos: linux
goarch: amd64
pkg: github.com/coder/coder/coderd/userpassword
cpu: Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
BenchmarkBcryptMinCost-16        	    1651	    702727 ns/op	    5165 B/op      10 allocs/op
BenchmarkPbkdf2MinCost-16        	    1669	    714843 ns/op	     804 B/op      10 allocs/op
BenchmarkBcryptDefaultCost-16    	      27	  42676316 ns/op	    5246 B/op      10 allocs/op
BenchmarkPbkdf2-16               	      26	  45902236 ns/op	     804 B/op      10 allocs/op
PASS
ok  	github.com/coder/coder/coderd/userpassword	5.036s
```
2022-04-28 18:22:38 +00:00
e330dc1321 feat: Switch packages for typescript generation code (#1196)
* feat: Switch packages for typescript generation code

Supports a larger set of types
  - [x] Basics (string/int/etc) 
  - [x] Maps
  - [x] Slices
  - [x] Enums
  - [x] Pointers
2022-04-28 16:59:14 +00:00
afc43fe95f feat: Generate random admin user password in dev mode (#1207)
* feat: Generate random admin user password in dev mode

* Add dev mode test with email/pass from env

* Set email/pass for playwright e2e test via cli flags
v0.5.1
2022-04-28 19:13:44 +03:00