Thumbnail

rani/matterbridge.git

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

Viewing file on branch master

1# Running matterbridge
2
3This page is about running matterbridge from CLI, or as a service. For setup, see [setup.md](setup.md). For configuration, see [config.md](config.md).
4
5## Command-line
6
7```bash
8Usage of ./matterbridge:
9 -conf string
10 config file (default "matterbridge.toml")
11 -debug
12 enable debug
13 -gops
14 enable gops agent
15 -version
16 show version
17```
18
19## docker-compose image
20
21From the directory where you have your configuration `matterbridge.toml`, create a file named `docker-compose.yml`:
22
23```yml
24version: '3.7'
25services:
26 matterbridge:
27 image: ghcr.io/matterbridge-org/matterbridge:latest
28 restart: unless-stopped
29 volumes:
30 - ./matterbridge.toml:/etc/matterbridge/matterbridge.toml:ro
31# command: -debug
32```
33
34Afterwards, start the container with `docker-compose up -d`.
35
36# Service integrations
37
38## systemd
39
40A sample systemd unit to run matterbridge in the background, restarting if necessary.
41
42`/etc/systemd/system/matterbridge.service`, remember to correct `ExecStart=` and `User=`
43
44```dosini
45[Unit]
46Description=Matterbridge daemon
47After=network-online.target
48
49[Service]
50Type=simple
51ExecStart=/path/to/your/matterbridge/binary -conf /path/to/your/matterbridge.toml
52Restart=always
53RestartSec=5s
54User=matterbridge
55
56[Install]
57WantedBy=multi-user.target
58```
59
60Reload systemd with `sudo systemctl daemon-reload`, enable on system start and now with `sudo systemctl enable --now matterbridge.service`
61
62## OpenRC
63
64A sample OpenRC service to run matterbridge in the background.
65
66/etc/init.d/matterbridge
67```sh
68#!/sbin/openrc-run
69# Copyright 2021-2022 Gentoo Authors
70# Distributed under the terms of the GNU General Public License v2
71
72command=/usr/bin/matterbridge
73command_args="-conf ${MATTERBRIDGE_CONF:-/etc/matterbridge/matterbridge.toml} ${MATTERBRIDGE_ARGS}"
74command_user="mattermost:mattermost"
75pidfile="/run/${RC_SVCNAME}.pid"
76command_background=1
77
78depend() {
79 need net
80}
81```
82Enable with `sudo rc-update add matterbridge default`
83
84Start with `sudo rc-service matterbridge start`
85