Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjg committed Nov 6, 2023
1 parent 09413e8 commit 26da79b
Showing 1 changed file with 11 additions and 53 deletions.
64 changes: 11 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,21 @@
# Automerge Repo Sync Server

A very simple automerge-repo synchronization server. It pairs with the websocket client protocol
found in `@automerge/automerge-repo-network-websocket`.
A very simple automerge-repo synchronization server. It pairs with the
websocket client protocol found in
`@automerge/automerge-repo-network-websocket`.

The server is an unsecured [Express](https://expressjs.com/) app. It is really just for
demonstration purposes at this point; you probably don't want to use it for anything real yet. This
isn't a great way to operate (or the only way) but it's a useful demonstration of what a
client/server deployment might look like.
The server is an unsecured [Express](https://expressjs.com/) app. It is partly
for demonstration purposes but it's also a reasonable way to run a public sync
server.

## Setting up
## Running the sync server

Before getting started, make sure you've run `yarn`, and `yarn build` at the root of the monorepo. This will install all your dependencies and make sure the other libraries are compiled.
`npx @automerge/automerge-repo-sync-server`

## Run the sync server
The server is configured with environment variables. There are two options:

`yarn start:syncserver`

## Set up a sync-server on ubuntu

Set up basic firewall:

```
$ sudo ufw allow OpenSSH
$ sudo ufw allow http
$ sudo ufw allow https
$ sudo ufw enable
```

Install git:

```
$ sudo apt-get install git
```

Install node:

```
$ curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - &&\
sudo apt-get install -y nodejs
```

Clone repo (may require setting up ssh keys to clone from github)

```
$ git clone [email protected]:automerge-repo/automerge-repo-sync-server.git
```

Build everything:

```
$ cd automerge-repo-sync-server
$ yarn build
```

Run a server:

```
$ PORT=<your preferred port> yarn start
```
- `PORT` - the port to listen for websocket connections on
- `DATA_DIR` - the directory to store saved documents in

## Contributors

Expand Down

0 comments on commit 26da79b

Please sign in to comment.