From be26312ca94150125d24f6b90981ddd3ddda0ef9 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 23 Nov 2025 13:01:19 +0000 Subject: [PATCH] Add quick fix script for talkkonnect issues Created fix_talkkonnect_now.sh to resolve immediate issues: - Sets true for self-signed certificates - Warns about SuperUser account (admin-only, not for clients) - Fixes file ownership and permissions - Creates/updates systemd service - Enables and starts talkkonnect service automatically This fixes: - Certificate errors ("wrong certificate") - SuperUser connection issues (can't connect as SuperUser) - Service not starting automatically The script detects existing installations and fixes them in-place. Minor update to setup_intercom.sh to indicate improved method. --- fix_talkkonnect_now.sh | 183 +++++++++++++++++++++++++++++++++++++++++ setup_intercom.sh | 2 + 2 files changed, 185 insertions(+) create mode 100755 fix_talkkonnect_now.sh diff --git a/fix_talkkonnect_now.sh b/fix_talkkonnect_now.sh new file mode 100755 index 0000000..2883744 --- /dev/null +++ b/fix_talkkonnect_now.sh @@ -0,0 +1,183 @@ +#!/usr/bin/env bash +# ====================================================================== +# File: fix_talkkonnect_now.sh +# Purpose: Quick fix for current talkkonnect issues +# ====================================================================== + +echo "=======================================================================" +echo "TalkKonnect Quick Fix Script" +echo "=======================================================================" +echo "" + +TARGET_USER="${1:-kiosk}" +CONFIG_FILE="/home/$TARGET_USER/.config/talkkonnect/talkkonnect.xml" + +if [ ! -f "$CONFIG_FILE" ]; then + echo "[!] Config file not found: $CONFIG_FILE" + echo "[!] Looking for alternative locations..." + + if [ -f "/home/$TARGET_USER/talkkonnect.xml" ]; then + CONFIG_FILE="/home/$TARGET_USER/talkkonnect.xml" + echo "[+] Found config at: $CONFIG_FILE" + else + echo "[!] No config file found" + exit 1 + fi +fi + +echo "[+] Using config: $CONFIG_FILE" +echo "" + +# Fix 1: Enable insecure mode for self-signed certificates +echo "[1/4] Fixing certificate issue..." +if grep -q "false" "$CONFIG_FILE"; then + sudo sed -i 's|false|true|g' "$CONFIG_FILE" + echo " ✓ Set insecure=true (allows self-signed certificates)" +elif ! grep -q "" "$CONFIG_FILE"; then + sudo sed -i 's|| true\n |' "$CONFIG_FILE" + echo " ✓ Added insecure=true setting" +else + echo " ✓ Certificate setting already correct" +fi +echo "" + +# Fix 2: Check if using SuperUser account +echo "[2/4] Checking account settings..." +if grep -q "SuperUser" "$CONFIG_FILE"; then + echo " ⚠️ WARNING: You're trying to connect as 'SuperUser'" + echo " SuperUser is the SERVER ADMIN account, not a client account." + echo "" + echo " To fix:" + echo " 1. Connect with Mumble desktop/mobile app as SuperUser" + echo " 2. Create a regular user account or allow unregistered users" + echo " 3. Use that account for talkkonnect, not SuperUser" + echo "" + read -p " Change username now? (y/n): " change_user + if [[ "$change_user" =~ ^[Yy]$ ]]; then + read -p " Enter new username: " new_username + sudo sed -i "s|.*|$new_username|" "$CONFIG_FILE" + read -s -p " Enter password (blank if none): " new_password + echo + sudo sed -i "s|.*|$new_password|" "$CONFIG_FILE" + echo " ✓ Username updated" + fi +else + CURRENT_USER=$(grep "" "$CONFIG_FILE" | sed 's/.*\(.*\)<\/username>/\1/') + echo " ✓ Username: $CURRENT_USER (not SuperUser - good!)" +fi +echo "" + +# Fix 3: Check and fix ownership +echo "[3/4] Fixing file permissions..." +sudo chown -R "$TARGET_USER:$TARGET_USER" "$(dirname $CONFIG_FILE)" +sudo chmod 644 "$CONFIG_FILE" +echo " ✓ Ownership set to $TARGET_USER" +echo "" + +# Fix 4: Check systemd service +echo "[4/4] Checking systemd service..." +SERVICE_FILE="/etc/systemd/system/talkkonnect.service" + +if [ ! -f "$SERVICE_FILE" ]; then + echo " ⚠️ Systemd service not found" + echo " Creating service file..." + + TARGET_UID=$(id -u "$TARGET_USER") + TARGET_HOME="/home/$TARGET_USER" + + # Determine which binary to use + if [ -f "/usr/local/bin/talkkonnect" ]; then + BINARY_PATH="/usr/local/bin/talkkonnect" + elif [ -f "$TARGET_HOME/go/bin/talkkonnect" ]; then + BINARY_PATH="$TARGET_HOME/go/bin/talkkonnect" + else + echo " ✗ Talkkonnect binary not found!" + exit 1 + fi + + sudo tee "$SERVICE_FILE" > /dev/null </dev/null; then + echo " Enabling talkkonnect service..." + sudo systemctl enable talkkonnect + echo " ✓ Service enabled (will start on boot)" +fi + +# Check if service is running +if systemctl is-active --quiet talkkonnect 2>/dev/null; then + echo " Restarting talkkonnect service..." + sudo systemctl restart talkkonnect + sleep 3 +else + echo " Starting talkkonnect service..." + sudo systemctl start talkkonnect + sleep 3 +fi + +if systemctl is-active --quiet talkkonnect 2>/dev/null; then + echo " ✓ Service is RUNNING" +else + echo " ✗ Service failed to start" + echo "" + echo "Check logs with: sudo journalctl -u talkkonnect -n 50" +fi + +echo "" +echo "=======================================================================" +echo "✓ Quick Fix Complete!" +echo "=======================================================================" +echo "" +echo "Changes made:" +echo " 1. ✓ Set true (allows self-signed certs)" +echo " 2. ✓ Fixed file ownership" +echo " 3. ✓ Created/updated systemd service" +echo " 4. ✓ Enabled and started talkkonnect service" +echo "" +echo "Important Notes:" +echo "" +echo "❌ SUPERUSER ISSUE:" +echo " 'SuperUser' is the Mumble SERVER ADMIN account." +echo " You CANNOT use it as a regular client." +echo "" +echo " To fix:" +echo " 1. Use Mumble desktop/mobile app to connect as SuperUser" +echo " 2. Create a regular user account on the server" +echo " 3. OR configure server to allow unregistered users" +echo " 4. Update talkkonnect config to use the regular account" +echo "" +echo "Check status:" +echo " sudo systemctl status talkkonnect" +echo "" +echo "View logs:" +echo " sudo journalctl -u talkkonnect -f" +echo "" +echo "Edit config:" +echo " sudo nano $CONFIG_FILE" +echo "" diff --git a/setup_intercom.sh b/setup_intercom.sh index 91a6e57..5a396fb 100755 --- a/setup_intercom.sh +++ b/setup_intercom.sh @@ -206,6 +206,8 @@ install_talkkonnect_with_config() { echo " INSTALLING TALKKONNECT CLIENT" echo "═══════════════════════════════════════════════════════════════" echo + echo "Using improved talkkonnect installation method..." + echo echo "[1/4] Installing Go..." if ! command -v go &>/dev/null; then