Commit Graph

81 Commits

Author SHA1 Message Date
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
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
2022-04-28 19:13:44 +03:00
8661f92a10 feat: Output username and password for code server --dev (#1193)
Fixes #825
2022-04-27 17:59:37 +03:00
f9ce54a51e fix: Increase default provisioner daemons to 3 (#1180)
It's odd to only build one workspace at a time as a default.
2022-04-26 07:19:17 -05:00
877854a2f3 fix: Display proper access URL on server start (#1172)
Fixes #1170.
2022-04-25 23:30:22 +00:00
88669fd578 feat: Move workspaces under organizations (#1109)
This removes split ownership for workspaces. They are now
a resource of organizations and have a designated owner,
which is a user.

This enables simple administration for commands like:
- `coder stop ben/dev`
- `coder build logs colin/arch`

or if we decide to allow administrators to access workspaces,
they could even SSH using this syntax: `coder ssh colin/dev`.
2022-04-25 16:11:03 -05:00
9056c53054 fix: Disable known hosts checking for config-ssh (#1150)
This was causing the remote identity changed message.
We don't need to verify remote hosts because we
already auth via our API.
2022-04-25 18:59:18 +00:00
a2dd618849 feat: Use environment variables and startup script in agent (#1147)
These values were ignored. Environment variables are applied to
new sessions, and are refreshed on reconnect. This is cool because
a workspace could be updated with new environment variables without
requiring a complete start/stop.

The startup script is only ran once regardless of changes, which
feels like the expected behavior.
2022-04-25 18:30:39 +00:00
09405ddc40 test: Wait for WorkspaceResources to complete before exiting (#1149)
This caused a flake seen in:
https://github.com/coder/coder/runs/6162655678?check_suite_focus=true#step:9:87
2022-04-25 18:11:35 +00:00
7e33d80fa9 feat: Add helper output on failed gitssh (#1127) 2022-04-25 00:29:15 -05:00
4417dd5951 feat: Add STUN servers to enable P2P (#1126)
This exposes a `--stun-server` option for listing
STUN servers. By default it uses the Google STUN
server, but this is not required.
2022-04-25 04:52:07 +00:00
c8e566fe42 feat: Add links for registering git key (#1125) 2022-04-25 04:27:45 +00:00
8ff0c8b02a fix: Write agent URL to file for gitssh (#1123)
This was broken because gitssh couldn't find the URL.
Now it can, and SSH is confirmed to work on dogfood! 🥳
2022-04-25 04:06:52 +00:00
abc13c5a92 fix: use fmt.Fprintln to print workspaces table (#1122) 2022-04-25 04:04:34 +00:00
885d5f2098 fix: Monitor TTY size when using SSH (#1119)
The TTY wasn't resizing properly, and reasonably so considering
we weren't updating it 🤦.
2022-04-24 22:23:54 -05:00
be974cf280 feat: Add users create and list commands (#1111)
This allows for *extremely basic* user management.
2022-04-24 20:08:26 -05:00
7496c3da81 feat: Add GitHub OAuth (#1050)
* Initial oauth

* Add Github authentication

* Add AuthMethods endpoint

* Add frontend

* Rename basic authentication to password

* Add flags for configuring GitHub auth

* Remove name from API keys

* Fix authmethods in test

* Add stories and display auth methods error
2022-04-23 22:58:57 +00:00
3976994781 chore: Rename "start" to "server" (#1110)
Workspace commands will be aliased at the top-level, so
"start" would easily be confused with starting a workspace.

Server seems like a more appropriate name too.
2022-04-23 12:19:20 -05:00
8165a6ef75 feat: Add spooky hidden flag (#1065) 2022-04-19 16:40:01 +00:00
5ce06769cd chore: replace todos with issues (#1066) 2022-04-19 12:16:57 -04:00
c8246e3e8a feat: Add Azure instance identitity authentication (#1064)
This enables zero-trust authentication for Azure instances. Now
we support the three major clouds: AWS, Azure, and GCP 😎.
2022-04-19 13:48:13 +00:00
d202f20fdb feat: Add TURN proxying to enable offline deployments (#1000)
* Add turnconn

* Add option for passing ICE servers

* Log TURN remote address

* Add TURN server to coder start
2022-04-18 22:40:25 +00:00
6d948ffba2 fix: Panic if Terraform fails installation (#1056) 2022-04-18 15:11:59 -05:00
d98b7ec469 fix: Test flake for DataDog agent logs (#1026)
Sometimes the DataDog agent would fail to connect and
angrily log using the standard lib logger. This would
fail tests. See:

https://github.com/coder/coder/runs/6038192436?check_suite_focus=true
2022-04-18 12:37:01 -05:00
af672803a2 autostart/autostop: move to traditional 5-valued cron string for compatibility (#1049)
This PR modfies the original 3-valued cron strings used in package schedule to be traditional 5-valued cron strings.

- schedule.Weekly will validate that the month and dom fields are equal to *
- cli autostart/autostop will attempt to detect local timezone using TZ env var, defaulting to UTC
- cli autostart/autostop no longer accepts a raw schedule -- instead use the --minute, --hour, --dow, and --tz arguments.
- Default schedules are provided that should suffice for most users.

Fixes #993
2022-04-18 11:04:48 -05:00
f803e37505 chore: use workspace name as arg in coder workspaces create (#1007) 2022-04-14 17:23:20 +00:00
7090227d38 fix: GitSSH test flake on slow CI runs (#1001)
There was a 5s timeout on the context, which was occasionally
hit during slow runs. See:

https://github.com/coder/coder/runs/6025622326?check_suite_focus=true

I also removed the AWS authentication, because it added to the test
time for key-generation and such.
2022-04-14 11:38:54 -05:00
fed02cdcdc chore: replace cloudflare dev tunnel with frp (#867) 2022-04-14 11:29:40 -04:00
027d89dd9b chore: Add alias coder agent (#986) 2022-04-13 20:55:55 +00:00
6edd7cb036 fix: typo in create workspaces command hint (#995)
Resolves: #994
2022-04-13 15:30:58 +00:00
e8b310166f fix: Remove resource addresses (#982)
These were added under the impression that there was significant
user-experience impact if multiple resources share the same name.

This hasn't proven to be true yet, so figured we'd take this out
until it becomes necessary.
2022-04-12 14:38:02 -05:00
e8b1a57929 feat: Add support for VS Code and JetBrains Gateway via SSH (#956)
* Improve CLI documentation

* feat: Allow workspace resources to attach multiple agents

This enables a "kubernetes_pod" to attach multiple agents that
could be for multiple services. Each agent is required to have
a unique name, so SSH syntax is:

`coder ssh <workspace>.<agent>`

A resource can have zero agents too, they aren't required.

* Add tree view

* Improve table UI

* feat: Allow workspace resources to attach multiple agents

This enables a "kubernetes_pod" to attach multiple agents that
could be for multiple services. Each agent is required to have
a unique name, so SSH syntax is:

`coder ssh <workspace>.<agent>`

A resource can have zero agents too, they aren't required.

* Rename `tunnel` to `skip-tunnel`

This command was `true` by default, which causes
a confusing user experience.

* Add disclaimer about editing templates

* Add help to template create

* Improve workspace create flow

* Add end-to-end test for config-ssh

* Improve testing of config-ssh

* Fix workspace list

* feat: Add support for VS Code and JetBrains Gateway via SSH

This fixes various bugs that made this not work:
- Incorrect max message size in `peer`
- Incorrect reader buffer size in `peer`
- Lack of SFTP support in `agent`
- Lack of direct-tcpip support in `agent`
- Misuse of command from session. It should always use the shell
- Blocking on SSH session, only allowing one at a time

Fixes #833 too.

* Fix config-ssh command with socat
2022-04-12 00:17:18 +00:00
fb9dc4f346 feat: Improve resource preview and first-time experience (#946)
* Improve CLI documentation

* feat: Allow workspace resources to attach multiple agents

This enables a "kubernetes_pod" to attach multiple agents that
could be for multiple services. Each agent is required to have
a unique name, so SSH syntax is:

`coder ssh <workspace>.<agent>`

A resource can have zero agents too, they aren't required.

* Add tree view

* Improve table UI

* feat: Allow workspace resources to attach multiple agents

This enables a "kubernetes_pod" to attach multiple agents that
could be for multiple services. Each agent is required to have
a unique name, so SSH syntax is:

`coder ssh <workspace>.<agent>`

A resource can have zero agents too, they aren't required.

* Rename `tunnel` to `skip-tunnel`

This command was `true` by default, which causes
a confusing user experience.

* Add disclaimer about editing templates

* Add help to template create

* Improve workspace create flow

* Add end-to-end test for config-ssh

* Improve testing of config-ssh

* Fix workspace list

* Fix config ssh tests

* Update cli/configssh.go

Co-authored-by: Cian Johnston <public@cianjohnston.ie>

* Fix requested changes

* Remove socat requirement

* Fix resources not reading in TTY

Co-authored-by: Cian Johnston <public@cianjohnston.ie>
2022-04-11 18:54:30 -05:00
19b4323512 feat: Allow workspace resources to attach multiple agents (#942)
This enables a "kubernetes_pod" to attach multiple agents that
could be for multiple services. Each agent is required to have
a unique name, so SSH syntax is:

`coder ssh <workspace>.<agent>`

A resource can have zero agents too, they aren't required.
2022-04-11 16:06:15 -05:00
53db17803a feat: cli: add autostart and autostop commands (#922)
* feat: cli: add autostart and autostop commands

* fix: autostart/autostop: add help and usage, hide for now
2022-04-08 16:29:07 +00:00
cb5b228a21 fix: Disable raw using confirm prompt on Darwin (#926)
This caused cancel errors on prompt, but would have caused incorrect
content in parameter values if it surfaced.

Fixes #915.
2022-04-08 11:25:19 -05:00
38f074254b feat: wrap ssh with coder key (#894) 2022-04-07 22:40:27 +00:00
18595791c0 feat: add version to footer (#882)
* Add endpoint for getting build info

* Add build info XService

* Add version with link to page footer

Partially addresses #376.

* Lift buildinfo package
2022-04-07 12:18:58 -05:00
02ad3f14f5 chore: Rename Projects to Templates (#880)
Customer feedback indicated projects was a confusing name.
After querying the team internally, it seemed unanimous
that it is indeed a confusing name.

Here's for a lil less confusion @ashmeer7 🥂
2022-04-06 12:42:40 -05:00
9da17be61e feat: Add user scoped git ssh keys (#834) 2022-04-06 00:18:26 +00:00
5ae71f0958 feat: Add buildinfo package to embed version (#840)
This also resolves build time and commit hash using the
Go 1.18 debug/buildinfo package. An external URL is outputted
on running version as well to easily route the caller to a
release or commit.
2022-04-05 01:35:03 +00:00
ccba2ba99d fix: Remove line length limit on MacOS for input prompts (#839)
This caused inputs to be truncated on MacOS terminals.
2022-04-03 18:09:55 +00:00
2a7ab08bab fix: use golang.org/x/term instead of golang.org/x/crypto/ssh/terminal (#837)
The latter is deprecated: https://pkg.go.dev/golang.org/x/crypto/ssh/terminal
2022-04-01 21:25:46 +00:00
2b1a0ee126 chore: update v1 schema (#643) 2022-04-01 14:42:36 -05:00
dc46ff407b fix: ensure websocket close messages are truncated to 123 bytes (#779)
It's possible for websocket close messages to be too long, which cause
them to silently fail without a proper close message. See error below:

```
2022-03-31 17:08:34.862 [INFO]	(stdlib)	<close_notjs.go:72>	"2022/03/31 17:08:34 websocket: failed to marshal close frame: reason string max is 123 but got \"insert provisioner daemon:Cannot encode []database.ProvisionerType into oid 19098 - []database.ProvisionerType must implement Encoder or be converted to a string\" with length 161"
```
2022-04-01 18:17:45 +00:00
0d53795c0d feat: Add strict transport security and secure cookie options (#741) 2022-03-31 12:31:06 -05:00
6612e3c9c7 feat: Add config-ssh command (#735)
* feat: Add config-ssh command

Closes #254 and #499.

* Fix Windows support
2022-03-30 17:59:54 -05:00
3abb87ddb6 chore: remove usage of ioutil (#642)
It was deprecated as of 1.17.
2022-03-29 14:59:32 -05:00
82dfd6c72f feat: Add UI for awaiting agent connections (#578)
* feat: Add stage to build logs

This adds a stage property to logs, and refactors the job logs
cliui.

It also adds tests to the cliui for build logs!

* feat: Add stage to build logs

This adds a stage property to logs, and refactors the job logs
cliui.

It also adds tests to the cliui for build logs!

* feat: Add config-ssh and tests for resiliency

* Rename "Echo" test to "ImmediateExit"

* Fix Terraform resource agent association

* Fix logs post-cancel

* Fix select on Windows

* Remove terraform init logs

* Move timer into it's own loop

* Fix race condition in provisioner jobs

* Fix requested changes
2022-03-28 19:19:28 -05:00
620c889842 fix: change dev tunnel default back to true (#630) 2022-03-28 22:16:13 +00:00