From 6a20128960191c61cccb6dcd1f0c84cb17c86f59 Mon Sep 17 00:00:00 2001 From: jokob-sk Date: Wed, 22 Oct 2025 07:48:50 +1100 Subject: [PATCH] BE: install refactor work Signed-off-by: jokob-sk --- .devcontainer/Dockerfile | 2 +- .../config/nginx/netalertx.conf.template | 0 .../services/config/php/conf.d/99-xdebug.ini | 0 .../python/backend-extra-launch-parameters | 0 .venv_import_check.py | 0 Dockerfile | 2 +- back/app.sql | 0 back/ieee-oui.txt | 0 docker-compose.yml | 43 ++++++++++++------- docker_build.log | 0 docs/DEV_PORTS_HOST_MODE.md | 0 install/production-filesystem/README.md | 0 .../app/log/IP_changes.log | 0 install/production-filesystem/app/log/app.log | 0 .../app/log/app.php_errors.log | 0 .../app/log/app_front.log | 0 .../production-filesystem/app/log/crond.log | 0 .../app/log/db_is_locked.log | 0 .../app/log/execution_queue.log | 0 .../app/log/plugins/.dockerignore | 0 .../app/log/report_output.html | 0 .../app/log/report_output.json | 0 .../app/log/report_output.txt | 0 .../production-filesystem/app/log/stderr.log | 0 .../production-filesystem/app/log/stdout.log | 0 .../build/init-backend.sh | 0 .../production-filesystem/build/init-crond.sh | 0 .../production-filesystem/build/init-nginx.sh | 0 .../build/init-php-fpm.sh | 0 install/production-filesystem/entrypoint.sh | 0 .../services/config/nginx/README.md | 0 .../config/nginx/conf.active/netalertx.conf | 0 .../services/config/nginx/fastcgi_params | 0 .../services/config/nginx/mime.types | 0 .../config/nginx/netalertx.conf.template | 0 .../services/config/php/php-fpm.conf | 0 .../services/config/php/php-fpm.d/www.conf | 0 .../python/backend-extra-launch-parameters | 0 .../services/scripts/check-cap.sh | 0 .../scripts/check-first-run-config.sh | 0 .../services/scripts/check-first-run-db.sh | 0 .../scripts/check-mandatory-folders.sh | 0 .../services/scripts/check-permissions.sh | 0 .../services/scripts/check-ramdisk.sh | 0 .../services/scripts/check-root.sh | 0 .../services/scripts/check-storage.sh | 0 requirements.txt | 0 xdebug.out | 0 48 files changed, 30 insertions(+), 17 deletions(-) mode change 100644 => 100755 .devcontainer/Dockerfile mode change 100644 => 100755 .devcontainer/resources/devcontainer-overlay/services/config/nginx/netalertx.conf.template mode change 100644 => 100755 .devcontainer/resources/devcontainer-overlay/services/config/php/conf.d/99-xdebug.ini mode change 100644 => 100755 .devcontainer/resources/devcontainer-overlay/services/config/python/backend-extra-launch-parameters mode change 100644 => 100755 .venv_import_check.py mode change 100644 => 100755 back/app.sql mode change 100644 => 100755 back/ieee-oui.txt mode change 100644 => 100755 docker_build.log mode change 100644 => 100755 docs/DEV_PORTS_HOST_MODE.md mode change 100644 => 100755 install/production-filesystem/README.md mode change 100644 => 100755 install/production-filesystem/app/log/IP_changes.log mode change 100644 => 100755 install/production-filesystem/app/log/app.log mode change 100644 => 100755 install/production-filesystem/app/log/app.php_errors.log mode change 100644 => 100755 install/production-filesystem/app/log/app_front.log mode change 100644 => 100755 install/production-filesystem/app/log/crond.log mode change 100644 => 100755 install/production-filesystem/app/log/db_is_locked.log mode change 100644 => 100755 install/production-filesystem/app/log/execution_queue.log mode change 100644 => 100755 install/production-filesystem/app/log/plugins/.dockerignore mode change 100644 => 100755 install/production-filesystem/app/log/report_output.html mode change 100644 => 100755 install/production-filesystem/app/log/report_output.json mode change 100644 => 100755 install/production-filesystem/app/log/report_output.txt mode change 100644 => 100755 install/production-filesystem/app/log/stderr.log mode change 100644 => 100755 install/production-filesystem/app/log/stdout.log mode change 100644 => 100755 install/production-filesystem/build/init-backend.sh mode change 100644 => 100755 install/production-filesystem/build/init-crond.sh mode change 100644 => 100755 install/production-filesystem/build/init-nginx.sh mode change 100644 => 100755 install/production-filesystem/build/init-php-fpm.sh mode change 100644 => 100755 install/production-filesystem/entrypoint.sh mode change 100644 => 100755 install/production-filesystem/services/config/nginx/README.md mode change 100644 => 100755 install/production-filesystem/services/config/nginx/conf.active/netalertx.conf mode change 100644 => 100755 install/production-filesystem/services/config/nginx/fastcgi_params mode change 100644 => 100755 install/production-filesystem/services/config/nginx/mime.types mode change 100644 => 100755 install/production-filesystem/services/config/nginx/netalertx.conf.template mode change 100644 => 100755 install/production-filesystem/services/config/php/php-fpm.conf mode change 100644 => 100755 install/production-filesystem/services/config/php/php-fpm.d/www.conf mode change 100644 => 100755 install/production-filesystem/services/config/python/backend-extra-launch-parameters mode change 100644 => 100755 install/production-filesystem/services/scripts/check-cap.sh mode change 100644 => 100755 install/production-filesystem/services/scripts/check-first-run-config.sh mode change 100644 => 100755 install/production-filesystem/services/scripts/check-first-run-db.sh mode change 100644 => 100755 install/production-filesystem/services/scripts/check-mandatory-folders.sh mode change 100644 => 100755 install/production-filesystem/services/scripts/check-permissions.sh mode change 100644 => 100755 install/production-filesystem/services/scripts/check-ramdisk.sh mode change 100644 => 100755 install/production-filesystem/services/scripts/check-root.sh mode change 100644 => 100755 install/production-filesystem/services/scripts/check-storage.sh mode change 100644 => 100755 requirements.txt mode change 100644 => 100755 xdebug.out diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile old mode 100644 new mode 100755 index 3e0c7324..40fd7035 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -18,7 +18,7 @@ # It reduces the chance of system hijacking and operates with all modern security protocols in place as is # expected from a security appliance. # -# This file can be built with `docker compose -f docker-compose.yml up --build --force-recreate` +# This file can be built with `docker-compose -f docker-compose.yml up --build --force-recreate` FROM alpine:3.22 AS builder diff --git a/.devcontainer/resources/devcontainer-overlay/services/config/nginx/netalertx.conf.template b/.devcontainer/resources/devcontainer-overlay/services/config/nginx/netalertx.conf.template old mode 100644 new mode 100755 diff --git a/.devcontainer/resources/devcontainer-overlay/services/config/php/conf.d/99-xdebug.ini b/.devcontainer/resources/devcontainer-overlay/services/config/php/conf.d/99-xdebug.ini old mode 100644 new mode 100755 diff --git a/.devcontainer/resources/devcontainer-overlay/services/config/python/backend-extra-launch-parameters b/.devcontainer/resources/devcontainer-overlay/services/config/python/backend-extra-launch-parameters old mode 100644 new mode 100755 diff --git a/.venv_import_check.py b/.venv_import_check.py old mode 100644 new mode 100755 diff --git a/Dockerfile b/Dockerfile index e32bb24b..a395236a 100755 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@ # It reduces the chance of system hijacking and operates with all modern security protocols in place as is # expected from a security appliance. # -# This file can be built with `docker compose -f docker-compose.yml up --build --force-recreate` +# This file can be built with `docker-compose -f docker-compose.yml up --build --force-recreate` FROM alpine:3.22 AS builder diff --git a/back/app.sql b/back/app.sql old mode 100644 new mode 100755 diff --git a/back/ieee-oui.txt b/back/ieee-oui.txt old mode 100644 new mode 100755 diff --git a/docker-compose.yml b/docker-compose.yml index 92fd56f9..db9bc7a0 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,13 +15,13 @@ services: - NET_BIND_SERVICE # Required to bind to privileged ports (nbtscan) volumes: - - type: volume - source: netalertx_config + - type: bind + source: ${APP_DATA_LOCATION}/netalertx/config target: /app/config read_only: false - - type: volume - source: netalertx_db + - type: bind + source: ${APP_DATA_LOCATION}/netalertx/db target: /app/db read_only: false @@ -30,15 +30,26 @@ services: target: /etc/localtime read_only: true + # Retain logs - comment out tmpfs /app/log if you want to retain logs between container restarts + # - /path/on/host/log:/app/log + # Optional logs + # - type: bind + # source: ${LOGS_LOCATION} + # target: /app/log + # read_only: false + + # Optional development mounts + - type: bind + source: ${DEV_LOCATION} + target: /app/front/plugins/custom + read_only: false + # Use a custom Enterprise-configured nginx config for ldap or other settings # - /custom-enterprise.conf:/services/config/nginx/conf.active/netalertx.conf:ro # Test your plugin on the production container # - /path/on/host:/app/front/plugins/custom - # Retain logs - comment out tmpfs /app/log if you want to retain logs between container restarts - # - /path/on/host/log:/app/log - # Tempfs mounts for writable directories in a read-only container and improve system performance tmpfs: # Speed up logging. This can be commented out to retain logs between container restarts @@ -52,11 +63,13 @@ services: # /tmp is required by php for session save this should be reworked to /services/run/tmp - "/tmp:uid=20211,gid=20211,mode=1700,rw,noexec,nosuid,nodev,async,noatime,nodiratime" environment: - LISTEN_ADDR: 0.0.0.0 # Listen for connections on all interfaces - PORT: 20211 # Application port - GRAPHQL_PORT: 20212 # GraphQL API port - ALWAYS_FRESH_INSTALL: false # Set to true to reset your config and database on each container start - NETALERTX_DEBUG: 0 # 0=kill all services and restart if any dies. 1 keeps running dead services. + LISTEN_ADDR: 0.0.0.0 # Listen for connections on all interfaces + PORT: ${PORT} # Application port + ALWAYS_FRESH_INSTALL: ${ALWAYS_FRESH_INSTALL} # Set to true to reset your config and database on each container start + NETALERTX_DEBUG: 0 # 0=kill all services and restart if any dies. 1 keeps running dead services. + TZ: ${TZ} # Timezone, e.g. Europe/Paris + # APP_CONF_OVERRIDE={"SCAN_SUBNETS":"['192.168.1.0/24 --interface=eth1']","GRAPHQL_PORT":"20223","UI_theme":"Light"} # (optional) app.conf settings override + # LOADED_PLUGINS=["DHCPLSS","PIHOLE","ASUSWRT","FREEBOX"] # (optional) default plugins to load # Resource limits to prevent resource exhaustion mem_limit: 2048m @@ -70,7 +83,7 @@ services: max-file: "3" restart: unless-stopped -volumes: - netalertx_config: - netalertx_db: +# volumes: +# netalertx_config: +# netalertx_db: diff --git a/docker_build.log b/docker_build.log old mode 100644 new mode 100755 diff --git a/docs/DEV_PORTS_HOST_MODE.md b/docs/DEV_PORTS_HOST_MODE.md old mode 100644 new mode 100755 diff --git a/install/production-filesystem/README.md b/install/production-filesystem/README.md old mode 100644 new mode 100755 diff --git a/install/production-filesystem/app/log/IP_changes.log b/install/production-filesystem/app/log/IP_changes.log old mode 100644 new mode 100755 diff --git a/install/production-filesystem/app/log/app.log b/install/production-filesystem/app/log/app.log old mode 100644 new mode 100755 diff --git a/install/production-filesystem/app/log/app.php_errors.log b/install/production-filesystem/app/log/app.php_errors.log old mode 100644 new mode 100755 diff --git a/install/production-filesystem/app/log/app_front.log b/install/production-filesystem/app/log/app_front.log old mode 100644 new mode 100755 diff --git a/install/production-filesystem/app/log/crond.log b/install/production-filesystem/app/log/crond.log old mode 100644 new mode 100755 diff --git a/install/production-filesystem/app/log/db_is_locked.log b/install/production-filesystem/app/log/db_is_locked.log old mode 100644 new mode 100755 diff --git a/install/production-filesystem/app/log/execution_queue.log b/install/production-filesystem/app/log/execution_queue.log old mode 100644 new mode 100755 diff --git a/install/production-filesystem/app/log/plugins/.dockerignore b/install/production-filesystem/app/log/plugins/.dockerignore old mode 100644 new mode 100755 diff --git a/install/production-filesystem/app/log/report_output.html b/install/production-filesystem/app/log/report_output.html old mode 100644 new mode 100755 diff --git a/install/production-filesystem/app/log/report_output.json b/install/production-filesystem/app/log/report_output.json old mode 100644 new mode 100755 diff --git a/install/production-filesystem/app/log/report_output.txt b/install/production-filesystem/app/log/report_output.txt old mode 100644 new mode 100755 diff --git a/install/production-filesystem/app/log/stderr.log b/install/production-filesystem/app/log/stderr.log old mode 100644 new mode 100755 diff --git a/install/production-filesystem/app/log/stdout.log b/install/production-filesystem/app/log/stdout.log old mode 100644 new mode 100755 diff --git a/install/production-filesystem/build/init-backend.sh b/install/production-filesystem/build/init-backend.sh old mode 100644 new mode 100755 diff --git a/install/production-filesystem/build/init-crond.sh b/install/production-filesystem/build/init-crond.sh old mode 100644 new mode 100755 diff --git a/install/production-filesystem/build/init-nginx.sh b/install/production-filesystem/build/init-nginx.sh old mode 100644 new mode 100755 diff --git a/install/production-filesystem/build/init-php-fpm.sh b/install/production-filesystem/build/init-php-fpm.sh old mode 100644 new mode 100755 diff --git a/install/production-filesystem/entrypoint.sh b/install/production-filesystem/entrypoint.sh old mode 100644 new mode 100755 diff --git a/install/production-filesystem/services/config/nginx/README.md b/install/production-filesystem/services/config/nginx/README.md old mode 100644 new mode 100755 diff --git a/install/production-filesystem/services/config/nginx/conf.active/netalertx.conf b/install/production-filesystem/services/config/nginx/conf.active/netalertx.conf old mode 100644 new mode 100755 diff --git a/install/production-filesystem/services/config/nginx/fastcgi_params b/install/production-filesystem/services/config/nginx/fastcgi_params old mode 100644 new mode 100755 diff --git a/install/production-filesystem/services/config/nginx/mime.types b/install/production-filesystem/services/config/nginx/mime.types old mode 100644 new mode 100755 diff --git a/install/production-filesystem/services/config/nginx/netalertx.conf.template b/install/production-filesystem/services/config/nginx/netalertx.conf.template old mode 100644 new mode 100755 diff --git a/install/production-filesystem/services/config/php/php-fpm.conf b/install/production-filesystem/services/config/php/php-fpm.conf old mode 100644 new mode 100755 diff --git a/install/production-filesystem/services/config/php/php-fpm.d/www.conf b/install/production-filesystem/services/config/php/php-fpm.d/www.conf old mode 100644 new mode 100755 diff --git a/install/production-filesystem/services/config/python/backend-extra-launch-parameters b/install/production-filesystem/services/config/python/backend-extra-launch-parameters old mode 100644 new mode 100755 diff --git a/install/production-filesystem/services/scripts/check-cap.sh b/install/production-filesystem/services/scripts/check-cap.sh old mode 100644 new mode 100755 diff --git a/install/production-filesystem/services/scripts/check-first-run-config.sh b/install/production-filesystem/services/scripts/check-first-run-config.sh old mode 100644 new mode 100755 diff --git a/install/production-filesystem/services/scripts/check-first-run-db.sh b/install/production-filesystem/services/scripts/check-first-run-db.sh old mode 100644 new mode 100755 diff --git a/install/production-filesystem/services/scripts/check-mandatory-folders.sh b/install/production-filesystem/services/scripts/check-mandatory-folders.sh old mode 100644 new mode 100755 diff --git a/install/production-filesystem/services/scripts/check-permissions.sh b/install/production-filesystem/services/scripts/check-permissions.sh old mode 100644 new mode 100755 diff --git a/install/production-filesystem/services/scripts/check-ramdisk.sh b/install/production-filesystem/services/scripts/check-ramdisk.sh old mode 100644 new mode 100755 diff --git a/install/production-filesystem/services/scripts/check-root.sh b/install/production-filesystem/services/scripts/check-root.sh old mode 100644 new mode 100755 diff --git a/install/production-filesystem/services/scripts/check-storage.sh b/install/production-filesystem/services/scripts/check-storage.sh old mode 100644 new mode 100755 diff --git a/requirements.txt b/requirements.txt old mode 100644 new mode 100755 diff --git a/xdebug.out b/xdebug.out old mode 100644 new mode 100755