Compare commits

..

No commits in common. "26ec62beee568ff16830bb45c7ef7ae2bcc60778" and "f9191b4437b11c574c16d82897c3afac716f6fd5" have entirely different histories.

2 changed files with 22 additions and 24 deletions

View File

@ -49,9 +49,6 @@ fi
# Override STD to show all output for debugging # Override STD to show all output for debugging
export STD='' export STD=''
# Force non-interactive mode for all apt operations
export DEBIAN_FRONTEND=noninteractive
# Update PATH to include common installation directories # Update PATH to include common installation directories
export PATH="/usr/local/bin:/usr/local/go/bin:/root/.cargo/bin:/root/.rbenv/bin:/root/.rbenv/shims:/opt/java/bin:$PATH" export PATH="/usr/local/bin:/usr/local/go/bin:/root/.cargo/bin:/root/.rbenv/bin:/root/.rbenv/shims:/opt/java/bin:$PATH"
@ -77,20 +74,17 @@ reload_path() {
[ -f "/root/.cargo/env" ] && source /root/.cargo/env 2>/dev/null || true [ -f "/root/.cargo/env" ] && source /root/.cargo/env 2>/dev/null || true
} }
# Clean up before test to avoid interactive prompts and locks # Helper functions
cleanup_before_test() { msg_info() { echo -e "${BLUE} ${1}${NC}"; }
# Kill any hanging apt processes msg_ok() { echo -e "${GREEN}${1}${NC}"; }
killall apt-get apt 2>/dev/null || true msg_error() { echo -e "${RED}${1}${NC}"; }
msg_warn() { echo -e "${YELLOW}${1}${NC}"; }
# Remove apt locks # Reload environment helper
rm -f /var/lib/dpkg/lock-frontend /var/lib/dpkg/lock /var/cache/apt/archives/lock 2>/dev/null || true reload_path() {
export PATH="/usr/local/bin:/usr/local/go/bin:/root/.cargo/bin:/root/.rbenv/bin:/root/.rbenv/shims:/opt/java/bin:$PATH"
# Remove existing keyrings to avoid overwrite prompts # Source profile files if they exist
rm -f /etc/apt/keyrings/*.gpg 2>/dev/null || true [ -f "/root/.bashrc" ] && source /root/.bashrc 2>/dev/null || true
# Wait a moment for processes to clean up
sleep 1
}
[ -f "/root/.profile" ] && source /root/.profile 2>/dev/null || true [ -f "/root/.profile" ] && source /root/.profile 2>/dev/null || true
[ -f "/root/.cargo/env" ] && source /root/.cargo/env 2>/dev/null || true [ -f "/root/.cargo/env" ] && source /root/.cargo/env 2>/dev/null || true
} }
@ -101,9 +95,6 @@ test_function() {
local test_command="$2" local test_command="$2"
local validation_cmd="${3:-}" local validation_cmd="${3:-}"
# Clean up before starting test
cleanup_before_test
echo -e "\n${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}" echo -e "\n${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
echo -e "${CYAN}Testing: ${test_name}${NC}" echo -e "${CYAN}Testing: ${test_name}${NC}"
echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}" echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
@ -182,14 +173,21 @@ test_function "Adminer" \
"test -f /usr/share/adminer/latest.php && echo 'Adminer installed'" "test -f /usr/share/adminer/latest.php && echo 'Adminer installed'"
# ============================================================================== # ==============================================================================
# TEST 3: CLICKHOUSE # TEST 3: LOCAL IP HELPER
# ==============================================================================
test_function "Local IP Helper" \
"setup_local_ip_helper" \
"systemctl is-enabled local-ip-helper.service &>/dev/null && echo 'Service enabled'"
# ==============================================================================
# TEST 4: CLICKHOUSE
# ============================================================================== # ==============================================================================
test_function "ClickHouse" \ test_function "ClickHouse" \
"setup_clickhouse" \ "setup_clickhouse" \
"clickhouse-server --version" "clickhouse-server --version"
# ============================================================================== # ==============================================================================
# TEST 4: POSTGRESQL # TEST 5: POSTGRESQL
# ============================================================================== # ==============================================================================
test_function "PostgreSQL 17" \ test_function "PostgreSQL 17" \
"PG_VERSION=17 setup_postgresql" \ "PG_VERSION=17 setup_postgresql" \

View File

@ -551,8 +551,8 @@ setup_deb822_repo() {
# Ensure keyring directory exists # Ensure keyring directory exists
mkdir -p /etc/apt/keyrings mkdir -p /etc/apt/keyrings
# Download GPG key (with --yes to avoid interactive prompts) # Download GPG key
curl -fsSL "$gpg_url" | gpg --dearmor --yes -o "/etc/apt/keyrings/${name}.gpg" curl -fsSL "$gpg_url" | gpg --dearmor -o "/etc/apt/keyrings/${name}.gpg"
# Create deb822 sources file # Create deb822 sources file
cat <<EOF >/etc/apt/sources.list.d/${name}.sources cat <<EOF >/etc/apt/sources.list.d/${name}.sources
@ -2138,7 +2138,7 @@ function setup_mongodb() {
# Use standardized repo setup # Use standardized repo setup
mkdir -p /etc/apt/keyrings mkdir -p /etc/apt/keyrings
curl -fsSL "https://pgp.mongodb.com/server-${MONGO_VERSION}.asc" | gpg --dearmor --yes -o "/etc/apt/keyrings/mongodb-${MONGO_VERSION}.gpg" curl -fsSL "https://pgp.mongodb.com/server-${MONGO_VERSION}.asc" | gpg --dearmor -o "/etc/apt/keyrings/mongodb-${MONGO_VERSION}.gpg"
cat <<EOF >/etc/apt/sources.list.d/mongodb-org-${MONGO_VERSION}.sources cat <<EOF >/etc/apt/sources.list.d/mongodb-org-${MONGO_VERSION}.sources
Types: deb Types: deb