Commit b8266d5a authored by fnux's avatar fnux

Import __coturn type

parent 80d2007b
This diff is collapsed.
cdist-type__coturn(7)
=====================
NAME
----
cdist-type__coturn - Install and configure a coturn TURN server
DESCRIPTION
-----------
This (singleton) type install and configure a coturn TURN
server.
REQUIRED PARAMETERS
-------------------
None.
OPTIONAL PARAMETERS
-------------------
static_auth_secret
Secret used to access the TURN REST API.
realm
Defailt realm.
BOOLEAN PARAMETERS
------------------
use_auth_secret
Allows TURN credentials to be accounted for a specific user id.
no_tcp_relay
Disable TCP relay endpoints.
EXAMPLES
--------
.. code-block:: sh
__coturn \
--realm turn.domain.tld \
--no_tcp_relay
SEE ALSO
--------
- `coturn Github repository <https://github.com/coturn/coturn>`_
AUTHORS
-------
Timothée Floure <timothee.floure@ungleich.ch>
COPYING
-------
Copyright \(C) 2020 Timothée Floure. You can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
#!/bin/sh -e
#
# 2020 Timothée Floure (timothee.floure@ungleich.ch)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
#
__package coturn
# Optional parameters.
if [ -f "$__object/parameter/use_auth_secret" ]; then
export USE_AUTH_SECRET=1
fi
if [ -f "$__object/parameter/static_auth_secret" ]; then
static_auth_secret=$(cat "$__object/parameter/static_auth_secret")
export STATIC_AUTH_SECRET=$static_auth_secret
fi
if [ -f "$__object/parameter/realm" ]; then
realm=$(cat "$__object/parameter/realm")
export REALM=$realm
fi
if [ -f "$__object/parameter/no_tcp_relay" ]; then
no_tcp_relay=$(cat "$__object/parameter/no_tcp_relay")
export NO_TCP_RELAY=$no_tcp_relay
fi
# Hardcoded.
coturn_config='/etc/turnserver.conf'
# Generate and deploy configuration file.
mkdir -p "$__object/files"
"$__type/files/turnserver.conf.sh" > "$__object/files/turnserver.conf"
__file $coturn_config \
--source "$__object/files/turnserver.conf" \
--state present
# Restart coturn server.
require="__file/$coturn_config" __service coturn --action restart
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment