Skip to content

Plugin for Prosody (Jitsi) for logging user logins and logouts in a given room based on JWT token from a LMS.

License

Notifications You must be signed in to change notification settings

bryanasdev000/jitsi-logging-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

jitsi-logging-plugin

PT-BR

Plugin para o Prosody (Jitsi) para logging das entradas e saídas dos usuários em uma determinada sala. Utilizado para gerar uma lista de presença para ensino a distancia, e utilizado em conjunto com o plugin do Moodle, de onde vem as informações como curso. turma nome do aluno e etc, porem, e de fácil adaptação para outra "fonte" de dados, contanto que as informações cheguem via JWT.

Esse pequeno modulo age basicamente como um man in the middle, recebendo as Informações atraves do JWT, anexando o JID e as enviando para outro serviço.

EN-US

Plugin for Prosody (Jitsi) for logging user logins and logouts in a given room. Used to generate a presence list for distance learning, and used in conjunction with the Moodle plugin, where the Information comes from such as the course. class, student name and etc, however, the code can be easily adapted to another "source" of data, as long as the Information arrives via JWT.

This small module basically acts as a man in the middle, receiving the information through the JWT, attaching the JID and sending it to another service.

Installation

WARNING: WORK IN PROGRESS

Before the install of this plugin make sure you have your Jitsi using authentication by JWT (aka secure domain).

    1. Copy the lua file to the Jitsi Prosody plugins folder, usually /usr/share/jitsi-meet/prosody-plugins/.
    1. Edit line 56 and set the URL to point to your microservice-jitsi-log.
    1. Open /etc/prosody/conf.d/jitsi.domain.tld.cfg.lua, edit the Component "conference.jitsi.domain.tld" "muc component to add presence_logger. Change this line modules_enabled = { [EXISTING MODULES] } TO modules_enabled = { [EXISTING MODULES]; "presence_logger"; }
    1. Restart prosody service.

Your config file shoud look like that:

--- a lot of lines above
Component "conference.jitsi.domain.tld" "muc"
    storage = "memory"
    modules_enabled = {
        "muc_meeting_id";
        "muc_domain_mapper";
        "token_verification";
        "token_moderation";
        "presence_logger"; -- this plugin
    }
    admins = { "focus@auth.jitsi.domain.tld" }
    muc_room_locking = false
    muc_room_default_public_jids = true
--- a lot of lines below

Usage

Include the necessary information in JWT payload.

Token body should look something like this:

{
  "context": {
    "user": {
      "avatar": "https://domain.tld/image.jpg",
      "name": "Bryan",
      "email": "",
      "id": ""
    },
    "group": ""
  },
  "courseid": 1,
  "groupid": "2543",
  "email": "bryan@domain.tld",
  "aud": "jitsi",
  "iss": "moodle",
  "sub": "jitsi.domain.tld",
  "room": "520_1_Python_Intro",
  "exp": 1592485089,
  "moderator": true
}

The context section is main used by Jitsi as "metadata", the rest is sended by Moodle (in my case) on the JWT body to send to another service.

TODO

  • Variable URL for request
  • Callback on request
  • Code review
  • Variable payload
  • Healthcheck user (something like Speakerstats)

Thanks

About

Plugin for Prosody (Jitsi) for logging user logins and logouts in a given room based on JWT token from a LMS.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages