Thumbnail

rani/matterbridge.git

Clone URL: https://git.buni.party/rani/matterbridge.git

Viewing file on branch master

1Matterbridge is not going to implement it's own "mediaserver" instead we make use of other tools that are good at this sort of stuff.
2This mediaserver will be used to upload media to services that don't have support for uploading images/video/files.
3At this moment this is xmpp and irc
4
5> [!INFO]
6> The `MediaServerUpload` option has been deprecated. If you are using it and would like to
7> help reimplement and document it, please open an issue or a pull request.
8
9Running the media server requires a web server which publicly serves files
10in a given directory, where matterbridge can write the files.
11
12# Use local download
13
14In this case we're using matterbridge to download to a local path your webserver has read access to and matterbridge has write access to.
15Matterbridge is running on this same server.
16
17## matterbridge configuration
18
19In this example the local path matterbridge has write access to is `/var/www/matterbridge`
20
21Your server (apache, nginx, ...) exposes this on `http://yourserver.com/matterbridge` (nginx, apache configuration is out of scope)
22
23configuration needs to happen in `[general]`
24```
25[general]
26MediaDownloadPath="/var/www/matterbridge"
27MediaServerDownload="https://yourserver.com/matterbridge"
28```
29
30When using the local download configuration, matterbridge does not clean up any of the content it downloads to the Mediaserver path.
31## Sidenote
32If you run into issues with the amount of storage available, then it is advised to do an automated cleanup which is to be done externally (i.e. via cron). An example of a clean up script and two examples of cron jobs are provided below. These represent the minimal amount of effort needed to handle this and don't take into account any ability to customize much.
33
34cleanup.sh:
35```
36#!/bin/bash
37find /path/to/matterbridge/media -mindepth 1 -mtime +30 -delete
38```
39
40This will delete all downloaded content that is more than 30 days old (but not the media directory itself, due to the use of `-mindepth 1`). You should adjust the path and the max age to suit your own needs. It may be helpful to look at the [`find` manual page](https://www.gnu.org/software/findutils/manual/html_node/find_html/index.html).
41
42To run the script as the user running matterbridge, execute `crontab -e` and add the following line to the bottom of the file:
43```
44@daily /path/to/cleanup.sh
45```
46
47If you want to run it as root, you probably shouldn't (fix your file permissions instead). However, you can add the script to /etc/cron.daily:
48`cp /path/to/cleanup.sh /etc/cron.daily`. This will execute it daily automatically in most Redhat and Debian based Linux distros.