mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
Single Debian/Ubuntu Installer
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
# NetAlertX Proxmox Installer
|
||||
|
||||
A comprehensive installer script for deploying NetAlertX on Proxmox VE (Debian-based) systems. This installer automates the complete setup including dependencies, NGINX configuration, systemd service, and security hardening.
|
||||
An installer script for deploying NetAlertX on Proxmox VE (Debian-based) systems. This installer automates the complete setup including dependencies, NGINX configuration, systemd service, and security hardening.
|
||||
|
||||
## 🚀 Quick Start
|
||||
|
||||
### Prerequisites
|
||||
- Proxmox VE (Debian-based)
|
||||
- Fresh LXC or VM of Debian 13 or Ubuntu 24
|
||||
- Root access
|
||||
- Internet connection
|
||||
|
||||
@@ -13,16 +13,7 @@ A comprehensive installer script for deploying NetAlertX on Proxmox VE (Debian-b
|
||||
|
||||
```bash
|
||||
# Download and run the installer
|
||||
curl -fsSL https://raw.githubusercontent.com/JVKeller/NetAlertX/main/install/proxmox/proxmox-install-netalertx.sh | bash
|
||||
```
|
||||
|
||||
### Non-Interactive Installation
|
||||
```bash
|
||||
# Skip all prompts and use defaults
|
||||
NETALERTX_ASSUME_YES=1 curl -fsSL https://raw.githubusercontent.com/JVKeller/NetAlertX/main/install/proxmox/proxmox-install-netalertx.sh | bash
|
||||
|
||||
# Custom port
|
||||
PORT=8080 NETALERTX_ASSUME_YES=1 curl -fsSL https://raw.githubusercontent.com/JVKeller/NetAlertX/main/install/proxmox/proxmox-install-netalertx.sh | bash
|
||||
wget https://raw.githubusercontent.com/jokob-sk/NetAlertX/refs/heads/main/install/proxmox/proxmox-install-netalertx.sh -O proxmox-install-netalertx.sh && chmod +x proxmox-install-netalertx.sh && ./proxmox-install-netalertx.sh
|
||||
```
|
||||
|
||||
## 📋 What This Installer Does
|
||||
@@ -37,8 +28,6 @@ PORT=8080 NETALERTX_ASSUME_YES=1 curl -fsSL https://raw.githubusercontent.com/JV
|
||||
### Security Features
|
||||
- **Hardened permissions**: Proper user/group ownership
|
||||
- **TMPFS mounts**: Log and API directories mounted as tmpfs for security
|
||||
- **NGINX user**: Configured to run as www-data
|
||||
- **Strict bash options**: Error handling and security
|
||||
|
||||
### Service Management
|
||||
- **Systemd service**: Auto-start on boot with restart policies
|
||||
@@ -48,21 +37,12 @@ PORT=8080 NETALERTX_ASSUME_YES=1 curl -fsSL https://raw.githubusercontent.com/JV
|
||||
## 🔧 Configuration
|
||||
|
||||
### Port Configuration
|
||||
The installer prompts for a custom port (default: 20211) with a 10-second countdown:
|
||||
The installer will prompt for a custom port, or defaultto 20211 after 10-seconds:
|
||||
|
||||
```
|
||||
Enter HTTP port for NetAlertX [20211] (auto-continue in 10s):
|
||||
```
|
||||
|
||||
### Environment Variables
|
||||
| Variable | Description | Default |
|
||||
|----------|-------------|---------|
|
||||
| `NETALERTX_ASSUME_YES` | Skip all prompts | `false` |
|
||||
| `NETALERTX_FORCE` | Force installation | `false` |
|
||||
| `PORT` | Custom HTTP port | `20211` |
|
||||
| `LISTEN_ADDR` | Bind address | `0.0.0.0` |
|
||||
| `ALWAYS_FRESH_INSTALL` | Clear existing data | `false` |
|
||||
|
||||
### Service Management
|
||||
```bash
|
||||
# Check service status
|
||||
|
||||
@@ -267,8 +267,8 @@ mkdir -p /var/www/html
|
||||
# create symbolic link to the installer directory
|
||||
ln -sfn "${INSTALL_DIR}/front" "$WEB_UI_DIR"
|
||||
|
||||
# create symbolic link to NGINX configuration coming with NetAlertX
|
||||
ln -sfn "${INSTALLER_DIR}/${NGINX_CONF_FILE}" "${NGINX_CONFIG}"
|
||||
# Copy NGINX configuration to NetAlertX config directory
|
||||
cp "${INSTALLER_DIR}/${NGINX_CONF_FILE}" "${INSTALL_DIR}/config/${NGINX_CONF_FILE}"
|
||||
|
||||
# Use selected port (may be default 20211)
|
||||
if [ -n "${PORT-}" ]; then
|
||||
@@ -276,22 +276,16 @@ if [ -n "${PORT-}" ]; then
|
||||
printf "%b\n" "Setting webserver to port ($PORT)"
|
||||
printf "%b\n" "--------------------------------------------------------------------------"
|
||||
# Update the template to reflect the right port
|
||||
sed -i "s/listen 20211;/listen ${PORT};/g" "${INSTALLER_DIR}/${NGINX_CONF_FILE}"
|
||||
sed -i "s/listen 20211;/listen ${PORT};/g" "${INSTALL_DIR}/config/${NGINX_CONF_FILE}"
|
||||
sed -i "s/listen /listen ${LISTEN_ADDR}:/g" "${INSTALL_DIR}/config/${NGINX_CONF_FILE}"
|
||||
# Warn if port is already in use
|
||||
if ss -ltn | awk '{print $4}' | grep -q ":${PORT}$"; then
|
||||
printf "%b\n" "--------------------------------------------------------------------------"
|
||||
printf "%b\n" "${RED}[WARNING] ${RESET}Port ${PORT} appears in use. NGINX may fail to bind."
|
||||
printf "%b\n" "--------------------------------------------------------------------------"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Change web interface address if set
|
||||
# if [ -n "${LISTEN_ADDR-}" ]; then
|
||||
# printf "%b\n" "--------------------------------------------------------------------------"
|
||||
# printf "%b\n" "Setting webserver to user-supplied address (${LISTEN_ADDR})"
|
||||
# printf "%b\n" "--------------------------------------------------------------------------"
|
||||
# sed -i "s/listen /listen ${LISTEN_ADDR}:/g" "${NGINX_CONFIG}"
|
||||
# sed -i "s/listen /listen ${LISTEN_ADDR}:/g" "${INSTALLER_DIR}/${NGINX_CONF_FILE}"
|
||||
# fi
|
||||
|
||||
# Run the hardware vendors update at least once
|
||||
printf "%b\n" "--------------------------------------------------------------------------"
|
||||
printf "%b\n" "${GREEN}[VENDORS UPDATE] ${RESET}Run the hardware vendors update"
|
||||
@@ -362,18 +356,9 @@ printf "%b\n" "-----------------------------------------------------------------
|
||||
chgrp -R www-data "$INSTALL_DIR"
|
||||
chmod -R ug+rwX,o-rwx "$INSTALL_DIR"
|
||||
chmod -R ug+rwX,o-rwx "$WEB_UI_DIR"
|
||||
chmod -R ug+rwX "$INSTALL_DIR/log" "$INSTALL_DIR/config"
|
||||
# chmod -R ug+rwX "$INSTALL_DIR/log" "$INSTALL_DIR/config"
|
||||
chown -R www-data:www-data "$FILEDB" 2>/dev/null || true
|
||||
|
||||
mkdir -p "$INSTALL_DIR/log" "$INSTALL_DIR/api"
|
||||
mountpoint -q "$INSTALL_DIR/log" || mount -t tmpfs -o noexec,nosuid,nodev tmpfs "$INSTALL_DIR/log"
|
||||
mountpoint -q "$INSTALL_DIR/api" || mount -t tmpfs -o noexec,nosuid,nodev tmpfs "$INSTALL_DIR/api"
|
||||
mkdir -p "$INSTALL_DIR/log/plugins"
|
||||
touch "$INSTALL_DIR"/log/{app.log,execution_queue.log,app_front.log,app.php_errors.log,stderr.log,stdout.log,db_is_locked.log}
|
||||
touch "$INSTALL_DIR"/api/user_notifications.json
|
||||
chown -R www-data:www-data "$INSTALL_DIR/log" "$INSTALL_DIR/api"
|
||||
chmod -R ug+rwX "$INSTALL_DIR/log" "$INSTALL_DIR/api"
|
||||
|
||||
# start PHP
|
||||
printf "%b\n" "--------------------------------------------------------------------------"
|
||||
printf "%b\n" "${GREEN}[STARTING] ${RESET}Starting PHP and NGINX"
|
||||
|
||||
26
install/proxmox/requirements.txt
Normal file
26
install/proxmox/requirements.txt
Normal file
@@ -0,0 +1,26 @@
|
||||
openwrt-luci-rpc
|
||||
asusrouter
|
||||
asyncio
|
||||
aiohttp
|
||||
graphene
|
||||
flask
|
||||
flask-cors
|
||||
unifi-sm-api
|
||||
tplink-omada-client
|
||||
wakeonlan
|
||||
pycryptodome
|
||||
requests
|
||||
paho-mqtt
|
||||
scapy
|
||||
cron-converter
|
||||
pytz
|
||||
json2table
|
||||
dhcp-leases
|
||||
pyunifi
|
||||
speedtest-cli
|
||||
chardet
|
||||
python-nmap
|
||||
dnspython
|
||||
librouteros
|
||||
yattag
|
||||
git+https://github.com/foreign-sub/aiofreepybox.git
|
||||
Reference in New Issue
Block a user