Commit Graph

26 Commits

Author SHA1 Message Date
Connor Peet
eee5e7643a cli: propagate server-data-dir and extensions-dir when installing service (#236734)
Fixes #236195
2024-12-20 10:29:40 -08:00
Sandeep Somavarapu
4920694ece fix #234843 (#235955)
* fix #234843

* fix lint error
2024-12-12 16:48:37 +01:00
Sandeep Somavarapu
653fd419de #232043 revert cli command and support downloading VSIX in UI (#233843)
* Revert "fix #232043 (#233596)"

This reverts commit e9d6c6afc0.

* #232043 revert cli command and support downloading VSIX in UI
2024-11-14 15:41:28 +01:00
Sandeep Somavarapu
e9d6c6afc0 fix #232043 (#233596)
* fix #232043

* fix compilation error

* fix compilation

* fix compilation

* fix compilation

* fix compilation

* fix compilation
2024-11-12 14:09:05 +01:00
Hamir Mahal
a744313eb7 style: simplify string formatting for readability (#231763)
* style: simplify string formatting for readability

* fix: formatting in `.rs` files in `src/`
2024-10-22 16:30:46 +00:00
Connor Peet
6269ab41b4 cli: add --install-extension command for use with tunnel server (#207741)
* cli: add --install-extension command for use with tunnel server

* fix clippy
2024-03-14 19:05:20 +01:00
samhanic
74c419b5bd add cli update-extensions prototype 2023-12-03 14:25:40 +01:00
Connor Peet
2e37be2160 Adopt Terrapin / msrustup for the CLI (#188732)
* cli: use terrapin for cli builds

* update rust to 1.70 to allow ado artifacts feed on windows

* apparently manaul cargo login is required

* use msrustup

* rustup is no longer user

* update to 1.73

* add rust oss install
2023-10-08 17:18:22 -07:00
Connor Peet
1fe8359ed0 cli: implement 'server of server' for a local web server (#191014)
Closes https://github.com/microsoft/vscode/issues/168492

This implements @aeschli's 'server server' concept in a new
`code serve-web` command.

Command line args are similar to the standalone web server. The first
time a user hits that page, the latest version of the VS Code web server
will be downloaded and run. Thanks to Martin's previous PRs, all
resources the page requests are prefixed with `/<quality-<commit>`.

The latest release version is cached, but when the page is loaded again
and there's a new release, a the new server version will be downloaded
and started up.

Behind the scenes the servers all listen on named pipes/sockets and the
CLI acts as a proxy server to those sockets. Servers without connections
for an hour will be shut down automatically.
2023-08-22 17:29:51 -07:00
Connor Peet
5a14d85f48 cli: adding forwarding for local port for remote tunnels (#188715)
This reuses a lot of the logic we use for the normal VS Code Server
tunnel to do port forwarding. It does use a _different_ tunnel than what
Remote Tunnels would otherwise use for the control server. The reason
for this is that ports exist on a tunnel instance, and if we reused the
same tunnel then a client would expect all CLI hosts to serve all
tunnels, where the port forwarding instance would not provide the VS
Code server. It also reuses the singleton logic so all ports on a
machine are handled by a single CLI instance for the same reason: we
can't have different instances hosting subsets of
ports on a single tunnel.

Currently all ports are under the default privacy: support for
public/private tunnels is either later today or next iteration.
2023-07-24 15:12:21 -07:00
Connor Peet
3e0786633b cli: allow exec server to listen on socket (#188123)
* cli: allow exec server to listen on socket

For remote ssh

* fix lint
2023-07-18 09:19:44 -07:00
Connor Peet
6f568d087d cli: ensure code tunnel service is headless on windows (#184621)
Fixes #184058
2023-06-08 10:50:44 -07:00
Connor Peet
75c2f321b2 cli: update dependencies (#184189)
Up all the dependencies! Notably:

- russh to the latest main now that tunnel changes are merged
- secret-service-rs to 3.x and dropping our custom fork
- which also fixes SDL pings

Fixes https://github.com/microsoft/vscode-internalbacklog/issues/4328
Fixes https://github.com/microsoft/vscode-internalbacklog/issues/4077
2023-06-02 10:27:47 -07:00
Connor Peet
679bb967c3 cli: add stdio control server
* signing: implement signing service on the web

* wip

* cli: implement stdio service

This is used to implement the exec server for WSL. Guarded behind a signed handshake.

* update distro

* rm debug

* address pr comments
2023-05-19 17:19:52 +02:00
Connor Peet
d3d9f86116 cli: store cli in user data dir, separate per quality (#182102)
* cli: store cli in user data dir, separate per quality

Fixes #181017

On first run, the `~/.vscode-cli` will be migrated inside the user data dir of the currently running quality.

* use create_dir_all instead

* clippy fixes
2023-05-10 13:09:23 -07:00
Connor Peet
b9c2df39d1 cli: don't colorize file log output, collect internal logs for broadcast (#177420)
Fixes #177345
2023-03-17 17:14:41 +01:00
Connor Peet
eab8ba65bf cli: add tunnel status command (#177381)
Fixes #177372
2023-03-16 12:26:56 -07:00
Connor Peet
abab52dd94 cli: add tunnel kill/restart subcommands (#177286) 2023-03-15 15:09:12 -07:00
Connor Peet
2c2ead679b cli: initial wsl control server
Adds an stdin/out json rpc server for wsl.

Exposes a singular install_local command to install+boot the vscode server on a port from a local archive.

Also refines the common rpc layer some more. I'm decently happy with it now.
2023-01-18 08:23:04 -08:00
Connor Peet
796ee2bf3c chore: pull more strings from the product.json (#166769)
Fixes the bulk of https://github.com/microsoft/vscode-cli/issues/560
2022-11-18 18:52:52 -08:00
Connor Peet
1bf3323015 cli: add service integration for macos, observability
Adds support for running the tunnel as a service on macOS via launchservices.

It also hooks up observability (`code tunnel service log`) on macOS and Linux.
On macOS--and later Windows, hence the manual implementation of `tail`--it
saves output to a log file and watches it. On Linux, it simply delegates to
journalctl.

The "tailing" is implemented via simple polling of the file size. I didn't want
to pull in a giant set of dependencies for inotify/kqueue/etc just for this use
case; performance when polling a single log file is not a huge concern.
2022-11-15 15:39:58 -08:00
Connor Peet
c536595a7f cli: fallback to system installs in the standalone CLI
The standalone CLI should detect and fall back to using and
system-installed VS Code instance, rather than trying to download zips
and manage its own VS Code instances.

There are three approaches used for discovery:

- On Windows, we can easily and quickly read the register to find
  installed versions based on their app ID.
- On macOS, we initially look in `/Applications` and fall back to the
  slow `system_profiler` command to list app .app's if that fails.
- On Linux, we just look in the PATH. I believe all Linux installers
  (snap, dep, rpm) automatically add VS Code to the user's PATH.

Failing this, the user can also manually specify their installation dir,
using the command `code version use stable --install-dir /path/to/vscode`.

Fixes #164159
2022-10-20 10:54:13 -07:00
Connor Peet
889fbd2f1b add detection for integrated cli, verify 2022-09-26 07:22:58 +02:00
Connor Peet
07453efc00 cli: implement better self-updating
- Start separating a "standalone" CLI. This is a little awkward with clap-
  derive, but I got it working. Detection of whether the CLI _is_
  standalone is still todo.
- Remove the old ad-hoc update code for code-server, and use the update
  service instead.
- Fix some of the "permission denied" errors people got while updating
  before. We need to rename the old running binary, not just overwrite it.
2022-09-23 17:47:39 -07:00
Connor Peet
b784bcdd32 cli: use hard tabs to align with vscode style 2022-09-23 14:17:01 -07:00
Connor Peet
3762635fe1 move cli to top level 2022-09-20 08:42:44 -07:00