How to get the version of a jitsi server?

Hi, as a user I´d like to know which version a certain jitsi server is running. I´d like to be able to compare two servers regarding it´s version.

How can I do so?

edit: fix the bang :frowning:

#!/bin/bash
JM_SERV=$1
if [ "$JM_SERV" == "" ]; then
    echo pass jitsi-meet server name in parameter
    exit 1
fi

# if user did not specify https prefix add it (needed by curl)
HTTP=${JM_SERV:0:8}
if [ "${HTTP,,}" != "https://" ]; then
    JM_SERVER='https://'$JM_SERV
else
    JM_SERVER=$JM_SERV
fi

# get jitsi-meet-web version from server
JMW_VER=$(curl --connect-timeout 5 -s -L $JM_SERVER  | grep -aoP "(?<=lib-jitsi-meet.min.js\?v=).*(?=\")")
if [ "$JMW_VER" == "" ]; then
    echo unable to access $JM_SERVER
    exit 1
fi

# try to get version from stable
res=$(curl -s -L https://download.jitsi.org/stable/Packages)
# extact first all jitsi-meet packages
# then extract everything up to the matching jitsi-meet-web version
# then extract the last jitsi-meet version
JM_VER=$(echo -n $res   | grep -aoP  'Package: jitsi-meet Architecture.*' | grep -aoP ".*(?=1\.0\.$JMW_VER)"  | grep -aoP 'Version: 2\.0\.(?!.*Version: 2\.0\.).*' | grep -aoP 'Version: 2\.0\.(.*)-1')
JM_VER=$(echo $JM_VER | cut -d'.' -f 3 | cut -d'-' -f 1 )
if [ "$JM_VER" != "" ]; then
    VERS=stable
fi

# if it fails, try unstable
if [ "$JM_VER" == "" ]; then
    res=$(curl -s -L https://download.jitsi.org/unstable/Packages)
    JM_VER=$(echo -n $res   | grep -aoP  'Package: jitsi-meet Architecture.*' | grep -aoP ".*(?=1\.0\.$JMW_VER)"  | grep -aoP 'Version: 2\.0\.(?!.*Version: 2\.0\.).*' | grep -aoP 'Version: 2\.0\.(.*)-1')
    JM_VER=$(echo $JM_VER | cut -d'.' -f 3 | cut -d'-' -f 1 )
    if [ "$JM_VER" != "" ]; then
        VERS=unstable
    fi
fi

if [ "$VERS" == "" ]; then
    echo the server $JM_SERVER is running the unknown Jitsi-meet-web $JMW_VER version
    exit 1
fi

# success
echo the server $JM_SERV is \(probably\) running $JM_VER \($VERS\)
1 Like

Your shabang is one bang short :wink:

thanks, to think I have used this script for months now and never seen the difference :frowning:

Should only really matter if someone’s using non bash compatible shell, which will be rare these days. I’m just being pedantic because I used to work with groups that insisted on using tcsh on their local machine.

@gpatel-fr thanks!

On my VirtualMachine I didn´t get access to any JM_SERVER. Later I´ll try it on another machine without VM.

However, the

lib-jitsi-meet.min.js\?v=

is already usefull as I can check it manually in my browsers website code view. :+1:

The script needs Internet access, as it’s intended to get at the version of a running server from the outside. If you have access to the server, if it’s running Debian packages all you have to do is dpkg -l | grep jitsi. If it’s a Docker thingy, I don’t know.

There are versions in the index.html file for the web. Also you can execute in the js console JitsiMeetJS.version also, create a meeting with two tabs open and filter ‘version’ in the js console logs. These are all the versions currently available on the client side.