Files
n8n-install/scripts/01_system_preparation.sh
Yury Kossakovsky bf5575a48f Add RAGFlow service configuration and documentation
- Updated .env.example to include RAGFlow hostname and internal credentials for MySQL and MinIO.
- Modified Caddyfile to set up a reverse proxy for RAGFlow service.
- Enhanced docker-compose.yml with RAGFlow service definition, including environment variables and health checks for dependencies.
- Updated README.md to include RAGFlow information and service URL for user guidance.
- Configured system preparation script to set vm.max_map_count for Elasticsearch support required by RAGFlow.
- Added secret generation for RAGFlow internal credentials in the secrets generation script.
- Included RAGFlow in the final report script for visibility on service status and access information.
2025-11-05 10:18:35 -07:00

60 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
set -e
# Source the utilities file
source "$(dirname "$0")/utils.sh"
export DEBIAN_FRONTEND=noninteractive
# System Update
log_info "Updating package list and upgrading the system..."
apt update -y && apt upgrade -y
# Installing Basic Utilities
log_info "Installing standard CLI tools..."
apt install -y \
htop git curl make unzip ufw fail2ban python3 psmisc whiptail \
build-essential ca-certificates gnupg lsb-release openssl \
debian-keyring debian-archive-keyring apt-transport-https python3-pip python3-dotenv python3-yaml
# Configuring Firewall (UFW)
log_info "Configuring firewall (UFW)..."
echo "y" | ufw reset
ufw --force enable
ufw default deny incoming
ufw default allow outgoing
ufw allow ssh
ufw allow http
ufw allow https
ufw reload
ufw status
# Configuring Fail2Ban
log_info "Enabling brute-force protection (Fail2Ban)..."
systemctl enable fail2ban
sleep 1
systemctl start fail2ban
sleep 1
fail2ban-client status
sleep 1
fail2ban-client status sshd
# Automatic Security Updates
log_info "Enabling automatic security updates..."
apt install -y unattended-upgrades
# Automatic confirmation for dpkg-reconfigure
echo "y" | dpkg-reconfigure --priority=low unattended-upgrades
# Set vm.max_map_count for Elasticsearch (required for RAGFlow if using ES backend)
log_info "Configuring vm.max_map_count for Elasticsearch support..."
if [ -f /etc/sysctl.conf ]; then
if ! grep -q "^vm.max_map_count" /etc/sysctl.conf; then
echo "vm.max_map_count=262144" >> /etc/sysctl.conf
log_info "Added vm.max_map_count=262144 to /etc/sysctl.conf"
fi
fi
# Apply immediately
sysctl -w vm.max_map_count=262144 > /dev/null 2>&1 || true
exit 0