system-config/docker/jitsi-meet/prosody/rootfs/etc/cont-init.d/10-config
James E. Blair c79c11c2b7 Build jitsi-meet images
So that we can run jitsi-meet with local modifications, build our
own container images.  This builds the base, prosody, and web images
from the docker-jitsi-meet project.  That project has distinct
Dockerfiles for each image, but for simplicity, this change combines
them into a single multi-stage Dockerfile.  The minor stylistic
differences between the different sections are a result of that, and
are intentional in order to minimise the delta from the source material.

Again, for simplicity, this change does not publish the base image
since it is not anticipated that we will run this build often.  If we do,
we could split this back out.

The upstream images are based on pre-built debian packages hosted by
the jitsi project.  Since our goal is to modify the software, we will
need to rebuild the debian packages as well.  This adds a new builder
image that is used to build the debian packages initially.

The docker-jitsi-meet project also has Dockerfiles for several more
images, but since the immediate need is only for the "web" image (built
from the "jitsi-meet" project), we only build that image and the "prosody"
image (not strictly necessary, but it is also a product of the "jisti-meet"
repository, so it seems a good practice to build it as well).

Change-Id: Ib3177ebfe2b8732a3522a1fa101fe95586dd1e1b
2020-03-25 15:40:50 -07:00

68 lines
2.2 KiB
Plaintext

#!/usr/bin/with-contenv bash
if [[ ! -f /config/saslauthd.conf ]]; then
cp /defaults/saslauthd.conf /config/
fi
if [[ ! -f /etc/saslauthd.conf ]]; then
tpl /config/saslauthd.conf > /etc/saslauthd.conf
mkdir -pm777 /var/run/saslauthd
adduser prosody sasl
echo >> /etc/ldap/ldap.conf "TLS_REQCERT allow"
fi
PROSODY_CFG="/config/prosody.cfg.lua"
if [[ ! -d /config/data ]]; then
mkdir -pm 750 /config/data
fi
if [[ "$(stat -c %U /config)" != "prosody" ]]; then
chown -R prosody /config
fi
if [[ "$(stat -c %U /prosody-plugins)" != "prosody" ]]; then
chown -R prosody /prosody-plugins
fi
if [[ "$(stat -c %U /prosody-plugins-custom)" != "prosody" ]]; then
chown -R prosody /prosody-plugins-custom
fi
if [[ ! -f $PROSODY_CFG ]]; then
cp -r /defaults/* /config
tpl /defaults/prosody.cfg.lua > $PROSODY_CFG
tpl /defaults/conf.d/jitsi-meet.cfg.lua > /config/conf.d/jitsi-meet.cfg.lua
prosodyctl --config $PROSODY_CFG register $JICOFO_AUTH_USER $XMPP_AUTH_DOMAIN $JICOFO_AUTH_PASSWORD
prosodyctl --config $PROSODY_CFG register $JVB_AUTH_USER $XMPP_AUTH_DOMAIN $JVB_AUTH_PASSWORD
if [[ ! -z $JIBRI_XMPP_USER ]] && [[ ! -z $JIBRI_XMPP_PASSWORD ]]; then
prosodyctl --config $PROSODY_CFG register $JIBRI_XMPP_USER $XMPP_AUTH_DOMAIN $JIBRI_XMPP_PASSWORD
fi
if [[ ! -z $JIBRI_RECORDER_USER ]] && [[ ! -z $JIBRI_RECORDER_PASSWORD ]]; then
prosodyctl --config $PROSODY_CFG register $JIBRI_RECORDER_USER $XMPP_RECORDER_DOMAIN $JIBRI_RECORDER_PASSWORD
fi
if [[ ! -z $JIGASI_XMPP_USER ]] && [[ ! -z $JIGASI_XMPP_PASSWORD ]]; then
prosodyctl --config $PROSODY_CFG register $JIGASI_XMPP_USER $XMPP_AUTH_DOMAIN $JIGASI_XMPP_PASSWORD
fi
fi
mkdir -p /config/certs
if [[ ! -f /config/certs/$XMPP_DOMAIN.crt ]]; then
# echo for using all default values
echo | prosodyctl --config $PROSODY_CFG cert generate $XMPP_DOMAIN
fi
if [[ ! -f /config/certs/$XMPP_AUTH_DOMAIN.crt ]]; then
# echo for using all default values
echo | prosodyctl --config $PROSODY_CFG cert generate $XMPP_AUTH_DOMAIN
fi
# certs will be created in /config/data
mv /config/data/*.{crt,key} /config/certs/ || true
rm -f /config/data/*.cnf