allow werkzeug to work in our environment

This commit is contained in:
Chuck
2025-08-13 17:32:08 -05:00
parent 33e1f05f77
commit 8e1b04550b
2 changed files with 20 additions and 7 deletions

View File

@@ -296,8 +296,8 @@ else
echo "Building rpi-rgb-led-matrix Python bindings..."
make build-python PYTHON=$(which python3)
cd bindings/python
echo "Installing rpi-rgb-led-matrix Python package..."
python3 setup.py install
echo "Installing rpi-rgb-led-matrix Python package via pip..."
python3 -m pip install --break-system-packages .
popd >/dev/null
else
echo "✗ rpi-rgb-led-matrix-master directory not found at $PROJECT_ROOT_DIR"
@@ -355,10 +355,14 @@ echo "Step 7: Installing web interface service..."
echo "-------------------------------------------"
if [ -f "$PROJECT_ROOT_DIR/install_web_service.sh" ]; then
if [ ! -f "/etc/systemd/system/ledmatrix-web.service" ]; then
bash "$PROJECT_ROOT_DIR/install_web_service.sh"
# Ensure systemd sees any new/changed unit files
systemctl daemon-reload || true
echo "✓ Web interface service installed"
else
echo "ledmatrix-web.service already present; preserving existing configuration and skipping static installer"
fi
else
echo "⚠ install_web_service.sh not found; skipping web service installation"
fi

View File

@@ -1401,4 +1401,13 @@ if __name__ == '__main__':
# In threading mode this uses Werkzeug; allow it explicitly for systemd usage
# Use eventlet server when available; fall back to Werkzeug in threading mode
logger.info(f"Starting web interface on http://0.0.0.0:5001 (async_mode={ASYNC_MODE})")
socketio.run(app, host='0.0.0.0', port=5001, debug=False, use_reloader=False)
# When running without eventlet/gevent, Flask-SocketIO uses Werkzeug, which now
# enforces a production guard unless explicitly allowed. Enable it here.
socketio.run(
app,
host='0.0.0.0',
port=5001,
debug=False,
use_reloader=False,
allow_unsafe_werkzeug=True
)