summaryrefslogtreecommitdiffhomepage
path: root/cmd/tsconnect/src/lib/ssh.ts
AgeCommit message (Collapse)AuthorFilesLines
2023-11-28scripts/check_license_headers: enforce license on ts/tsx filesSonia Appasamy1-0/+3
Enforcing inclusion of our OSS license at the top of .ts and .tsx files. Also updates any relevant files in the repo that were previously missing the license comment. An additional `@license` comment is added to client/web/src/index.tsx to preserve the license in generated Javascript. Updates #10261 Signed-off-by: Sonia Appasamy <sonia@tailscale.com>
2022-10-17cmd/tsconnect: add progress and connection callbacksMihai Parparita1-4/+12
Allows UI to display slightly more fine-grained progress when the SSH connection is being established. Updates tailscale/corp#7186 Signed-off-by: Mihai Parparita <mihai@tailscale.com>
2022-10-06cmd/tsconnect: close the SSH session an unload event instead of beforeunloadMihai Parparita1-5/+5
The window may not end up getting unloaded (if other beforeunload handlers prevent the event), thus we should only close the SSH session if it's truly getting unloaded. Updates tailscale/corp#7304 Signed-off-by: Mihai Parparita <mihai@tailscale.com>
2022-09-21cmd/tsconnect: add error callback for SSH sessionsMihai Parparita1-1/+2
We were just logging them to the console, which is useful for debugging, but we may want to show them in the UI too. Updates tailscale/corp#6939 Signed-off-by: Mihai Parparita <mihai@tailscale.com>
2022-09-19cmd/tsconnect: allow SSH connection timeout to be overriddenMihai Parparita1-0/+3
5 seconds may not be enough if we're still loading the derp map and connecting to a slow machine. Updates #5693 Signed-off-by: Mihai Parparita <mihai@tailscale.com>
2022-09-14cmd/tsconnect: use the parent window for `beforeunload` event listenerMihai Parparita1-6/+4
The SSH session may be rendered in a different window that the one that is executing the script. Signed-off-by: Mihai Parparita <mihai@tailscale.com>
2022-09-12cmd/tsconnect: allow xterm.js terminal options to be passed inMihai Parparita1-2/+4
Allows clients to use a custom theme and other xterm.js customization options. Fixes #5610 Signed-off-by: Mihai Parparita <mihai@tailscale.com>
2022-09-12cmd/tsconnect: fix xterm.js link opening not working when rendered into ↵Mihai Parparita1-1/+3
another window The default WebLinksAddon handler uses window.open(), but that gets blocked by the popup blocker when the event being handled is another window. We instead need to invoke open() on the window that the event was triggered in. Signed-off-by: Mihai Parparita <mihai@tailscale.com>
2022-09-09cmd/tsconnect: enable web links addon in the terminalMihai Parparita1-0/+6
More user friendly, and as a side-effect we handle SSH check mode better, since the URL that's output is now clickable. Fixes #5247 Signed-off-by: Mihai Parparita <mihai@tailscale.com>
2022-09-08cmd/tsconnect: temporarily switch to xterm.js fork that handles popup windowsMihai Parparita1-1/+4
Allows other work to be unblocked while xtermjs/xterm.js#4069 is worked through. To enable testing the popup window handling, the standalone app allows opening of SSH sessions in new windows by holding down the alt key while pressing the SSH button. Signed-off-by: Mihai Parparita <mihai@tailscale.com>
2022-08-31cmd/tsconnect: remove debugging codeMihai Parparita1-1/+1
Remove test prefix added to validate the error code from 27f36f77c364562bc1ca660c241291e23606e54d. Signed-off-by: Mihai Parparita <mihai@tailscale.com>
2022-08-30cmd/tsconnect: output errors to the JS console tooMihai Parparita1-8/+21
We were just outputting them to the terminal, but that's hard to debug because we immediately tear down the terminal when getting an error. Signed-off-by: Mihai Parparita <mihai@tailscale.com>
2022-08-26cmd/tsconnect: expose runSSHSession in npm packageMihai Parparita1-0/+52
Move it to lib/ so that it can be used in both the app and the package. Updates #5415 Signed-off-by: Mihai Parparita <mihai@tailscale.com>