Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 23 additions & 30 deletions debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,8 @@ case "$1" in
# and we're done with debconf
db_stop

OLD_JITSI_CONFIG="/usr/share/jitsi-videobridge/.sip-communicator/sip-communicator.properties"
NEW_JITSI_CONFIG="/etc/jitsi/videobridge/sip-communicator.properties"
HOCON_CONFIG="/etc/jitsi/videobridge/jvb.conf"

if [ -f $OLD_JITSI_CONFIG ]; then
mv $OLD_JITSI_CONFIG $NEW_JITSI_CONFIG
echo "# Config has moved to /etc/jitsi/videobridge/
# do not edit this file as it is not used" > ${OLD_JITSI_CONFIG}.old
elif [ ! -f $NEW_JITSI_CONFIG ]; then
# if sip-communicator.properties file is missing create it
# as jvb will search for it and if cannot create it will fail starting
touch $NEW_JITSI_CONFIG
fi

# let's check whether there is a setting in the $CONFIG
# for home folder and logging props file, if missing add it
if ! grep -q "JAVA_SYS_PROPS" "$CONFIG"; then
Expand All @@ -82,25 +70,8 @@ case "$1" in
# and this breaks startup script
sed -i 's/\$JVB_EXTRA_JVM_PARAMS//g' $CONFIG

if ! grep -q "org.ice4j.ice.harvest.STUN_MAPPING_HARVESTER_ADDRESSES" "$NEW_JITSI_CONFIG" \
&& ! grep -q "org.ice4j.ice.harvest.NAT_HARVESTER_PUBLIC_ADDRESS" "$NEW_JITSI_CONFIG" ;then
echo "org.ice4j.ice.harvest.DISABLE_AWS_HARVESTER=true" >> $NEW_JITSI_CONFIG
echo "org.ice4j.ice.harvest.STUN_MAPPING_HARVESTER_ADDRESSES=meet-jit-si-turnrelay.jitsi.net:443" >> $NEW_JITSI_CONFIG
fi

if ! grep -q "org.jitsi.videobridge.xmpp.user.shard.MUC_JIDS" "$NEW_JITSI_CONFIG" ;then
echo "org.jitsi.videobridge.ENABLE_STATISTICS=true" >> $NEW_JITSI_CONFIG
echo "org.jitsi.videobridge.STATISTICS_TRANSPORT=muc" >> $NEW_JITSI_CONFIG
echo "org.jitsi.videobridge.xmpp.user.shard.HOSTNAME=localhost" >> $NEW_JITSI_CONFIG
echo "org.jitsi.videobridge.xmpp.user.shard.DOMAIN=auth.$JVB_HOSTNAME" >> $NEW_JITSI_CONFIG
echo "org.jitsi.videobridge.xmpp.user.shard.USERNAME=jvb" >> $NEW_JITSI_CONFIG
echo "org.jitsi.videobridge.xmpp.user.shard.PASSWORD=$JVB_SECRET" >> $NEW_JITSI_CONFIG
echo "org.jitsi.videobridge.xmpp.user.shard.MUC_JIDS=JvbBrewery@internal.auth.$JVB_HOSTNAME" >> $NEW_JITSI_CONFIG
echo "org.jitsi.videobridge.xmpp.user.shard.MUC_NICKNAME=$(uuidgen)" >> $NEW_JITSI_CONFIG
fi

if [ ! -f $HOCON_CONFIG ]; then
echo "Generating an empty hocon config"
echo "Generating a default hocon config"
echo "videobridge {
http-servers {
public {
Expand All @@ -112,6 +83,28 @@ case "$1" in
domain = \"$JVB_HOSTNAME:443\"
tls = true
}
apis.xmpp-client.configs {
shard {
HOSTNAME=localhost
DOMAIN=\"auth.$JVB_HOSTNAME\"
USERNAME=jvb
PASSWORD=$JVB_SECRET
MUC_JIDS=\"jvbbrewery@internal.auth.$JVB_HOSTNAME\"
MUC_NICKNAME=$(uuidgen)
}
}
}
ice4j {
harvest {
mapping {
aws {
enabled = false
}
stun {
addresses = [\"meet-jit-si-turnrelay.jitsi.net:443\"]
}
}
}
}" >> $HOCON_CONFIG
fi

Expand Down