Skip to content
Merged
34 changes: 33 additions & 1 deletion apps/talk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ debug = false
hashkey = $(openssl rand -hex 16)
blockkey = $(openssl rand -hex 16)
[clients]
internalsecret = $(openssl rand -hex 16)
internalsecret = $(TURN_INTERNAL_SECRET)
[backend]
allowed = ${TURN_DOMAIN}
allowall = false
Expand Down Expand Up @@ -486,3 +486,35 @@ else
msg_box "Congratulations, everything is working as intended! The installation succeeded.\n\nLogging can be found by typing: journalctl -lfu signaling"
exit 0
fi

####### Talk recording
print_text_in_color "$ICyan" "Setting up Talk recording..."

# Pull and start
docker pull nextcloud/aio-talk-recording:latest
docker run -t -d -p "$TURN_RECORDING_HOST":"$TURN_RECORDING_HOST_PORT":"$TURN_RECORDING_HOST_PORT" \
--restart always \
--name talk-recording \
nextcloud/aio-talk-recording \
–cap-add=sys_nice \
--shm-size=2g \
-e NC_DOMAIN="${TURN_DOMAIN}" \
-e TZ="${TIMEZONE}" \
-e RECORDING_SECRET="${TURN_RECORDING_SECRET}" \
-e INTERNAL_SECRET="${TURN_INTERNAL_SECRET}"

# Talk recording
if [ -d "$NCPATH/apps/spreed" ]
then
if [ "$TALK_RECORDING_ENABLED" = 'yes' ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [shellcheck] reported by reviewdog 🐶
Command appears to be unreachable. Check usage (or ignore if invoked indirectly). SC2317

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@szaimen Never found the check you run here, but I guess it's something like is_this_docker_running talk_recording?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [shellcheck] reported by reviewdog 🐶
Command appears to be unreachable. Check usage (or ignore if invoked indirectly). SC2317

then
while ! nc -z "$TURN_RECORDING_HOST" 1234; do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [shellcheck] reported by reviewdog 🐶
Command appears to be unreachable. Check usage (or ignore if invoked indirectly). SC2317

echo "waiting for Talk Recording to become available..."
sleep 5
done

nextcloud_occ config:app:set spreed recording_servers --value="{\"servers\":[{\"server\":\"http://$TURN_RECORDING_HOST:$TURN_RECORDING_HOST_PORT/\",\"verify\":true}],\"secret\":\"$TURN_RECORDING_SECRET\"}"
else
nextcloud_occ config:app:delete spreed recording_servers
fi
fi
4 changes: 4 additions & 0 deletions lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ turn_install() {
JANUS_API_KEY=$(gen_passwd "$SHUF" "a-zA-Z0-9@#*")
NC_SECRET=$(gen_passwd "$SHUF" "a-zA-Z0-9@#*")
SIGNALING_SERVER_CONF=/etc/signaling/server.conf
TURN_INTERNAL_SECRET=$(gen_passwd "$SHUF" "a-zA-Z0-9@#*")
TURN_RECORDING_SECRET=$(gen_passwd "$SHUF" "a-zA-Z0-9@#*")
TURN_RECORDING_HOST=127.0.0.1
TURN_RECORDING_HOST_PORT=1234
}

## FUNCTIONS
Expand Down