Skip to content

Commit 077a373

Browse files
committed
Fix merge
2 parents 8cb83fa + 3a48827 commit 077a373

33 files changed

+1344
-886
lines changed

README.md

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,52 @@ This software is a part of __UnicornTranscoder__ project, it's the LoadBalancer
1212

1313
* Plex Media Server
1414
* NodeJS
15-
* npm
15+
* RedisCache (Optionnal)
16+
* Postgresql (Optionnal)
1617

1718
## Setup
1819

1920
### 1. Installation
2021

2122
* Clone the repository
2223
* Install with `npm install`
23-
* Edit the configuration
24-
25-
| Variable | Description |
26-
| ----------------- | ------------------------------------------------------------ |
27-
| cluster | Array of UnicornTranscoder Servers in the cluster |
28-
| preprod | If enabled, will filter on IP and send to the configured UnicornTranscoder, it allows to have a UnicornTranscoder server for developement without impacting users on the Plex Media Server |
29-
| plex | Configuration of the Plex Media server |
30-
| >host | Address to join the Plex Media Server |
31-
| >port | Port of the Plex Media server |
32-
| >sessions | Where Plex store sessions (to grab external subtitles) |
33-
| >database | Plex Media Server Database |
34-
| loadBalancer.port | Port UnicornLoadBalancer will listen |
35-
| alerts.discord | Discord Webhook to notify unavailable UnicornTranscoder |
36-
37-
* Configure Plex Media Server access Address
38-
* In Settings -> Server -> Network
39-
* Set `Custom server access URLs` to the address to access the UnicornLoadBalancer
24+
* Setup some environnement variables to configure the *UnicornLoadBlancer*
25+
26+
| Name | Description | Type | Default |
27+
| ----------------- | ------------------------------------------------------------ | ------| ------- |
28+
| **SERVER_HOST** | Host to access to the *UnicornLoadBalancer* | `string` | `127.0.0.1` |
29+
| **SERVER_PORT** | Port used by the *UnicornLoadBalancer* | `int` | `3001` |
30+
| **SERVER_PUBLIC** | Public url where the *UnicornLoadBalancer* can be called, **with** a slash at the end | `string` | `http://127.0.0.1:3001/` |
31+
| **PLEX_HOST** | Host to access to Plex | `string` | `127.0.0.1` |
32+
| **PLEX_PORT** | Port used by Plex | `int` | `32400` |
33+
| **PLEX_PATH_USR** | The Plex's path | `string` | `/usr/lib/plexmediaserver/` |
34+
| **PLEX_PATH_SESSIONS** | The path where Plex store sessions (to grab external subtitles) | `string` | `/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache/Transcode/Sessions` |
35+
| **DATABASE_MODE** | Kind of database to use with Plex, can be `sqlite` or `postgresql` | `string` | `sqlite` |
36+
| **DATABASE_SQLITE_PATH** | The path of the Plex database | `string` | `/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db` |
37+
| **DATABASE_POSTGRESQL_HOST** | Host of the Postgresql server | `string` | ` ` |
38+
| **DATABASE_POSTGRESQL_DATABASE** | Name of the postgresql database | `string` | ` ` |
39+
| **DATABASE_POSTGRESQL_USER** | User used by the Postgresql database| `string` | ` ` |
40+
| **DATABASE_POSTGRESQL_PASSWORD** | Password used by the Postgresql database | `string` | `sqlite` |
41+
| **DATABASE_POSTGRESQL_PORT** | Port used by the Postgresql database | `int` | `5432` |
42+
| **REDIS_HOST** | The host of the redis database | `string` `undefined` | `undefined` |
43+
| **REDIS_PORT** | Port used by Redis | `int` | `6379` |
44+
| **REDIS_PASSWORD** | The password of the redis database | `string` | ` ` |
45+
| **REDIS_DB** | The index of the redis database | `int` | `0` |
46+
| **CUSTOM_SCORES_TIMEOUT** | Seconds to consider a not-pinged server as unavailable | `int` | `10` |
47+
| **CUSTOM_IMAGE_RESIZER** | Enable or disable the custom (Unicorn) image resizer (most efficient than Plex one) | `bool` | `false` |
48+
| **CUSTOM_IMAGE_PROXY** | Use a proxy to convert images, **with** a slash at the end | `string` | ` ` |
49+
| **CUSTOM_DOWNLOAD_FORWARD** | Enable or disable 302 for download links and direct play, if enabled, transcoders need to have access to media files | `bool` | `false` |
50+
| **CUSTOM_SERVERS_LIST** | Transcoder servers set by default, **with** a slash at the end, separate servers with a **comma** | `string array` | `[]` |
51+
52+
* Configure Plex Media Server access address
53+
* In Settings -> Server -> Network
54+
* Set `Custom server access URLs` to the address to access the UnicornLoadBalancer
4055
* Run with npm start
4156

42-
## 2. Notes
57+
### 2. Notes
4358

44-
All the requests to this Plex Media Server should pass by the UnicornLoadBalancer, if someone reach the server directly without passing through UnicornLoadBalancer he will not be able to start a stream, since FFMPEG binary has been replaced. It is recomended to setup a nginx reverse proxy in front to setup a SSL certificate and to have an iptable to direct access to the users on port 32400.
59+
All requests to the Plex Media Server should pass through the *UnicornLoadBalancer*, if someone reach the server directly he will not be able to start a stream, since FFMPEG binary has been replaced. To solve this problem it is recomended to configure an iptable to drop direct access on port **32400**.
60+
It is also recomended to setup a nginx reverse proxy in front of the *UnicornLoadBalancer* to setup a SSL certificate.
4561

4662
```
4763
#Example iptable
@@ -50,4 +66,3 @@ iptables -A INPUT -p tcp --dport 32400 -i eth0 -s <transcoderIP> -j ACCEPT
5066
#Deny all other incoming connections
5167
iptables -A INPUT -p tcp --dport 32400 -i eth0 -j DROP
5268
```
53-

app.js

Lines changed: 0 additions & 26 deletions
This file was deleted.

bin/www

Lines changed: 0 additions & 49 deletions
This file was deleted.

config.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

core/discord.js

Lines changed: 0 additions & 156 deletions
This file was deleted.

core/proxy.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)