2023-06-06 15:22:33 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Variables
|
|
|
|
if [ -z "$NC_DOMAIN" ]; then
|
|
|
|
echo "You need to provide the NC_DOMAIN."
|
|
|
|
exit 1
|
|
|
|
elif [ -z "$RECORDING_SECRET" ]; then
|
|
|
|
echo "You need to provide the RECORDING_SECRET."
|
|
|
|
exit 1
|
|
|
|
elif [ -z "$INTERNAL_SECRET" ]; then
|
|
|
|
echo "You need to provide the INTERNAL_SECRET."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2023-07-21 17:32:44 +08:00
|
|
|
if [ -z "$HPB_DOMAIN" ]; then
|
|
|
|
export HPB_DOMAIN="$NC_DOMAIN"
|
|
|
|
fi
|
|
|
|
|
2023-06-27 00:18:26 +08:00
|
|
|
cat << RECORDING_CONF > "/conf/recording.conf"
|
2023-06-06 15:22:33 +08:00
|
|
|
[logs]
|
2023-06-24 20:09:57 +08:00
|
|
|
# 30 means Warning
|
2023-06-06 15:22:33 +08:00
|
|
|
level = 30
|
|
|
|
|
|
|
|
[http]
|
|
|
|
listen = 0.0.0.0:1234
|
|
|
|
|
|
|
|
[backend]
|
2023-06-27 16:59:20 +08:00
|
|
|
allowall = ${ALLOW_ALL}
|
2024-01-02 18:29:55 +08:00
|
|
|
# The secret below is still needed if allowall is set to true, also it doesn't hurt to be here
|
|
|
|
secret = ${RECORDING_SECRET}
|
2023-06-06 15:22:33 +08:00
|
|
|
backends = backend-1
|
2023-06-27 16:59:20 +08:00
|
|
|
skipverify = ${SKIP_VERIFY}
|
2023-06-06 15:22:33 +08:00
|
|
|
maxmessagesize = 1024
|
|
|
|
videowidth = 1920
|
|
|
|
videoheight = 1080
|
|
|
|
directory = /tmp
|
|
|
|
|
|
|
|
[backend-1]
|
2023-06-27 19:13:15 +08:00
|
|
|
url = ${HPB_PROTOCOL}://${NC_DOMAIN}
|
2023-06-06 15:22:33 +08:00
|
|
|
secret = ${RECORDING_SECRET}
|
2023-06-27 16:59:20 +08:00
|
|
|
skipverify = ${SKIP_VERIFY}
|
2023-06-06 15:22:33 +08:00
|
|
|
|
|
|
|
[signaling]
|
|
|
|
signalings = signaling-1
|
|
|
|
|
|
|
|
[signaling-1]
|
2023-07-21 17:32:44 +08:00
|
|
|
url = ${HPB_PROTOCOL}://${HPB_DOMAIN}${HPB_PATH}
|
2023-06-06 15:22:33 +08:00
|
|
|
internalsecret = ${INTERNAL_SECRET}
|
|
|
|
|
|
|
|
[ffmpeg]
|
2023-11-16 18:43:49 +08:00
|
|
|
# common = ffmpeg -loglevel level+warning -n
|
2023-06-06 15:22:33 +08:00
|
|
|
# outputaudio = -c:a libopus
|
|
|
|
# outputvideo = -c:v libvpx -deadline:v realtime -crf 10 -b:v 1M
|
|
|
|
extensionaudio = .ogg
|
|
|
|
extensionvideo = .webm
|
2023-11-16 18:43:49 +08:00
|
|
|
|
|
|
|
[recording]
|
|
|
|
browser = firefox
|
2023-06-06 15:22:33 +08:00
|
|
|
RECORDING_CONF
|
|
|
|
|
|
|
|
exec "$@"
|