diff --git a/app.py b/app.py index 6544d32..6512ed2 100644 --- a/app.py +++ b/app.py @@ -73,4 +73,5 @@ def restart_miner(): if __name__ == '__main__': # Run on all interfaces - app.run(host='0.0.0.0', port=5000, debug=True) + # Port 80 requires authbind or root + app.run(host='0.0.0.0', port=80, debug=True) diff --git a/install.sh b/install.sh index 61b4342..bca8eed 100755 --- a/install.sh +++ b/install.sh @@ -23,7 +23,14 @@ echo "Installing NecroHash to $TARGET_DIR..." echo "Installing system dependencies..." apt-get update # Add automake, autoconf, libtool explicitly, and ensure pthread support -apt-get install -y python3 python3-venv git libncurses5-dev libudev-dev build-essential autoconf automake libtool pkg-config libcurl4-openssl-dev libusb-1.0-0-dev +# Added authbind for port 80 access as non-root +apt-get install -y python3 python3-venv git libncurses5-dev libudev-dev build-essential autoconf automake libtool pkg-config libcurl4-openssl-dev libusb-1.0-0-dev authbind + +# 1.1 Configure authbind for Port 80 +echo "Configuring authbind for Port 80..." +touch /etc/authbind/byport/80 +chmod 500 /etc/authbind/byport/80 +chown $USER /etc/authbind/byport/80 # 2. Cgminer Installation (dtbartle fork for Gridseed GC3355) if [ ! -f "/usr/local/bin/cgminer" ]; then diff --git a/start_gui.sh b/start_gui.sh index 74c8e7f..3073ecc 100755 --- a/start_gui.sh +++ b/start_gui.sh @@ -16,4 +16,9 @@ fi echo "Starting NecroHash WebGUI..." # Run with gunicorn for production or python directly for dev. # Using python for simplicity as requested on Pi 1 -python app.py +# Use authbind if available to bind port 80 as non-root +if command -v authbind >/dev/null 2>&1; then + authbind --deep python app.py +else + python app.py +fi