Skip to content

Commit

Permalink
Add more info on how to set up linkup (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
ostenbom authored Aug 23, 2023
1 parent 18fe678 commit 6db9b4c
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ services:
- name: backend
remote: https://api-dev.hosting-provider.com
local: http://localhost:9000
directory: ./
directory: ./relative/path/to/backend
domains:
- domain: dev-domain.com
default_service: web
Expand All @@ -67,9 +67,22 @@ domains:
default_service: backend
```
### Local environment variables
When booting local servers to run in linkup, they must be configured with environment variables that point to your linkup domain.
To do this, linkup appends the contents of `.env.linkup` to the `.env` file located in the `directory` configuration field of the service.

Linkup will fail to start if there is no `.env.linkup` file, and it will warn you to restart your local server if it was already booted on `linkup start`.

## Deploying Linkup

In order to run linkup sessions, you need a dedicated domain for linkup to run on and deployed copies of the remote services you want to provide.
In order to run linkup sessions, you need:

- A dedicated domain for the linkup cloudflare worker to run on
- Deployed copies of the remote services you want to provide

### Configuring the domain & worker

Linkup is deployed as a cloudflare worker with a key-value store, and can be deployed using the wrangler cli:

Expand All @@ -79,3 +92,13 @@ cp wrangler.toml.sample wrangler.toml
# Edit wrangler.toml to point to your cf kv store
npx wrangler@latest deploy
```

It is also easiest to use a domain in cloudflare. Set the `*` and `*.*` subdomains to point to the worker you just deployed.

### Deploying remote services

The remote services you would like to make available to linkup sessions have a few requirements:

- They must be accessible at a public url
- Their environment variables must be configured to point to your linkup domain
- For requests _from_ the remote service to be correctly routed to linkup sessions, they must be able to [propagate trace contexts](https://www.w3.org/TR/trace-context/) through requests made from the service. The easiest way to acheive this is to use an OpenTelemetry client library to instrument your http client. Here is [an example for javascript](https://www.npmjs.com/package/@opentelemetry/instrumentation-http).

0 comments on commit 6db9b4c

Please sign in to comment.