Skip to content

Commit

Permalink
Systemd
Browse files Browse the repository at this point in the history
  • Loading branch information
streamer45 committed Jun 6, 2024
1 parent 05adcec commit a60d986
Showing 1 changed file with 45 additions and 1 deletion.
46 changes: 45 additions & 1 deletion docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ docker pull mattermost/rtcd:latest

## Running


### Docker

To start `rtcd` we can run the following command:

```sh
Expand All @@ -30,14 +33,55 @@ docker run --name rtcd -e "RTCD_LOGGER_ENABLEFILE=false" -e "RTCD_API_SECURITY_A
- `8443/udp` and `8443/tcp` are the ports used to route all the calls related media traffic (i.e. voice, screen share). The first one (UDP) is preferred but the latter (TCP) can be used as a fallback.
- `8045/tcp` Is the port used to serve the HTTP/WebSocket internal API to communicate with the Mattermost side (Calls plugin).

### Running with config file
#### Running with config file

Of course it's also possible to provide the service with a complete config file by mounting a volume, e.g.:

```sh
docker run --name rtcd -v /path/to/rtcd/config:/config mattermost/rtcd -config /config/config.toml
```

### Systemd

Alternatively, the `rtcd` binary can be executed throuhg a systemd service file such as:

```
sudo touch /lib/systemd/system/rtcd.service
```

```
[Unit]
Description=rtcd
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/rtcd
Restart=always
RestartSec=10
User=mattermost
Group=mattermost
Environment=API_SECURITY_ALLOWSELFREGISTRATION=true
[Install]
WantedBy=multi-user.target
```

> **_Note:_** By default the service starts even if no configuration file is provided. In such case default values are used. In the service file above we are overriding a config setting through environment variables:
> - `api.security.allow_self_registration` We set this to `true` so that clients (Mattermost instances) can automatically self register and authenticate to the service without manually having to create accounts. This is fine as long as the service is running in an internal/private network.
Load the service file:

```
sudo systemctl daemon-reload
```

Enable and start the service:

```
sudo systemctl enable --now /lib/systemd/system/rtcd.service
```

### Verify service is running

Finally, to verify that the service is correctly running we can try calling the HTTP API:
Expand Down

0 comments on commit a60d986

Please sign in to comment.