Switch to Port 80 using authbind for non-root access
This commit is contained in:
3
app.py
3
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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user