CHROMEEXTENSIONKEY=$(yq r $SOURCE public.kurento.chromeExtensionKey)
CHROMEEXTENSIONLINK=$(yq r $SOURCE public.kurento.chromeExtensionLink)
ENABLESCREENSHARING=$(yq r $SOURCE public.kurento.enableScreensharing)
ENABLEVIDEO=$(yq r $SOURCE public.kurento.enableVideo)
ETHERPAD_ENABLED=$(yq r $SOURCE public.note.enabled)
ETHERPAD_URL=$(yq r $SOURCE public.note.url)
yq w -i $TARGET public.kurento.wsUrl "$WSURL"
yq w -i $TARGET public.kurento.chromeExtensionKey "$CHROMEEXTENSIONKEY"
yq w -i $TARGET public.kurento.chromeExtensionLink "$CHROMEEXTENSIONLINK"
yq w -i $TARGET public.kurento.enableScreensharing "$ENABLESCREENSHARING"
yq w -i $TARGET public.kurento.enableVideo "$ENABLEVIDEO"
if["$ETHERPAD_ENABLED"=="null"];then
# This is an upgrade from a previous version of 2.2-dev that didn't have settings for etherpad
yq w -i $TARGET public.note.enabled "true"
yq w -i $TARGET public.note.url "$PROTOCOL://$HOST/pad"
else
yq w -i $TARGET public.note.enabled "$ETHERPAD_ENABLED"
yq w -i $TARGET public.note.url "$ETHERPAD_URL"
fi
yq w -i $TARGET public.app.listenOnlyMode "true"
mv -f $SOURCE"${SOURCE}_"
else
# New Setup
WSURL=$(cat $SERVLET_DIR/WEB-INF/classes/bigbluebutton.properties | grep -v '#'| sed -n '/^bigbluebutton.web.serverURL/{s/.*=//;p}'| sed 's/https/wss/g'| sed s'/http/ws/g')
yq w -i $TARGET public.kurento.wsUrl "$WSURL/bbb-webrtc-sfu"
yq w -i $TARGET public.kurento.enableScreensharing "true"
yq w -i $TARGET public.kurento.enableVideo "true"
yq w -i $TARGET public.app.listenOnlyMode "true"
yq w -i $TARGET public.note.enabled "true"
yq w -i $TARGET public.note.url "$PROTOCOL://$HOST/pad"
sed -i "s/proxy_pass .*/proxy_pass http:\/\/$IP:5066;/g" /etc/bigbluebutton/nginx/sip.nginx
sed -i "s/server_name .*/server_name $IP;/g" /etc/nginx/sites-available/bigbluebutton