Update PoliticTalk Jitsi room policy

This commit is contained in:
2026-05-16 21:51:14 +05:30
parent 8997f4804f
commit def2d46096
20 changed files with 748 additions and 26 deletions

View File

@@ -10,12 +10,26 @@ BACKUP_DIR="$BACKUP_ROOT/$STAMP"
CONFIG_SRC="$JITSI_DIR/config/$DOMAIN-config.js"
ASSETS_SRC="$JITSI_DIR/assets/public/politictalk"
PROSODY_PLUGINS_SRC="$JITSI_DIR/prosody-plugins"
TITLE_SRC="$JITSI_DIR/web/title.html"
PLUGIN_HEAD_SRC="$JITSI_DIR/web/plugin.head.html"
INTERFACE_SRC="$JITSI_DIR/interface_config/politictalk-overrides.js"
NGINX_SRC="$JITSI_DIR/nginx/$DOMAIN.conf"
CONFIG_DEST="/etc/jitsi/meet/$DOMAIN-config.js"
ASSETS_DEST="/etc/jitsi/meet/public/politictalk"
WEB_IMAGES_DEST="/usr/share/jitsi-meet/images/politictalk"
PROSODY_PLUGINS_DEST="/usr/share/jitsi-meet/prosody-plugins"
TITLE_DEST="/usr/share/jitsi-meet/title.html"
PLUGIN_HEAD_DEST="/usr/share/jitsi-meet/plugin.head.html"
INTERFACE_DEST="/usr/share/jitsi-meet/interface_config.js"
NGINX_DEST="/etc/nginx/sites-available/$DOMAIN.conf"
INTERFACE_MARKER_START="// BEGIN POLITICTALK INTERFACE OVERRIDES"
INTERFACE_MARKER_END="// END POLITICTALK INTERFACE OVERRIDES"
PLUGIN_MARKER_START="<!-- BEGIN POLITICTALK PLUGIN HEAD -->"
PLUGIN_MARKER_END="<!-- END POLITICTALK PLUGIN HEAD -->"
if [[ "$(id -u)" -ne 0 ]]; then
echo "Run this script with sudo on the VPS."
exit 1
@@ -31,6 +45,31 @@ if [[ ! -d "$ASSETS_SRC" ]]; then
exit 1
fi
if [[ ! -d "$PROSODY_PLUGINS_SRC" ]]; then
echo "Missing Prosody plugins source: $PROSODY_PLUGINS_SRC"
exit 1
fi
if [[ ! -f "$TITLE_SRC" ]]; then
echo "Missing title source: $TITLE_SRC"
exit 1
fi
if [[ ! -f "$PLUGIN_HEAD_SRC" ]]; then
echo "Missing plugin head source: $PLUGIN_HEAD_SRC"
exit 1
fi
if [[ ! -f "$INTERFACE_SRC" ]]; then
echo "Missing interface source: $INTERFACE_SRC"
exit 1
fi
if [[ ! -f "$INTERFACE_DEST" ]]; then
echo "Missing Jitsi interface config destination: $INTERFACE_DEST"
exit 1
fi
install -d -m 0755 "$BACKUP_DIR"
if [[ -f "$CONFIG_DEST" ]]; then
@@ -42,16 +81,72 @@ if [[ -d "$ASSETS_DEST" ]]; then
cp -a "$ASSETS_DEST" "$BACKUP_DIR/public/"
fi
if [[ -d "$WEB_IMAGES_DEST" ]]; then
install -d -m 0755 "$BACKUP_DIR/usr-share-jitsi-meet/images"
cp -a "$WEB_IMAGES_DEST" "$BACKUP_DIR/usr-share-jitsi-meet/images/"
fi
if [[ -f "$TITLE_DEST" ]]; then
install -d -m 0755 "$BACKUP_DIR/usr-share-jitsi-meet"
cp -a "$TITLE_DEST" "$BACKUP_DIR/usr-share-jitsi-meet/"
fi
if [[ -f "$PLUGIN_HEAD_DEST" ]]; then
install -d -m 0755 "$BACKUP_DIR/usr-share-jitsi-meet"
cp -a "$PLUGIN_HEAD_DEST" "$BACKUP_DIR/usr-share-jitsi-meet/"
fi
if [[ -f "$INTERFACE_DEST" ]]; then
install -d -m 0755 "$BACKUP_DIR/usr-share-jitsi-meet"
cp -a "$INTERFACE_DEST" "$BACKUP_DIR/usr-share-jitsi-meet/"
fi
if [[ -d "$PROSODY_PLUGINS_DEST" ]]; then
install -d -m 0755 "$BACKUP_DIR/usr-share-jitsi-meet/prosody-plugins"
find "$PROSODY_PLUGINS_DEST" -maxdepth 1 -name 'mod_politictalk_*.lua' -type f -exec cp -a {} "$BACKUP_DIR/usr-share-jitsi-meet/prosody-plugins/" \;
fi
if [[ "${DEPLOY_NGINX:-0}" == "1" && -f "$NGINX_DEST" ]]; then
cp -a "$NGINX_DEST" "$BACKUP_DIR/"
fi
install -d -m 0755 "$ASSETS_DEST"
install -d -m 0755 "$WEB_IMAGES_DEST"
install -m 0644 "$CONFIG_SRC" "$CONFIG_DEST"
install -m 0644 "$TITLE_SRC" "$TITLE_DEST"
find "$ASSETS_SRC" -maxdepth 1 -type f -print0 | while IFS= read -r -d '' file; do
install -m 0644 "$file" "$ASSETS_DEST/"
install -m 0644 "$file" "$WEB_IMAGES_DEST/"
done
install -d -m 0755 "$PROSODY_PLUGINS_DEST"
find "$PROSODY_PLUGINS_SRC" -maxdepth 1 -name 'mod_politictalk_*.lua' -type f -print0 | while IFS= read -r -d '' file; do
install -m 0644 "$file" "$PROSODY_PLUGINS_DEST/"
done
tmp_plugin_head="$(mktemp)"
awk -v start="$PLUGIN_MARKER_START" -v end="$PLUGIN_MARKER_END" '
$0 == start { skip = 1; next }
$0 == end { skip = 0; next }
!skip { print }
' "$PLUGIN_HEAD_DEST" > "$tmp_plugin_head"
printf '\n%s\n' "$PLUGIN_MARKER_START" >> "$tmp_plugin_head"
cat "$PLUGIN_HEAD_SRC" >> "$tmp_plugin_head"
printf '\n%s\n' "$PLUGIN_MARKER_END" >> "$tmp_plugin_head"
install -m 0644 "$tmp_plugin_head" "$PLUGIN_HEAD_DEST"
rm -f "$tmp_plugin_head"
tmp_interface="$(mktemp)"
awk -v start="$INTERFACE_MARKER_START" -v end="$INTERFACE_MARKER_END" '
$0 == start { skip = 1; next }
$0 == end { skip = 0; next }
!skip { print }
' "$INTERFACE_DEST" > "$tmp_interface"
printf '\n' >> "$tmp_interface"
cat "$INTERFACE_SRC" >> "$tmp_interface"
install -m 0644 "$tmp_interface" "$INTERFACE_DEST"
rm -f "$tmp_interface"
if [[ "${DEPLOY_NGINX:-0}" == "1" ]]; then
if [[ ! -f "$NGINX_SRC" ]]; then
echo "Missing nginx source: $NGINX_SRC"

