Skip to content

Instantly share code, notes, and snippets.

View sarahbanas's full-sized avatar

Sarah sarahbanas

View GitHub Profile
@sarahbanas
sarahbanas / conference.js
Created July 19, 2020 01:45
Jitsi issue: when a moderator leaves, the room still exists and participants stick around. Fix: replace original USER_LEFT (around line 1988) with the function below. It will kick all users out and leave/disconnect the room.
room.on(JitsiConferenceEvents.USER_LEFT, (id, user) => {
// The logic shared between RN and web.
commonUserLeftHandling(APP.store, room, user);
// if user is a moderator, kick everyone out
if(user.isModerator) {
let participants = APP.conference.listMembers();
participants.forEach(participant => {
APP.store.dispatch(kickedOut(room, participant));
this.leaveRoomAndDisconnect();
@sarahbanas
sarahbanas / jitsi_uploader.sh
Last active October 20, 2021 20:14
Modified /usr/bin/jitsi_uploader.sh that modifies the video file names and path, allowing you to insert the data into a remote or local MySQL database and move the video file to the static jitsi folder for browser viewing/download.
#!/bin/bash
RECORDINGS_DIR=$1
VIDEO_FILE_PATH=$(find $RECORDINGS_DIR -name *.mp4)
VIDEO_FILE_NAME=${VIDEO_FILE_PATH}
### WE USE THIS FILE FOR UPLOADS
CONFIG_FILE_PATH="/etc/jitsi/uploader"
# pull jitsi uploader environment var overrides if it exists
@sarahbanas
sarahbanas / create_prosody_user.sh
Last active May 27, 2020 20:16
Create a prosody user via shell script remotely
# make sure to have your prosody set up on your server, such as remote_prosody@yourserver, and can access root/sudo
# you can create this file and c&p the 5 lines below into the home directory
$ cd ~
$ vi create_prosody_user.sh
#!/bin/bash
sudo -s <<EOF
prosodyctl register $1 yourhost.com "$2"
EOF