Skip to content

Commit d7ce509

Browse files
committed
Rework the readme deployment section
1 parent 1ea425f commit d7ce509

File tree

1 file changed

+38
-19
lines changed

1 file changed

+38
-19
lines changed

README.md

Lines changed: 38 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,51 +2,60 @@
22

33
The Code Extension Marketplace is an open-source alternative to the VS Code
44
Marketplace for use in editors like
5-
[code-server](https://github.com/cdr/code-server).
5+
[code-server](https://github.com/coder/code-server).
66

77
This marketplace reads extensions from file storage and provides an API for
88
editors to consume. It does not have a frontend or any mechanisms for extension
99
authors to add or update extensions in the marketplace.
1010

1111
## Deployment
1212

13-
Replace `$os` and `$arch` with your operating system and architecture.
13+
The marketplace is a single binary. Deployment involves running the binary,
14+
pointing it to a directory of extensions, and exposing the binary's bound
15+
address in some way.
16+
17+
### Getting the binary
18+
19+
The binary can be downloaded from GitHub releases. For example here is a way to
20+
download the latest release using `wget`. Replace `$os` and `$arch` with your
21+
operating system and architecture.
1422

1523
```
1624
wget https://github.com/coder/code-marketplace/releases/latest/download/code-marketplace-$os-$arch -O ./code-marketplace
1725
chmod +x ./code-marketplace
18-
./code-marketplace server --extensions-dir /my/extensions
1926
```
2027

21-
Run `./code-marketplace --help` for a full list of options.
22-
23-
It is recommended to put the marketplace behind TLS otherwise code-server will
24-
reject connecting to the API.
25-
26-
The `/healthz` endpoint can be used to determine if the marketplace is ready to
27-
receive requests.
28+
### Running the binary
2829

29-
## Usage in code-server
30+
The marketplace server can be ran using the `server` sub-command.
3031

3132
```
32-
export EXTENSIONS_GALLERY='{"serviceUrl":"https://<domain>/api", "itemUrl":"https://<domain>/item", "resourceUrlTemplate": "https://<domain>/files/{publisher}/{name}/{version}/{path}"}'
33-
code-server
33+
./code-marketplace server --extensions-dir ./extensions
3434
```
3535

36-
If code-server reports content security policy errors ensure that the
37-
marketplace is running behind an https URL.
36+
Run `./code-marketplace --help` for a full list of options.
37+
38+
### Exposing the marketplace
3839

39-
## Reverse proxy
40+
The marketplace must be put behind TLS otherwise code-server will reject
41+
connecting to the API. This could mean using a reverse proxy like NGINX or Caddy
42+
with your own domain and certificates or using a service like Cloudflare.
4043

41-
To host the marketplace behind a reverse proxy set either the `Forwarded` header
42-
or both the `X-Forwarded-Host` and `X-Forwarded-Proto` headers.
44+
When hosting the marketplace behind a reverse proxy set either the `Forwarded`
45+
header or both the `X-Forwarded-Host` and `X-Forwarded-Proto` headers. These are
46+
used to generate absolute URLs to extension assets in API responses.
4347

4448
The marketplace does not support being hosted behind a base path; it must be
4549
proxied at the root of your domain.
4650

51+
### Health checks
52+
53+
The `/healthz` endpoint can be used to determine if the marketplace is ready to
54+
receive requests.
55+
4756
## Adding extensions
4857

49-
Extensions can be added to the marketplace by file or URL. The extensions
58+
Extensions can be added to the marketplace by file or URL. The extensions
5059
directory does not need to be created beforehand.
5160

5261
```
@@ -77,6 +86,16 @@ Or the Vim extension from GitHub:
7786
./code-marketplace add https://github.com/VSCodeVim/Vim/releases/download/v1.24.1/vim-1.24.1.vsix --extensions-dir ./extensions
7887
```
7988

89+
## Usage in code-server
90+
91+
```
92+
export EXTENSIONS_GALLERY='{"serviceUrl":"https://<domain>/api", "itemUrl":"https://<domain>/item", "resourceUrlTemplate": "https://<domain>/files/{publisher}/{name}/{version}/{path}"}'
93+
code-server
94+
```
95+
96+
If code-server reports content security policy errors ensure that the
97+
marketplace is running behind an https URL.
98+
8099
## Development
81100

82101
```

0 commit comments

Comments
 (0)