From e7667136b0ec53a5879693f3cbb34a0356d83401 Mon Sep 17 00:00:00 2001 From: zarazaex69 Date: Sun, 17 May 2026 21:45:58 +0300 Subject: [PATCH] feat(script): improve Jitsi room configuration in cnc and srv --- script/cnc.sh | 19 ++++++++++++++++++- script/srv.sh | 39 ++++++++++++++++++++++++++++++++++----- 2 files changed, 52 insertions(+), 6 deletions(-) diff --git a/script/cnc.sh b/script/cnc.sh index 27d4cab..689d1fb 100755 --- a/script/cnc.sh +++ b/script/cnc.sh @@ -123,7 +123,24 @@ echo "[*] Using transport: $TRANSPORT" echo "" if [ "$AUTH" = "jitsi" ]; then - read -p "Enter Jitsi room URL (https://host/room or host/room): " ROOM_ID + read -p "Jitsi base URL [default: https://meet.cryptopro.ru/]: " JITSI_BASE_INPUT + JITSI_BASE_URL=${JITSI_BASE_INPUT:-https://meet.cryptopro.ru/} + JITSI_BASE_URL="${JITSI_BASE_URL%/}" + + read -p "Enter Jitsi room name or URL: " JITSI_ROOM_INPUT + if [ -z "$JITSI_ROOM_INPUT" ]; then + echo "[X] Jitsi room name/URL cannot be empty" + exit 1 + fi + + case "$JITSI_ROOM_INPUT" in + http://*|https://*|*/*) + ROOM_ID="$JITSI_ROOM_INPUT" + ;; + *) + ROOM_ID="$JITSI_BASE_URL/$JITSI_ROOM_INPUT" + ;; + esac else read -p "Enter Room ID: " ROOM_ID fi diff --git a/script/srv.sh b/script/srv.sh index 135c6be..6ffd76f 100755 --- a/script/srv.sh +++ b/script/srv.sh @@ -140,12 +140,41 @@ if [ "$CARRIER" = "jazz" ]; then echo "[*] Will generate room before starting server" ;; esac +elif [ "$CARRIER" = "jitsi" ]; then + read -p "Jitsi base URL [default: https://meet.cryptopro.ru/]: " JITSI_BASE_INPUT + JITSI_BASE_URL=${JITSI_BASE_INPUT:-https://meet.cryptopro.ru/} + JITSI_BASE_URL="${JITSI_BASE_URL%/}" + + echo "Room options:" + echo " 1) Auto-generate new room (recommended)" + echo " 2) Use specific room name or URL" + read -p "Enter choice [1-2, default: 1]: " ROOM_CHOICE + + case "$ROOM_CHOICE" in + 2) + read -p "Enter Jitsi room name or URL: " JITSI_ROOM_INPUT + if [ -z "$JITSI_ROOM_INPUT" ]; then + echo "[X] Jitsi room name/URL cannot be empty" + exit 1 + fi + + case "$JITSI_ROOM_INPUT" in + http://*|https://*|*/*) + ROOM_ID="$JITSI_ROOM_INPUT" + ;; + *) + ROOM_ID="$JITSI_BASE_URL/$JITSI_ROOM_INPUT" + ;; + esac + ;; + *) + JITSI_ROOM="olcrtc-$PODMAN_ID" + ROOM_ID="$JITSI_BASE_URL/$JITSI_ROOM" + echo "[*] Generated Jitsi room URL: $ROOM_ID" + ;; + esac else - if [ "$CARRIER" = "jitsi" ]; then - read -p "Enter Jitsi room URL (https://host/room or host/room): " ROOM_ID - else - read -p "Enter Room ID: " ROOM_ID - fi + read -p "Enter Room ID: " ROOM_ID if [ -z "$ROOM_ID" ]; then echo "[X] Room ID/URL cannot be empty" exit 1