e96652ebbc
feat: block file transfers for security ( #13501 )
2024-06-10 12:12:23 +00:00
b248f125e1
chore: rename notification banners to announcement banners ( #13419 )
2024-05-31 10:59:28 -06:00
d8e0be6ee6
feat: add support for multiple banners ( #13081 )
2024-05-08 15:40:43 -06:00
c63f569174
refactor(agent/agentssh): move envs to agent and add agentssh config struct ( #12204 )
...
This commit refactors where custom environment variables are set in the
workspace and decouples agent specific configs from the `agentssh.Server`.
To reproduce all functionality, `agentssh.Config` is introduced.
The custom environment variables are now configured in `agent/agent.go`
and the agent retains control of the final state. This will allow for
easier extension in the future and keep other modules decoupled.
2024-02-19 16:30:00 +02:00
f2aef0726b
fix(agent/agentssh): allow scp to exit with zero status ( #12028 )
...
Fixes #11786
2024-02-07 10:22:31 +02:00
081fbef097
fix: code-server path based forwarding, defer to code-server ( #11759 )
...
Do not attempt to construct a path based port forward url.
Always defer to code server, as it has it's own proxy method.
2024-01-23 11:36:44 -06:00
385d58caf6
fix(agent/agentssh): allow remote forwarding a socket multiple times ( #11631 )
...
* fix(agent/agentssh): allow remote forwarding a socket multiple times
Fixes #11198
Fixes https://github.com/coder/customers/issues/407
2024-01-16 21:26:13 +02:00
df3c310379
feat(cli): add coder open vscode
( #11191 )
...
Fixes #7667
2024-01-02 20:46:18 +02:00
dbbf8acc26
fix: track JetBrains connections ( #10968 )
...
* feat: implement jetbrains agentssh tracking
Based on tcp forwarding instead of ssh connections
* Add JetBrains tracking to bottom bar
2023-12-07 12:15:54 -09:00
6c67add2d9
fix: detect and retry reverse port forward on used port ( #10844 )
...
Fixes #10799
The flake happens when we try to remote forward, but the port we've chosen is not free. In the flaked example, it's actually the SSH listener that occupies the port we try to remote forward, leading to confusing reads (c.f. the linked issue).
This fix simplies the tests considerably by using the Go ssh client, rather than shelling out to OpenSSH. This avoids using a pseudoterminal, avoids the need for starting any local OS listeners to communicate the forwarding (go SSH just returns in-process listeners), and avoids an OS listener to wire OpenSSH up to the agentConn.
With the simplied logic, we can immediately tell if a remote forward on a random port fails, so we can do this in a loop until success or timeout.
I've also simplified and fixed up the other forwarding tests. Since we set up forwarding in-process with Go ssh, we can remove a lot of the `require.Eventually` logic.
2023-11-27 09:42:45 +04:00
61be4dfe5a
fix: improve exit codes for agent/agentssh and cli/ssh ( #10850 )
2023-11-24 14:35:56 +02:00
2c6e0f7d0a
feat(agent/agentssh): handle session signals ( #10842 )
2023-11-23 19:55:36 +02:00
e448c10122
chore: add uuid's to ssh sessions for logging ( #10721 )
...
* chore: add uuid to ssh connection logs
2023-11-17 16:04:23 +00:00
63a4f5f4a7
fix: case insensitive magic label ( #10592 )
2023-11-08 11:17:14 -06:00
54648b90ca
fix: properly trim spaces so multi-line shebang executes ( #10146 )
2023-10-09 19:19:57 +00:00
b402f2a816
feat: add shebang support to scripts ( #10134 )
...
This enables much greater portability!
2023-10-09 10:57:57 -05:00
e0e6d7c9a6
fix: case insensitve agent ssh session env var ( #9675 )
2023-09-13 14:18:00 -05:00
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
34c3f919dc
fix(agent/agentssh): check for hushlogin via afero fs ( #8358 )
2023-07-07 13:30:23 +03:00
3f058f28e7
test(agent): use afero for motd tests to allow parallel execution ( #8329 )
2023-07-06 10:57:51 +03:00
6015319e9d
feat: show service banner in SSH/TTY sessions ( #8186 )
...
* Allow workspace agents to get appearance
* Poll for service banner every two minutes
* Show service banner before MOTD if not quiet
2023-06-30 10:41:29 -08:00
e738123a9c
chore: log ssh connection disconnects with errors ( #8143 )
...
Signed-off-by: Spike Curtis <spike@coder.com >
2023-06-22 11:37:50 +04:00
4fb4c9b270
chore: add more rules to ensure logs consistency ( #8104 )
2023-06-21 12:00:38 +02:00
1c8f564fdb
feat: add logging of ssh connections to agent ( #8096 )
...
* feat: adds logging of ssh connections to agent
Signed-off-by: Spike Curtis <spike@coder.com >
* code review improvements
Signed-off-by: Spike Curtis <spike@coder.com >
---------
Signed-off-by: Spike Curtis <spike@coder.com >
2023-06-21 13:49:58 +04:00
b1d1b63113
chore: ensure logs consistency across Coder ( #8083 )
2023-06-20 12:30:45 +02:00
247f8a973f
feat: replace ssh maxTimeout with keep-alive mechanism ( #8062 )
...
* Bump up coder/ssh
* feat: Set default agent timeout to ~72h
* Address PR comments
* Fix
2023-06-16 15:22:18 +02:00
74fdcb1ace
fix(agent/agentssh): wait for sessions to exit ( #8008 )
2023-06-13 17:52:31 +00:00
14efdadd3c
feat: Collect agent SSH metrics ( #7584 )
2023-05-25 12:52:36 +02:00
9c030a8888
fix: pty.Start respects context on Windows too ( #7373 )
...
* fix: pty.Start respects context on Windows too
Signed-off-by: Spike Curtis <spike@coder.com >
* Fix windows imports; rename ToExec -> AsExec
Signed-off-by: Spike Curtis <spike@coder.com >
* Fix import in windows test
Signed-off-by: Spike Curtis <spike@coder.com >
---------
Signed-off-by: Spike Curtis <spike@coder.com >
2023-05-03 11:43:05 +04:00
daee91c6dc
refactor: PTY & SSH ( #7100 )
...
* Add ssh tests for longoutput, orphan
Signed-off-by: Spike Curtis <spike@coder.com >
* PTY/SSH tests & improvements
Signed-off-by: Spike Curtis <spike@coder.com >
* Fix some tests
Signed-off-by: Spike Curtis <spike@coder.com >
* Fix linting
Signed-off-by: Spike Curtis <spike@coder.com >
* fmt
Signed-off-by: Spike Curtis <spike@coder.com >
* Fix windows test
Signed-off-by: Spike Curtis <spike@coder.com >
* Windows copy test
Signed-off-by: Spike Curtis <spike@coder.com >
* WIP Windows pty handling
Signed-off-by: Spike Curtis <spike@coder.com >
* Fix truncation tests
Signed-off-by: Spike Curtis <spike@coder.com >
* Appease linter/fmt
Signed-off-by: Spike Curtis <spike@coder.com >
* Fix typo
Signed-off-by: Spike Curtis <spike@coder.com >
* Rework truncation test to not assume OS buffers
Signed-off-by: Spike Curtis <spike@coder.com >
* Disable orphan test on Windows --- uses sh
Signed-off-by: Spike Curtis <spike@coder.com >
* agent_test running SSH in pty use ptytest.Start
Signed-off-by: Spike Curtis <spike@coder.com >
* More detail about closing pseudoconsole on windows
Signed-off-by: Spike Curtis <spike@coder.com >
* Code review fixes
Signed-off-by: Spike Curtis <spike@coder.com >
* Rearrange ptytest method order
Signed-off-by: Spike Curtis <spike@coder.com >
* Protect pty.Resize on windows from races
Signed-off-by: Spike Curtis <spike@coder.com >
* Fix windows bugs
Signed-off-by: Spike Curtis <spike@coder.com >
* PTY doesn't extend PTYCmd
Signed-off-by: Spike Curtis <spike@coder.com >
* Fix windows types
Signed-off-by: Spike Curtis <spike@coder.com >
---------
Signed-off-by: Spike Curtis <spike@coder.com >
2023-04-24 14:53:57 +04:00
fd84df769d
fix: add DISPLAY
env var for X11 connections ( #7248 )
...
* fix: add `DISPLAY` env var for X11 connections
* Update agent/agentssh/agentssh.go
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com >
---------
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com >
2023-04-21 16:43:49 +00:00
f39e6a79de
feat: add support for X11 forwarding ( #7205 )
...
* feat: add support for X11 forwarding
* Only run X forwarding on Linux
* Fix piping
* Fix comments
2023-04-21 15:52:40 +00:00
aa660e0631
feat(agentssh): Gracefully close SSH sessions on Close ( #7027 )
...
By tracking and closing sessions manually before closing the underlying
connections, we ensure that the termination is propagated to SSH/SFTP
clients and they're not left waiting for a connection timeout.
Refs: #6177
2023-04-06 19:57:30 +03:00
0224426e5b
refactor(agent): Move SSH server into agentssh package ( #7004 )
...
Refs: #6177
2023-04-06 19:39:22 +03:00