Skip to content

Commit c67968f

Browse files
committed
Adapted README
1 parent c0c157a commit c67968f

File tree

4 files changed

+30
-19
lines changed

4 files changed

+30
-19
lines changed

README.md

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,43 @@
1-
[![Proxy Test: 3 Pads <> 3 Unique Backends](https://github.com/ether/etherpad-proxy/actions/workflows/1maxPadPerInstance.yml/badge.svg)](https://github.com/ether/etherpad-proxy/actions/workflows/1maxPadPerInstance.yml) [![Proxy Test: 9 Pads <> 3 Backends](https://github.com/ether/etherpad-proxy/actions/workflows/3maxPadPerInstance.yml/badge.svg)](https://github.com/ether/etherpad-proxy/actions/workflows/3maxPadPerInstance.yml) [![Somewhat faster assignment Proxy Test: 3 Pads <> 3 Unique Backends](https://github.com/ether/etherpad-proxy/actions/workflows/rapidUniqueness.yml/badge.svg)](https://github.com/ether/etherpad-proxy/actions/workflows/rapidUniqueness.yml) [![Lint](https://github.com/ether/etherpad-proxy/actions/workflows/lint-package-lock.yml/badge.svg)](https://github.com/ether/etherpad-proxy/actions/workflows/lint-package-lock.yml)
2-
31
# Sharding Reverse Proxy for Etherpad
42
This is a reverse proxy that which will shard pads based on padId(within query[currently in socket-namespace branch of Etherpad core]) to a pool of backends based on the availability of the backends which is based on the number of concurrent active Pads being edited.
53

6-
It's likely that this project will only get to proof of concept stage(see V0) and then something that integrates with HAProxy/Varnish et al will replace it as NodeJS is probably not the right tool for the job but having the high level management system written in NodeJS makes sense to discover potential pitfalls and best practices.
7-
8-
## Getting started
9-
Copy ``settings.json.template`` to ``settings.json`` and modify the values.
10-
11-
## Usage
12-
```
13-
node app.js
4+
This is now a production grade reverse proxy written in Golang.
5+
6+
## Getting started for production
7+
8+
1. Install Docker
9+
2. Install Docker Compose
10+
3. Use the provided docker-compose
11+
4. Copy ``settings.json.template`` to ``settings.json`` and modify the values.
12+
5. Depending on the `port` value in `settings.json`, you may need to modify the `ports` section of the `docker-compose.yml` file.
13+
14+
```yaml
15+
reverse-proxy:
16+
container_name: reverse-proxy
17+
image: ghcr.io/ether/etherpad-proxy:latest
18+
ports:
19+
- "9000:9000"
20+
volumes:
21+
- ./reverse-proxy/db:/app/db
22+
- ./settings.json:/app/settings.json
1423
```
1524
1625
Visit http://localhost:9000
1726
1827
## Settings
28+
1929
Settings come from ``settings.json``, see ``settings.json.template`` for an example to modify for your environment.
2030
2131
``backends`` is your Backend Etherpad instances.
2232
2333
``maxPadsPerInstance`` is how many active pads you want to allow per instance. This value should be between 1 and 20000 depending on the number of authors and words per minute that you limit or you wish to allow. Once this limit is met then random instances will be used.
2434
25-
``checkInterval`` is how often to check every backend for availability. You should set this to a low number if you have lower number of very active instances with short pad life. You should set this to a high number if you have lost of instances with relatively long pad life expectancy.
35+
``checkInterval`` is how often to check every backend for availability. You should set this to a low number if you have lower number of very active instances with short pad life. You should set this to a high number if you have lots of instances with relatively long pad life expectancy.
2636
2737
``port`` is the port this service listens on.
2838
29-
For database settings/options please see UeberDB https://github.com/ether/ueberdb
30-
3139
## V1
32-
- [ ] Test in production.
33-
- [ ] Figure out why changing ``1000`` to ``200`` for ``checkInterval`` makes tests fail.
34-
- [ ] Abstract http-proxy out / introduce support for other proxy software/services.
3540
- [ ] API to create/destroy backends - REF: https://github.com/colyseus/proxy/blob/master/proxy.ts
36-
- [ ] If no backends are available, send a message explaining "we're full up"
3741
3842
# License
3943
Apache 2

db/.gitkeep

Whitespace-only changes.

docker-compose.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,11 @@ services:
2323
volumes:
2424
- "./support/settings.json:/opt/etherpad-lite/settings.json"
2525
- "./test3:/opt/etherpad-lite/var"
26+
reverse-proxy:
27+
container_name: reverse-proxy
28+
image: ghcr.io/ether/etherpad-proxy:latest
29+
ports:
30+
- "9000:9000"
31+
volumes:
32+
- ./reverse-proxy/db:/app/db
33+
- ./settings.json:/app/settings.json

settings.json.template

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
},
1717
"maxPadsPerInstance": 5,
1818
"checkInterval": 1000,
19-
"dbType": "dirty",
2019
"dbSettings": {
21-
"filename": "dirty.db"
20+
"filename": "./db/dirty.db"
2221
}
2322
}

0 commit comments

Comments
 (0)