From a2b9eabd17e148e0367aa2f834051798ed1caa55 Mon Sep 17 00:00:00 2001 From: "Rodrigo Rodriguez (Pragmatismo)" Date: Sun, 25 Jan 2026 10:53:22 -0300 Subject: [PATCH] Commit all changes before refactoring to Suite/Assistant architecture --- .cargo/config.toml | 2 +- .gitignore | 5 +- .vscode/launch.json | 24 +++++ .vscode/settings.json | 3 + DEPENDENCIES-DEV.sh | 204 ++++++++++++++++++++++++++++++++++++++++++ DEPENDENCIES.sh | 140 +++++++++++++++++++++++++++++ botserver | 2 +- botui | 2 +- 8 files changed, 375 insertions(+), 7 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 .vscode/settings.json create mode 100644 DEPENDENCIES-DEV.sh create mode 100644 DEPENDENCIES.sh diff --git a/.cargo/config.toml b/.cargo/config.toml index 1e44aa9..561e09b 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,5 +1,5 @@ [build] -rustc-wrapper = "/home/rodriguez/.cargo/bin/sccache" +rustc-wrapper = "~/.cargo/bin/sccache" [target.x86_64-unknown-linux-gnu] linker = "clang" diff --git a/.gitignore b/.gitignore index cc52a10..0b61bf6 100644 --- a/.gitignore +++ b/.gitignore @@ -30,10 +30,7 @@ botserver-installers/* !botserver-installers/.gitkeep botserver-stack TODO* -# IDE/Editor settings (local only) -.vscode/ -.zed/ -.idea/ + # Lock file (regenerated from Cargo.toml) Cargo.lock diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..03aef25 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,24 @@ +{ + "version": "0.2.0", + "configurations": [ + + { + "type": "lldb", + "request": "launch", + "name": "Debug executable 'botserver'", + "cargo": { + "args": ["run", "--bin=botserver", "--package=botserver", "--manifest-path=${workspaceFolder}/botserver/Cargo.toml"], + "filter": { + "name": "botserver", + "kind": "bin" + } + }, + "args": [], + "env": { + "RUST_LOG": "trace,aws_sigv4=off,aws_smithy_checksums=off,mio=off,reqwest=off,aws_runtime=off,aws_smithy_http_client=off,rustls=off,hyper_util=off,aws_smithy_runtime=off,aws_smithy_runtime_api=off,tracing=off,aws_sdk_s3=off" + + }, + "cwd": "${workspaceFolder}/botserver" + }, + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..3b66410 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "git.ignoreLimitWarning": true +} \ No newline at end of file diff --git a/DEPENDENCIES-DEV.sh b/DEPENDENCIES-DEV.sh new file mode 100644 index 0000000..076c336 --- /dev/null +++ b/DEPENDENCIES-DEV.sh @@ -0,0 +1,204 @@ +#!/bin/bash +# +# DEPENDENCIES-DEV.sh - Development Dependencies for General Bots +# +# This script installs additional packages needed for BUILDING botserver from source. +# Only install these if you plan to compile the code yourself. +# +# Usage: sudo ./DEPENDENCIES-DEV.sh +# + +set -e + +# Colors +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +NC='\033[0m' + +echo -e "${GREEN}========================================${NC}" +echo -e "${GREEN} General Bots Development Dependencies${NC}" +echo -e "${GREEN}========================================${NC}" + +# Check root +if [ "$EUID" -ne 0 ]; then + echo -e "${RED}Error: Run as root (use sudo)${NC}" + exit 1 +fi + +# Detect OS +if [ -f /etc/os-release ]; then + . /etc/os-release + OS=$ID +else + echo -e "${RED}Error: Cannot detect OS${NC}" + exit 1 +fi + +echo -e "${YELLOW}OS: $OS${NC}" + +install_debian_ubuntu() { + apt-get update + apt-get install -y \ + build-essential \ + gcc \ + g++ \ + clang \ + llvm-dev \ + libclang-dev \ + cmake \ + make \ + git \ + pkg-config \ + libssl-dev \ + libpq-dev \ + liblzma-dev \ + zlib1g-dev \ + libabseil-dev \ + protobuf-compiler \ + libprotobuf-dev \ + automake \ + bison \ + flex \ + gperf \ + libtool \ + m4 \ + nasm \ + python3 \ + python3-pip \ + nodejs \ + npm + + # Cross-compilation toolchains + apt-get install -y \ + gcc-aarch64-linux-gnu \ + gcc-arm-linux-gnueabihf \ + gcc-x86-64-linux-gnu || true +} + +install_fedora_rhel() { + dnf groupinstall -y "Development Tools" + dnf install -y \ + gcc \ + gcc-c++ \ + clang \ + llvm-devel \ + clang-devel \ + cmake \ + make \ + git \ + pkgconf-devel \ + openssl-devel \ + libpq-devel \ + xz-devel \ + zlib-devel \ + abseil-cpp-devel \ + protobuf-compiler \ + protobuf-devel \ + automake \ + bison \ + flex \ + gperf \ + libtool \ + m4 \ + nasm \ + python3 \ + python3-pip \ + nodejs \ + npm +} + +install_arch() { + pacman -Sy --noconfirm \ + base-devel \ + gcc \ + clang \ + llvm \ + cmake \ + make \ + git \ + pkgconf \ + openssl \ + postgresql-libs \ + xz \ + zlib \ + abseil-cpp \ + protobuf \ + automake \ + bison \ + flex \ + gperf \ + libtool \ + m4 \ + nasm \ + python \ + python-pip \ + nodejs \ + npm +} + +install_alpine() { + apk add --no-cache \ + build-base \ + gcc \ + g++ \ + clang \ + llvm-dev \ + clang-dev \ + cmake \ + make \ + git \ + pkgconf-dev \ + openssl-dev \ + postgresql-dev \ + xz-dev \ + zlib-dev \ + abseil-cpp-dev \ + protobuf-dev \ + protoc \ + automake \ + bison \ + flex \ + gperf \ + libtool \ + m4 \ + nasm \ + python3 \ + py3-pip \ + nodejs \ + npm +} + +case $OS in + ubuntu|debian|linuxmint|pop) + install_debian_ubuntu + ;; + fedora|rhel|centos|rocky|almalinux) + install_fedora_rhel + ;; + arch|manjaro) + install_arch + ;; + alpine) + install_alpine + ;; + *) + echo -e "${RED}Unsupported OS: $OS${NC}" + echo "Required development packages:" + echo " - build-essential/base-devel" + echo " - gcc, g++, clang" + echo " - cmake, make, git" + echo " - Development headers for:" + echo " - OpenSSL, PostgreSQL, XZ, zlib" + echo " - Abseil, Protobuf, LLVM" + exit 1 + ;; +esac + +echo -e "${GREEN}Development dependencies installed!${NC}" +echo "" +echo "Install Rust if not already installed:" +echo " curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh" +echo "" +echo "Then build with:" +echo " cargo build --release" diff --git a/DEPENDENCIES.sh b/DEPENDENCIES.sh new file mode 100644 index 0000000..094f56b --- /dev/null +++ b/DEPENDENCIES.sh @@ -0,0 +1,140 @@ +#!/bin/bash +# +# DEPENDENCIES.sh - Runtime Dependencies for General Bots +# +# This script installs all system packages required to RUN botserver binary. +# These are the minimal dependencies needed for production deployment. +# +# Usage: sudo ./DEPENDENCIES.sh +# + +set -e + +# Colors +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +NC='\033[0m' + +echo -e "${GREEN}========================================${NC}" +echo -e "${GREEN} General Bots Runtime Dependencies${NC}" +echo -e "${GREEN}========================================${NC}" + +# Check root +if [ "$EUID" -ne 0 ]; then + echo -e "${RED}Error: Run as root (use sudo)${NC}" + exit 1 +fi + +# Detect OS +if [ -f /etc/os-release ]; then + . /etc/os-release + OS=$ID +else + echo -e "${RED}Error: Cannot detect OS${NC}" + exit 1 +fi + +echo -e "${YELLOW}OS: $OS${NC}" + +install_debian_ubuntu() { + apt-get update + apt-get install -y \ + libpq5 \ + libssl3 \ + liblzma5 \ + zlib1g \ + ca-certificates \ + curl \ + wget \ + libabseil20210324 \ + libclang1 \ + pkg-config \ + snapd + + # LXC for containers + snap install lxd || apt-get install -y lxd || true + + # Initialize LXD + if command -v lxd &> /dev/null && ! lxc list &> /dev/null 2>&1; then + lxd init --auto || true + fi +} + +install_fedora_rhel() { + dnf install -y \ + libpq \ + openssl-libs \ + xz-libs \ + zlib \ + ca-certificates \ + curl \ + wget \ + abseil-cpp \ + clang-libs \ + pkgconf-pkg-config \ + lxc \ + lxc-templates +} + +install_arch() { + pacman -Sy --noconfirm \ + postgresql-libs \ + openssl \ + xz \ + zlib \ + ca-certificates \ + curl \ + wget \ + abseil-cpp \ + clang \ + pkgconf \ + lxc +} + +install_alpine() { + apk add --no-cache \ + libpq \ + openssl \ + xz-libs \ + zlib \ + ca-certificates \ + curl \ + wget \ + abseil-cpp \ + clang \ + pkgconf \ + lxc +} + +case $OS in + ubuntu|debian|linuxmint|pop) + install_debian_ubuntu + ;; + fedora|rhel|centos|rocky|almalinux) + install_fedora_rhel + ;; + arch|manjaro) + install_arch + ;; + alpine) + install_alpine + ;; + *) + echo -e "${RED}Unsupported OS: $OS${NC}" + echo "Required libraries:" + echo " - libpq (PostgreSQL client)" + echo " - libssl (OpenSSL)" + echo " - liblzma (XZ compression)" + echo " - zlib (compression)" + echo " - abseil-cpp (Google Abseil)" + echo " - clang (LLVM runtime)" + echo " - LXC (containers)" + exit 1 + ;; +esac + +echo -e "${GREEN}Runtime dependencies installed!${NC}" +echo "" +echo "You can now run:" +echo " ./botserver" diff --git a/botserver b/botserver index 96fba86..c34d272 160000 --- a/botserver +++ b/botserver @@ -1 +1 @@ -Subproject commit 96fba8646bb4b910ef3484b5d7967cfb8a313d9e +Subproject commit c34d272c5402e1c8ffe2f6bcd3b5918588142953 diff --git a/botui b/botui index 74a2122..fee8b3d 160000 --- a/botui +++ b/botui @@ -1 +1 @@ -Subproject commit 74a2122827b61e00f2a64d297ec002bed4162de8 +Subproject commit fee8b3d2a3341a2a2f31aab6d3656fe32cb3a9c0