Organize project: Move old code and documentation to oldcode folder, add comprehensive README

This commit is contained in:
Developer
2025-12-18 13:42:59 +02:00
parent 651818f424
commit 901a01c5b8
25 changed files with 6005 additions and 0 deletions

View 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"