View File

@@ -13,4 +13,4 @@ fi
"$SCRIPT_DIR/local-jitsi-sync.sh"
cd "$STACK_DIR"
docker compose restart web
docker compose up -d --force-recreate web

View File

@@ -67,7 +67,7 @@ set_env HTTP_PORT "$HTTP_PORT"
set_env HTTPS_PORT "$HTTPS_PORT"
set_env PUBLIC_URL "$PUBLIC_URL"
set_env ENABLE_PREJOIN_PAGE 1
set_env ENABLE_PREJOIN_PAGE 0
set_env ENABLE_WELCOME_PAGE 1
set_env ENABLE_NOISY_MIC_DETECTION 1
set_env ENABLE_NO_AUDIO_DETECTION 1
@@ -86,6 +86,37 @@ set_env DYNAMIC_BRANDING_URL /images/politictalk/branding.json
set_env TOOLBAR_BUTTONS microphone,chat,raisehand,fullscreen,noisesuppression,participants-pane,hangup
set_env HIDE_PREMEETING_BUTTONS microphone,camera,select-background,invite,settings
set_env HIDE_PREJOIN_EXTRA_BUTTONS no-audio,by-phone
set_env XMPP_MUC_MODULES politictalk_roles
set_env ENABLE_AUTH 0
set_env AUTH_TYPE internal
set_env ENABLE_GUESTS 0
set_env JICOFO_ENABLE_AUTH 0
set_env ENABLE_AUTO_OWNER 1
set_env ENABLE_MODERATOR_CHECKS 0
set_env WAIT_FOR_HOST_DISABLE_AUTO_OWNERS false
if [[ "${ENABLE_POLITICTALK_JWT_AUTH:-0}" == "1" ]]; then
if [[ -z "${POLITICTALK_JITSI_JWT_APP_ID:-}" || -z "${POLITICTALK_JITSI_JWT_APP_SECRET:-}" ]]; then
echo "Set POLITICTALK_JITSI_JWT_APP_ID and POLITICTALK_JITSI_JWT_APP_SECRET before enabling local JWT auth."
exit 1
fi
set_env ENABLE_AUTH 1
set_env AUTH_TYPE jwt
set_env ENABLE_GUESTS 0
set_env JWT_APP_ID "$POLITICTALK_JITSI_JWT_APP_ID"
set_env JWT_APP_SECRET "$POLITICTALK_JITSI_JWT_APP_SECRET"
set_env JWT_ACCEPTED_ISSUERS "$POLITICTALK_JITSI_JWT_APP_ID"
set_env JWT_ACCEPTED_AUDIENCES "${POLITICTALK_JITSI_JWT_AUDIENCE:-jitsi}"
set_env JWT_ALLOW_EMPTY 0
set_env JWT_ENABLE_DOMAIN_VERIFICATION 0
set_env JICOFO_AUTH_TYPE jwt
set_env JICOFO_ENABLE_AUTH 1
set_env ENABLE_AUTO_OWNER 0
set_env ENABLE_MODERATOR_CHECKS 1
set_env WAIT_FOR_HOST_DISABLE_AUTO_OWNERS true
fi
mkdir -p "$CONFIG_DIR"/{web,transcripts,prosody/config,prosody/prosody-plugins-custom,jicofo,jvb,jigasi,jibri}

View File

@@ -17,5 +17,9 @@ mkdir -p "$CONFIG_DIR"/{web,transcripts,prosody/config,prosody/prosody-plugins-c
cp "$LOCAL_DIR/custom-config.js" "$CONFIG_DIR/web/custom-config.js"
cp "$LOCAL_DIR/custom-interface_config.js" "$CONFIG_DIR/web/custom-interface_config.js"
cp "$LOCAL_DIR/docker-compose.override.yml" "$STACK_DIR/docker-compose.override.yml"
find "$CONFIG_DIR/prosody/prosody-plugins-custom" -maxdepth 1 -name 'mod_politictalk_*.lua' -type f -delete
find "$ROOT_DIR/prosody-plugins" -maxdepth 1 -name 'mod_politictalk_*.lua' -type f -print0 | while IFS= read -r -d '' file; do
cp "$file" "$CONFIG_DIR/prosody/prosody-plugins-custom/"
done
echo "Synced PoliticTalk local overrides into Docker Jitsi runtime."