Fix talkkonnect permission issues and add setup documentation

The installation script had a critical bug where it created the config
directory in the script runner's home directory instead of the target
user's home directory. This caused "permission denied" errors when the
systemd service tried to run as the target user.

Changes:
- Fixed CONFIG_DIR to use $TARGET_HOME instead of $HOME
- Updated config path replacements to use $TARGET_HOME
- Added ownership change after config creation when running as different user
- Created fix_talkkonnect_permissions.sh script to repair existing installations
- Added comprehensive TALKKONNECT_SETUP.md with troubleshooting guide

This fixes the "open /home/user/.config/talkkonnect/talkkonnect.xml: permission denied" error.
This commit is contained in:
Claude
2025-11-23 04:25:56 +00:00
parent cd5a52de63
commit 28a3e394d8
3 changed files with 421 additions and 2 deletions
+8 -2
View File
@@ -434,7 +434,7 @@ echo "======================================================================="
echo "[+] CREATING CONFIGURATION"
echo "======================================================================="
CONFIG_DIR="$HOME/.config/talkkonnect"
CONFIG_DIR="$TARGET_HOME/.config/talkkonnect"
mkdir -p "$CONFIG_DIR"
cat > "$CONFIG_DIR/talkkonnect.xml" << 'EOFXML'
@@ -523,7 +523,13 @@ cat > "$CONFIG_DIR/talkkonnect.xml" << 'EOFXML'
EOFXML
# Update the log path to use actual username
sed -i "s|/home/user/|$HOME/|g" "$CONFIG_DIR/talkkonnect.xml"
sed -i "s|/home/user/|$TARGET_HOME/|g" "$CONFIG_DIR/talkkonnect.xml"
# Set proper ownership if running as a different user
if [ "$TARGET_USER" != "$USER" ]; then
sudo chown -R "$TARGET_USER:$TARGET_USER" "$CONFIG_DIR"
echo "[+] Set ownership of config directory to $TARGET_USER"
fi
echo "[+] Created configuration file: $CONFIG_DIR/talkkonnect.xml"