Switch to Port 80 using authbind for non-root access

This commit is contained in:
Gemini Bot
2026-01-20 13:12:34 +00:00
parent bf1241850b
commit 6e2a9d5b2e
3 changed files with 16 additions and 3 deletions

3
app.py
View File

@@ -73,4 +73,5 @@ def restart_miner():
if __name__ == '__main__': if __name__ == '__main__':
# Run on all interfaces # 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)

View File

@@ -23,7 +23,14 @@ echo "Installing NecroHash to $TARGET_DIR..."
echo "Installing system dependencies..." echo "Installing system dependencies..."
apt-get update apt-get update
# Add automake, autoconf, libtool explicitly, and ensure pthread support # 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) # 2. Cgminer Installation (dtbartle fork for Gridseed GC3355)
if [ ! -f "/usr/local/bin/cgminer" ]; then if [ ! -f "/usr/local/bin/cgminer" ]; then

View File

@@ -16,4 +16,9 @@ fi
echo "Starting NecroHash WebGUI..." echo "Starting NecroHash WebGUI..."
# Run with gunicorn for production or python directly for dev. # Run with gunicorn for production or python directly for dev.
# Using python for simplicity as requested on Pi 1 # 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