Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Update jicofo start script to check for config. #1176

Merged
merged 3 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 0 additions & 6 deletions debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,6 @@ case "$1" in
OLD_JITSI_CONFIG="/etc/jitsi/jicofo/sip-communicator.properties"
HOCON_CONFIG="/etc/jitsi/jicofo/jicofo.conf"

# Updates config so new and old installs will start using the new config file
if ! grep -q "\-Dconfig.file" "$CONFIG"; then
echo "Updating $CONFIG to use jicofo.conf"
sed -i 's|JAVA_SYS_PROPS="|JAVA_SYS_PROPS="-Dconfig.file='"$HOCON_CONFIG"' |g' $CONFIG
fi

if [ ! -f $HOCON_CONFIG ]; then
echo "Generating an empty jicofo.conf file"
echo "# Jicofo HOCON configuration. See reference.conf in /usr/share/jicofo/jicofo.jar for
Expand Down
14 changes: 13 additions & 1 deletion resources/jicofo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,23 @@
if [[ "$1" == "--help" ]]; then
echo -e "Usage: $0"
echo
echo -e "Supported environment variables: JICOFO_AUTH_PASSWORD, JICOFO_MAX_MEMORY, JAVA_SYS_PROPS."
echo -e "Supported environment variables: JICOFO_MAX_MEMORY, JAVA_SYS_PROPS."
echo
exit 1
fi

if [[ ! "$JAVA_SYS_PROPS" == *"-Dconfig.file="* ]]; then
if [[ -f /etc/jitsi/jicofo/jicofo.conf ]]; then
JAVA_SYS_PROPS="$JAVA_SYS_PROPS -Dconfig.file=/etc/jitsi/jicofo/jicofo.conf"
else
echo
echo "To run jicofo you need a configuration file. Use environment variable JAVA_SYS_PROPS."
echo "e.g. export JAVA_SYS_PROPS=\"-Dconfig.file=/etc/jitsi/jicofo/jicofo.conf\""
echo
exit 2
fi
fi

SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"

mainClass="org.jitsi.jicofo.Main"
Expand Down
20 changes: 9 additions & 11 deletions resources/mvn-exec.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
#!/bin/sh -e

readonly CONFIG=$1
if [ -z ${CONFIG+x} -o ! -f $1 ]; then
echo 'Config file missing.'
exit 1
#!/bin/bash -e

if [[ ! "$JAVA_SYS_PROPS" == *"-Dconfig.file="* ]]; then
echo
echo "To run jicofo you need a configuration file. Use environment variable JAVA_SYS_PROPS."
echo "e.g. export JAVA_SYS_PROPS=\"-Dconfig.file=/etc/jitsi/jicofo/jicofo.conf\""
echo
exit 2
fi

. $CONFIG

export JICOFO_AUTH_PASSWORD

exec mvn compile exec:exec -Dexec.executable=java -Dexec.args="-cp %classpath ${JAVA_SYS_PROPS} org.jitsi.jicofo.Main --domain=\"${JICOFO_HOSTNAME}\" --host=\"${JICOFO_HOST}\" --user_domain=\"${JICOFO_AUTH_DOMAIN}\" --user_name=\"${JICOFO_AUTH_USER}\""
exec mvn ${JAVA_SYS_PROPS} compile exec:java -pl jicofo -Dexec.mainClass=org.jitsi.jicofo.Main
Loading