Skip to content
This repository was archived by the owner on Jun 9, 2025. It is now read-only.

Commit bca72e8

Browse files
authored
Update documentation for Typescript language server deployment (#248)
This takes the same changes made to the Go lang server documentation in PR #244 and adapts them for the Typescript language server
1 parent ea47ab8 commit bca72e8

File tree

1 file changed

+31
-9
lines changed

1 file changed

+31
-9
lines changed

configure/lang/typescript/README.md

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This folder contains the deployment manifests for the [Javascript/Typescript lan
44

55
## Installation instructions
66

7-
### Setup TLS/SSL
7+
### Setup TLS/SSL (Highly recommended, optional)
88

99
TLS/SSL is required for secure communication with the language server. Once you have completed ["Configure TLS/SSL"](../../../docs/configure.md#configure-tlsssl) in [docs/configure.md](../../../docs/configure.md#configure-tlsssl), for your overall Sourcegraph instance, you'll need to configure TLS/SSL for the Javascript/Typescript language server as well.
1010

@@ -43,7 +43,7 @@ The Javascript/Typescript language server needs it's own domain (e.g. `typescrip
4343
**WARNING:** Do NOT commit the actual TLS cert and key files to your fork (unless your fork is
4444
private **and** you are okay with storing secrets in it).
4545
46-
### HTTP basic authentication
46+
### HTTP basic authentication (Highly recommended, optional)
4747
4848
HTTP basic authentication is used to prevent unauthorized access to the language server. At a high level, you'll create a secret then put it in both [configure/lang/typescript/lang-typescript.Ingress.yaml](lang-typescript.Ingress.yaml) and in your Sourcegraph global settings so that logged-in users are authenticated when their browser makes requests to the Javascript/Typescript language server.
4949
@@ -76,13 +76,6 @@ _These instructions are derived from https://kubernetes.github.io/ingress-nginx/
7676
echo kubectl create secret generic langserver-auth --from-file=auth >> create-new-cluster.sh
7777
```
7878

79-
1. Add the following fields to your Sourcegraph global settings (`$PASSWORD` is that password that you created above, and `$TYPESCRIPT_DOMAIN_NAME` is the domain name that you are using for your Javascript/Typescript language server instance):
80-
81-
```js
82-
"typescript.serverUrl": "wss://langserveruser:$PASSWORD@$TYPESCRIPT_DOMAIN_NAME/",
83-
"typescript.sourcegraphUrl": "http://sourcegraph-frontend:30080",
84-
```
85-
8679
### Apply the Javascript/Typescript language server configuration to the cluster
8780

8881
1. Add the `kubectl` command that applies the Javascript/Typescript language server configuration to [kubectl-apply-all.sh](../../../kubectl-apply-all.sh)
@@ -96,3 +89,32 @@ _These instructions are derived from https://kubernetes.github.io/ingress-nginx/
9689
```console
9790
./kubectl-apply-all.sh
9891
```
92+
93+
### Configure Sourcegraph to use the Typescript language server
94+
95+
Add the following fields to your Sourcegraph global settings (`$PASSWORD` is the HTTP basic auth password that you created above, and `$TYPESCRIPT_DOMAIN_NAME` is the domain name that you are using for your Typescript language server instance):
96+
97+
```js
98+
"typescript.serverUrl": "wss://langserveruser:$PASSWORD@$TYPESCRIPT_DOMAIN_NAME/",
99+
"typescript.sourcegraphUrl": "http://sourcegraph-frontend:30080",
100+
```
101+
102+
If you haven't setup SSL/TLS and HTTP basic authentication yet `typescript.serverUrl` should look like this:
103+
104+
```js
105+
"typescript.serverUrl": "ws://$TYPESCRIPT_DOMAIN_NAME"
106+
```
107+
108+
Note that `wss` has been changed to `ws`.
109+
110+
If you choose not to expose the language server to the internet yet, you need to forward a local port to the language server so that your browser can connect to it:
111+
112+
```console
113+
kubectl port-forward svc/lang-typescript 9876:8080
114+
```
115+
116+
Then your `typescript.serverUrl` would look like this:
117+
118+
```js
119+
"typescript.serverUrl": "ws://localhost:9876"
120+
```

0 commit comments

Comments
 (0)