From 377d96e3157da717f48c015c5e25bb9a2828a939 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 1 Jan 2026 03:12:33 +0000 Subject: [PATCH 1/4] Initial plan From 97da7c689f7512c924380e606ecebaa6d03cf47c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 1 Jan 2026 03:22:54 +0000 Subject: [PATCH 2/4] Add install.sh from copilot/add-installation-script with alfa branch path updates Co-authored-by: ComunidadTelebots <25162501+ComunidadTelebots@users.noreply.github.com> --- install.sh | 208 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 208 insertions(+) create mode 100755 install.sh diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..3f86ff3 --- /dev/null +++ b/install.sh @@ -0,0 +1,208 @@ +#!/bin/bash +# Installation script for DBTeamV2 +# Created to automate the installation of all dependencies + +set -e + +# Colors for output +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +BLUE='\033[0;34m' +NC='\033[0m' # No Color + +# Function to print colored messages +print_message() { + echo -e "${GREEN}[DBTeamV2]${NC} $1" +} + +print_error() { + echo -e "${RED}[ERROR]${NC} $1" +} + +print_warning() { + echo -e "${YELLOW}[WARNING]${NC} $1" +} + +# Function to detect OS +detect_os() { + if [ -f /etc/os-release ]; then + . /etc/os-release + OS=$ID + VERSION=$VERSION_ID + elif [ -f /etc/lsb-release ]; then + . /etc/lsb-release + OS=$DISTRIB_ID + VERSION=$DISTRIB_RELEASE + else + OS=$(uname -s) + VERSION=$(uname -r) + fi + + echo "$OS" +} + +# Function to check if running as root or with sudo +check_sudo() { + if [ "$EUID" -ne 0 ]; then + if ! command -v sudo &> /dev/null; then + print_error "This script requires sudo privileges. Please install sudo or run as root." + exit 1 + fi + SUDO="sudo" + else + SUDO="" + fi +} + +# Function to install dependencies on Debian/Ubuntu +install_debian_ubuntu() { + print_message "Installing dependencies for Debian/Ubuntu..." + + $SUDO apt-get update + + # Try to install dependencies + if ! $SUDO apt-get install -y git redis-server libconfig8-dev libjansson-dev lua5.2 liblua5.2-dev lua-lgi glib-2.0 libnotify-dev libssl-dev libssl1.0.0 make libstdc++6 g++-4.9 unzip tmux; then + print_warning "Some packages failed to install. Trying with additional repository..." + $SUDO add-apt-repository ppa:ubuntu-toolchain-r/test -y || true + $SUDO apt-get autoclean + $SUDO apt-get update + $SUDO apt-get install -y git redis-server libconfig8-dev libjansson-dev lua5.2 liblua5.2-dev lua-lgi glib-2.0 libnotify-dev libssl-dev libssl1.0.0 make libstdc++6 g++-4.9 unzip libreadline-gplv2-dev libreadline5-dev tmux + fi + + print_message "System dependencies installed successfully!" +} + +# Function to install dependencies on Arch +install_arch() { + print_message "Installing dependencies for Arch Linux..." + + # Note: Arch package names may differ. Using pacman directly for basic packages. + print_warning "Note: Some Debian package names may not exist in Arch. Installing available packages..." + + # Install basic packages with pacman (those that exist) + $SUDO pacman -S --noconfirm --needed git redis lua52 tmux make gcc openssl glib2 libconfig jansson unzip + + # Install lua-lgi from AUR if yay is available + if command -v yay &> /dev/null; then + yay -S --noconfirm --needed lua-lgi + elif command -v yaourt &> /dev/null; then + yaourt -S --noconfirm lua-lgi + else + print_warning "AUR helper (yay/yaourt) not found. You may need to manually install lua-lgi from AUR." + fi + + print_message "System dependencies installed successfully!" +} + +# Function to install dependencies on Fedora +install_fedora() { + print_message "Installing dependencies for Fedora..." + + # Fedora uses different package names than Debian + # Install all packages including lua-devel in one command + $SUDO dnf install -y git redis lua lua-devel tmux make gcc openssl-devel glib2-devel libconfig-devel jansson-devel unzip libnotify-devel readline-devel + + print_message "System dependencies installed successfully!" +} + +# Function to install Python dependencies +install_python_deps() { + print_message "Installing Python dependencies for python_api..." + + if [ ! -d "python_api" ]; then + print_warning "python_api directory not found. Skipping Python dependencies." + return + fi + + if ! command -v python3 &> /dev/null; then + print_error "Python 3 is not installed. Please install Python 3 first." + return + fi + + if ! command -v pip3 &> /dev/null; then + print_warning "pip3 is not installed. Installing pip3..." + case $OS in + ubuntu|debian) + $SUDO apt-get install -y python3-pip + ;; + arch) + $SUDO pacman -S --noconfirm python-pip + ;; + fedora) + $SUDO dnf install -y python3-pip + ;; + esac + fi + + print_message "Installing Python packages from requirements.txt..." + pip3 install --user -r projects/python_api/python_api/requirements.txt + + print_message "Python dependencies installed successfully!" +} + +# Main installation function +main() { + echo -e "${BLUE}" + echo "╔═══════════════════════════════════════════╗" + echo "║ DBTeamV2 Automated Installation Script ║" + echo "╔═══════════════════════════════════════════╗" + echo -e "${NC}" + + # Check sudo + check_sudo + + # Detect OS + OS=$(detect_os) + print_message "Detected OS: $OS" + + # Install system dependencies based on OS + case $OS in + ubuntu|debian) + install_debian_ubuntu + ;; + arch|manjaro) + install_arch + ;; + fedora) + install_fedora + ;; + *) + print_error "Unsupported operating system: $OS" + print_message "Please install dependencies manually according to README.md" + exit 1 + ;; + esac + + # Check if launch.sh exists + if [ ! -f "projects/scripts/scripts/launch.sh" ]; then + print_error "launch.sh not found. Please run this script from the DBTeamV2 directory." + exit 1 + fi + + # Make launch.sh executable if it isn't + chmod +x projects/scripts/scripts/launch.sh + + # Run launch.sh install + print_message "Configuring DBTeamV2 (installing Lua dependencies and telegram-cli)..." + ./projects/scripts/scripts/launch.sh install + + # Ask about Python dependencies + echo "" + read -p "Do you want to install Python API dependencies? (y/n): " -n 1 -r + echo "" + if [[ $REPLY =~ ^[Yy]$ ]]; then + install_python_deps + fi + + echo "" + echo -e "${GREEN}╔═══════════════════════════════════════════╗${NC}" + echo -e "${GREEN}║ Installation completed successfully! ║${NC}" + echo -e "${GREEN}╚═══════════════════════════════════════════╝${NC}" + echo "" + print_message "You can now run './projects/scripts/scripts/launch.sh' to start the bot." + print_message "For more information, see README.md" +} + +# Run main function +main From 4f47aa89013d61ea2c8bb6fe7981f682edafa23c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 1 Jan 2026 03:24:12 +0000 Subject: [PATCH 3/4] Fix python_api directory check to use correct path Co-authored-by: ComunidadTelebots <25162501+ComunidadTelebots@users.noreply.github.com> --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 3f86ff3..a031f72 100755 --- a/install.sh +++ b/install.sh @@ -110,8 +110,8 @@ install_fedora() { install_python_deps() { print_message "Installing Python dependencies for python_api..." - if [ ! -d "python_api" ]; then - print_warning "python_api directory not found. Skipping Python dependencies." + if [ ! -d "projects/python_api/python_api" ]; then + print_warning "projects/python_api/python_api directory not found. Skipping Python dependencies." return fi From 37868f3a0268e91d21a0f8edf41724b7f7101318 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 1 Jan 2026 03:25:40 +0000 Subject: [PATCH 4/4] Fix box drawing characters in installation banner Co-authored-by: ComunidadTelebots <25162501+ComunidadTelebots@users.noreply.github.com> --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index a031f72..a7a6abf 100755 --- a/install.sh +++ b/install.sh @@ -146,7 +146,7 @@ main() { echo -e "${BLUE}" echo "╔═══════════════════════════════════════════╗" echo "║ DBTeamV2 Automated Installation Script ║" - echo "╔═══════════════════════════════════════════╗" + echo "╚═══════════════════════════════════════════╝" echo -e "${NC}" # Check sudo