From 7125cea29bdf71043c98cd79b0065b91b9f34784 Mon Sep 17 00:00:00 2001 From: jokob-sk Date: Sat, 29 Nov 2025 16:19:13 +1100 Subject: [PATCH] DOCS: DB + config -> /data Signed-off-by: jokob-sk --- README.md | 5 +++-- docs/DEBUG_TIPS.md | 5 +++-- docs/DOCKER_COMPOSE.md | 20 ++++++++++---------- docs/DOCKER_INSTALLATION.md | 3 +-- docs/DOCKER_PORTAINER.md | 2 +- docs/FILE_PERMISSIONS.md | 6 ++---- docs/MIGRATION.md | 3 +-- docs/SYNOLOGY_GUIDE.md | 8 ++------ 8 files changed, 23 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 0b39e673..3dfc064e 100755 --- a/README.md +++ b/README.md @@ -44,8 +44,7 @@ Start NetAlertX in seconds with Docker: docker run -d \ --network=host \ --restart unless-stopped \ - -v /local_data_dir/config:/data/config \ - -v /local_data_dir/db:/data/db \ + -v /local_data_dir:/data \ -v /etc/localtime:/etc/localtime:ro \ --tmpfs /tmp:uid=20211,gid=20211,mode=1700 \ -e PORT=20211 \ @@ -53,6 +52,8 @@ docker run -d \ ghcr.io/jokob-sk/netalertx:latest ``` +Note: Your `/local_data_dir` should contain a `config` and `db` folder. + To deploy a containerized instance directly from the source repository, execute the following BASH sequence: ```bash git clone https://github.com/jokob-sk/NetAlertX.git diff --git a/docs/DEBUG_TIPS.md b/docs/DEBUG_TIPS.md index 03c5d23e..75821542 100755 --- a/docs/DEBUG_TIPS.md +++ b/docs/DEBUG_TIPS.md @@ -16,8 +16,7 @@ Start the container via the **terminal** with a command similar to this one: docker run \ --network=host \ --restart unless-stopped \ - -v /local_data_dir/config:/data/config \ - -v /local_data_dir/db:/data/db \ + -v /local_data_dir:/data \ -v /etc/localtime:/etc/localtime:ro \ --tmpfs /tmp:uid=20211,gid=20211,mode=1700 \ -e PORT=20211 \ @@ -26,6 +25,8 @@ docker run \ ``` +Note: Your `/local_data_dir` should contain a `config` and `db` folder. + > [!NOTE] > ⚠ The most important part is NOT to use the `-d` parameter so you see the error when the container crashes. Use this error in your issue description. diff --git a/docs/DOCKER_COMPOSE.md b/docs/DOCKER_COMPOSE.md index 401af196..b0ad6678 100755 --- a/docs/DOCKER_COMPOSE.md +++ b/docs/DOCKER_COMPOSE.md @@ -1,18 +1,18 @@ # NetAlertX and Docker Compose > [!WARNING] -> ⚠️ **Important:** The documentation has been recently updated and some instructions may have changed. -> If you are using the currently live production image, please follow the instructions on [Docker Hub](https://hub.docker.com/r/jokobsk/netalertx) for building and running the container. +> ⚠️ **Important:** The documentation has been recently updated and some instructions may have changed. +> If you are using the currently live production image, please follow the instructions on [Docker Hub](https://hub.docker.com/r/jokobsk/netalertx) for building and running the container. > These docs reflect the latest development version and may differ from the production image. -Great care is taken to ensure NetAlertX meets the needs of everyone while being flexible enough for anyone. This document outlines how you can configure your docker-compose. There are many settings, so we recommend using the Baseline Docker Compose as-is, or modifying it for your system.Good care is taken to ensure NetAlertX meets the needs of everyone while being flexible enough for anyone. This document outlines how you can configure your docker-compose. There are many settings, so we recommend using the Baseline Docker Compose as-is, or modifying it for your system. +Great care is taken to ensure NetAlertX meets the needs of everyone while being flexible enough for anyone. This document outlines how you can configure your docker-compose. There are many settings, so we recommend using the Baseline Docker Compose as-is, or modifying it for your system.Good care is taken to ensure NetAlertX meets the needs of everyone while being flexible enough for anyone. This document outlines how you can configure your docker-compose. There are many settings, so we recommend using the Baseline Docker Compose as-is, or modifying it for your system. -> [!NOTE] -> The container needs to run in `network_mode:"host"` to access Layer 2 networking such as arp, nmap and others. Due to lack of support for this feature, Windows host is not a supported operating system. +> [!NOTE] +> The container needs to run in `network_mode:"host"` to access Layer 2 networking such as arp, nmap and others. Due to lack of support for this feature, Windows host is not a supported operating system. ## Baseline Docker Compose -There is one baseline for NetAlertX. That's the default security-enabled official distribution. +There is one baseline for NetAlertX. That's the default security-enabled official distribution. ```yaml services: @@ -45,7 +45,7 @@ services: # - /home/user/netalertx_data:/data:rw - type: bind # Bind mount for timezone consistency - source: /etc/localtime + source: /etc/localtime target: /etc/localtime read_only: true @@ -125,9 +125,9 @@ docker compose up ### Modification 1: Use a Local Folder (Bind Mount) -By default, the baseline compose file uses a single named volume (netalertx_data) mounted at /data. This single-volume layout is preferred because NetAlertX manages both configuration and the database under /data (for example, /data/config and /data/db) via its web UI. Using one named volume simplifies permissions and portability: Docker manages the storage and NetAlertX manages the files inside /data. +By default, the baseline compose file uses a single named volume (netalertx_data) mounted at `/data`. This single-volume layout is preferred because NetAlertX manages both configuration and the database under `/data` (for example, `/data/config` and `/data/db`) via its web UI. Using one named volume simplifies permissions and portability: Docker manages the storage and NetAlertX manages the files inside `/data`. -A two-volume layout that mounts /data/config and /data/db separately (for example, netalertx_config and netalertx_db) is supported for backward compatibility and some advanced workflows, but it is an abnormal/legacy layout and not recommended for new deployments. +A two-volume layout that mounts `/data/config` and `/data/db` separately (for example, `netalertx_config` and `netalertx_db`) is supported for backward compatibility and some advanced workflows, but it is an abnormal/legacy layout and not recommended for new deployments. However, if you prefer to have direct, file-level access to your configuration for manual editing, a "bind mount" is a simple alternative. This tells Docker to use a specific folder from your computer (the "host") inside the container. @@ -187,7 +187,7 @@ services: environment: - PORT=${PORT} - GRAPHQL_PORT=${GRAPHQL_PORT} - + ... ``` diff --git a/docs/DOCKER_INSTALLATION.md b/docs/DOCKER_INSTALLATION.md index cd4988f3..6929e534 100644 --- a/docs/DOCKER_INSTALLATION.md +++ b/docs/DOCKER_INSTALLATION.md @@ -25,8 +25,7 @@ Head to [https://netalertx.com/](https://netalertx.com/) for more gifs and scree ```bash docker run -d --rm --network=host \ - -v /local_data_dir/config:/data/config \ - -v /local_data_dir/db:/data/db \ + -v /local_data_dir:/data \ -v /etc/localtime:/etc/localtime \ --tmpfs /tmp:uid=20211,gid=20211,mode=1700 \ -e PORT=20211 \ diff --git a/docs/DOCKER_PORTAINER.md b/docs/DOCKER_PORTAINER.md index f588d058..d1a08dc9 100755 --- a/docs/DOCKER_PORTAINER.md +++ b/docs/DOCKER_PORTAINER.md @@ -78,7 +78,7 @@ In the **Environment variables** section of Portainer, add the following: > > `sudo chown -R 20211:20211 /local_data_dir` > -> `sudo chmod -R a+rwx /local_data_dir1` +> `sudo chmod -R a+rwx /local_data_dir` > diff --git a/docs/FILE_PERMISSIONS.md b/docs/FILE_PERMISSIONS.md index f8c3624b..a7d11a60 100755 --- a/docs/FILE_PERMISSIONS.md +++ b/docs/FILE_PERMISSIONS.md @@ -46,8 +46,7 @@ NetAlertX requires certain paths to be writable at runtime. These paths should b ```bash docker run -it --rm --name netalertx --user "0" \ - -v /local_data_dir/config:/data/config \ - -v /local_data_dir/db:/data/db \ + -v /local_data_dir:/data \ --tmpfs /tmp:uid=20211,gid=20211,mode=1700 \ ghcr.io/jokob-sk/netalertx:latest ``` @@ -84,8 +83,7 @@ services: - NET_BIND_SERVICE # Required to bind to privileged ports (nbtscan) restart: unless-stopped volumes: - - /local_data_dir/config:/data/config - - /local_data_dir/db:/data/db + - /local_data_dir:/data - /etc/localtime:/etc/localtime environment: - PORT=20211 diff --git a/docs/MIGRATION.md b/docs/MIGRATION.md index d1d08e1b..8848ee9b 100755 --- a/docs/MIGRATION.md +++ b/docs/MIGRATION.md @@ -284,8 +284,7 @@ services: - NET_BIND_SERVICE # 🆕 New line restart: unless-stopped volumes: - - /local_data_dir/config:/data/config # 🆕 This has changed from /app to /data - - /local_data_dir/db:/data/db # 🆕 This has changed from /app to /data + - /local_data_dir:/data # 🆕 This folder contains your /db and /config directories and the parent changed from /app to /data # Ensuring the timezone is the same as on the server - make sure also the TIMEZONE setting is configured - /etc/localtime:/etc/localtime:ro # 🆕 New line environment: diff --git a/docs/SYNOLOGY_GUIDE.md b/docs/SYNOLOGY_GUIDE.md index 5db5af2f..7707d50e 100755 --- a/docs/SYNOLOGY_GUIDE.md +++ b/docs/SYNOLOGY_GUIDE.md @@ -47,8 +47,7 @@ services: - NET_ADMIN - NET_BIND_SERVICE volumes: - - /app_storage/netalertx/config:/data/config - - /app_storage/netalertx/db:/data/db + - /app_storage/netalertx:/data # to sync with system time - /etc/localtime:/etc/localtime:ro tmpfs: @@ -66,10 +65,7 @@ services: ```yaml volumes: - - /volume1/app_storage/netalertx/config:/data/config - - /volume1/app_storage/netalertx/db:/data/db - # (optional) useful for debugging if you have issues setting up the container - # - local/path/logs:/tmp/log <- commented out with # ⚠ + - /volume1/app_storage/netalertx:/data ``` ![Adjusting docker-compose](./img/SYNOLOGY/08_Adjust_docker_compose_volumes.png)