|
1 | | -[](https://github.com/ether/etherpad-proxy/actions/workflows/1maxPadPerInstance.yml) [](https://github.com/ether/etherpad-proxy/actions/workflows/3maxPadPerInstance.yml) [](https://github.com/ether/etherpad-proxy/actions/workflows/rapidUniqueness.yml) [](https://github.com/ether/etherpad-proxy/actions/workflows/lint-package-lock.yml) |
2 | | - |
3 | 1 | # Sharding Reverse Proxy for Etherpad |
4 | 2 | 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. |
5 | 3 |
|
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 |
14 | 23 | ``` |
15 | 24 |
|
16 | 25 | Visit http://localhost:9000 |
17 | 26 |
|
18 | 27 | ## Settings |
| 28 | +
|
19 | 29 | Settings come from ``settings.json``, see ``settings.json.template`` for an example to modify for your environment. |
20 | 30 |
|
21 | 31 | ``backends`` is your Backend Etherpad instances. |
22 | 32 |
|
23 | 33 | ``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. |
24 | 34 |
|
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. |
26 | 36 |
|
27 | 37 | ``port`` is the port this service listens on. |
28 | 38 |
|
29 | | -For database settings/options please see UeberDB https://github.com/ether/ueberdb |
30 | | - |
31 | 39 | ## 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. |
35 | 40 | - [ ] 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" |
37 | 41 |
|
38 | 42 | # License |
39 | 43 | Apache 2 |
0 commit comments