Linux cesa-www-main 6.1.0-49-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64
Apache/2.4.68 (Debian)
Server IP : 10.218.0.2 & Your IP : 216.73.216.28
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
www /
cesa.co.za /
python /
Delete
Unzip
Name
Size
Permission
Date
Action
__pycache__
[ DIR ]
drwxr-sr-x
2025-12-29 08:35
app
[ DIR ]
drwxr-sr-x
2025-10-28 07:05
venv
[ DIR ]
drwxr-sr-x
2025-12-29 09:06
.env
479
B
-rw-r--r--
2025-12-29 08:31
.htaccess
44
B
-rw-r--r--
2025-12-29 08:31
check-ssl.py
1.36
KB
-rw-r--r--
2025-12-29 08:31
config.py
5.79
KB
-rw-r--r--
2025-12-29 08:31
db-bck.py
10.9
KB
-rw-r--r--
2025-12-29 09:24
db-transfer-no-longer-needed.py
3.94
KB
-rw-r--r--
2025-12-29 08:31
env.example
5.5
KB
-rw-r--r--
2025-12-29 08:31
requirements.txt
266
B
-rw-r--r--
2025-12-29 08:59
run-backup.sh
529
B
-rw-r--r--
2025-12-29 09:24
send-mail.py
1.3
KB
-rw-r--r--
2025-12-29 08:31
server-checks.py
2.93
KB
-rw-r--r--
2025-12-29 08:31
setup-env.sh
3.03
KB
-rw-r--r--
2025-12-29 09:06
Save
Rename
#!/bin/bash # # Setup script for Python virtual environment # This script creates a virtual environment and installs required packages # set -e # Exit on error # Get the directory where this script is located SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" VENV_DIR="${SCRIPT_DIR}/venv" REQUIREMENTS_FILE="${SCRIPT_DIR}/requirements.txt" # Colors for output RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m' NC='\033[0m' # No Color echo -e "${GREEN}Setting up Python virtual environment...${NC}" # Check if Python 3 is available if ! command -v python3 &> /dev/null; then echo -e "${RED}Error: python3 is not installed. Please install Python 3 first.${NC}" exit 1 fi # Check if python3-venv is installed (required for venv module) if ! python3 -m venv --help &> /dev/null; then echo -e "${YELLOW}Warning: python3-venv module not found. Attempting to install...${NC}" if command -v apt-get &> /dev/null; then echo "Please run: sudo apt-get install python3-venv python3-full" exit 1 else echo -e "${RED}Error: Cannot create virtual environment. Please install python3-venv.${NC}" exit 1 fi fi # Check if virtual environment exists and is valid if [ ! -d "$VENV_DIR" ]; then echo -e "${GREEN}Creating virtual environment in ${VENV_DIR}...${NC}" python3 -m venv "$VENV_DIR" echo -e "${GREEN}Virtual environment created successfully.${NC}" elif [ ! -f "${VENV_DIR}/bin/activate" ]; then echo -e "${YELLOW}Virtual environment directory exists but is incomplete. Recreating...${NC}" rm -rf "$VENV_DIR" python3 -m venv "$VENV_DIR" echo -e "${GREEN}Virtual environment recreated successfully.${NC}" else echo -e "${YELLOW}Virtual environment already exists at ${VENV_DIR}${NC}" fi # Verify activate script exists before sourcing if [ ! -f "${VENV_DIR}/bin/activate" ]; then echo -e "${RED}Error: Virtual environment activation script not found at ${VENV_DIR}/bin/activate${NC}" echo -e "${RED}Please remove the venv directory and run this script again:${NC}" echo -e " rm -rf ${VENV_DIR}" exit 1 fi # Activate virtual environment echo -e "${GREEN}Activating virtual environment...${NC}" source "${VENV_DIR}/bin/activate" # Upgrade pip echo -e "${GREEN}Upgrading pip...${NC}" pip install --upgrade pip --quiet # Install requirements if requirements.txt exists if [ -f "$REQUIREMENTS_FILE" ]; then echo -e "${GREEN}Installing requirements from ${REQUIREMENTS_FILE}...${NC}" pip install -r "$REQUIREMENTS_FILE" echo -e "${GREEN}Requirements installed successfully.${NC}" else echo -e "${YELLOW}Warning: ${REQUIREMENTS_FILE} not found. Skipping requirements installation.${NC}" fi echo -e "${GREEN}Setup complete!${NC}" echo "" echo -e "${YELLOW}To activate the virtual environment in the future, run:${NC}" echo -e " source ${VENV_DIR}/bin/activate" echo "" echo -e "${YELLOW}To deactivate, run:${NC}" echo -e " deactivate" echo "" echo -e "${YELLOW}To run scripts with the virtual environment:${NC}" echo -e " ${VENV_DIR}/bin/python ${SCRIPT_DIR}/db-bck.py"