Commit Graph

1760 Commits

Author SHA1 Message Date
Kyle Carberry dbd5b4a47b feat: Add workspace owner name to response (#1448)
This will be rendered in the workspace page!
2022-05-13 20:41:21 -05:00
Colin Adler fe7645b8a9 feat: add templates delete command (#1443) 2022-05-13 22:54:32 +00:00
Cian Johnston f970829b9e feat: add autostart/autostop show, show autostart/autostop schedule in ls output (#1436)
* feat: add autostart/autostop show, show autostart/autostop schedule in ls output
2022-05-13 19:03:27 +00:00
Cian Johnston 9410237ed5 chore: un-hide autostart and autostop commands (#1418) 2022-05-13 18:09:16 +01:00
Cian Johnston b2760b1faf feat: send native system notification on scheduled workspace shutdown (#1414)
* feat: send native system notification on scheduled workspace shutdown

This commit adds a fairly generic notification package and uses it
to notify users connected over SSH of pending workspace shutdowns.
Only one notification will be sent at most 5 minutes prior to the scheduled
shutdown, and only one CLI instance will send notifications if multiple
instances are running.
2022-05-13 18:09:04 +01:00
Kyle Carberry 7b5300d0cc fix: Improve develop script to start tunnel by default (#1409)
This allows for running the development script to actually
build workspaces!
2022-05-12 12:37:51 -05:00
David Wahler 20916281d8 feat: Add reset-password command (#1380)
* allow non-destructively checking if database needs to be migrated

* feat: Add reset-password command

* fix linter errors

* clean up reset-password usage prompt

* Add confirmation to reset-password command

* Ping database before checking migration, to improve error message
2022-05-12 12:32:56 -05:00
Mathias Fredriksson 56076a0aa2 feat: Unify cli behavior for templates create and update (#1385)
Fixes #565
2022-05-12 14:54:58 +03:00
Cian Johnston f4da5d4f3a feat: add lifecycle.Executor to manage autostart and autostop (#1183)
This PR adds a package lifecycle and an Executor implementation that attempts to schedule a build of workspaces with autostart configured.

- lifecycle.Executor takes a chan time.Time in its constructor (e.g. time.Tick(time.Minute))
- Whenever a value is received from this channel, it executes one iteration of looping through the workspaces and triggering lifecycle operations.
- When the context passed to the executor is Done, it exits.
- Only workspaces that meet the following criteria will have a lifecycle operation applied to them:
  - Workspace has a valid and non-empty autostart or autostop schedule (either)
  - Workspace's last build was successful
- The following transitions will be applied depending on the current workspace state:
  - If the workspace is currently running, it will be stopped.
  - If the workspace is currently stopped, it will be started.
  - Otherwise, nothing will be done.
- Workspace builds will be created with the same parameters and template version as the last successful build (for example, template version)
2022-05-11 23:03:02 +01:00
Garrett Delfosse be3bc5cc55 Remove coder templates edit command (#1396) 2022-05-11 20:05:45 +00:00
Spike Curtis 9d94f4f714 fix: macOS backspace processing (#1379)
Revert "fix: Remove line length limit on MacOS for input prompts (#839)"

This reverts commit ccba2ba99d.
2022-05-10 15:20:36 -07:00
Colin Adler 97a95f1377 chore: upgrade golangci-lint to v1.46.0 (#1373) 2022-05-10 16:04:23 -05:00
Kyle Carberry e0a7aec228 fix: Match kubectl table style for simpler scripting (#1363)
Fixes #1322.
2022-05-10 15:57:07 -05:00
Kyle Carberry 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
Kyle Carberry ddb9631d7a fix: Group subcommands for cognitive ease (#1351) 2022-05-09 17:42:02 -05:00
Spike Curtis 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
Kyle Carberry 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
Mathias Fredriksson 3dbcddc310 fix: Confirm password in cli create first user step (#1220)
Fixes #1182
2022-05-06 15:47:38 +03:00
Kyle Carberry 914a2f477c fix: Restore terminal on interrupt when connecting (#1312)
Fixes #1292.
2022-05-05 20:11:44 -05:00
Colin Adler 9d2e788fea feat: allow verbose logging in coder server (#1280) 2022-05-03 16:13:30 -05:00
Colin Adler 0f9e30e54f fix: use correct enable bool for pprof (#1279) 2022-05-03 19:54:10 +00:00
Colin Adler 55ad97bbd7 feat: add pprof and prometheus metrics to coder server (#1266) 2022-05-03 12:48:02 +00:00
Kyle Carberry 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
Kyle Carberry 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
Kyle Carberry 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
Kyle Carberry 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
Kyle Carberry 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
Kyle Carberry 9b37a0de31 fix: Disable ErrorLog in http.Server (#1244)
Vault does similarly: https://github.com/hashicorp/vault/blob/e2490059d0711635e529a4efcbaa1b26998d6e1c/command/server.go#L2714

These messages have primarily been noise.
2022-05-01 20:31:12 -05:00
Kyle Carberry 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
Kyle Carberry 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
Mathias Fredriksson 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
Mathias Fredriksson 8661f92a10 feat: Output username and password for code server --dev (#1193)
Fixes #825
2022-04-27 17:59:37 +03:00
Kyle Carberry 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
Kyle Carberry 877854a2f3 fix: Display proper access URL on server start (#1172)
Fixes #1170.
2022-04-25 23:30:22 +00:00
Kyle Carberry 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
Kyle Carberry 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
Kyle Carberry 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
Kyle Carberry 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
Kyle Carberry 7e33d80fa9 feat: Add helper output on failed gitssh (#1127) 2022-04-25 00:29:15 -05:00
Kyle Carberry 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
Kyle Carberry c8e566fe42 feat: Add links for registering git key (#1125) 2022-04-25 04:27:45 +00:00
Kyle Carberry 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
Colin Adler abc13c5a92 fix: use fmt.Fprintln to print workspaces table (#1122) 2022-04-25 04:04:34 +00:00
Kyle Carberry 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
Kyle Carberry be974cf280 feat: Add users create and list commands (#1111)
This allows for *extremely basic* user management.
2022-04-24 20:08:26 -05:00
Kyle Carberry 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
Kyle Carberry 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
Garrett Delfosse 8165a6ef75 feat: Add spooky hidden flag (#1065) 2022-04-19 16:40:01 +00:00
G r e y 5ce06769cd chore: replace todos with issues (#1066) 2022-04-19 12:16:57 -04:00
Kyle Carberry 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