diff --git a/ct/netalertx.sh b/ct/netalertx.sh deleted file mode 100644 index 53e740dcd1..0000000000 --- a/ct/netalertx.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env bash -_CS_DEFAULT_URL="https://raw.githubusercontent.com/community-scripts/DevScripts/main" -_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func" -source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func") -# Copyright (c) 2021-2026 community-scripts ORG -# Author: MickLesk (CanbiZ) -# License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE -# Source: https://github.com/netalertx/NetAlertX - -APP="NetAlertX" -var_tags="${var_tags:-network;monitoring}" -var_cpu="${var_cpu:-1}" -var_ram="${var_ram:-1024}" -var_disk="${var_disk:-4}" -var_os="${var_os:-debian}" -var_version="${var_version:-13}" -var_arm64="${var_arm64:-yes}" -var_unprivileged="${var_unprivileged:-1}" -var_testurl="${var_testurl:-https://github.com/community-scripts/DevScripts/issues/2657}" - -header_info "$APP" -variables -color -catch_errors - -function update_script() { - header_info - check_container_storage - check_container_resources - - if [[ ! -d /opt/netalertx ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - - if check_for_gh_release "netalertx" "netalertx/NetAlertX"; then - msg_info "Stopping NetAlertX" - systemctl stop netalertx - msg_ok "Stopped NetAlertX" - - CLEAN_INSTALL=1 CLEAN_INSTALL_KEEP=".venv" fetch_and_deploy_gh_release "netalertx" "netalertx/NetAlertX" "tarball" - - msg_info "Updating NetAlertX" - cd /opt/netalertx - $STD uv pip install --python .venv/bin/python -r requirements.txt - ln -sfn /opt/netalertx/install/production-filesystem/services /opt/netalertx/services - echo "v$(cat ~/.netalertx)" >/opt/netalertx/.VERSION - date +%s >/opt/netalertx/front/buildtimestamp.txt - msg_ok "Updated NetAlertX" - - msg_info "Starting NetAlertX" - systemctl start netalertx - msg_ok "Started NetAlertX" - msg_ok "Updated successfully!" - fi - exit -} - -start -build_container -description - -msg_ok "Completed Successfully!\n" -echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" -echo -e "${INFO}${YW}Access it using the following URL:${CL}" -echo -e "${GATEWAY}${BGN}http://${IP}:20211${CL}" -echo -e "${INFO}${YW}The login password is in /opt/netalertx_data/.env${CL}" diff --git a/install/netalertx-install.sh b/install/netalertx-install.sh deleted file mode 100644 index e7db23c3c5..0000000000 --- a/install/netalertx-install.sh +++ /dev/null @@ -1,183 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (c) 2021-2026 community-scripts ORG -# Author: MickLesk (CanbiZ) -# License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE -# Source: https://github.com/netalertx/NetAlertX - -source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" -color -verb_ip6 -catch_errors -setting_up_container -network_check -update_os - -msg_info "Installing Dependencies" -$STD apt install -y \ - nginx \ - sqlite3 \ - arp-scan \ - nmap \ - fping \ - nbtscan \ - traceroute \ - mtr-tiny \ - iw \ - snmp \ - dnsutils \ - net-tools \ - avahi-utils \ - libwww-perl \ - usbutils \ - psmisc \ - wget \ - zip \ - cron -msg_ok "Installed Dependencies" - -PHP_VERSION="8.4" PHP_FPM="YES" PHP_MODULE="curl,sqlite3" setup_php -export UV_PYTHON_INSTALL_DIR="/opt/uv-python" -PYTHON_VERSION="3.13" setup_uv -fetch_and_deploy_gh_release "netalertx" "netalertx/NetAlertX" "tarball" - -msg_info "Setting up NetAlertX" -cd /opt/netalertx -$STD uv venv --python 3.13 .venv -$STD uv pip install --python .venv/bin/python -r requirements.txt -ln -sfn /opt/netalertx/install/production-filesystem/services /opt/netalertx/services -ln -sfn /opt/netalertx /app -echo "v$(cat ~/.netalertx)" >/opt/netalertx/.VERSION -date +%s >/opt/netalertx/front/buildtimestamp.txt -mkdir -p /opt/netalertx_data/{config,db,log/plugins,api,tmp} -touch /opt/netalertx_data/log/{app.log,execution_queue.log,app_front.log,app.php_errors.log,stderr.log,db_is_locked.log} -install -m 600 /opt/netalertx/back/app.conf /opt/netalertx_data/config/app.conf -cp /opt/netalertx/back/app.db /opt/netalertx_data/db/app.db -NETALERTX_PASSWORD=$(random_password) -sed -i "s|^TIMEZONE=.*|TIMEZONE='$(timedatectl show -p Timezone --value 2>/dev/null || echo Etc/UTC)'|" /opt/netalertx_data/config/app.conf -cat <>/opt/netalertx_data/config/app.conf -ARPSCAN_ARGS='arp-scan --ignoredups --retry=6' -NMAPDEV_ARGS='nmap --privileged -sn -PR -oX - ' -SETPWD_enable_password=True -SETPWD_password='$(echo -n "$NETALERTX_PASSWORD" | sha256sum | awk '{print $1}')' -EOF -cat </opt/netalertx_data/.env -NETALERTX_PASSWORD=${NETALERTX_PASSWORD} -NETALERTX_APP=/opt/netalertx -NETALERTX_DATA=/opt/netalertx_data -NETALERTX_CONFIG=/opt/netalertx_data/config -NETALERTX_DB=/opt/netalertx_data/db -NETALERTX_API=/opt/netalertx_data/api -NETALERTX_LOG=/opt/netalertx_data/log -NETALERTX_TMP=/opt/netalertx_data/tmp -SYSTEM_SERVICES_RUN_TMP=/opt/netalertx_data/tmp -VENDORSPATH_NEWEST=/opt/netalertx_data/tmp/ieee-oui.txt -LOG_EXECUTION_QUEUE=/opt/netalertx_data/log/execution_queue.log -PYTHONPATH=/opt/netalertx:/opt/netalertx/server:/opt/netalertx/server/plugins -PATH=/opt/netalertx/.venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -PYTHONUNBUFFERED=1 -NMAP_PRIVILEGED=1 -EOF -chmod 600 /opt/netalertx_data/.env -chown -R www-data:www-data /opt/netalertx_data -msg_ok "Set up NetAlertX" - -msg_info "Configuring PHP-FPM and Nginx" -cat </etc/php/8.4/fpm/pool.d/netalertx.conf -[netalertx] -user = www-data -group = www-data -listen = /run/php/netalertx.sock -listen.owner = www-data -listen.group = www-data -pm = dynamic -pm.max_children = 10 -pm.start_servers = 2 -pm.min_spare_servers = 1 -pm.max_spare_servers = 3 -env[NETALERTX_CONFIG] = /opt/netalertx_data/config -env[NETALERTX_DB] = /opt/netalertx_data/db -env[NETALERTX_API] = /opt/netalertx_data/api -env[NETALERTX_LOG] = /opt/netalertx_data/log -php_admin_value[memory_limit] = 256M -EOF -systemctl restart php8.4-fpm -cat <<'EOF' >/etc/nginx/sites-available/netalertx -map "$http_referer|$http_host" $sec_legacy { - "~^https?://(?[^/:]+)(?::\d+)?/.*\|\k(?::\d+)?$" "TRUSTED"; - default "UNTRUSTED"; -} -map $http_sec_fetch_site $is_trusted { - "same-origin" "TRUSTED"; - "" $sec_legacy; - default "UNTRUSTED"; -} -server { - listen 20211 default_server; - large_client_header_buffers 4 16k; - root /opt/netalertx/front; - index index.php; - add_header X-Forwarded-Prefix "/app" always; - - location /server/ { - error_page 403 /403_internal.html; - if ($is_trusted != "TRUSTED") { - return 403; - } - rewrite ^/server/(.*)$ /$1 break; - proxy_pass http://127.0.0.1:20212; - proxy_buffering off; - proxy_cache off; - proxy_http_version 1.1; - proxy_set_header Connection ""; - client_max_body_size 50m; - proxy_read_timeout 3600s; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - } - - location ~* \.php$ { - add_header Cache-Control "no-store"; - fastcgi_pass unix:/run/php/netalertx.sock; - include fastcgi_params; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_param SCRIPT_NAME $fastcgi_script_name; - fastcgi_read_timeout 600; - } -} -EOF -nginx_enable_site "netalertx" -msg_ok "Configured PHP-FPM and Nginx" - -msg_info "Creating Service" -cat </etc/systemd/system/netalertx.service -[Unit] -Description=NetAlertX Backend -After=network-online.target -Wants=network-online.target - -[Service] -Type=simple -User=www-data -Group=www-data -WorkingDirectory=/opt/netalertx -EnvironmentFile=/opt/netalertx_data/.env -AmbientCapabilities=CAP_NET_RAW CAP_NET_ADMIN CAP_NET_BIND_SERVICE -ExecStart=/opt/netalertx/.venv/bin/python3 -m server -Restart=always -RestartSec=5 - -[Install] -WantedBy=multi-user.target -EOF -cat </etc/cron.d/netalertx -* * * * * www-data LOG_EXECUTION_QUEUE=/opt/netalertx_data/log/execution_queue.log /opt/netalertx/services/scripts/cron_script.sh >/dev/null 2>&1 -EOF -systemctl enable -q --now netalertx -msg_ok "Created Service" - -motd_ssh -customize -cleanup_lxc diff --git a/json/netalertx.json b/json/netalertx.json deleted file mode 100644 index 640cc42ad5..0000000000 --- a/json/netalertx.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "NetAlertX", - "slug": "netalertx", - "categories": [ - 4 - ], - "date_created": "2026-11-15", - "type": "ct", - "platforms": ["pve"], - "updateable": true, - "privileged": false, - "interface_port": 20211, - "documentation": "https://docs.netalertx.com/", - "website": "https://netalertx.com/", - "repository": "https://github.com/netalertx/NetAlertX", - "architectures": [ - "amd64", - "arm64" - ], - "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/netalertx.webp", - "description": "NetAlertX watches your network for devices: it discovers everything on the LAN with ARP scans, nmap and imports from routers, Pi-hole or DHCP servers, and tracks when devices come and go. It alerts you about new, unknown or missing devices through email, ntfy, Telegram, MQTT, webhooks and more, and ships many plugins for other integrations.", - "install_methods": [ - { - "type": "default", - "script": "ct/netalertx.sh", - "config_path": "/opt/netalertx_data/config/app.conf", - "resources": { - "cpu": 1, - "ram": 1024, - "hdd": 4, - "os": "Debian", - "version": "13" - } - } - ], - "default_credentials": { - "username": null, - "password": null - }, - "notes": [ - { - "text": "The login password is NETALERTX_PASSWORD in /opt/netalertx_data/.env.", - "type": "info" - }, - { - "text": "The ARP scan only sees the subnet the container's network interface is on; add more subnets under Settings > ARPSCAN.", - "type": "info" - } - ] -}