Commit Graph

97 Commits

Author SHA1 Message Date
e6f1ce1fb2 fix: Allow coderd to exit on error channel (#1355)
coderd would fail silently if this was called, because connections
would never drain. HashiCorp's hc-install package broke today,
and we couldn't notice because this was hanging!
2022-05-10 02:19:20 +00:00
ddb9631d7a fix: Group subcommands for cognitive ease (#1351) 2022-05-09 17:42:02 -05:00
ad8d9dd71a feat: make it harder to skip graceful shutdown accidentally (#1327)
* feat: make it harder to skip graceful shutdown accidentally

Signed-off-by: Spike Curtis <spike@coder.com>

* fixup: don't use unbuffered signal channel

Signed-off-by: Spike Curtis <spike@coder.com>
2022-05-06 13:45:18 -07:00
97ee5600c7 fix: Remove "CODER_URL" and "CODER_TOKEN" (#1330)
These aren't being used, so it's best to remove for now.
It caused issues with dogfooding from v1 too!
2022-05-06 18:46:21 +00:00
3dbcddc310 fix: Confirm password in cli create first user step (#1220)
Fixes #1182
2022-05-06 15:47:38 +03:00
914a2f477c fix: Restore terminal on interrupt when connecting (#1312)
Fixes #1292.
2022-05-05 20:11:44 -05:00
9d2e788fea feat: allow verbose logging in coder server (#1280) 2022-05-03 16:13:30 -05:00
0f9e30e54f fix: use correct enable bool for pprof (#1279) 2022-05-03 19:54:10 +00:00
55ad97bbd7 feat: add pprof and prometheus metrics to coder server (#1266) 2022-05-03 12:48:02 +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
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
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
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!
2022-04-30 16:40:30 +00: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
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