v2.7: Fixed auto-update path detection for case-sensitive file systems
- Replaced hardcoded paths with dynamic path detection using __file__ - Auto-update now works regardless of folder case (prezenta vs Prezenta) - Added comprehensive dependency management documentation - Enhanced port 80 capability setup script - Updated system packages repository structure - Fixed path resolution for Files/reposytory and system_packages directories
This commit is contained in:
31
setup_port_capability.sh
Executable file
31
setup_port_capability.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Grant the Python executable the capability to bind to privileged ports (like port 80)
|
||||
# This is safer than running the entire application as root
|
||||
|
||||
echo "Setting up Python to bind to privileged ports..."
|
||||
|
||||
# Get the Python executable path and resolve symbolic links
|
||||
PYTHON_PATH=$(which python3)
|
||||
REAL_PYTHON_PATH=$(readlink -f "$PYTHON_PATH")
|
||||
echo "Python path: $PYTHON_PATH"
|
||||
echo "Real Python path: $REAL_PYTHON_PATH"
|
||||
|
||||
# Set the capability on the real executable
|
||||
sudo setcap 'cap_net_bind_service=+ep' "$REAL_PYTHON_PATH"
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "✓ Successfully granted port binding privileges to Python"
|
||||
echo "Your Flask app can now bind to port 80 without running as root"
|
||||
|
||||
# Verify the capability was set
|
||||
echo "Verifying capability:"
|
||||
getcap "$REAL_PYTHON_PATH"
|
||||
else
|
||||
echo "✗ Failed to set capability"
|
||||
echo "Make sure you have libcap2-bin installed: sudo apt install libcap2-bin"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Note: After setting this capability, you can change your Flask app to use port 80"
|
||||
echo "Change the port from 5000 to 80 in your app.py file"
|
||||
Reference in New Issue
Block a user