From 34386f8149826552f9837edcd01ecf0c8e843275 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 3 Dec 2025 03:02:39 +0000 Subject: [PATCH] v1.26: Make COTURN explicitly optional with clear guidance MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Major Installation Flow Restructure: **Full Setup (Option 2):** 1. VPN Detection - Shows benefits of VPN vs COTURN 2. Install base software (Asterisk + Baresip) 3. Optional: Internet/FQDN Setup - Clear YES/NO choice with colored guidance - If NO: Uses local network or VPN IP 4. Optional: COTURN Setup (only offered if internet setup chosen) - Clear warning: "⚠ COTURN is complex and usually NOT needed!" - Shows when you DON'T need it (VPN, port forwarding, same network) - Shows when you MIGHT need it (no VPN, VLAN isolation, symmetric NAT) - Defaults to NO 5. PTT configuration **Server Only (Option 3):** - Same flow as Full Setup, but without client software or PTT **Key Improvements:** - COTURN is now a **separate, explicit** optional step (not buried in wizard) - Users see clear guidance on when COTURN is actually needed - VPN is presented as the better alternative - Default answer is NO for COTURN (safer for users) - Colors render properly with -e flag This addresses user feedback that COTURN setup is complex and should be clearly optional, not implied as mandatory. --- easy-asterisk-interactive-v1.25.sh | 161 ++++++++++++++++++++++++++--- 1 file changed, 148 insertions(+), 13 deletions(-) diff --git a/easy-asterisk-interactive-v1.25.sh b/easy-asterisk-interactive-v1.25.sh index a06e80f..aa64e00 100644 --- a/easy-asterisk-interactive-v1.25.sh +++ b/easy-asterisk-interactive-v1.25.sh @@ -2866,14 +2866,84 @@ install_full() { KIOSK_USER="${target_user:-$default_user}" KIOSK_UID=$(id -u "$KIOSK_USER") - # Check for VPN + # Check for VPN first + echo "" + print_header "VPN Detection" + echo "VPNs (Tailscale, NetBird, WireGuard) are great for:" + echo " • Connecting kiosks on different VLANs without COTURN" + echo " • Allowing internet users to call internal kiosks" + echo " • Avoiding complex firewall/NAT configuration" + echo "" detect_vpn_interface || true + # Basic config if ! collect_common_config; then return; fi collect_client_config + + # Install base software install_dependencies INSTALLED_SERVER="y" INSTALLED_CLIENT="y" + + # Optional: Internet/FQDN setup + echo "" + print_header "Internet Access (Optional)" + echo "Do you want to setup internet calling with FQDN and TLS certificates?" + echo "" + echo -e " ${GREEN}Choose YES if:${NC}" + echo " • You want internet users to call your system" + echo " • You have a domain name (FQDN)" + echo " • You need TLS encryption" + echo "" + echo -e " ${YELLOW}Choose NO if:${NC}" + echo " • Local network only" + echo " • Using VPN for remote access" + echo "" + read -p "Setup internet access with FQDN/certs? [y/N]: " do_internet + + if [[ "$do_internet" =~ ^[Yy]$ ]]; then + setup_internet_access + else + # Local network config + if [[ "$USE_VPN" == "y" ]]; then + ASTERISK_HOST="$VPN_IP" + else + ASTERISK_HOST=$(hostname -I | cut -d' ' -f1) + fi + ENABLE_TLS="n" + USE_COTURN="n" + fi + + # Optional: COTURN setup + if [[ "$do_internet" =~ ^[Yy]$ ]]; then + echo "" + print_header "COTURN Setup (Optional)" + echo "COTURN is a TURN/STUN server for NAT traversal." + echo "" + echo -e " ${YELLOW}⚠ COTURN is complex and usually NOT needed!${NC}" + echo "" + echo -e " ${GREEN}You DON'T need COTURN if:${NC}" + echo " • Using VPN (Tailscale, NetBird, WireGuard)" + echo " • Simple port forwarding works for you" + echo " • All devices on same network/VLANs" + echo "" + echo -e " ${RED}You MIGHT need COTURN if:${NC}" + echo " • VPN is not an option" + echo " • Strict firewall/VLAN isolation" + echo " • Symmetric NAT issues" + echo "" + read -p "Setup COTURN server? [y/N]: " do_coturn + + if [[ "$do_coturn" =~ ^[Yy]$ ]]; then + install_coturn + USE_COTURN="y" + else + USE_COTURN="n" + print_info "Skipping COTURN (recommended for most users)" + fi + fi + + # Configure everything configure_asterisk configure_baresip enable_client_services @@ -2887,27 +2957,92 @@ install_full() { detect_ptt_button fi - echo "" - read -p "Run Internet/Certificate Setup wizard now? [Y/n]: " run_setup - [[ ! "$run_setup" =~ ^[Nn]$ ]] && setup_internet_access - print_success "Installation complete" } install_server_only() { print_header "Server Installation" - ASTERISK_HOST="127.0.0.1" - ENABLE_TLS="y" + + # Check for VPN first + echo "" + print_header "VPN Detection" + echo "VPNs (Tailscale, NetBird, WireGuard) are great for:" + echo " • Connecting kiosks on different VLANs without COTURN" + echo " • Allowing internet users to call internal kiosks" + echo " • Avoiding complex firewall/NAT configuration" + echo "" + detect_vpn_interface || true + + # Basic config + if ! collect_common_config; then return; fi + + # Install base software install_asterisk_packages + INSTALLED_SERVER="y" + + # Optional: Internet/FQDN setup + echo "" + print_header "Internet Access (Optional)" + echo "Do you want to setup internet calling with FQDN and TLS certificates?" + echo "" + echo -e " ${GREEN}Choose YES if:${NC}" + echo " • You want internet users to call your system" + echo " • You have a domain name (FQDN)" + echo " • You need TLS encryption" + echo "" + echo -e " ${YELLOW}Choose NO if:${NC}" + echo " • Local network only" + echo " • Using VPN for remote access" + echo "" + read -p "Setup internet access with FQDN/certs? [y/N]: " do_internet + + if [[ "$do_internet" =~ ^[Yy]$ ]]; then + setup_internet_access + else + # Local network config + if [[ "$USE_VPN" == "y" ]]; then + ASTERISK_HOST="$VPN_IP" + else + ASTERISK_HOST=$(hostname -I | cut -d' ' -f1) + fi + ENABLE_TLS="n" + USE_COTURN="n" + fi + + # Optional: COTURN setup + if [[ "$do_internet" =~ ^[Yy]$ ]]; then + echo "" + print_header "COTURN Setup (Optional)" + echo "COTURN is a TURN/STUN server for NAT traversal." + echo "" + echo -e " ${YELLOW}⚠ COTURN is complex and usually NOT needed!${NC}" + echo "" + echo -e " ${GREEN}You DON'T need COTURN if:${NC}" + echo " • Using VPN (Tailscale, NetBird, WireGuard)" + echo " • Simple port forwarding works for you" + echo " • All devices on same network/VLANs" + echo "" + echo -e " ${RED}You MIGHT need COTURN if:${NC}" + echo " • VPN is not an option" + echo " • Strict firewall/VLAN isolation" + echo " • Symmetric NAT issues" + echo "" + read -p "Setup COTURN server? [y/N]: " do_coturn + + if [[ "$do_coturn" =~ ^[Yy]$ ]]; then + install_coturn + USE_COTURN="y" + else + USE_COTURN="n" + print_info "Skipping COTURN (recommended for most users)" + fi + fi + + # Configure everything configure_asterisk open_firewall_ports - INSTALLED_SERVER="y" save_config - - echo "" - read -p "Run Internet/Certificate Setup wizard now? [Y/n]: " run_setup - [[ ! "$run_setup" =~ ^[Nn]$ ]] && setup_internet_access - + print_success "Server installed" }