Use jicofo package

This commit is contained in:
Bob Mottram 2016-11-09 14:19:08 +00:00
parent 35a9e2bf5f
commit 6cfb489b11
1 changed files with 20 additions and 49 deletions

View File

@ -52,8 +52,6 @@ JITSI_AUTH_ONION_HOSTNAME=
# repos # repos
JITSI_MEET_REPO="https://github.com/jitsi/jitsi-meet" JITSI_MEET_REPO="https://github.com/jitsi/jitsi-meet"
JITSI_MEET_COMMIT='4d335e086be74fd9074ff302ff56401beb62bf80' JITSI_MEET_COMMIT='4d335e086be74fd9074ff302ff56401beb62bf80'
JICOFO_REPO="https://github.com/jitsi/jicofo"
JICOFO_COMMIT='91f08b13b34a4fddedc65901c44fce15905d6a1f'
# secrets # secrets
JITSI_VIDEOBRIDGE_SECRET= JITSI_VIDEOBRIDGE_SECRET=
@ -266,56 +264,29 @@ function install_jitsi_videobridge {
} }
function install_jitsi_jicofo { function install_jitsi_jicofo {
apt-get -yq install default-jdk ant apt-get -yq install jicofo
if [ ! -f /usr/share/jicofo/jicofo.sh ]; then
if [ ! -d ${INSTALL_DIR} ]; then echo $'jicofo package install failed'
mkdir -p ${INSTALL_DIR} exit 6238345
fi fi
function_check git_clone systemctl stop jicofo
git_clone ${JICOFO_REPO} ${INSTALL_DIR}/jicofo
if [ ! -d ${INSTALL_DIR}/jicofo ]; then jicofo_config=/etc/jitsi/jicofo/config
exit 63829 sed -i "s|JICOFO_HOST=.*|JICOFO_HOST=localhost|g" $jicofo_config
sed -i "s|JICOFO_HOSTNAME=.*|JICOFO_HOSTNAME=${JITSI_VIDEOBRIDGE_ONION_HOSTNAME}|g" $jicofo_config
sed -i "s|JICOFO_SECRET=.*|JICOFO_SECRET=${JITSI_VIDEOBRIDGE_SECRET}|g" $jicofo_config
sed -i "s|JICOFO_PORT=.*|JICOFO_PORT=${VIDEOBRIDGE_PORT}|g" $jicofo_config
sed -i "s|JICOFO_AUTH_DOMAIN=.*|JICOFO_AUTH_DOMAIN=${JITSI_AUTH_ONION_HOSTNAME}|g" $jicofo_config
sed -i "s|JICOFO_AUTH_USER=.*|JICOFO_AUTH_USER=focus|g" $jicofo_config
sed -i "s|JICOFO_AUTH_PASSWORD=.*|JICOFO_AUTH_PASSWORD=${JITSI_FOCUS_SECRET}|g" $jicofo_config
if [ ! -f /etc/init.d/jicofo ]; then
echo $'jicofo daemon not found'
exit 737279
fi fi
cd ${INSTALL_DIR}/jicofo sed -i 's|exec $DAEMON|exec /usr/bin/torify $DAEMON|g' /etc/init.d/jicofo
git checkout ${JICOFO_COMMIT} -b ${JICOFO_COMMIT} systemctl daemon-reload
set_completion_param "jitsi jicofo commit" "${JICOFO_COMMIT}"
check_architecture=$(uname -a)
if [[ "$check_architecture" == *"amd64"* ]]; then
ant dist.lin64
jicofo_dir=${INSTALL_DIR}/jicofo/dist/lin64
else
ant dist.lin
jicofo_dir=${INSTALL_DIR}/jicofo/dist/lin
fi
if [ ! -d ${jicofo_dir} ]; then
echo $'Jicofo working directory not found'
exit 62825
fi
# TODO does this have to be run as root?
echo '[Unit]' > /etc/systemd/system/jicofo.service
echo 'Description=Jicofo (Jitsi Conference Focus)' >> /etc/systemd/system/jicofo.service
echo 'After=syslog.target network.target tor.service' >> /etc/systemd/system/jicofo.service
echo '' >> /etc/systemd/system/jicofo.service
echo '[Service]' >> /etc/systemd/system/jicofo.service
echo 'Type=simple' >> /etc/systemd/system/jicofo.service
echo 'User=root' >> /etc/systemd/system/jicofo.service
echo 'Group=root' >> /etc/systemd/system/jicofo.service
echo "WorkingDirectory=${jicofo_dir}" >> /etc/systemd/system/jicofo.service
echo "ExecStart=/usr/bin/torify ./jicofo.sh --domain=${JITSI_ONION_HOSTNAME} --secret=\"${JITSI_FOCUS_SECRET}\" --user_domain=${JITSI_AUTH_ONION_HOSTNAME} --user_name=focus --user_password=\"${JITSI_CONFERENCE_SECRET}\"" >> /etc/systemd/system/jicofo.service
echo 'Restart=on-failure' >> /etc/systemd/system/jicofo.service
echo 'SuccessExitStatus=3 4' >> /etc/systemd/system/jicofo.service
echo 'RestartForceExitStatus=3 4' >> /etc/systemd/system/jicofo.service
echo '' >> /etc/systemd/system/jicofo.service
echo '[Install]' >> /etc/systemd/system/jicofo.service
echo 'WantedBy=multi-user.target' >> /etc/systemd/system/jicofo.service
chmod +x /etc/systemd/system/jicofo.service
systemctl enable jicofo
systemctl start jicofo systemctl start jicofo
} }