Commit Graph

24 Commits

Author SHA1 Message Date
Dean Sheather eda32659a8
chore: fix flake in tunnel (#9746) 2023-09-19 18:54:56 +00:00
Ammar Bandukwala dd97fe2bce
chore(cli): replace lipgloss with coder/pretty (#9564)
This change will improve over CLI performance and "snappiness" as well as
substantially reduce our test times. Preliminary benchmarks show
`coder server --help` times cut from 300ms to 120ms on my dogfood
instance.

The inefficiency of lipgloss disproportionately impacts our system, as all help
text for every command is generated whenever any command is invoked.

The `pretty` API could clean up a lot of the code (e.g., by replacing
complex string concatenations with Printf), but this commit is too
expansive as is so that work will be done in a follow up.
2023-09-07 16:28:22 -05:00
Kyle Carberry 22e781eced
chore: add /v2 to import module path (#9072)
* chore: add /v2 to import module path

go mod requires semantic versioning with versions greater than 1.x

This was a mechanical update by running:
```
go install github.com/marwan-at-work/mod/cmd/mod@latest
mod upgrade
```

Migrate generated files to import /v2

* Fix gen
2023-08-18 18:55:43 +00:00
Colin Adler bc862fa493
chore: upgrade tailscale to v1.46.1 (#8913) 2023-08-09 19:50:26 +00:00
Ammar Bandukwala 5eaf809851
fix(cli): speed up CLI over SSH (#7885)
By caching the terminal's color profile, we avoid myriad round trips during command execution.
2023-06-07 05:22:58 +00:00
Dean Sheather 5460ab4ba6
chore: switch to new wgtunnel via tunnelsdk (#6489) 2023-03-22 13:13:48 +00:00
Ammar Bandukwala f05609b4da
chore: format Go more aggressively 2023-02-18 18:32:09 -06:00
Kyle Carberry 5325bec26c
fix: Add timeout to selecting a dev tunnel (#4592)
For some reason this timed out for a prospect. Even if this
doesn't fix it, the problem will be revealed.
2022-10-17 18:03:17 +00:00
Kyle Carberry b0fe9bcdd1
chore: Upgrade to Go 1.19 (#3617)
This is required as part of #3505.
2022-08-21 22:32:53 +00:00
Mathias Fredriksson 4730c589fe
chore: Use standardized test timeouts and delays (#3291) 2022-08-01 15:45:05 +03:00
Mathias Fredriksson d27076cac7
fix: Improve `coder server` shutdown procedure (#3246)
* fix: Improve `coder server` shutdown procedure

This commit improves the `coder server` shutdown procedure so that all
triggers for shutdown do so in a graceful way without skipping any
steps.

We also improve cancellation and shutdown of services by ensuring
resources are cleaned up at the end.

Notable changes:
- We wrap `cmd.Context()` to allow us to control cancellation better
- We attempt graceful shutdown of the http server (`server.Shutdown`)
  because it's less abrupt (compared to `shutdownConns`)
- All exit paths share the same shutdown procedure (except for early
  exit)
- `provisionerd`s are now shutdown concurrently instead of one at a
  time, the also now get a new context for shutdown because
  `cmd.Context()` may be cancelled
- Resources created by `newProvisionerDaemon` are cleaned up
- Lifecycle `Executor` exits its goroutine on context cancellation

Fixes #3245
2022-07-27 18:21:21 +03:00
Mathias Fredriksson bb05b1f749
fix: Use slog for devtunnel logging (#3248)
Ensures standardized logging for server.
2022-07-27 18:05:47 +03:00
Mathias Fredriksson f34b5000cb
fix: Avoid logging to stdout in devtunnel test (#3194)
The device keeps logging to the logger even after `dev.Close()` but
doing that with `t.Log` is unsafe (test has ended). This is why
`slogtest` was used.

`dev.Close()` has a wait on encryption and decryption routines, however,
these are left running even after the wait. The implementation uses the
WaitGroups in a weird way.
2022-07-26 12:20:21 +03:00
Mathias Fredriksson 51dd1fde3b
fix: Remove use of `require` in `require.Eventually` in tests (#3110)
* fix: Remove use of `require` in `require.Eventually` in tests

Because require uses `t.FailNow()` and `require.Eventually` runs the
function in a goroutine, which is not allowed.

* feat: Add ruleguard for require.Eventually

Co-authored-by: Cian Johnston <cian@coder.com>
2022-07-22 20:02:49 +03:00
Spike Curtis fa4361db76
restore devtunnel test (#3050)
* Dev tunnel test uses local fake server; fixed port

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

* Remove parallel for test

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

* Fix segfault
2022-07-22 08:26:39 -07:00
Colin Adler 92ebdaec5a
feat: force legacy tunnels to new version (#2914) 2022-07-12 00:33:35 +00:00
Colin Adler 482feef373
feat(devtunnel): support geodistributed tunnels (#2711) 2022-06-30 19:11:13 -05:00
Colin Adler c36b0d892b
fix(devtunnel): use 1280 mtu (#2420)
This should be more compatible with cloud VMs and VPNs.
2022-06-16 12:12:04 -05:00
Colin Adler e9f87f12ec
chore: skip devtunnel test (#2336) 2022-06-14 20:32:40 -05:00
Colin Adler 8415022bf9
fix(devtunnel): close `http.Server` before wireguard interface (#2263) 2022-06-10 23:40:33 +00:00
Colin Adler de6f86bf7a
fix: ensure config dir exists before reading tunnel config (#2259) 2022-06-10 21:42:55 +00:00
Colin Adler f562b74fa1
feat: use custom wireguard reverse proxy for dev tunnel (#1975) 2022-06-10 13:38:11 -05:00
Colin Adler d135f85f69
fix: use correct devnull device on windows for proxy logs (#1803) 2022-05-26 15:21:36 -05:00
Colin Adler fed02cdcdc
chore: replace cloudflare dev tunnel with frp (#867) 2022-04-14 11:29:40 -04:00